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

@@ -422,12 +422,26 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
if err != nil {
return 0, err
}
isMerchantCancel := false
// 获取发起取消的人员
for _, v := range orderStatus {
if v.VendorStatus == utils.Int64ToStr(model.WaybillStatusCancel) {
isMerchantCancel = true // 商户取消
break
}
}
for i := len(orderStatus) - 1; i >= 0; i-- {
if orderStatus[i].VendorStatus == utils.Int2Str(fnpsapi.OrderStatusAcceptCacle) {
continue
}
if orderStatus[i].VendorStatus == utils.Int2Str(fnpsapi.OrderStatusArrived) || orderStatus[i].VendorStatus == utils.Int2Str(fnpsapi.OrderStatusDelivering) || orderStatus[i].VendorStatus == utils.Int2Str(fnpsapi.OrderStatusDelivered) {
localPrice = order.OrderTotalAmountCent
if isMerchantCancel {
localPrice = order.OrderTotalAmountCent
} else {
localPrice = 0
}
break
}
if orderStatus[i].VendorStatus == utils.Int2Str(fnpsapi.OrderStatusAssigned) {