This commit is contained in:
邹宗楠
2025-06-05 16:15:39 +08:00
parent 17bcf8cfa4
commit 664141e513
5 changed files with 77 additions and 9 deletions

View File

@@ -208,6 +208,14 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
order.TotalShopMoney = order.TotalShopMoney + jxutils.StandardPrice2Int(utils.Str2Float64(rd.RefundPartialEstimateCharge.SettleAmount))
}
}
orderSkuShopPriceList := make(map[int]int64, 0)
orderSkuEarningPriceList := make(map[int]int64, 0)
for _, os := range order.Skus {
orderSkuShopPriceList[os.SkuID] = os.ShopPrice
orderSkuEarningPriceList[os.SkuID] = os.EarningPrice
}
switch order.EarningType {
case model.EarningTypePoints: // 扣点
//更新订单new_earning_price
@@ -221,15 +229,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
order.NewEarningPrice = order.TotalShopMoney*int64(100-order.OrderPayPercentage/2)/int64(100) - waybill.DesiredFee
}
}
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
case model.EarningTypeQuote: // 报价
orderSkuShopPriceList := make(map[int]int64, 0)
orderSkuEarningPriceList := make(map[int]int64, 0)
for _, os := range order.Skus {
orderSkuShopPriceList[os.SkuID] = os.ShopPrice
orderSkuEarningPriceList[os.SkuID] = os.EarningPrice
}
for _, rd := range refundDetail {
for _, rdw := range rd.WmAppRetailForOrderPartRefundList {
switch rd.RefundType {
@@ -250,7 +250,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
order.NewEarningPrice = order.EarningPrice
}
}
dao.UpdateEntity(db, order, "TotalShopMoney", "ShopPrice", "EarningPrice")
dao.UpdateEntity(db, order, "TotalShopMoney", "ShopPrice", "EarningPrice", "NewEarningPrice")
} else {
globals.SugarLogger.Debugf("美团平台售后获取退款金额信息错误: = %v", err)
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "美团平台售后获取退款金额信息错误", fmt.Sprintf("orderid := %d,%s,%v", model.VendorIDMTWM, order.VendorOrderID, err))