|
@@ -368,14 +368,22 @@ class WorkOrderService
|
|
|
$order_issue->restore();
|
|
$order_issue->restore();
|
|
|
}
|
|
}
|
|
|
$orderIssueType = app(OrderIssueTypeService::class)->firstOrCreate(['name' => '错漏发']);
|
|
$orderIssueType = app(OrderIssueTypeService::class)->firstOrCreate(['name' => '错漏发']);
|
|
|
|
|
+ $expressAbnormal = app(OrderIssueTypeService::class)->firstOrCreate(['name' => '快递异常']);
|
|
|
|
|
+ $loss = app(OrderIssueTypeService::class)->firstOrCreate(['name' => '快递丢件']);
|
|
|
|
|
+ $orderIssueTypeId = $detail->order_issue_type_id;
|
|
|
|
|
+ if($detail->order_issue_type_id == $expressAbnormal->id && $detail->process_progress == "丢件赔偿"){
|
|
|
|
|
+ $orderIssueTypeId = $loss->id;
|
|
|
|
|
+ }
|
|
|
if (!$order_issue) {
|
|
if (!$order_issue) {
|
|
|
$order_issue = OrderIssue::query()->create([
|
|
$order_issue = OrderIssue::query()->create([
|
|
|
'order_id' => $work_order->order_id,
|
|
'order_id' => $work_order->order_id,
|
|
|
'result_explain' => $work_order->remark,
|
|
'result_explain' => $work_order->remark,
|
|
|
'imported_status' => '正常',
|
|
'imported_status' => '正常',
|
|
|
- 'order_issue_type_id' => $detail->order_issue_type_id,
|
|
|
|
|
|
|
+ 'order_issue_type_id' => $orderIssueTypeId,
|
|
|
]);
|
|
]);
|
|
|
$order_issue->update(['created_at' => $detail->created_at]);
|
|
$order_issue->update(['created_at' => $detail->created_at]);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $order_issue->update(['order_issue_type_id' => $orderIssueTypeId]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$order_issue->update([
|
|
$order_issue->update([
|
|
@@ -431,7 +439,6 @@ class WorkOrderService
|
|
|
$processLogs = array_merge($commodityLog, $processLogs);
|
|
$processLogs = array_merge($commodityLog, $processLogs);
|
|
|
}
|
|
}
|
|
|
$order_issue->logs()->insert($processLogs);
|
|
$order_issue->logs()->insert($processLogs);
|
|
|
- $order_issue->logs()->insert();
|
|
|
|
|
$this->orderIssueService->endOrderIssues([$order_issue->id]);
|
|
$this->orderIssueService->endOrderIssues([$order_issue->id]);
|
|
|
$detail->processLogs()->where('status', '未同步')->update(['status' => '同步']);
|
|
$detail->processLogs()->where('status', '未同步')->update(['status' => '同步']);
|
|
|
}
|
|
}
|