Jelajahi Sumber

直接完成 问题

shish 10 bulan lalu
induk
melakukan
404053ca7b

+ 81 - 1
app-ghs/controllers/ShopExtController.php

@@ -5,6 +5,7 @@ namespace ghs\controllers;
 use biz\product\classes\XjClass;
 use biz\shop\classes\ShopExtClass;
 use bizGhs\order\classes\PurchaseOrderClass;
+use bizGhs\product\classes\ProductClass;
 use common\components\printUtil;
 use common\components\util;
 use Yii;
@@ -14,6 +15,85 @@ class ShopExtController extends BaseController
 
     public $guestAccess = [];
 
+    //修改拓展信息表 ssh 20251005
+    public function actionModifyExt()
+    {
+        $post = Yii::$app->request->post();
+        $arr = [];
+        if (isset($post['orderFlow'])) {
+            $arr['orderFlow'] = $post['orderFlow'];
+        }
+        if (isset($post['thirdSend'])) {
+            $arr['thirdSend'] = $post['thirdSend'];
+        }
+        if (isset($post['thirdSendFee'])) {
+            $arr['thirdSendFee'] = $post['thirdSendFee'];
+        }
+        if (empty($arr)) {
+            util::fail('没有需要修改');
+        }
+        $shopId = $this->shopId;
+        \bizHd\shop\classes\ShopExtClass::updateByCondition(['shopId' => $shopId], $arr);
+        util::complete('修改成功');
+    }
+
+    //设置处理花材、扫码收款和直接收款使用的花材 ssh 20250905
+    public function actionSetItem()
+    {
+        $post = Yii::$app->request->post();
+        $shopId = $this->shopId;
+        $shop = $this->shop;
+        $lsShopId = $shop->lsShopId ?? 0;
+        $lsExt = null;
+        //零售端需要同步修改
+        if (!empty($lsShopId)) {
+            $lsExt = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $lsShopId], true);
+        }
+        $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        $losingItem = $post['losingItem'] ?? 0;
+        if (!empty($losingItem)) {
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099323');
+            }
+            $ext->losingItem = $losingItem;
+            $ext->save();
+            if (!empty($lsExt)) {
+                $lsExt->losingItem = $losingItem;
+                $lsExt->save();
+            }
+        }
+        $zjGatheringItem = $post['zjGatheringItem'] ?? 0;
+        if (!empty($zjGatheringItem)) {
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099324');
+            }
+            $ext->zjGatheringItem = $zjGatheringItem;
+            $ext->save();
+            if (!empty($lsExt)) {
+                $lsExt->zjGatheringItem = $zjGatheringItem;
+                $lsExt->save();
+            }
+        }
+        util::complete('修改成功');
+    }
+
+    public function actionInfo()
+    {
+        $ext = $this->shopExt;
+        $losingItemId = $ext->losingItem ?? 0;
+        $losingItem = ProductClass::getById($losingItemId, true);
+        $losingItemName = $losingItem->name ?? '';
+        $zjGatheringItemId = $ext->zjGatheringItem ?? 0;
+        $zjGatheringItem = ProductClass::getById($zjGatheringItemId, true);
+        $zjGatheringItemName = $zjGatheringItem->name ?? '';
+        $arr = $ext->attributes ?? [];
+        $arr['losingItemName'] = $losingItemName;
+        $arr['zjGatheringItemName'] = $zjGatheringItemName;
+        util::success($arr);
+    }
+
     //添加外采打印机  ssh 20230618
     public function actionAddWcPrint()
     {
@@ -242,4 +322,4 @@ class ShopExtController extends BaseController
         util::complete();
     }
 
-}
+}

+ 4 - 12
app-hd/controllers/NoticeController.php

