Browse Source

出标机

cqpCow 11 months ago
parent
commit
c4f22f08a4
2 changed files with 5 additions and 5 deletions
  1. 2 2
      app/Jobs/LabelDealJob.php
  2. 3 3
      app/Service/LabelDealService.php

+ 2 - 2
app/Jobs/LabelDealJob.php

@@ -46,10 +46,10 @@ class LabelDealJob implements ShouldQueue
         LabelDealService::getInstance()->clearData($data,$return,$box_list);
 
         //调用外部方法
-        $result = DwyService::getInstance()->setBoxData($this->header,$dv,$return,$box_list,$data);
+        list($lead_bind,$lead_out) = DwyService::getInstance()->setBoxData($this->header,$dv,$return,$box_list,$data);
 
         //调用保存接口
-        LabelDealService::getInstance()->boxOut($data,$this->header,$result,$this->id);
+        LabelDealService::getInstance()->boxOut($lead_bind,$lead_out,$this->header,$this->id);
     }
 
     protected function echoMessage(OutputInterface $output)

+ 3 - 3
app/Service/LabelDealService.php

@@ -28,7 +28,7 @@ class LabelDealService extends Service
         }
     }
 
-    public function boxOut($data,$token,$result,$id)
+    public function boxOut($lead_bind,$lead_out,$token,$id)
     {
         //商标绑定
         $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/1';
@@ -37,15 +37,15 @@ class LabelDealService extends Service
             'Content-Type:application/json',
             'Authorization: ' . $token,
         ];
-        $lead_bind = $data['lead_bind'];
         $return_bind = $this->post_helper($url, json_encode($lead_bind), $header);
+        file_put_contents('msg_result.txt',date('Y-m-d H:i:s') . "绑定:" . $return_bind. PHP_EOL,8);
         $return_bind = json_decode($return_bind, true);
 
         //商标出库
 //        $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/lead_bind_out_stock';
         $url = 'https://tm.dwycloud.com/jbl/api/module-data/brand_in_stock/brand_in_stock/diy/11';
-        $lead_out = $result;
         $return_out = $this->post_helper($url, json_encode($lead_out), $header);
+        file_put_contents('msg_result.txt',date('Y-m-d H:i:s') . "出库:" . $return_out. PHP_EOL,8);
         $return_out = json_decode($return_out, true);
 
         //toDo