|
|
@@ -23,7 +23,6 @@ class StationRuleBatchService
|
|
|
LogService::log(__METHOD__,'getByBatch','波次任务分配1.21:'.json_encode($batch));
|
|
|
$batchType = $batch['type'] ?? 'null';
|
|
|
$ownerId = $batch['owner_id'] ?? 'null';
|
|
|
- if(!$this->isLocationOfRobot($batch))return null;
|
|
|
LogService::log(__METHOD__,'getByBatch','波次任务分配1.22:'.($this->isLocationOfRobot($batch)));
|
|
|
$batch->loadMissing('stationTaskBatch');
|
|
|
// if($batch['stationTaskBatch'])return null;//? 这行有啥用?
|
|
|
@@ -40,10 +39,16 @@ class StationRuleBatchService
|
|
|
}
|
|
|
function isLocationOfRobot(?Batch $batch): bool
|
|
|
{
|
|
|
+ LogService::log(__METHOD__,'getByBatch','波次任务分配1.21I1:'.json_encode($batch));
|
|
|
if(!$batch)return false;
|
|
|
+ LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I2:'.json_encode($batch));
|
|
|
$sql = "select count(*) as count from order_commodities where location like 'IDE%' and order_id in (select id from orders where batch_id in (select id from batches where id = ?))";
|
|
|
+
|
|
|
+ LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I3:');
|
|
|
+ LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I3.2:'.$sql);
|
|
|
$billDetails = DB::select(DB::raw($sql),[$batch['id']]);
|
|
|
- return $billDetails[0]->count>0;
|
|
|
+ LogService::log(__METHOD__,'getByBatch','波次任务分配1.22I4:'.json_encode($batch).json_encode($billDetails).($billDetails[0]->count > 0));
|
|
|
+ return $billDetails[0]->count > 0;
|
|
|
}
|
|
|
|
|
|
function getStationType_toBeTask(Batch $batch): ?StationType{
|
|
|
@@ -65,8 +70,10 @@ class StationRuleBatchService
|
|
|
$batches=$batches->whereNotIn('id',data_get($batches_inTask,'*.id')??[]);
|
|
|
foreach ($batches as $batch){
|
|
|
$stationRuleBatch=$this->getByBatch($batch);
|
|
|
- if($stationRuleBatch)
|
|
|
+ if($stationRuleBatch){
|
|
|
+// if(!$this->isLocationOfRobot($batch))continue;
|
|
|
$batches_toProcess->push($batch);
|
|
|
+ }
|
|
|
}
|
|
|
LogService::log(__METHOD__,'shouldProcess','波次任务分配1.3:'.json_encode($batches_inTask));
|
|
|
return $batches_toProcess;
|