|
|
@@ -225,34 +225,34 @@ sql;
|
|
|
$wmsBatches = DB::connection("oracle")->select(DB::raw($sql));
|
|
|
$this->headerExe($wmsBatches);
|
|
|
$batches = $this->batchService->get(["code"=>$nos]);
|
|
|
- }
|
|
|
- $updateOrder = [["code","batch_id"]];
|
|
|
- $existOrder = [];
|
|
|
- $updatingBatches = [];
|
|
|
- foreach (Order::query()->select("code","batch_id")->whereNotNull("batch_id")->whereIn("code",$ods)->get() as $item){
|
|
|
- $existOrder[$item->code] = $item->batch_id;
|
|
|
- }
|
|
|
- foreach ($batches as $batch){
|
|
|
- $mark = false;
|
|
|
- foreach ($map[$batch->code] as $on){
|
|
|
- if (!isset($existOrder[$on]) || $existOrder[$on]!=$batch->id){
|
|
|
- $updateOrder[] = [
|
|
|
- "code"=>$on,
|
|
|
- "batch_id"=>$batch->id
|
|
|
- ];
|
|
|
- $mark = true;
|
|
|
+ $updateOrder = [["code","batch_id"]];
|
|
|
+ $existOrder = [];
|
|
|
+ $updatingBatches = [];
|
|
|
+ foreach (Order::query()->select("code","batch_id")->whereNotNull("batch_id")->whereIn("code",$ods)->get() as $item){
|
|
|
+ $existOrder[$item->code] = $item->batch_id;
|
|
|
+ }
|
|
|
+ foreach ($batches as $batch){
|
|
|
+ $mark = false;
|
|
|
+ foreach ($map[$batch->code] as $on){
|
|
|
+ if (!isset($existOrder[$on]) || $existOrder[$on]!=$batch->id){
|
|
|
+ $updateOrder[] = [
|
|
|
+ "code"=>$on,
|
|
|
+ "batch_id"=>$batch->id
|
|
|
+ ];
|
|
|
+ $mark = true;
|
|
|
+ }
|
|
|
}
|
|
|
+ if ($mark)$updatingBatches[] = $batch;
|
|
|
+ unset($map[$batch->code]);
|
|
|
+ }
|
|
|
+ if (count($updateOrder)>1){
|
|
|
+ app("OrderService")->batchUpdate($updateOrder);//反向修改订单
|
|
|
+ LogService::log(__METHOD__,"波次同步-修改订单波次号",json_encode($updateOrder));
|
|
|
+ app("BatchService")->checkBatchOrderInfo($updatingBatches);
|
|
|
+ LogService::log(__METHOD__,"修改过的波次_",json_encode($updatingBatches));
|
|
|
+ LogService::log(__METHOD__,"波次注册一入口",json_encode($updatingBatches));
|
|
|
+ BatchTaskJob::dispatch($updatingBatches); //在这里为波次注册队列任务!
|
|
|
}
|
|
|
- if ($mark)$updatingBatches[] = $batch;
|
|
|
- unset($map[$batch->code]);
|
|
|
- }
|
|
|
- if (count($updateOrder)>1){
|
|
|
- app("OrderService")->batchUpdate($updateOrder);//反向修改订单
|
|
|
- LogService::log(__METHOD__,"波次同步-修改订单波次号",json_encode($updateOrder));
|
|
|
- app("BatchService")->checkBatchOrderInfo($updatingBatches);
|
|
|
- LogService::log(__METHOD__,"修改过的波次_",json_encode($updatingBatches));
|
|
|
- LogService::log(__METHOD__,"波次注册一入口",json_encode($updatingBatches));
|
|
|
- BatchTaskJob::dispatch($updatingBatches); //在这里为波次注册队列任务!
|
|
|
}
|
|
|
|
|
|
if ($map){
|