1
This commit is contained in:
@@ -200,9 +200,6 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
|||||||
if db == nil {
|
if db == nil {
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
}
|
}
|
||||||
if orderStatus.RefVendorOrderID == "3801105140856800486" {
|
|
||||||
globals.SugarLogger.Debugf("======orderStatus := %s", utils.Format4Output(orderStatus, false))
|
|
||||||
}
|
|
||||||
isDuplicated, err = addOrderOrWaybillStatus(orderStatus, db)
|
isDuplicated, err = addOrderOrWaybillStatus(orderStatus, db)
|
||||||
//if err == nil && !isDuplicated && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
//if err == nil && !isDuplicated && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||||
if err == nil && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
if err == nil && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||||
@@ -211,9 +208,6 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
|||||||
VendorID: orderStatus.VendorID,
|
VendorID: orderStatus.VendorID,
|
||||||
}
|
}
|
||||||
if err = db.Db.ReadForUpdate(order, "AfsOrderID", "VendorID"); err == nil {
|
if err = db.Db.ReadForUpdate(order, "AfsOrderID", "VendorID"); err == nil {
|
||||||
if orderStatus.RefVendorOrderID == "3801105140856800486" {
|
|
||||||
globals.SugarLogger.Debugf("======order := %s", utils.Format4Output(order, false))
|
|
||||||
}
|
|
||||||
if orderStatus.Status > model.OrderStatusUnknown { // todo 要求status不能回绕
|
if orderStatus.Status > model.OrderStatusUnknown { // todo 要求status不能回绕
|
||||||
order.VendorStatus = orderStatus.VendorStatus
|
order.VendorStatus = orderStatus.VendorStatus
|
||||||
order.Status = orderStatus.Status
|
order.Status = orderStatus.Status
|
||||||
@@ -236,14 +230,8 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
|||||||
updateFields = append(updateFields, "AfsFinishedAt")
|
updateFields = append(updateFields, "AfsFinishedAt")
|
||||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil {
|
if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil {
|
||||||
if orderAfsInfo, err := handler.GetOrderAfsInfo(nil, order.VendorOrderID, order.AfsOrderID); err == nil && orderAfsInfo.AfsTotalShopMoney != 0 {
|
if orderAfsInfo, err := handler.GetOrderAfsInfo(nil, order.VendorOrderID, order.AfsOrderID); err == nil && orderAfsInfo.AfsTotalShopMoney != 0 {
|
||||||
if orderStatus.RefVendorOrderID == "3801105140856800486" {
|
|
||||||
globals.SugarLogger.Debugf("======orderAfsInfo := %s", utils.Format4Output(orderAfsInfo, false))
|
|
||||||
}
|
|
||||||
order.AfsTotalShopMoney = orderAfsInfo.AfsTotalShopMoney
|
order.AfsTotalShopMoney = orderAfsInfo.AfsTotalShopMoney
|
||||||
updateFields = append(updateFields, "AfsTotalShopMoney")
|
updateFields = append(updateFields, "AfsTotalShopMoney")
|
||||||
if orderStatus.RefVendorOrderID == "3801105140856800486" {
|
|
||||||
globals.SugarLogger.Debugf("======order2 := %s", utils.Format4Output(order, false))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package mtwm
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -308,20 +309,14 @@ func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.G
|
|||||||
func (c *PurchaseHandler) GetOrderAfsInfo(ctx *jxcontext.Context, vendorOrderID, afsOrderID string) (orderAfsInfo *partner.OrderAfsInfo, err error) {
|
func (c *PurchaseHandler) GetOrderAfsInfo(ctx *jxcontext.Context, vendorOrderID, afsOrderID string) (orderAfsInfo *partner.OrderAfsInfo, err error) {
|
||||||
orderAfsInfo = &partner.OrderAfsInfo{}
|
orderAfsInfo = &partner.OrderAfsInfo{}
|
||||||
var afsTotalShopMoney int64
|
var afsTotalShopMoney int64
|
||||||
order, _ := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDMTWM)
|
if list, err := api.MtwmAPI.GetOrderRefundDetail(utils.Str2Int64(vendorOrderID), 0); err == nil {
|
||||||
|
|
||||||
list, err := getAPI(order.VendorOrgCode, jxutils.GetShowStoreIDFromOrder(order), order.VendorStoreID).GetOrderRefundDetail(utils.Str2Int64(vendorOrderID), 0)
|
|
||||||
globals.SugarLogger.Debugf("=================list-v := %s", utils.Format4Output(list, false))
|
|
||||||
globals.SugarLogger.Debugf("=================list-v err:= %v", utils.Format4Output(list, false))
|
|
||||||
|
|
||||||
if err == nil {
|
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
if v.RefundPartialEstimateCharge.SettleAmount != "" {
|
if v.RefundPartialEstimateCharge.SettleAmount != "" {
|
||||||
afsTotalShopMoney += jxutils.StandardPrice2Int(utils.Str2Float64(v.RefundPartialEstimateCharge.SettleAmount))
|
afsTotalShopMoney += jxutils.StandardPrice2Int(utils.Str2Float64(v.RefundPartialEstimateCharge.SettleAmount))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err == nil {
|
if order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDMTWM); err == nil {
|
||||||
orderAfsInfo.AfsTotalShopMoney = order.TotalShopMoney + afsTotalShopMoney
|
orderAfsInfo.AfsTotalShopMoney = order.TotalShopMoney + afsTotalShopMoney
|
||||||
}
|
}
|
||||||
return orderAfsInfo, err
|
return orderAfsInfo, err
|
||||||
|
|||||||
Reference in New Issue
Block a user