修改退差价结算
This commit is contained in:
@@ -200,6 +200,9 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
||||
if db == nil {
|
||||
db = dao.GetDB()
|
||||
}
|
||||
if orderStatus.RefVendorOrderID == "3801105140856800486" {
|
||||
globals.SugarLogger.Debugf("======orderStatus := %s", utils.Format4Output(orderStatus, false))
|
||||
}
|
||||
isDuplicated, err = addOrderOrWaybillStatus(orderStatus, db)
|
||||
//if err == nil && !isDuplicated && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||
if err == nil && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||
@@ -208,6 +211,9 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
||||
VendorID: orderStatus.VendorID,
|
||||
}
|
||||
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不能回绕
|
||||
order.VendorStatus = orderStatus.VendorStatus
|
||||
order.Status = orderStatus.Status
|
||||
@@ -230,9 +236,15 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
||||
updateFields = append(updateFields, "AfsFinishedAt")
|
||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID); handler != nil {
|
||||
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
|
||||
updateFields = append(updateFields, "AfsTotalShopMoney")
|
||||
if orderStatus.RefVendorOrderID == "3801105140856800486" {
|
||||
globals.SugarLogger.Debugf("======order2 := %s", utils.Format4Output(order, false))
|
||||
}
|
||||
}
|
||||
updateFields = append(updateFields, "AfsTotalShopMoney")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user