1
This commit is contained in:
@@ -194,6 +194,10 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
|
||||
}
|
||||
|
||||
isDuplicated, order, err := c.addOrderStatus(orderStatus, db)
|
||||
if orderStatus.VendorOrderID == "3901182973700720079" {
|
||||
globals.SugarLogger.Debugf("=======isDuplicated2 := %s", utils.Format4Output(isDuplicated, false))
|
||||
globals.SugarLogger.Debugf("=======order := %s", utils.Format4Output(order, false))
|
||||
}
|
||||
if err == nil {
|
||||
dao.Commit(db, txDB)
|
||||
if orderStatus.Status == model.OrderStatusWaybillTipChanged {
|
||||
@@ -291,10 +295,6 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
|
||||
} else {
|
||||
partner.CurOrderManager.OnOrderMsg(order2, utils.Int2Str(order2.Status), fmt.Sprintf("取消订单申请赔付:%s", "成功"))
|
||||
}
|
||||
if order2.VendorOrderID == "3901182973700720079" {
|
||||
globals.SugarLogger.Debugf("=======order2 := %s", utils.Format4Output(order2, false))
|
||||
globals.SugarLogger.Debugf("=======orderStatus := %s", utils.Format4Output(orderStatus, false))
|
||||
}
|
||||
|
||||
if order2.Status != model.OrderStatusCanceled {
|
||||
order2.Status = model.OrderStatusCanceled
|
||||
@@ -974,6 +974,11 @@ func (c *OrderManager) addOrderStatus(orderStatus *model.OrderStatus, db *dao.Da
|
||||
}
|
||||
|
||||
isDuplicated, err = addOrderOrWaybillStatus(orderStatus, db)
|
||||
if orderStatus.VendorOrderID == "3901182973700720079" {
|
||||
globals.SugarLogger.Debugf("=======order2 := %s", utils.Format4Output(orderStatus, false))
|
||||
globals.SugarLogger.Debugf("=======isDuplicated := %s", utils.Format4Output(isDuplicated, false))
|
||||
globals.SugarLogger.Debugf("=======err := %v", err)
|
||||
}
|
||||
if err == nil && !isDuplicated && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||
// todo 加这个代码的原因是,抖店运单取消会去将本地的订单状态设置为取消,跳过,不修改本地订单状态
|
||||
if orderStatus.RefVendorID == model.VendorIDDD && orderStatus.OrderType == model.OrderTypeWaybill && orderStatus.VendorStatus == utils.Int64ToStr(tiktok_api.ShipmentStatusCanceled) {
|
||||
@@ -1025,6 +1030,10 @@ func (c *OrderManager) addOrderStatus(orderStatus *model.OrderStatus, db *dao.Da
|
||||
}
|
||||
|
||||
utils.CallFuncLogError(func() error {
|
||||
if orderStatus.VendorOrderID == "3901182973700720079" {
|
||||
globals.SugarLogger.Debugf("=======order := %s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("=======updateFields := %s", utils.Format4Output(updateFields, false))
|
||||
}
|
||||
_, err = db.Db.Update(order, updateFields...)
|
||||
return err
|
||||
}, "addOrderStatus update orderID:%s, status:%v", order.VendorOrderID, orderStatus)
|
||||
|
||||
Reference in New Issue
Block a user