wugg 2 years ago
parent
commit
8bf6ac249e
2 changed files with 31 additions and 31 deletions
  1. 29 29
      app/admin/controller/Reorder.php
  2. 2 2
      app/command/handleYzOrderData.php

+ 29 - 29
app/admin/controller/Reorder.php

@@ -934,7 +934,7 @@ class Reorder extends Base
 
                     //对应采购单也要处理
                     $holder_id = Db::name('supplier')->where(['code' => $cgd['supplierNo'], 'is_del' => 0])->value('personid', 0);
-                    if(in_array($cgd['status'],[1,2])){
+                    if(in_array($cgd['status'],[4])){
                         if($orderinfo['is_stock']==1){
                             //库存品,推给31库管人员、41库管-张凯旋
                             $uid = Db::name('user_role')
@@ -943,39 +943,39 @@ class Reorder extends Base
                                     ['roleid', 'in', [31, 41]],
                                     ['status', '=', 1]
                                 ])->column('uid');
-                            if(!in_array($this->uid,$uid)) throw new Exception('库存品订单只能由库管人员操作');
-//                            ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
-//                                "order_type" => 'CGD',
-//                                "order_code" => $cgd['cgdNo'],
-//                                "order_id" => $cgd["id"],
-//                                "order_status" => $cgd['status'],
-//                                "before_status" => $lor,
-//                                'holder_id' => $holder_id,
-//                                'handle_user_list' => implode(',', $uid),
-//                            ]);
+//                            if(!in_array($this->uid,$uid)) throw new Exception('库存品订单只能由库管人员操作');
+                            ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
+                                "order_type" => 'CGD',
+                                "order_code" => $cgd['cgdNo'],
+                                "order_id" => $cgd["id"],
+                                "order_status" => $cgd['status'],
+                                "before_status" => $lor,
+                                'holder_id' => $holder_id,
+                                'handle_user_list' => implode(',', $uid),
+                            ]);
                         }else{
-                            if($this->uid != $holder_id)throw new Exception('非库存品和采返商品只能由供应商负责人操作');
+//                            if($this->uid != $holder_id)throw new Exception('非库存品和采返商品只能由供应商负责人操作');
                             //非库存品和采返商品,推给供应商负责人
-//                            ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
-//                                "order_type" => 'CGD',
-//                                "order_code" => $cgd['cgdNo'],
-//                                "order_id" => $cgd["id"],
-//                                "order_status" => $cgd['status'],
-//                                "before_status" => $lor,
-//                                'holder_id' => $holder_id,
-//                                'handle_user_list' => $orderinfo['cgderid'],
-//                            ]);
+                            ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
+                                "order_type" => 'CGD',
+                                "order_code" => $cgd['cgdNo'],
+                                "order_id" => $cgd["id"],
+                                "order_status" => $cgd['status'],
+                                "before_status" => $lor,
+                                'holder_id' => $holder_id,
+                                'handle_user_list' => $orderinfo['cgderid'],
+                            ]);
                         }
                     }
 
-                    ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
-                        "order_type" => 'CGD',
-                        "order_code" => $cgd['cgdNo'],
-                        "order_id" => $cgd["id"],
-                        "order_status" => $cgd['status'],
-                        "before_status" => $lor,
-                        'holder_id' => $holder_id
-                    ]);
+//                    ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], [
+//                        "order_type" => 'CGD',
+//                        "order_code" => $cgd['cgdNo'],
+//                        "order_id" => $cgd["id"],
+//                        "order_status" => $cgd['status'],
+//                        "before_status" => $lor,
+//                        'holder_id' => $holder_id
+//                    ]);
 
                     if($orderinfo['is_stock'] == 1 || $info['is_th'] == 0){
 

+ 2 - 2
app/command/handleYzOrderData.php

@@ -28,10 +28,10 @@ class handleYzOrderData extends Command
     protected function execute(Input $input, Output $output)
     {
 		$limit = Cache::store('redis')->get("YzTimeLimit");
-        $c_data = Cache::store('redis')->handler()->rpop(Config::get('app.handle_queue_key'));
         if($limit==1){
         	return '' ;
         }
+        $c_data = Cache::store('redis')->handler()->rpop(Config::get('app.handle_queue_key'));
         Cache::store('redis')->set("YzTimeLimit",1,60);
         if ($c_data){
 
@@ -599,7 +599,7 @@ class handleYzOrderData extends Command
             }
 
         }
-
+        Cache::store('redis')->set("YzTimeLimit",0,60);
         //没有需要处理的数据
 
     }