1
This commit is contained in:
@@ -232,14 +232,14 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
|
||||
case model.EarningTypeQuote: // 报价
|
||||
for _, rd := range refundDetail {
|
||||
for _, rdw := range rd.WmAppRetailForOrderPartRefundList {
|
||||
globals.SugarLogger.Debugf("-----order.ShopPrice1:=%d", order.ShopPrice)
|
||||
globals.SugarLogger.Debugf("-----order.ShopPrice1:=%s,%d,%d", order.VendorOrderID, order.ShopPrice, order.NewEarningPrice)
|
||||
switch rd.RefundType {
|
||||
// 退款类型:1-全额退款;2-部分退款;3-退差价;5-按金额灵活退。
|
||||
case 3: // 缺重退部分
|
||||
if _, ok := orderSkuShopPriceList[utils.Str2Int(rdw.SkuID)]; ok {
|
||||
order.ShopPrice = order.ShopPrice - utils.Float64TwoInt64((rdw.RefundPrice/rdw.FoodPrice)*float64(orderSkuShopPriceList[utils.Str2Int(rdw.SkuID)]))
|
||||
order.EarningPrice = order.EarningPrice - jxutils.StandardPrice2Int((rdw.RefundPrice/rdw.FoodPrice)*float64(orderSkuEarningPriceList[utils.Str2Int(rdw.SkuID)]))
|
||||
globals.SugarLogger.Debugf("-----order.ShopPrice2:=%d", order.ShopPrice)
|
||||
order.EarningPrice = order.EarningPrice - utils.Float64TwoInt64((rdw.RefundPrice/rdw.FoodPrice)*float64(orderSkuEarningPriceList[utils.Str2Int(rdw.SkuID)]))
|
||||
globals.SugarLogger.Debugf("-----order.ShopPrice2:=%s,%d,%d", order.VendorOrderID, order.ShopPrice, order.NewEarningPrice)
|
||||
}
|
||||
default: // 全退
|
||||
if _, ok := orderSkuShopPriceList[utils.Str2Int(rdw.SkuID)]; ok {
|
||||
@@ -252,7 +252,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
|
||||
order.NewEarningPrice = order.EarningPrice
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("-----order.ShopPrice3:=%d", order.ShopPrice)
|
||||
globals.SugarLogger.Debugf("-----order.ShopPrice3:=%s,%d,%d", order.VendorOrderID, order.ShopPrice, order.NewEarningPrice)
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney", "ShopPrice", "EarningPrice", "NewEarningPrice")
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("美团平台售后获取退款金额信息错误: = %v", err)
|
||||
|
||||
Reference in New Issue
Block a user