1
This commit is contained in:
@@ -535,7 +535,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
} else {
|
||||
skus, err = dao.GetStoreSkus(db, vendorID, storeID, skuIDs)
|
||||
}
|
||||
globals.SugarLogger.Debugf("----------len %d", len(skus))
|
||||
|
||||
if err != nil || len(skus) == 0 {
|
||||
return err
|
||||
@@ -571,6 +570,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
now := jxutils.OperationTime2HourMinuteFormat(time.Now())
|
||||
var failedList []*partner.StoreSkuInfoWithErr
|
||||
globals.SugarLogger.Debugf("----------len %d", len(skus))
|
||||
for _, sku := range skus {
|
||||
if !useVendorPriceDirectly && !isSkuLockTimeValid(sku) {
|
||||
sku.VendorPrice = 0
|
||||
@@ -582,9 +582,11 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
if sku.Status != model.SkuStatusNormal {
|
||||
sku.MergedStatus = model.SkuStatusDontSale
|
||||
}
|
||||
globals.SugarLogger.Debugf("----------sku.MergedStatus-- %d", sku.MergedStatus)
|
||||
var bareSku *partner.StoreSkuInfo
|
||||
isNeedReorder := false
|
||||
if isStoreSkuSyncNeedDelete(sku) {
|
||||
globals.SugarLogger.Debugf("----------func %d", 1)
|
||||
if !dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
||||
bareSku = storeSkuSyncInfo2Bare(sku)
|
||||
if singleStoreHandler == nil {
|
||||
@@ -597,8 +599,10 @@ 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.Debugf("----------func %d", 2)
|
||||
calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))
|
||||
if singleStoreHandler == nil {
|
||||
globals.SugarLogger.Debugf("----------func %d", 3)
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
||||
// todo 多平台商品库没有正常创建,直接跳过
|
||||
} else {
|
||||
@@ -613,6 +617,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("----------func %d", 4)
|
||||
if sku.MergedStatus == model.SkuStatusNormal {
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB && vendorID != model.VendorIDDD && vendorID != model.VendorIDJDShop {
|
||||
globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
@@ -625,7 +630,9 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
isNeedReorder = true
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("----------func %d", 5)
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) && vendorID != model.VendorIDJDShop {
|
||||
globals.SugarLogger.Debugf("----------func %d", 6)
|
||||
// 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)
|
||||
@@ -637,6 +644,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
parentTask.AddFailedList(failedList)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("----------func %d", 7)
|
||||
globals.SugarLogger.Debugf("----------MergedStatus %d", sku.MergedStatus)
|
||||
isAdded2Update := false
|
||||
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
|
||||
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
|
||||
|
||||
Reference in New Issue
Block a user