Procházet zdrojové kódy

直接分配货位

shish před 2 roky
rodič
revize
dbc96990f0

+ 27 - 0
app-ghs/controllers/BookItemGhsController.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\book\classes\BookItemCustomClass;
+use bizGhs\book\classes\BookItemGhsClass;
+use common\components\util;
+use Yii;
+
+class BookItemGhsController extends BaseController
+{
+
+    public function actionGetList()
+    {
+        $get = Yii::$app->request->get();
+        $where = [];
+        $where['mainId'] = $this->mainId;
+        $parentId = $get['parentId'] ?? 0;
+        if (empty($parentId)) {
+            util::fail('没有找到相关信息');
+        }
+        $where['parentId'] = $parentId;
+        $list = BookItemGhsClass::getAllByCondition($where, 'addTime DESC', '*');
+        util::success(['list' => $list]);
+    }
+
+}

+ 5 - 6
app-ghs/controllers/PurchaseOrderController.php

@@ -392,12 +392,6 @@ class PurchaseOrderController extends BaseController
                     util::fail('你不能采购哦');
                 }
             }
-        } else {
-            if ($this->mainId == 644) {
-//                if (!in_array($this->adminId, [919])) {
-//                    util::fail('你不能采购哈');
-//                }
-            }
         }
 
 
@@ -490,6 +484,11 @@ class PurchaseOrderController extends BaseController
             if (isset($order->needPrint) && $order->needPrint == 1) {
                 PurchaseOrderClass::printTicket($order);
             }
+            $pfLevel = $shop->pfLevel ?? 0;
+            if ($pfLevel == 1 && !empty($bookSn) && $inType == 0) {
+                //如果是昆明批发,有开启预订则直接分配货位号
+                PurchaseOrderClass::assign($order, $bookSn);
+            }
 
             util::success($order);
         } catch (\Exception $e) {

+ 6 - 0
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -1171,6 +1171,12 @@ class PurchaseOrderClass extends BaseClass
                 $orderInfo[$key]['bigCover'] = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_700,w_700";
                 $sendList = CgOrderItemSendClass::getAllByCondition(['parentId' => $id], null, '*');
                 $orderInfo[$key]['sendList'] = $sendList;
+                $num = $val['itemNum'] ?? 0;
+                $confirmSendNum = $val['confirmSendNum'] ?? 0;
+                $orderInfo[$key]['noSeatNum'] = 0;
+                if ($num > $confirmSendNum) {
+                    $orderInfo[$key]['noSeatNum'] = floatval(bcsub($num, $confirmSendNum, 2));
+                }
             }
         }
         $orderData = self::groupAdmin($orderData);