shish 2 tahun lalu
induk
melakukan
7518ef2641

+ 78 - 6
app-ghs/controllers/CheckOrderController.php

@@ -11,30 +11,102 @@ use common\components\util;
 class CheckOrderController extends BaseController
 {
 
+    //预订中减少库存
+    public function actionBookDelStock()
+    {
+        $get = Yii::$app->request->get();
+        $productId = $get['itemId'] ?? 0;
+        $bookItemCustomId = $get['bookItemCustomId'] ?? 0;
+        $num = $get['num'] ?? 0;
+        if ($num <= 0) {
+            util::fail('请填写要减的数量');
+        }
+        $shop = $this->shop;
+        $staff = $this->shopAdmin;
+        $bookItemCustomRes = BookItemCustomClass::getById($bookItemCustomId, true);
+        if (empty($bookItemCustomRes)) {
+            util::fail('没有预订相关的信息呢');
+        }
+        if ($bookItemCustomRes->mainId != $this->mainId) {
+            util::fail('不是你的预订信息');
+        }
+        $connection = Yii::$app->db;
+        $transaction = $connection->beginTransaction();
+        try {
+            CheckOrderClass::bookToDelStock($productId, $num, $shop, $staff);
+            $transaction->commit();
+            util::complete('操作成功');
+        } catch (\Exception $e) {
+            Yii::info("操作失败原因:" . $e->getMessage());
+            $transaction->rollBack();
+            util::fail('操作失败');
+        }
+    }
+
+    //预订中增加库存
+    public function actionBookAddStock()
+    {
+        $get = Yii::$app->request->get();
+        $productId = $get['itemId'] ?? 0;
+        $bookItemCustomId = $get['bookItemCustomId'] ?? 0;
+        $num = $get['num'] ?? 0;
+        if ($num <= 0) {
+            util::fail('请填写要加的数量');
+        }
+        $shop = $this->shop;
+        $staff = $this->shopAdmin;
+        $bookItemCustomRes = BookItemCustomClass::getById($bookItemCustomId, true);
+        if (empty($bookItemCustomRes)) {
+            util::fail('没有预订相关的信息呢...');
+        }
+        if ($bookItemCustomRes->mainId != $this->mainId) {
+            util::fail('不是你的预订信息..');
+        }
+        $needCgNum = $bookItemCustomRes->needCgNum ?? 0;
+        if ($num > $needCgNum) {
+            util::fail("最多只需要加" . $needCgNum . "份");
+        }
+        $connection = Yii::$app->db;
+        $transaction = $connection->beginTransaction();
+        try {
+            CheckOrderClass::bookToAddStock($productId, $num, $shop, $staff, $bookItemCustomRes);
+            $transaction->commit();
+            util::complete('操作成功');
+        } catch (\Exception $e) {
+            Yii::info("操作失败原因:" . $e->getMessage());
+            $transaction->rollBack();
+            util::fail('操作失败');
+        }
+    }
+
     //借库存 ssh 20240720
     public function actionLoan()
     {
         $get = Yii::$app->request->get();
         $inId = $get['inId'] ?? 0;
         $outId = $get['outId'] ?? 0;
-        $bookItemCustomId = $get['bookItemCustomId']??0;
+        $bookItemCustomId = $get['bookItemCustomId'] ?? 0;
         $num = $get['num'] ?? 0;
         if ($num <= 0) {
-            util::fail('借数量不足');
+            util::fail('请填写要数量');
         }
         $shop = $this->shop;
         $staff = $this->shopAdmin;
-        $bookItemCustomRes = BookItemCustomClass::getById($bookItemCustomId,true);
-        if(empty($bookItemCustomRes)){
+        $bookItemCustomRes = BookItemCustomClass::getById($bookItemCustomId, true);
+        if (empty($bookItemCustomRes)) {
             util::fail('没有预订相关的信息呢');
         }
-        if($bookItemCustomRes->mainId!=$this->mainId){
+        if ($bookItemCustomRes->mainId != $this->mainId) {
             util::fail('不是你的预订信息');
         }
+        $needCgNum = $bookItemCustomRes->needCgNum ?? 0;
+        if ($num > $needCgNum) {
+            util::fail("最多只需要借" . $needCgNum . "份");
+        }
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
-            CheckOrderClass::loanStock($inId, $outId, $num, $shop, $staff,$bookItemCustomRes);
+            CheckOrderClass::loanStock($inId, $outId, $num, $shop, $staff, $bookItemCustomRes);
             $transaction->commit();
             util::complete('操作成功');
         } catch (\Exception $e) {

+ 3 - 0
biz-ghs/book/classes/BookCustomClass.php

@@ -304,6 +304,9 @@ class BookCustomClass extends BaseClass
             $customNamePy = $bookCustomRes->py ?? '';
             $orderSn = $bill->orderSn ?? '';
             $event = $staffName . "增加待入库单 {$orderSn} 减少待采 {$name} " . $delNeedCgNum . $bigUnit;
+        } elseif ($currentChangeType == 'pdAddStock') {
+            $currentCapitalType = dict::getDict('capitalType', 'pd');
+            $event = $staffName . '盘点增加库存' . $delNeedCgNum . $bigUnit . ',减少待采' . $delNeedCgNum . $bigUnit;
         } elseif ($currentChangeType == 'loanStock') {
             $currentCapitalType = dict::getDict('capitalType', 'loanStock');
             $customId = $bookCustomRes->customId ?? 0;

+ 36 - 33
biz-ghs/book/classes/BookItemClass.php

@@ -258,8 +258,8 @@ class BookItemClass extends BaseClass
             }
 
             $lastNum = $data['lastNum'] ?? 0;
-            $remark = $data['remark']??'';
-            $hasRemark = $data['hasRemark']??0;
+            $remark = $data['remark'] ?? '';
+            $hasRemark = $data['hasRemark'] ?? 0;
             $staffName = $params['staffName'] ?? '';
             $staffId = $params['staffId'] ?? 0;
             $ioData = [
@@ -289,7 +289,7 @@ class BookItemClass extends BaseClass
                     'py' => $py,
                     'cgStaffId' => $cgStaffId,
                     'cgStaffName' => $cgStaffName,
-                    'hasRemark'=>$hasRemark,
+                    'hasRemark' => $hasRemark,
                 ];
                 $bookItemRes = self::add($statData, true);
             }
@@ -317,8 +317,8 @@ class BookItemClass extends BaseClass
                     'cgStaffId' => $cgStaffId,
                     'cgStaffName' => $cgStaffName,
                     'bookSn' => $bookSn,
-                    'hasRemark'=>$hasRemark,
-                    'remark'=>$remark,
+                    'hasRemark' => $hasRemark,
+                    'remark' => $remark,
                 ];
                 $bookItemCustomRes = BookItemCustomClass::add($currentData, true);
             }
