|
|
@@ -77,7 +77,7 @@ class StationTaskBatchService
|
|
|
}
|
|
|
$this->batchService->updateWhereIn('id', data_get($batches_handled, '*.id'), ['status' => '处理中']);
|
|
|
$this->insert($stationTaskBatches_toCreate->toArray());
|
|
|
- $stationTaskBatches_toCreate=$this->getWithIds($stationTaskBatches_toCreate);
|
|
|
+ $stationTaskBatches_toCreate=$this->getAndAttachIds($stationTaskBatches_toCreate);
|
|
|
$this->stationTaskService->registerSubTasks(
|
|
|
$stationTasks_toAttach,
|
|
|
$stationTaskBatches_toCreate->map(function($taskBatch){
|
|
|
@@ -88,18 +88,18 @@ class StationTaskBatchService
|
|
|
return $stationTaskBatches_toCreate;
|
|
|
}
|
|
|
|
|
|
- function getWithIds($stationMissionBatches): Collection
|
|
|
+ function getAndAttachIds($stationTaskBatches): Collection
|
|
|
{
|
|
|
- $md5=is_array($stationMissionBatches)
|
|
|
- ?$md5=md5(json_encode($stationMissionBatches)):null;
|
|
|
+ $md5=is_array($stationTaskBatches)
|
|
|
+ ?$md5=md5(json_encode($stationTaskBatches)):null;
|
|
|
|
|
|
return Cache::remember(
|
|
|
- $md5??md5(json_encode($stationMissionBatches->toArray()))
|
|
|
+ 'StationTaskBatch_'.$md5??md5(json_encode($stationTaskBatches->toArray()))
|
|
|
,config('cache.expirations.rarelyChange')
|
|
|
- ,function()use($stationMissionBatches){
|
|
|
+ ,function()use($stationTaskBatches){
|
|
|
return StationTaskBatch::query()
|
|
|
- ->whereIn('status',data_get($stationMissionBatches,'*.status'))
|
|
|
- ->whereIn('batch_id',data_get($stationMissionBatches,'*.batch_id'))
|
|
|
+ ->whereIn('status',data_get($stationTaskBatches,'*.status'))
|
|
|
+ ->whereIn('batch_id',data_get($stationTaskBatches,'*.batch_id'))
|
|
|
->get();
|
|
|
});
|
|
|
}
|