|
|
@@ -5,11 +5,8 @@ namespace App\Services;
|
|
|
|
|
|
|
|
|
use App\Exceptions\ErrorException;
|
|
|
-use App\Exceptions\PanicException;
|
|
|
use App\MaterialBox;
|
|
|
use App\StationTaskMaterialBox;
|
|
|
-use Illuminate\Http\Request;
|
|
|
-use Illuminate\Http\Response;
|
|
|
use Illuminate\Support\Collection;
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
use App\Traits\ServiceAppAop;
|
|
|
@@ -76,13 +73,13 @@ class ForeignHaiRoboticsService
|
|
|
"toLocCode" => $toLocation??'',
|
|
|
];
|
|
|
});
|
|
|
- return [
|
|
|
+ return [[
|
|
|
"taskMode" =>$taskMode,
|
|
|
"bins"=>$bins,
|
|
|
"groupCode"=>$groupId.$timestampSuffix,
|
|
|
"priority"=>$priority,
|
|
|
"sequenceFlag"=>$isSequenced,
|
|
|
- ];
|
|
|
+ ]];
|
|
|
}
|
|
|
|
|
|
public function fetchGroup($toLocation, Collection $taskMaterialBoxes, $groupIdPrefix=''): bool
|
|
|
@@ -182,7 +179,7 @@ class ForeignHaiRoboticsService
|
|
|
$dataToPost=$this->makeJson_move(
|
|
|
collect([$stationTaskMaterialBox]),
|
|
|
'缓存架入立架',
|
|
|
- $this->stationService->getULineExit($stationTaskMaterialBox['station'])['name']??'',
|
|
|
+ 'BIN-IN1',//TODO:这里应该是动态取得,参考出立架getULineExit()方法,不然不能从站获得对应的出口,而且要改Station的child为children
|
|
|
'',
|
|
|
$stationTaskMaterialBox['stationTaskBatch']['id']
|
|
|
);
|
|
|
@@ -265,12 +262,16 @@ class ForeignHaiRoboticsService
|
|
|
LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c1:'.json_encode($dataToPost));
|
|
|
try{
|
|
|
LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c1.51:');
|
|
|
+ $a = json_encode($dataToPost);
|
|
|
$response = Http::post(config('api.haiq.storage.moveBin'), $dataToPost);
|
|
|
+ if(isset($response->json()['code'])&&$response->json()['code']==500)
|
|
|
+ throw new ErrorException('机器人500错误:'.json_encode($response->json()));
|
|
|
+ $b=json_encode($response->json());
|
|
|
LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c1.52:');
|
|
|
- LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c1.53:'.json_encode($response));
|
|
|
+ LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c1.53:'.json_encode($response->json()));
|
|
|
}catch (\Exception $e){
|
|
|
LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c1.54:');
|
|
|
- throw new ErrorException('海柔机器人任务执行失败:'.json_encode($dataToPost));
|
|
|
+ throw new ErrorException('海柔机器人任务执行失败:'.json_encode($dataToPost).$e->getMessage());
|
|
|
}
|
|
|
LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2c2:'.json_encode($dataToPost));
|
|
|
$errMsg = (function () use ($response) {
|