@@ -143,12 +143,8 @@ class NoticeController extends PublicController
                 if (!empty($cg) && !empty($order)) {
                     if (isset($cg->book) && $cg->book == 0) {
                         $ghsShopId = $order->shopId ?? 0;
-                        if (getenv('YII_ENV') == 'production') {
-                            $specialList = [10649, 8042, 16454, 21319, 33668,42345];
-                        } else {
-                            $specialList = [36523];
-                        }
-                        if (!in_array($ghsShopId, $specialList)) {
+                        $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                        if ($ext->orderFlow == 0) {
                             PurchaseClass::confirmTake($cg);
                         }
                     }
@@ -366,12 +362,8 @@ class NoticeController extends PublicController
                 if (!empty($cg) && !empty($order)) {
                     if (isset($cg->book) && $cg->book == 0) {
                         $ghsShopId = $order->shopId ?? 0;
-                        if (getenv('YII_ENV') == 'production') {
-                            $specialList = [10649, 8042, 16454, 21319, 33668,42345];
-                        } else {
-                            $specialList = [36523];
-                        }
-                        if (!in_array($ghsShopId, $specialList)) {
+                        $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                        if ($ext->orderFlow == 0) {
                             PurchaseClass::confirmTake($cg);
                         }
                     }

+ 2 - 6
app-hd/controllers/PurchaseController.php

@@ -753,12 +753,8 @@ class PurchaseController extends BaseController
             if (!empty($cg)) {
                 if (isset($cg->book) && $cg->book == 0) {
                     $ghsShopId = $ghs['shopId'] ?? 0;
-                    if (getenv('YII_ENV') == 'production') {
-                        $specialList = [10649, 8042, 16454, 21319, 33668, 42345];
-                    } else {
-                        $specialList = [36523];
-                    }
-                    if (!in_array($ghsShopId, $specialList)) {
+                    $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                    if ($ext->orderFlow == 0) {
                         PurchaseClass::confirmTake($cg);
                     }
                 }

+ 33 - 36
app-hd/controllers/ShopExtController.php

@@ -18,6 +18,22 @@ class ShopExtController extends BaseController
 
     public $guestAccess = [];
 
+    public function actionMyInfo()
+    {
+        $shopId = $this->shopId;
+        $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        $losingItemId = $ext->losingItem ?? 0;
+        $losingItem = ProductClass::getById($losingItemId, true);
+        $losingItemName = $losingItem->name ?? '';
+        $zjGatheringItemId = $ext->zjGatheringItem ?? 0;
+        $zjGatheringItem = ProductClass::getById($zjGatheringItemId, true);
+        $zjGatheringItemName = $zjGatheringItem->name ?? '';
+        $arr = $ext->attributes ?? [];
+        $arr['losingItemName'] = $losingItemName;
+        $arr['zjGatheringItemName'] = $zjGatheringItemName;
+        util::success($arr);
+    }
+
     //设置处理花材、扫码收款和直接收款使用的花材 ssh 20250905
     public function actionSetItem()
     {
@@ -33,47 +49,28 @@ class ShopExtController extends BaseController
         $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
         $losingItem = $post['losingItem'] ?? 0;
         if (!empty($losingItem)) {
-            if (empty($ext->losingItem)) {
-                $info = ProductClass::getById($losingItem, true);
-                if ($info->mainId != $this->mainId) {
-                    util::fail('不是你的花材呢,编号099323');
-                }
-                $ext->losingItem = $losingItem;
-                $ext->save();
-                if (!empty($pfExt)) {
-                    $pfExt->losingItem = $losingItem;
-                    $pfExt->save();
-                }
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099323');
             }
-        }
-        $gatheringItem = $post['gatheringItem'] ?? 0;
-        if (!empty($gatheringItem)) {
-            if (empty($ext->gatheringItem)) {
-                $info = ProductClass::getById($losingItem, true);
-                if ($info->mainId != $this->mainId) {
-                    util::fail('不是你的花材呢,编号099324');
-                }
-                $ext->gatheringItem = $gatheringItem;
-                $ext->save();
-                if (!empty($pfExt)) {
-                    $pfExt->gatheringItem = $gatheringItem;
-                    $pfExt->save();
-                }
+            $ext->losingItem = $losingItem;
+            $ext->save();
+            if (!empty($pfExt)) {
+                $pfExt->losingItem = $losingItem;
+                $pfExt->save();
             }
         }
         $zjGatheringItem = $post['zjGatheringItem'] ?? 0;
         if (!empty($zjGatheringItem)) {
-            if (empty($ext->zjGatheringItem)) {
-                $info = ProductClass::getById($losingItem, true);
-                if ($info->mainId != $this->mainId) {
-                    util::fail('不是你的花材呢,编号099324');
-                }
-                $ext->zjGatheringItem = $zjGatheringItem;
-                $ext->save();
-                if (!empty($pfExt)) {
-                    $pfExt->zjGatheringItem = $zjGatheringItem;
-                    $pfExt->save();
-                }
+            $info = ProductClass::getById($losingItem, true);
+            if ($info->mainId != $this->mainId) {
+                util::fail('不是你的花材呢,编号099324');
+            }
+            $ext->zjGatheringItem = $zjGatheringItem;
+            $ext->save();
+            if (!empty($pfExt)) {
+                $pfExt->zjGatheringItem = $zjGatheringItem;
+                $pfExt->save();
             }
         }
         util::complete('修改成功');

+ 5 - 12
biz-ghs/order/services/OrderService.php

@@ -6,6 +6,7 @@ use biz\ghs\classes\GhsClass;
 use biz\shop\classes\ShopAdminClass;
 use biz\shop\classes\ShopCapitalClass;
 use biz\shop\classes\ShopClass;
+use biz\shop\classes\ShopExtClass;
 use biz\stat\classes\StatKdClass;
 use biz\stat\classes\StatKhCgClass;
 use biz\stat\classes\StatSaleClass;
@@ -134,12 +135,8 @@ class OrderService extends BaseService
         //不是预订单,并且供货商不是源花汇、小明鲜花、淄博花超、云漫梦金鹏、海翔,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
         if (!empty($cg) && !empty($order)) {
             $ghsShopId = $order->shopId ?? 0;
-            if (getenv('YII_ENV') == 'production') {
-                $specialList = [10649, 8042, 16454, 21319, 33668, 42345];
-            } else {
-                $specialList = [36523];
-            }
-            if (!in_array($ghsShopId, $specialList)) {
+            $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+            if ($ext->orderFlow == 0) {
                 $newCg = PurchaseClass::getById($cgId, true);
                 PurchaseClass::confirmTake($newCg);
             }
@@ -312,12 +309,8 @@ class OrderService extends BaseService
             //不是预订单,并且供货商不是源花汇、小明鲜花、淄博花超、云漫梦金鹏、海翔,则订单直接完成掉。是预订单,则确认发货时直接完成掉。有多个地方要修改,请搜索关键词zjFinish
             if (isset($returnOrder->book) && $returnOrder->book == 0) {
                 $ghsShopId = $ghs['shopId'] ?? 0;
-                if (getenv('YII_ENV') == 'production') {
-                    $specialList = [10649, 8042, 16454, 21319, 33668,42345];
-                } else {
-                    $specialList = [36523];
-                }
-                if (!in_array($ghsShopId, $specialList)) {
+                $ext = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, null, 'id,shopId,orderFlow');
+                if ($ext->orderFlow == 0) {
                     $returnId = $returnOrder->id;
                     $order = OrderClass::getById($returnId, true);
                     if (!empty($order)) {