This commit is contained in:
邹宗楠
2024-08-20 18:07:35 +08:00
parent c662f8089c
commit 0bdb3b6629
2 changed files with 8 additions and 1 deletions

View File

@@ -1424,6 +1424,7 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
vendorDate := batchItemList[0].(*tDateVendorPair)
if handler, _ := partner.GetPurchaseOrderHandlerFromVendorID(vendorDate.VendorID).(partner.IPurchasePlatformStoreSkuHandler); handler != nil {
orderIDs, err2 := handler.ListOrders(ctx, vendorDate.VendorOrgCode, task, vendorDate.QueryDate, vendorStoreIDMap[vendorDate.VendorID])
globals.SugarLogger.Debugf("===========orderIDs := %s", utils.Format4Output(orderIDs, false))
if err = err2; err == nil && len(orderIDs) > 0 {
var orderList []*tOrderVendorPair
for _, v := range orderIDs {
@@ -1438,6 +1439,7 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
VendorStoreID: vendorStoreID,
})
}
globals.SugarLogger.Debugf("===========orderList := %s", utils.Format4Output(orderList, false))
retVal = orderList
}
}
@@ -1483,6 +1485,7 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
pair := batchItemList[0].(*tOrderVendorPair)
if handler := partner.GetPurchaseOrderHandlerFromVendorID(pair.VendorID); handler != nil {
globals.SugarLogger.Debugf("===========orderList := %s , %s", utils.Format4Output(pair.VendorOrderID, false), pair.VendorStoreID)
order, err2 := handler.GetOrder(pair.VendorOrgCode, pair.VendorOrderID, pair.VendorStoreID)
if err = err2; err == nil {
@@ -1491,6 +1494,8 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
}
isDuplicated, err2 := c.SaveOrder(order, false, dao.GetDB())
globals.SugarLogger.Debugf("===========isDuplicated := %s , %v", utils.Format4Output(isDuplicated, false), err2)
globals.SugarLogger.Debugf("===========order := %s ", utils.Format4Output(order, false))
if err2 == nil && !isDuplicated {
retVal = []int{1}
if order.Status == model.OrderStatusNew {

View File

@@ -198,7 +198,9 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
refundDetail, err := mtmApi.GetOrderRefundDetail(utils.Str2Int64(order.VendorOrderID), 0)
if err == nil && len(refundDetail) > 0 {
for _, rd := range refundDetail {
order.TotalShopMoney = order.TotalShopMoney + jxutils.StandardPrice2Int(utils.Str2Float64(rd.RefundPartialEstimateCharge.SettleAmount))
if rd.RefundPartialEstimateCharge.SettleAmount != "" {
order.TotalShopMoney = order.TotalShopMoney + jxutils.StandardPrice2Int(utils.Str2Float64(rd.RefundPartialEstimateCharge.SettleAmount))
}
}
switch order.EarningType {
case model.EarningTypePoints: // 扣点