Kaynağa Gözat

海柔“完成”标记给batch

LD 5 yıl önce
ebeveyn
işleme
7a7af67ec8

+ 10 - 1
app/Http/Controllers/TestController.php

@@ -286,13 +286,22 @@ class TestController extends Controller
     {
         app('ForeignHaiRoboticsService')->markBinProcessed(
             '1',
-            'IDE0005680',
+            'IDE0005714',
             true,
             "2021-56-24 05-03-15",
             '',
             true
         );
     }
+    function hHasTaken(Request $request)
+    {
+        app('ForeignHaiRoboticsService')->taskUpdate(
+            301
+            ,1
+            ,0
+            ,'IDE0005714'
+        );
+    }
     function hBatch(Request $request)
     {
         $a=[

+ 3 - 3
app/Services/ForeignHaiRoboticsService.php

@@ -154,9 +154,9 @@ class ForeignHaiRoboticsService
             if(!$stationTaskMaterialBox){
                 throw new ErrorException('该料箱没有安排在处理队列中');
             }
-            $this->putBinToStore($stationTaskMaterialBox)
-                ?true
-                :(function(){throw new ErrorException('呼叫机器人回收U型线料箱失败');})();
+//            $this->putBinToStore($stationTaskMaterialBox)
+//                ?true
+//                :(function(){throw new ErrorException('呼叫机器人回收U型线料箱失败');})();
             $this->stationTaskMaterialBoxService
                 ->markProcessed($stationTaskMaterialBox);
             LogService::log('海柔请求','markBinProcessed1.7',

+ 5 - 1
app/Services/StationTaskCommodityService.php

@@ -27,6 +27,8 @@ class StationTaskCommodityService
     private $stationTaskService;
     /** @var MaterialBoxService $materialBoxService */
     private $materialBoxService;
+    /** @var StationTaskBatchService $stationTaskBatchService */
+    private $stationTaskBatchService;
     public function __construct(){
         $this->stationService=null;
         $this->stationTypeService=null;
@@ -97,9 +99,11 @@ class StationTaskCommodityService
         $this->instant($this->stationTypeService,'StationTypeService');
         $this->instant($this->stationService,'StationService');
         $this->instant($this->materialBoxService,'MaterialBoxService');
+        $this->instant($this->stationTaskBatchService,'StationTaskBatchService');
         $stationTaskCommodities_toCreate=new Collection();
         $order_ids=data_get($batch['orders'],'*.id');
         $orderCommodities=OrderCommodity::query()->with('orderBin')->whereIn('order_id',$order_ids)->get();
+        $stationTaskBatch=$this->stationTaskBatchService->get(['batch_id'=>$batch['id']])->first();
         foreach ($orderCommodities as $orderCommodity){
             $stationType=$this->stationTypeService->getForCommodity();
             $station=$this->stationService->getStation_byType($stationType['name']);
@@ -114,7 +118,7 @@ class StationTaskCommodityService
                     'amount'=>$orderCommodity['amount'],
                     'bin_number'=>$orderCommodity['orderBin']['number']??'',
                     'order_id'=>$orderCommodity['order_id'],
-                    'station_task_batch_id'=>$batch['id'],
+                    'station_task_batch_id'=>$stationTaskBatch['id'],
                     'station_task_material_box_id'=>$stationTaskMaterialBoxId,
                     'status'=>'待处理',
                 ])

+ 4 - 1
app/Services/StationTaskMaterialBoxService.php

@@ -68,18 +68,20 @@ class StationTaskMaterialBoxService
         $this->instant($this->materialBoxService,'MaterialBoxService');
         $this->instant($this->stationTypeService,'StationTypeService');
         $this->instant($this->stationService,'StationService');
+        $this->instant($this->stationTaskBatchService,'StationTaskBatchService');
         $stationMaterialBoxes_toCreate=new Collection();
         $order_ids=data_get($batch['orders'],'*.id');
         $orderCommodities=OrderCommodity::query()->with('orderBin')->whereIn('order_id',$order_ids)->get();
         if($orderCommodities->isEmpty())return $stationMaterialBoxes_toCreate;
         $stationType=$this->stationTypeService->getForMaterialBox_onBatchProcess();
+        $stationTaskBatch=$this->stationTaskBatchService->get(['batch_id'=>$batch['id']])->first();
         foreach ($orderCommodities as $orderCommodity){
             $station=$this->stationService->getStation_byType($stationType['name']);
             $materialBox=$this->materialBoxService->firstOrCreate(['code' => $orderCommodity['location']]);
             $stationMaterialBoxes_toCreate->push([
                 'station_id'=>$station['id'],
                 'material_box_id'=>$materialBox['id'],
-                'station_task_batch_id'=>$batch['id'],
+                'station_task_batch_id'=>$stationTaskBatch['id'],
                 'status'=>'待处理'
             ]);
         }
@@ -151,6 +153,7 @@ class StationTaskMaterialBoxService
     }
     function markProcessed(StationTaskMaterialBox $stationTaskMaterialBox){
         $stationTaskMaterialBox['status'] = '完成';
+        $stationTaskMaterialBox['station_id'] = 4;
         $stationTaskMaterialBox->update();
     }
 

+ 1 - 1
app/StationTaskMaterialBox.php

@@ -25,7 +25,7 @@ class StationTaskMaterialBox extends Model
     }
     function stationTaskBatch(): BelongsTo
     {
-        return $this->belongsTo(StationTaskBatch::class,"id","station_id");
+        return $this->belongsTo(StationTaskBatch::class);
     }
     function stationTask(): BelongsTo
     {

+ 3 - 5
laravel-echo-server.json

@@ -1,5 +1,5 @@
 {
-	"authHost": "https://localhost",
+	"authHost": "http://localhost",
 	"authEndpoint": "/broadcasting/auth",
 	"clients": [
 		{
@@ -21,14 +21,12 @@
 			"databasePath": "/database/laravel-echo-server.sqlite"
 		}
 	},
-	"devMode": false,
+	"devMode": true,
 	"host": null,
 	"port": "6001",
-	"protocol": "https",
+	"protocol": "http",
 	"socketio": {},
 	"secureOptions": 67108864,
-	"sslCertPath": "/etc/letsencrypt/live/was.baoshi56.com/fullchain.pem",
-	"sslKeyPath": "/etc/letsencrypt/live/was.baoshi56.com/privkey.pem",
 	"sslCertChainPath": "",
 	"sslPassphrase": "",
 	"subscribers": {

+ 1 - 1
laravel-echo-server.lock

@@ -1,3 +1,3 @@
 {
-	"process": 18588
+	"process": 15892
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 64 - 565
package-lock.json


+ 0 - 1
package.json

@@ -33,7 +33,6 @@
     "js-cookie": "^2.2.1",
     "jsbarcode": "^3.11.3",
     "laravel-echo": "^1.8.0",
-    "laravel-echo-server": "^1.6.2",
     "md5": "^2.3.0",
     "moment": "^2.28.0",
     "pusher-js": "^5.1.1",

+ 2 - 2
tests/webApi/thirdPart/haiq/pickStation.http

@@ -14,10 +14,10 @@
 
 
 
-POST https://was.baoshi56.com/api/thirdPart/haiq/pickStation/processed
+POST http://bswas/api/thirdPart/haiq/pickStation/processed
 Content-Type: application/json
 
-{"workStation": "1", "binCode":"IDE0005680", "success": true, "created_at":"2021-56-24 05-03-15", "exception": "", "is_in_plan":true}
+{"workStation": "1", "binCode":"IDE0005714", "success": true, "created_at":"2021-56-24 05-03-15", "exception": "", "is_in_plan":true}
 ###
 
 

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor