|
|
@@ -180,7 +180,6 @@ class CallBackHandler
|
|
|
// 查找主订单 (假设 outOrderNo 为 orderSn)
|
|
|
$order = OrderClass::getByCondition(['orderSn' => $outOrderNo], true);
|
|
|
$isGhs = true;
|
|
|
-
|
|
|
if (!$order) {
|
|
|
$order = HdOrderClass::getByCondition(['orderSn' => $outOrderNo], true);
|
|
|
$isGhs = false;
|
|
|
@@ -205,19 +204,17 @@ class CallBackHandler
|
|
|
}
|
|
|
|
|
|
$sendStatus = $this->convertOrderSendStatus($didiStatus);
|
|
|
-
|
|
|
// 如果状态无法映射,则忽略
|
|
|
if ($sendStatus === null) {
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
// 更新配送订单状态
|
|
|
$deliveryOrder->orderStatus = $sendStatus;
|
|
|
$deliveryOrder->save();
|
|
|
|
|
|
// 更新主订单
|
|
|
if ($isGhs) {
|
|
|
- util::checkRepeatCommit('ghs_pt_' . $order->id . '_' . $sendStatus, 2);
|
|
|
+ util::checkRepeatCommit('ghs_pt_' . $order->id . '_' . $didiStatus, 2);
|
|
|
|
|
|
if ($order) {
|
|
|
// 已送达
|
|
|
@@ -247,7 +244,7 @@ class CallBackHandler
|
|
|
}
|
|
|
} else {
|
|
|
// 零售订单处理
|
|
|
- util::checkRepeatCommit('hd_pt_' . $order->id . '_' . $sendStatus, 2);
|
|
|
+ util::checkRepeatCommit('hd_pt_' . $order->id . '_' . $didiStatus, 2);
|
|
|
|
|
|
if (!in_array($order->sendStatus, [-2, -1]) && in_array($sendStatus, [-1, -2])) {
|
|
|
$event = $this->cancelFrom($data);
|
|
|
@@ -274,7 +271,7 @@ class CallBackHandler
|
|
|
$gdos = GhsDeliveryOrderClass::getAllByCondition([
|
|
|
'deliveryId' => 'didi',
|
|
|
'ghsOrderId' => $order->id,
|
|
|
- 'orderStatus!=' => -1
|
|
|
+ 'orderStatus' => ['not in', [-1, -2]],
|
|
|
], 'id DESC', '*', null, true);
|
|
|
if(count($gdos)>=2){
|
|
|
noticeUtil::push("xhGhsDeliveryOrder ghsOrderId={$order->id} 有两笔以上是在配送中");
|
|
|
@@ -311,8 +308,8 @@ class CallBackHandler
|
|
|
'ARRIVED_FROM_ADDRESS' => 20, // 到达起点 -> 已分配骑手(或30骑手已到店)
|
|
|
'LEAVE_FROM_ADDRESS' => 4, // 已取货 -> 配送中
|
|
|
'ARRIVED_TO_ADDRESS' => 4, // 到达终点 -> 配送中
|
|
|
- 'SERVICE_FINISH' => 5, // 已送达
|
|
|
- 'SUBMIT_CHARGE' => 5, // 费用提交 -> 已送达
|
|
|
+ 'SERVICE_FINISH' => 4, //
|
|
|
+ 'SUBMIT_CHARGE' => 4, //
|
|
|
'COMPLETED' => 5, // 已完成 -> 已送达
|
|
|
'CANCEL' => -1, // 已取消
|
|
|
];
|
|
|
@@ -329,8 +326,8 @@ class CallBackHandler
|
|
|
'ARRIVED_FROM_ADDRESS' => 3,
|
|
|
'LEAVE_FROM_ADDRESS' => 3,
|
|
|
'ARRIVED_TO_ADDRESS' => 3,
|
|
|
- 'SERVICE_FINISH' => 4,
|
|
|
- 'SUBMIT_CHARGE' => 4,
|
|
|
+ //'SERVICE_FINISH' => 4,
|
|
|
+ //'SUBMIT_CHARGE' => 4,
|
|
|
'COMPLETED' => 4,
|
|
|
];
|
|
|
return isset($map[$didiStatus]) ? $map[$didiStatus] : null;
|