This commit is contained in:
邹宗楠
2025-06-05 16:16:53 +08:00
parent 664141e513
commit b6373341fb

View File

@@ -232,12 +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)
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)
}
default: // 全退
if _, ok := orderSkuShopPriceList[utils.Str2Int(rdw.SkuID)]; ok {
@@ -250,6 +252,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
order.NewEarningPrice = order.EarningPrice
}
}
globals.SugarLogger.Debugf("-----order.ShopPrice3:=%d", order.ShopPrice)
dao.UpdateEntity(db, order, "TotalShopMoney", "ShopPrice", "EarningPrice", "NewEarningPrice")
} else {
globals.SugarLogger.Debugf("美团平台售后获取退款金额信息错误: = %v", err)