@@ -334,7 +334,7 @@ class BookItemClass extends BaseClass
                     'mainId' => $mainId,
                     'customId' => $customId,
                     'bookSn' => $bookSn,
-                    'hasRemark'=>$hasRemark,
+                    'hasRemark' => $hasRemark,
                 ];
                 $bookCustomRes = BookCustomClass::add($currentData, true);
             }
@@ -426,12 +426,12 @@ class BookItemClass extends BaseClass
         $orderSn = $bill->orderSn ?? '';
 
         $currentChangeType = $params['currentChangeType'] ?? 'putIn';
-        if($currentChangeType == 'stockOn'){
+        if ($currentChangeType == 'stockOn') {
             $currentCapitalType = 0;
             $event = "{$staffName} 手动上架 {$name} " . $addOnNum . $bigUnit;
-        }elseif($currentChangeType == 'putIn'){
+        } elseif ($currentChangeType == 'putIn') {
             $event = "采购单 {$orderSn} 入库,{$name} 上架 " . $addOnNum . $bigUnit;
-        }else{
+        } else {
             $event = '';
             util::fail('不存在的动作');
         }
@@ -484,27 +484,27 @@ class BookItemClass extends BaseClass
         $staffId = $params['staffId'] ?? 0;
 
         $currentChangeType = $params['currentChangeType'] ?? 'delBook';
-        if($currentChangeType == 'ghsCgRefund'){
+        if ($currentChangeType == 'ghsCgRefund') {
             //供货商采购单售后
             $customId = 0;
             $customName = '';
             $customNamePy = '';
-            $orderSn = $bill->orderSn??'';
-            $event = $staffName.' 售后采购单'. $orderSn. ',下架' .$name. $delOnNum . $bigUnit;
+            $orderSn = $bill->orderSn ?? '';
+            $event = $staffName . ' 售后采购单' . $orderSn . ',下架' . $name . $delOnNum . $bigUnit;
             $currentCapitalType = dict::getDict('capitalType', 'ghsCgRefund');
-        }elseif($currentChangeType == 'stockOff'){
+        } elseif ($currentChangeType == 'stockOff') {
             $customId = 0;
             $customName = '';
             $customNamePy = '';
             $currentCapitalType = 0;
-            $event = $staffName.'手动下架' .$name. $delOnNum . $bigUnit;
-        }elseif($currentChangeType == 'delBook'){
+            $event = $staffName . '手动下架' . $name . $delOnNum . $bigUnit;
+        } elseif ($currentChangeType == 'delBook') {
             $customId = $bill->customId ?? 0;
             $customName = $bill->customName ?? '';
             $customNamePy = $bill->customNamePy ?? '';
             $currentCapitalType = dict::getDict('capitalType', 'delBook');
             $event = $customName . '减少预订' . $name . $num . $bigUnit . ',其中下架' . $delOnNum . $bigUnit;
-        }else{
+        } else {
             $currentCapitalType = dict::getDict('capitalType', 'delBook');
             $customId = 0;
             $customName = '';
@@ -689,24 +689,27 @@ class BookItemClass extends BaseClass
         $currentCapitalType = dict::getDict('capitalType', 'addBook');
         $staffName = $params['staffName'] ?? '';
         $staffId = $params['staffId'] ?? 0;
-        $currentChangeType = $params['currentChangeType']??'delBook';
-        if($currentChangeType == 'addCg'){
+        $currentChangeType = $params['currentChangeType'] ?? 'delBook';
+        if ($currentChangeType == 'addCg') {
             $currentCapitalType = dict::getDict('capitalType', 'ghsPurchase');
             $customId = 0;
             $customName = '';
             $customNamePy = '';
-            $orderSn = $bill->orderSn??'';
-            $event = $staffName."增加待入库单 {$orderSn} 减少待采 {$name} ". $delNeedCgNum . $bigUnit;
-        }elseif($currentChangeType == 'loanStock'){
+            $orderSn = $bill->orderSn ?? '';
+            $event = $staffName . "增加待入库单 {$orderSn} 减少待采 {$name} " . $delNeedCgNum . $bigUnit;
+        } elseif ($currentChangeType == 'pdAddStock') {
+            $currentCapitalType = dict::getDict('capitalType', 'pd');
+            $event = $staffName . '盘点增加库存' . $delNeedCgNum . $bigUnit . ',减少待采' . $delNeedCgNum . $bigUnit;
+        } elseif ($currentChangeType == 'loanStock') {
             $currentCapitalType = dict::getDict('capitalType', 'loanStock');
-            $outName = $params['outName']??'';
-            $event = $staffName . '向' . $outName .'借库存'.$delNeedCgNum.$bigUnit.',减少待采' . $delNeedCgNum . $bigUnit;
-        }elseif($currentChangeType == 'delBook'){
+            $outName = $params['outName'] ?? '';
+            $event = $staffName . '向' . $outName . '借库存' . $delNeedCgNum . $bigUnit . ',减少待采' . $delNeedCgNum . $bigUnit;
+        } elseif ($currentChangeType == 'delBook') {
             $customId = $bill->customId ?? 0;
             $customName = $bill->customName ?? '';
             $customNamePy = $bill->customNamePy ?? '';
             $event = $customName . '减少预订' . $name . $totalBookNum . $bigUnit . ',其中减少待采' . $delNeedCgNum . $bigUnit;
-        }else{
+        } else {
             $customId = 0;
             $customName = '';
             $customNamePy = '';
@@ -759,21 +762,21 @@ class BookItemClass extends BaseClass
         $staffName = $params['staffName'] ?? '';
         $staffId = $params['staffId'] ?? 0;
 
-        $currentChangeType = $params['currentChangeType']??'addBook';
-        if($currentChangeType == 'cgCancel'){
+        $currentChangeType = $params['currentChangeType'] ?? 'addBook';
+        if ($currentChangeType == 'cgCancel') {
             $currentCapitalType = dict::getDict('capitalType', 'ghsCgCancel');
-            $customId = $bookCustomRes->customId??0;
-            $customName = $bookCustomRes->name??'';
-            $customNamePy = $bookCustomRes->py??'';
-            $orderSn = $bill->orderSn??'';
+            $customId = $bookCustomRes->customId ?? 0;
+            $customName = $bookCustomRes->name ?? '';
+            $customNamePy = $bookCustomRes->py ?? '';
+            $orderSn = $bill->orderSn ?? '';
             $event = "采购单 {$orderSn} 取消,{$name} 增加待采" . $addNeedCgNum . $bigUnit;
-        }elseif($currentChangeType == 'addBook'){
+        } elseif ($currentChangeType == 'addBook') {
             $currentCapitalType = dict::getDict('capitalType', 'addBook');
             $customId = $bill->customId ?? 0;
             $customName = $bill->customName ?? '';
             $customNamePy = $bill->customNamePy ?? '';
             $event = $customName . '预订 ' . $name . $totalBookNum . $bigUnit . ',增加待采' . $addNeedCgNum . $bigUnit;
-        }else{
+        } else {
             $currentCapitalType = dict::getDict('capitalType', 'addBook');
             $customId = 0;
             $customName = '';

+ 3 - 0
biz-ghs/book/classes/BookItemCustomClass.php

@@ -431,6 +431,9 @@ class BookItemCustomClass extends BaseClass
             $currentCapitalType = dict::getDict('capitalType', 'ghsPurchase');
             $orderSn = $bill->orderSn ?? '';
             $event = $staffName . "增加待入库单 {$orderSn} 减少待采 {$name} " . $delNeedCgNum . $bigUnit;
+        } elseif ($currentChangeType == 'pdAddStock') {
+            $currentCapitalType = dict::getDict('capitalType', 'pd');
+            $event = $staffName . '盘点增加库存' . $delNeedCgNum . $bigUnit . ',减少待采' . $delNeedCgNum . $bigUnit;
         } elseif ($currentChangeType == 'loanStock') {
             $currentCapitalType = dict::getDict('capitalType', 'loanStock');
             $outName = $params['outName'] ?? '';

+ 140 - 27
biz-ghs/order/classes/CheckOrderClass.php

@@ -30,7 +30,120 @@ class CheckOrderClass extends BaseClass
         self::STATUS_COMPLETE => '已盘点',
     ];
 
-    public static function loanStock($inId, $outId, $num, $shop, $staff,$bookItemCustomRes)
+
+    public static function bookToDelStock($productId, $num, $shop, $staff)
+    {
+        $sjId = $shop->sjId ?? 0;
+        $shopId = $shop->id ?? 0;
+        $mainId = $shop->mainId ?? 0;
+        $product = ProductClass::getById($productId, true);
+        if (empty($product) || $product->mainId != $mainId) {
+            util::fail('没有找到花材。');
+        }
+        $stock = $out->stock ?? 0;
+        $bookSn = $shop->bookSn ?? 0;
+        $couldDelNum = 0;
+        if (empty($bookSn)) {
+            util::fail('没有在预订活动中');
+        }
+        $booItem = BookItemClass::getByCondition(['bookSn' => $bookSn, 'itemId' => $productId], true);
+        if (!empty($booItem)) {
+            //借出的人预订控制在不受影响范围
+            $bookNum = $booItem->bookNum ?? 0;
+            if ($bookNum > 0) {
+                $roadNum = $bookItem->roadNum ?? 0;
+                $needCgNum = $bookItem->needCgNum ?? 0;
+                $unReachNum = bcadd($roadNum, $needCgNum, 2);
+                $useStock = bcsub($bookNum, $unReachNum, 2);
+                if ($stock > $useStock) {
+                    $couldDelNum = bcsub($stock, $useStock, 2);
+                }
+            } else {
+                $couldDelNum = $stock;
+            }
+        } else {
+            $couldDelNum = $stock;
+        }
+        if ($couldDelNum <= 0) {
+            util::fail('不能删除库存');
+        }
+        if ($num > $couldDelNum) {
+            util::fail("最多只能删{$couldDelNum}份");
+        }
+        $newStock = bcsub($stock, $num, 2);
+
+        $adminId = $staff->adminId ?? 0;
+        $staffName = $staff->name ?? '';
+        $staffId = $staff->id ?? 0;
+
+        $ghsItemInfo = [['productId' => $couldDelNum, 'bigNum' => $newStock, 'smallNum' => 0,]];
+        $pdData = [];
+        $pdData['itemInfo'] = $ghsItemInfo;
+        $pdData['sjId'] = $sjId;
+        $pdData['shopId'] = $shopId;
+        $pdData['adminId'] = $adminId;
+        $pdData['mainId'] = $mainId;
+        $pdData['staffName'] = $data['staffName'] ?? '';
+        $pdData['remark'] = "在预订中删除库存";
+        $pdData['staffName'] = $staffName;
+        $pdData['staffId'] = $staffId;
+        self::opOrder($pdData, false, false, false);
+        return true;
+    }
+
+    public static function bookToAddStock($productId, $num, $shop, $staff, $bookItemCustomRes)
+    {
+        $mainId = $shop->mainId ?? 0;
+        $product = ProductClass::getById($productId, true);
+        if (empty($product) || $product->mainId != $mainId) {
+            util::fail('没有找到花材...');
+        }
+        $bookSn = $shop->bookSn ?? 0;
+
+        $stock = $product->stock ?? 0;
+        $newStock = bcadd($stock, $num);
+
+        $adminId = $staff->adminId ?? 0;
+        $staffName = $staff->name ?? '';
+        $staffId = $staff->id ?? 0;
+
+        $sjId = $shop->sjId ?? 0;
+        $shopId = $shop->id ?? 0;
+        $mainId = $shop->mainId ?? 0;
+        $ghsItemInfo = [['productId' => $productId, 'bigNum' => $newStock, 'smallNum' => 0,]];
+        $pdData = [];
+        $pdData['itemInfo'] = $ghsItemInfo;
+        $pdData['sjId'] = $sjId;
+        $pdData['shopId'] = $shopId;
+        $pdData['adminId'] = $adminId;
+        $pdData['mainId'] = $mainId;
+        $pdData['staffName'] = $staffName;
+        $pdData['staffId'] = $staffId;
+        $pdData['remark'] = "预定盘点增加{$num}个库存";
+        $inOrder = self::opOrder($pdData, false, false, false);
+        $needCgNum = $bookItemCustomRes->needCgNum ?? 0;
+        if ($num > $needCgNum) {
+            util::fail('增加库存不能超过待采数量');
+        }
+        $delNeedCgNum = $num;
+        $params = ['staffId' => $staffId, 'staffName' => $staffName];
+        $params['currentChangeType'] = 'pdAddStock';
+        $bookItemCustomRes = BookItemCustomClass::delNeedCgNum($bookItemCustomRes, $delNeedCgNum, 0, $inOrder, $shop, $in, $params);
+        $bookItemRes = BookItemClass::getByCondition(['bookSn' => $bookSn, 'itemId' => $productId], true);
+        if (empty($bookItemRes)) {
+            util::fail('借库存没有找到bookItem');
+        }
+        $bookItemRes = BookItemClass::delNeedCgNum($bookItemRes, $delNeedCgNum, 0, $inOrder, $shop, $in, $params);
+        $customId = $bookItemCustomRes->customId ?? 0;
+        $bookCustomRes = BookCustomClass::getByCondition(['bookSn' => $bookSn, 'customId' => $customId], true);
+        if (empty($bookCustomRes)) {
+            util::fail('盘点加库存没有找到bookCustom');
+        }
+        $bookCustomRes = BookCustomClass::delNeedCgNum($bookCustomRes, $delNeedCgNum, 0, $inOrder, $shop, $in, $params);
+        return true;
+    }
+
+    public static function loanStock($inId, $outId, $num, $shop, $staff, $bookItemCustomRes)
     {
         $sjId = $shop->sjId ?? 0;
         $shopId = $shop->id ?? 0;
@@ -51,31 +164,31 @@ class CheckOrderClass extends BaseClass
         if (!empty($bookSn)) {
             $booItem = BookItemClass::getByCondition(['bookSn' => $bookSn, 'itemId' => $outId], true);
             if (!empty($booItem)) {
-                //借出的人预订没有影响
-                $bookNum = $booItem->bookNum??0;
-                if($bookNum>0){
-                    $roadNum = $bookItem->roadNum??0;
-                    $needCgNum = $bookItem->needCgNum??0;
-                    $unReachNum = bcadd($roadNum,$needCgNum,2);
-                    $useStock = bcsub($bookNum,$unReachNum,2);
-                    if($stock>$useStock){
-                        $couldLoan = bcsub($stock,$useStock,2);
+                //借出的人预订控制在不受影响范围
+                $bookNum = $booItem->bookNum ?? 0;
+                if ($bookNum > 0) {
+                    $roadNum = $bookItem->roadNum ?? 0;
+                    $needCgNum = $bookItem->needCgNum ?? 0;
+                    $unReachNum = bcadd($roadNum, $needCgNum, 2);
+                    $useStock = bcsub($bookNum, $unReachNum, 2);
+                    if ($stock > $useStock) {
+                        $couldLoan = bcsub($stock, $useStock, 2);
                     }
-                }else{
+                } else {
                     $couldLoan = $stock;
                 }
-            }else{
+            } else {
                 $couldLoan = $stock;
             }
         }
-        if($num>$couldLoan){
+        if ($num > $couldLoan) {
             util::fail("只能借{$couldLoan}");
         }
         if ($inId == $outId) {
             util::fail('同个花材呢');
         }
 
-        $newOutStock = bcsub($stock, $num,2);
+        $newOutStock = bcsub($stock, $num, 2);
 
         $inStock = $in->stock ?? 0;
         $newInStock = bcadd($inStock, $num);
@@ -95,7 +208,7 @@ class CheckOrderClass extends BaseClass
         $pdData['remark'] = "借{$num}个库存给{$inName}";
         $pdData['staffName'] = $staffName;
         $pdData['staffId'] = $staffId;
-        self::opOrder($pdData, false, false,false);
+        self::opOrder($pdData, false, false, false);
 
         $sjId = $shop->sjId ?? 0;
         $shopId = $shop->id ?? 0;
@@ -110,27 +223,27 @@ class CheckOrderClass extends BaseClass
         $pdData['staffName'] = $staffName;
         $pdData['staffId'] = $staffId;
         $pdData['remark'] = "向{$outName}借{$num}个库存";
-        $inOrder = self::opOrder($pdData, false, false,false);
+        $inOrder = self::opOrder($pdData, false, false, false);
 
         //借入的人待采会被影响
-        $needCgNum = $bookItemCustomRes->needCgNum??0;
-        if($num>$needCgNum){
+        $needCgNum = $bookItemCustomRes->needCgNum ?? 0;
+        if ($num > $needCgNum) {
             $delNeedCgNum = $needCgNum;
-        }else{
+        } else {
             $delNeedCgNum = $num;
         }
-        $params = ['staffId'=>$staffId,'staffName'=>$staffName];
+        $params = ['staffId' => $staffId, 'staffName' => $staffName];
         $params['currentChangeType'] = 'loanStock';
         $params['outName'] = $outName;
-        $bookItemCustomRes = BookItemCustomClass::delNeedCgNum($bookItemCustomRes,$delNeedCgNum, 0, $inOrder, $shop, $in, $params);
-        $bookItemRes = BookItemClass::getByCondition(['bookSn'=>$bookSn,'itemId'=>$inId],true);
-        if(empty($bookItemRes)){
+        $bookItemCustomRes = BookItemCustomClass::delNeedCgNum($bookItemCustomRes, $delNeedCgNum, 0, $inOrder, $shop, $in, $params);
+        $bookItemRes = BookItemClass::getByCondition(['bookSn' => $bookSn, 'itemId' => $inId], true);
+        if (empty($bookItemRes)) {
             util::fail('借库存没有找到bookItem');
         }
         $bookItemRes = BookItemClass::delNeedCgNum($bookItemRes, $delNeedCgNum, 0, $inOrder, $shop, $in, $params);
-        $customId = $bookItemCustomRes->customId??0;
-        $bookCustomRes = BookCustomClass::getByCondition(['bookSn'=>$bookSn,'customId'=>$customId],true);
-        if(empty($bookCustomRes)){
+        $customId = $bookItemCustomRes->customId ?? 0;
+        $bookCustomRes = BookCustomClass::getByCondition(['bookSn' => $bookSn, 'customId' => $customId], true);
+        if (empty($bookCustomRes)) {
             util::fail('借库存没有找到bookCustom');
         }
         $bookCustomRes = BookCustomClass::delNeedCgNum($bookCustomRes, $delNeedCgNum, 0, $inOrder, $shop, $in, $params);
@@ -138,7 +251,7 @@ class CheckOrderClass extends BaseClass
     }
 
     //2021.1.22 lqh 操作订单  添加/保存草稿/草稿编辑保存: 区别在添加是立即改库存和记录流水记录,而保存草稿是只保存订单信息
-    public static function opOrder($data, $draft = false, $update = false,$check=true)
+    public static function opOrder($data, $draft = false, $update = false, $check = true)
     {
         $sjId = $data['sjId'];
         $shopId = $data['shopId'];