|
|
@@ -282,13 +282,15 @@ class OrderPackageService
|
|
|
$update_params[] = ['id', 'sent_at'];
|
|
|
foreach ($packages as $package) {
|
|
|
if ($package->sent_at) continue;
|
|
|
+ list($allocation,$orderHeader) = $map[$package->logistic_number];
|
|
|
try {
|
|
|
- $checktime = $map[$package->logistic_number]->checktime;
|
|
|
+ $checktime = $allocation->checktime;
|
|
|
} catch (\Exception $e) {
|
|
|
continue;
|
|
|
}
|
|
|
if ($checktime) {
|
|
|
- $this->checkingAndProcess($package,$map[$package->logistic_number]->orderlineno); //检查和处理揽收
|
|
|
+ //EDISENDFLAG
|
|
|
+ $this->checkingAndProcess($package,$allocation->orderlineno,$orderHeader); //检查和处理揽收
|
|
|
$update_params[] = [
|
|
|
'id' => $package->id,
|
|
|
'sent_at' => $checktime,
|
|
|
@@ -302,8 +304,10 @@ class OrderPackageService
|
|
|
* 检查和处理揽收
|
|
|
*
|
|
|
* @param OrderPackage|\stdClass $package
|
|
|
+ * @param int $lineNo
|
|
|
+ * @param \stdClass|mixed $orderHeader
|
|
|
*/
|
|
|
- public function checkingAndProcess(OrderPackage $package, int $lineNo)
|
|
|
+ public function checkingAndProcess(OrderPackage $package, int $lineNo, $orderHeader)
|
|
|
{
|
|
|
//校验快递商 订单状态 复核标记 揽收标记
|
|
|
$package->loadMissing("order.logistic");
|
|
|
@@ -314,6 +318,10 @@ class OrderPackageService
|
|
|
Log::warning("自动揽收跳出",["status"=>$package->order->wms_status]);
|
|
|
return;
|
|
|
}
|
|
|
+ if ($orderHeader->edisendflag!='Y' && !app("OrderService")->manualBack($orderHeader->orderno)){
|
|
|
+ Log::warning("揽收回传失败",["status"=>$orderHeader->orderno]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
dispatch(new PackageCollectingAllocation($package,$lineNo));
|
|
|
}
|
|
|
|
|
|
@@ -328,7 +336,7 @@ class OrderPackageService
|
|
|
$actAllocationDetails = $orderHeader->actAllocationDetails;
|
|
|
foreach ($actAllocationDetails as $actAllocationDetail) {
|
|
|
$logistic_number = $actAllocationDetail->picktotraceid;
|
|
|
- $map[$logistic_number] = $actAllocationDetail;
|
|
|
+ $map[$logistic_number] = [$actAllocationDetail,$orderHeader];
|
|
|
}
|
|
|
}
|
|
|
return $map;
|