feat: 修改系统门店和仓库订单管理功能

This commit is contained in:
mkm 2024-08-27 11:00:26 +08:00
parent 63c90c8bbf
commit 42b19ff900
3 changed files with 11 additions and 38 deletions

View File

@ -40,35 +40,6 @@ class SystemStoreController extends BaseAdminController
{
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 添加门店列表

View File

@ -125,7 +125,6 @@ class WarehouseOrderController extends BaseAdminController
Db::commit();
} catch (\Throwable $e) {
Db::rollback();
d($e);
throw new BusinessException($e->getMessage());
}
return $this->success('已导入后台队列,请在门店入库记录中查看', [], 1, 1);

View File

@ -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_storage\SystemStoreStorage;
use Illuminate\Support\Facades\Log;
use support\exception\BusinessException;
use think\facade\Db;
use Webman\RedisQueue\Redis;
@ -101,8 +102,7 @@ class StoreProductLogic extends BaseLogic
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
throw new BusinessException('添加商品失败'.$e->getMessage());
}
}
@ -220,8 +220,8 @@ class StoreProductLogic extends BaseLogic
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
throw new BusinessException('编辑商品失败'.$e->getMessage());
}
}
@ -280,8 +280,8 @@ class StoreProductLogic extends BaseLogic
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
throw new BusinessException('删除失败'.$e->getMessage());
}
}
@ -289,6 +289,10 @@ class StoreProductLogic extends BaseLogic
/**普通 */
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']);
$product = [
'product_id' => $find['id'],
@ -357,8 +361,7 @@ class StoreProductLogic extends BaseLogic
return true;
} catch (\Exception $e) {
Db::rollback();
Log::error('store-storage队列消费失败: ' . $e->getMessage() . ',line:' . $e->getLine() . ',file:' . $e->getFile());
return false;
throw new BusinessException('添加兑换商品失败'.$e->getMessage());
}
}
// else {