1
This commit is contained in:
@@ -495,6 +495,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
var bareSku *partner.StoreSkuInfo
|
||||
isNeedReorder := false
|
||||
if isStoreSkuSyncNeedDelete(sku) {
|
||||
globals.SugarLogger.Debug("11111111111111111111111")
|
||||
if !dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
||||
bareSku = storeSkuSyncInfo2Bare(sku)
|
||||
if singleStoreHandler == nil {
|
||||
@@ -507,6 +508,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
updateItems = append(updateItems, sku2Update(vendorID, sku, model.SyncFlagDeletedMask))
|
||||
}
|
||||
} else if model.IsSyncStatusNew(sku.SkuSyncStatus) {
|
||||
globals.SugarLogger.Debug("222222222222222")
|
||||
calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))
|
||||
if singleStoreHandler == nil {
|
||||
globals.SugarLogger.Debug("11111111111111111111111")
|
||||
@@ -524,6 +526,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debug("2222222222222223333333333333333")
|
||||
if sku.MergedStatus == model.SkuStatusNormal {
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB && vendorID != model.VendorIDJDShop {
|
||||
globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
@@ -536,7 +539,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
isNeedReorder = true
|
||||
} else {
|
||||
globals.SugarLogger.Debug("33333333333333333333333")
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) && vendorID != model.VendorIDJDShop {
|
||||
globals.SugarLogger.Debug("3333333333333333333333344444444444444")
|
||||
|
||||
// err = fmt.Errorf("门店:%d,修改没有创建的商品:%d", storeID, sku.SkuID)
|
||||
if vendorID != model.VendorIDJDShop || (vendorID == model.VendorIDJDShop && storeID == model.JdShopMainStoreID && sku.StoreSkuStatus != model.SkuStatusDontSale) {
|
||||
err = utils.NewErrorCode(fmt.Sprintf("门店:%d,修改没有创建的商品:%d", storeID, sku.SkuID), "-1", 0)
|
||||
@@ -548,6 +554,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
parentTask.AddFailedList(failedList)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debug("3333333333333333333333355555555555")
|
||||
|
||||
isAdded2Update := false
|
||||
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
|
||||
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
|
||||
@@ -563,6 +571,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
priceList = append(priceList, bareSku)
|
||||
}
|
||||
if !isAdded2Update {
|
||||
globals.SugarLogger.Debug("333333333333333333333335555555555566666666666666666")
|
||||
|
||||
if model.IsSyncStatusUpdate(sku.SkuSyncStatus) && singleStoreHandler == nil { // 正常就不应该进到这里
|
||||
// if bareSku == nil {
|
||||
// bareSku = storeSkuSyncInfo2Bare(sku)
|
||||
|
||||
Reference in New Issue
Block a user