This commit is contained in:
邹宗楠
2023-06-05 13:54:19 +08:00
parent b52bd5556f
commit 42213a4ff0
7 changed files with 71 additions and 45 deletions

View File

@@ -503,6 +503,15 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
return 0, err
}
isMerchantCancel := false
// 获取发起取消的人员
for _, v := range statusList {
if v.VendorStatus == utils.Int64ToStr(model.WaybillStatusCancel) {
isMerchantCancel = true // 商户取消
break
}
}
bill, err := partner.CurOrderManager.LoadWaybill(deliverId, model.VendorIDMTPS)
if err != nil {
return 0, err
@@ -520,11 +529,17 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
}
// 到店
if statusList[i].VendorStatus == utils.Int2Str(mtpsapi.OrderStatusPickedUp) {
return bill.DesiredFee, nil
if isMerchantCancel {
return bill.DesiredFee, nil
}
return 0, nil
}
// 接单
if statusList[i].VendorStatus == utils.Int2Str(mtpsapi.OrderStatusAccepted) {
return 200, nil
if isMerchantCancel {
return 200, nil
}
return 0, nil
}
// 待调度
if statusList[i].VendorStatus == utils.Int2Str(mtpsapi.OrderStatusWaitingForSchedule) {