1
This commit is contained in:
@@ -557,6 +557,15 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
||||
return 0, err
|
||||
}
|
||||
|
||||
isMerchantCancel := false
|
||||
// 获取发起取消的人员
|
||||
for _, v := range orderStatus {
|
||||
if v.VendorStatus == utils.Int64ToStr(model.WaybillStatusCancel) {
|
||||
isMerchantCancel = true // 商户取消
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
dadaOrder, err := api.DadaAPI.QueryOrderInfo(orderId)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -569,7 +578,11 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
||||
continue
|
||||
}
|
||||
if orderStatus[i].VendorStatus == utils.Int2Str(dadaapi.OrderStatusFinished) || orderStatus[i].VendorStatus == utils.Int2Str(dadaapi.OrderStatusDelivering) || orderStatus[i].VendorStatus == utils.Int2Str(dadaapi.OrderStatusReturningInOrder) {
|
||||
localPrice = utils.Float64TwoInt64(dadaOrder.DeliveryFee * float64(100))
|
||||
if isMerchantCancel {
|
||||
localPrice = utils.Float64TwoInt64(dadaOrder.DeliveryFee * float64(100))
|
||||
} else {
|
||||
localPrice = 0
|
||||
}
|
||||
break
|
||||
}
|
||||
if orderStatus[i].VendorStatus == utils.Int2Str(dadaapi.OrderStatusAccepted) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user