Просмотр исходного кода

Merge branch 'zengjun' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 5 лет назад
Родитель
Сommit
2e288ee426

+ 14 - 0
app/Http/Controllers/TestController.php

@@ -1483,5 +1483,19 @@ TEXT;
     {
         return view('httpTest');
     }
+
+    public function updateStation()
+    {
+//        $hid = 'hengli004';
+//        $measuringMachine = MeasuringMachine::query()->firstOrCreate(['code' => $hid],['name' => $hid]); // 称重设备
+        StationTask::query()->where('id',709)->update(
+            ['status'=>'完成']
+        );
+//        StationTaskMaterialBox::query()->where('id',7033)->delete();
+//        Station::query()->where('id',9)->delete();
+//        Station::query()->where('code' ,'缓存架01')->update(['code' => 'B1']);
+//        Station::query()->where('code' ,'缓存架02')->update(['code' => 'B2']);
+//        Station::query()->where('name' ,'HAI缓存架01-03-03')->update(['name' => 'HAIB1-03-03']);
+    }
 }
 

+ 2 - 2
app/Services/CacheShelfService.php

@@ -13,7 +13,7 @@ use Illuminate\Support\Facades\Http;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Collection;
 
-class CacheShelfService
+class   CacheShelfService
 {
     use ServiceAppAop;
 
@@ -107,7 +107,7 @@ class CacheShelfService
         $stationTask = $this->stationTaskService->create(1);                                                    // 生成站任务
         $stationTaskMaterialBox = $this->stationTaskMaterialBoxService->createByStationAndMaterialBox($station,$materialBox);     // 创建料箱任务
         $this->stationTaskService->registerStations($stationTask,[$station['id']]);                                            // 注册站任务站
-        $stationTaskMaterialBox->update(['station_task_id'=>$stationTask['id']]);
+        $stationTaskMaterialBox->update(['station_task_id'=>$stationTask->first()['id']]);
         $params = [[
                 'station_task_id'=>$stationTask->first()['id'],
                 'station_taskable_type'=>StationTaskMaterialBox::class,

+ 2 - 0
app/Services/ForeignHaiRoboticsService.php

@@ -295,6 +295,8 @@ class ForeignHaiRoboticsService
                 'station_id' => $stationTaskMaterialBox['station']['id']?? '',
             ]);
             $stationTaskMaterialBox->stationTask()->update(['status' => '完成']);
+
+
         }
         return $controlSuccess;
     }

+ 1 - 1
app/Services/StationTaskMaterialBoxService.php

@@ -210,7 +210,7 @@ class StationTaskMaterialBoxService
 
     function markProcessed(StationTaskMaterialBox $stationTaskMaterialBox){
         $stationTaskMaterialBox['status'] = '完成';
-        $stationTaskMaterialBox->update();
+        $stationTaskMaterialBox->save();
     }
     function getNotProcessedSiblings($stationTaskMaterialBox){
         return StationTaskMaterialBox::query()

+ 1 - 1
tests/Services/CacheShelfService/StationCacheLightOffTest.php

@@ -16,7 +16,7 @@ class StationCacheLightOffTest extends TestCase
     protected function setUp(): void
     {
         parent::setUp();
-        $this->data['code'] = 'HAIB1-01-01';    // 修改此处可进行测试
+        $this->data['code'] = 'HAIB1-02-02';    // 修改此处可进行测试
         $this->service = app(CacheShelfService::class);
     }
 

+ 2 - 2
tests/Services/CacheShelfService/StationCacheLightOnTest.php

@@ -15,8 +15,8 @@ class StationCacheLightOnTest extends TestCase
     protected function setUp(): void
     {
         parent::setUp(); // TODO: Change the autogenerated stub
-        $this->data['code'] = 'HAIB1-01-01';                // 修改此处可进行测试
-        $this->data['materialCode'] = 'IDE0005665';         // 修改此处可进行测试
+        $this->data['code'] = 'HAIB1-02-02';                // 修改此处可进行测试
+        $this->data['materialCode'] = 'IDE0000898';         // 修改此处可进行测试
         $this->service = app(CacheShelfService::class);
     }