1
This commit is contained in:
@@ -201,9 +201,8 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
}
|
}
|
||||||
isDuplicated, err = addOrderOrWaybillStatus(orderStatus, db)
|
isDuplicated, err = addOrderOrWaybillStatus(orderStatus, db)
|
||||||
globals.SugarLogger.Debugf("=========isDuplicated :%s", utils.Format4Output(isDuplicated, false))
|
//if err == nil && !isDuplicated && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||||
globals.SugarLogger.Debugf("=========err :%s", utils.Format4Output(err, false))
|
if err == nil && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
||||||
if err == nil && !isDuplicated && (orderStatus.Status != model.OrderStatusUnknown && orderStatus.Status != model.OrderStatusMsg) {
|
|
||||||
order = &model.AfsOrder{
|
order = &model.AfsOrder{
|
||||||
AfsOrderID: orderStatus.VendorOrderID,
|
AfsOrderID: orderStatus.VendorOrderID,
|
||||||
VendorID: orderStatus.VendorID,
|
VendorID: orderStatus.VendorID,
|
||||||
@@ -236,8 +235,6 @@ func (c *OrderManager) addAfsOrderStatus(db *dao.DaoDB, orderStatus *model.Order
|
|||||||
updateFields = append(updateFields, "AfsTotalShopMoney")
|
updateFields = append(updateFields, "AfsTotalShopMoney")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("=========order :%s", utils.Format4Output(order, false))
|
|
||||||
globals.SugarLogger.Debugf("=========updateFields :%s", utils.Format4Output(updateFields, false))
|
|
||||||
|
|
||||||
utils.CallFuncLogError(func() error {
|
utils.CallFuncLogError(func() error {
|
||||||
_, err = dao.UpdateEntity(db, order, updateFields...)
|
_, err = dao.UpdateEntity(db, order, updateFields...)
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ func addOrderOrWaybillStatus(status *model.OrderStatus, db *dao.DaoDB) (isDuplic
|
|||||||
status.ID = 0
|
status.ID = 0
|
||||||
status.Remark = utils.LimitUTF8StringLen(status.Remark, 255)
|
status.Remark = utils.LimitUTF8StringLen(status.Remark, 255)
|
||||||
created, _, err := db.Db.ReadOrCreate(status, "VendorOrderID", "VendorID", "OrderType", "Status", "VendorStatus", "StatusTime")
|
created, _, err := db.Db.ReadOrCreate(status, "VendorOrderID", "VendorID", "OrderType", "Status", "VendorStatus", "StatusTime")
|
||||||
globals.SugarLogger.Debugf("=================created:%v", created)
|
|
||||||
globals.SugarLogger.Debugf("=================err:%v", err)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if !created {
|
if !created {
|
||||||
isDuplicated = true
|
isDuplicated = true
|
||||||
@@ -101,7 +99,6 @@ func addOrderOrWaybillStatus(status *model.OrderStatus, db *dao.DaoDB) (isDuplic
|
|||||||
} else {
|
} else {
|
||||||
dao.Commit(db, txDB)
|
dao.Commit(db, txDB)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("=================isDuplicated:%v", isDuplicated)
|
|
||||||
return isDuplicated, err
|
return isDuplicated, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
if storeSku.SkuVendorMapCatID != "" {
|
if storeSku.SkuVendorMapCatID != "" {
|
||||||
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
|
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
|
||||||
} else if len(param.Pic) != 0 { // 自动推导分类id
|
} else if len(param.Pic) != 0 { // 自动推导分类id
|
||||||
param.CategoryLeafId, err = api.GetRecommendCategory(strings.Split(img, "|"))
|
param.CategoryLeafId, err = api.GetRecommendCategory([]string{whiteImg})
|
||||||
if param.CategoryLeafId == 0 || err != nil {
|
if param.CategoryLeafId == 0 || err != nil {
|
||||||
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("当前商品本地未设置抖音分类/抖音推荐分类查询错误:"+err.Error()), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("当前商品本地未设置抖音分类/抖音推荐分类查询错误:"+err.Error()), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user