feat: 修改系统门店和仓库订单管理功能
This commit is contained in:
parent
63c90c8bbf
commit
42b19ff900
@ -40,35 +40,6 @@ class SystemStoreController extends BaseAdminController
|
|||||||
{
|
{
|
||||||
return $this->dataLists(new SystemStoreSourceLists());
|
return $this->dataLists(new SystemStoreSourceLists());
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @notes 根据商品源获取门店列表
|
|
||||||
* @return \think\response\Json
|
|
||||||
* @author admin
|
|
||||||
* @date 2024/05/31 17:45
|
|
||||||
*/
|
|
||||||
public function source_product_update_store()
|
|
||||||
{
|
|
||||||
$addList=$this->request->post('addList');
|
|
||||||
$product_id=$this->request->post('product_id');
|
|
||||||
if($addList){
|
|
||||||
foreach ($addList as $key=>$value){
|
|
||||||
StoreProductLogic::copy($product_id,$value);
|
|
||||||
if(StoreProductLogic::hasError()){
|
|
||||||
return $this->fail(StoreProductLogic::getError());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$removeList=$this->request->post('removeList');
|
|
||||||
if($removeList){
|
|
||||||
foreach ($removeList as $key=>$value){
|
|
||||||
StoreProductLogic::store_del($product_id,$value);
|
|
||||||
if(StoreProductLogic::hasError()){
|
|
||||||
return $this->fail(StoreProductLogic::getError());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->success('设置成功', [], 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 添加门店列表
|
* @notes 添加门店列表
|
||||||
|
@ -125,7 +125,6 @@ class WarehouseOrderController extends BaseAdminController
|
|||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
d($e);
|
|
||||||
throw new BusinessException($e->getMessage());
|
throw new BusinessException($e->getMessage());
|
||||||
}
|
}
|
||||||
return $this->success('已导入后台队列,请在门店入库记录中查看', [], 1, 1);
|
return $this->success('已导入后台队列,请在门店入库记录中查看', [], 1, 1);
|
||||||
|
@ -14,6 +14,7 @@ use app\common\model\store_product_cate\StoreProductCate;
|
|||||||
use app\common\model\system_store\SystemStore;
|
use app\common\model\system_store\SystemStore;
|
||||||
use app\common\model\system_store_storage\SystemStoreStorage;
|
use app\common\model\system_store_storage\SystemStoreStorage;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use support\exception\BusinessException;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use Webman\RedisQueue\Redis;
|
use Webman\RedisQueue\Redis;
|
||||||
|
|
||||||
@ -101,8 +102,7 @@ class StoreProductLogic extends BaseLogic
|
|||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
self::setError($e->getMessage());
|
throw new BusinessException('添加商品失败'.$e->getMessage());
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,8 +220,8 @@ class StoreProductLogic extends BaseLogic
|
|||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
self::setError($e->getMessage());
|
throw new BusinessException('编辑商品失败'.$e->getMessage());
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,8 +280,8 @@ class StoreProductLogic extends BaseLogic
|
|||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
self::setError($e->getMessage());
|
throw new BusinessException('删除失败'.$e->getMessage());
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,6 +289,10 @@ class StoreProductLogic extends BaseLogic
|
|||||||
/**普通 */
|
/**普通 */
|
||||||
public static function ordinary($product_arr, $store_id, $admin_id, $find)
|
public static function ordinary($product_arr, $store_id, $admin_id, $find)
|
||||||
{
|
{
|
||||||
|
$res=StoreBranchProduct::where('store_id',$store_id)->where('product_id',$find['id'])->find();
|
||||||
|
if($res){
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
$dealCate = self::dealChangeCate($find['cate_id']);
|
$dealCate = self::dealChangeCate($find['cate_id']);
|
||||||
$product = [
|
$product = [
|
||||||
'product_id' => $find['id'],
|
'product_id' => $find['id'],
|
||||||
@ -357,8 +361,7 @@ class StoreProductLogic extends BaseLogic
|
|||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
Log::error('store-storage队列消费失败: ' . $e->getMessage() . ',line:' . $e->getLine() . ',file:' . $e->getFile());
|
throw new BusinessException('添加兑换商品失败'.$e->getMessage());
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user