Browse Source

大王椰出入库

cqpCow 1 year ago
parent
commit
6b7a32f424
1 changed files with 4 additions and 3 deletions
  1. 4 3
      app/Service/InOutOptionService.php

+ 4 - 3
app/Service/InOutOptionService.php

@@ -9,6 +9,7 @@ class InOutOptionService extends Service
 {
     const OrderKeyQueueIn = 'InOrderNumber';
     const OrderKeyQueueOut = 'OutOrderNumber';
+    const OrderKeyQueueInOut = 'InOutOrderNumber';
     const Key = 'FHCK';
 
     public function setOrderNumber($data){
@@ -20,7 +21,7 @@ class InOutOptionService extends Service
                 if($value['direction'] == '1'){
                     //(判断到有发货出库的入库标识 存入缓存)
                     if(Redis::exists($device_id . self::Key)){
-                        Redis::lpush($device_id . self::Key, json_encode($value));
+                        Redis::lpush($device_id . self::Key . Self::OrderKeyQueueInOut, json_encode($value));
                     }else{
                         //入库 直接生成入库单
                         if(! in_array($value['epc'],$in)) $in[] = $value['epc'];
@@ -28,7 +29,7 @@ class InOutOptionService extends Service
                 }elseif ($value['direction'] == '2'){
                     //(判断到有发货出库的出库标识 存入缓存)
                     if(Redis::exists($device_id . self::Key)){
-                        Redis::lpush($device_id . self::Key, json_encode($value));
+                        Redis::lpush($device_id . self::Key . Self::OrderKeyQueueInOut, json_encode($value));
                     }else{
                         //出库 直接生成出库单
                         if(! in_array($value['epc'],$out)) $out[] = $value['epc'];
@@ -46,7 +47,7 @@ class InOutOptionService extends Service
         $result = [];
 
         //发货出库
-        $key = $data['device_id'] . self::Key;
+        $key = $data['device_id'] . self::Key . Self::OrderKeyQueueInOut;
         if(Redis::exists($key)) {
             //发货
             while ($item = Redis::lpop($key)) {