Parcourir la source

入库单优化

shish il y a 3 ans
Parent
commit
c1a1375693

+ 1 - 1
app-ghs/controllers/AdminController.php

@@ -304,7 +304,7 @@ class AdminController extends BaseController
         }
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $this->shopAdmin->super = 0;
         }
 

+ 4 - 4
app-ghs/controllers/AuthController.php

@@ -133,7 +133,7 @@ class AuthController extends PublicController
         }
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 
@@ -260,7 +260,7 @@ class AuthController extends PublicController
         }
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 
@@ -520,7 +520,7 @@ class AuthController extends PublicController
         }
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 
@@ -623,7 +623,7 @@ class AuthController extends PublicController
         }
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 

+ 1 - 1
app-ghs/controllers/StatController.php

@@ -27,7 +27,7 @@ class StatController extends BaseController
         //惠雅鲜花员工不能看利润表
         $shopAdmin = $this->shopAdmin;
         $adminId = $shopAdmin->adminId ?? 0;
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             util::fail('暂无权限');
         }
 

+ 50 - 1
app-ghs/controllers/StockInController.php

@@ -2,8 +2,8 @@
 
 namespace ghs\controllers;
 
-use biz\admin\classes\AdminRoleClass;
 use bizGhs\order\classes\StockInOrderClass;
+use bizGhs\stock\classes\StockInDayClass;
 use common\components\util;
 use Yii;
 
@@ -11,6 +11,55 @@ use Yii;
 class StockInController extends BaseController
 {
 
+    //入库单盘点,生成需要盘点的花材 ssh 20221208
+    public function actionCreatePdItem()
+    {
+        $post = Yii::$app->request->post();
+        $ids = $post['ids'] ?? '';
+        $arr = json_decode($ids, true);
+        if (is_array($arr) == false) {
+            util::fail('没有盘点单');
+        }
+        $idData = array_column($arr, 'id');
+        if (empty($idData) || is_array($idData) == false) {
+            util::fail('没有盘点单哦');
+        }
+        $idData = array_filter(array_unique($idData));
+        $list = StockInOrderClass::getByIds($idData);
+        if (empty($list)) {
+            util::fail('没有找到盘点单');
+        }
+        $use = [];
+        $inMainId = 0;
+        foreach ($list as $item) {
+            $inMainId = $item['inMainId'] ?? 0;
+            if ($inMainId != $this->mainId) {
+                util::fail('入库单有问题');
+            }
+            $orderSn = $item['orderSn'] ?? '';
+            $itemList = StockInOrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
+            if (!empty($itemList)) {
+                foreach ($itemList as $it) {
+                    $itemId = $it['productId'] ?? 0;
+                    $ptItemId = $it['itemId'] ?? 0;
+                    $use[$itemId] = [
+                        'mainId' => $inMainId,
+                        'itemId' => $itemId,
+                        'ptItemId' => $ptItemId,
+                    ];
+                }
+            }
+        }
+        if (empty($use)) {
+            util::fail('没有找到需要盘点的花材');
+        }
+        StockInDayClass::deleteByCondition(['mainId' => $inMainId]);
+        foreach ($use as $info) {
+            StockInDayClass::add($info);
+        }
+        util::complete();
+    }
+
     //入库列表 lqh 2021.1.25
     public function actionList()
     {

+ 1 - 1
app-hd/controllers/AdminController.php

@@ -75,7 +75,7 @@ class AdminController extends BaseController
         $imgUploadApi = $apiHost . '/upload/save-file';
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 

+ 1 - 1
app-hd/controllers/ApplyController.php

@@ -206,7 +206,7 @@ class ApplyController extends BaseController
             $imgUploadApi = $apiHost . '/upload/save-file';
 
             //惠雅鲜花员工不能看收入情况
-            if (in_array($adminId, [99000])) {
+            if (in_array($adminId, [9900])) {
                 $shopAdmin->super = 0;
             }
 

+ 4 - 4
app-hd/controllers/AuthController.php

@@ -116,7 +116,7 @@ class AuthController extends PublicController
         $imgUploadApi = $apiHost . '/upload/save-file';
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 
@@ -203,7 +203,7 @@ class AuthController extends PublicController
         $imgUploadApi = $apiHost . '/upload/save-file';
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 
@@ -305,7 +305,7 @@ class AuthController extends PublicController
         $imgUploadApi = $apiHost . '/upload/save-file';
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 
@@ -548,7 +548,7 @@ class AuthController extends PublicController
         $imgUploadApi = $apiHost . '/upload/save-file';
 
         //惠雅鲜花员工不能看收入情况
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             $shopAdmin->super = 0;
         }
 

+ 1 - 1
app-hd/controllers/StatController.php

@@ -31,7 +31,7 @@ class StatController extends BaseController
         //惠雅鲜花员工不能看利润表
         $shopAdmin = $this->shopAdmin;
         $adminId = $shopAdmin->adminId ?? 0;
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             util::fail('暂无权限');
         }
 

+ 1 - 1
app-hd/controllers/StatKdController.php

@@ -24,7 +24,7 @@ class StatKdController extends BaseController
         //惠雅鲜花员工不能看利润表
         $shopAdmin = $this->shopAdmin;
         $adminId = $shopAdmin->adminId ?? 0;
-        if (in_array($adminId, [99000])) {
+        if (in_array($adminId, [9900])) {
             util::fail('暂无权限');
         }