1
This commit is contained in:
@@ -1744,30 +1744,24 @@ func UpdateStoresSkus(ctx *jxcontext.Context, causeFlag int, storeIDs []int, sku
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
flag, _ := doStoreSkuAudit(ctx, storeIDs, skuBindInfos)
|
flag, _ := doStoreSkuAudit(ctx, storeIDs, skuBindInfos)
|
||||||
if storeIDs[0] == 669149 {
|
|
||||||
globals.SugarLogger.Debugf("-------storeIDs %s", utils.Format4Output(storeIDs, false))
|
|
||||||
globals.SugarLogger.Debugf("-------skuBindInfos %s", utils.Format4Output(skuBindInfos, false))
|
|
||||||
globals.SugarLogger.Debugf("-------flag %s", utils.Format4Output(flag, false))
|
|
||||||
}
|
|
||||||
if !flag {
|
if !flag {
|
||||||
var num int64
|
var num int64
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
skuIDs, err := updateStoresSkusWithoutSync(ctx, db, storeIDs, skuBindInfos, isScale, isRefreshHigh) // 这个方法再通知京东创建商品
|
skuIDs, err := updateStoresSkusWithoutSync(ctx, db, storeIDs, skuBindInfos, isScale, isRefreshHigh) // 这个方法再通知京东创建商品
|
||||||
if storeIDs[0] == 669149 {
|
|
||||||
globals.SugarLogger.Debugf("-------skuIDs %s", utils.Format4Output(skuIDs, false))
|
|
||||||
globals.SugarLogger.Debugf("-------err %v", err)
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
isAsync = asyncStoreSkuOpFilter(ctx, isAsync)
|
isAsync = asyncStoreSkuOpFilter(ctx, isAsync)
|
||||||
num = int64(len(skuIDs))
|
num = int64(len(skuIDs))
|
||||||
if storeIDs[0] == 669149 {
|
|
||||||
globals.SugarLogger.Debugf("-------isAsync %s", utils.Format4Output(isAsync, false))
|
|
||||||
globals.SugarLogger.Debugf("-------err %d", num)
|
|
||||||
}
|
|
||||||
if num > 0 { // 这个方法非京东的创建商品,京东的改为同步库存,上下架等!
|
if num > 0 { // 这个方法非京东的创建商品,京东的改为同步库存,上下架等!
|
||||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, causeFlag, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
isForce := false
|
||||||
|
for _, v := range skuBindInfos[0].Skus {
|
||||||
|
if v.Stock != nil {
|
||||||
|
isForce = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, causeFlag, db, nil, storeIDs, skuIDs, isForce, isAsync, isContinueWhenError)
|
||||||
}
|
}
|
||||||
if num == 0 || !isAsync || hint == "" {
|
if num == 0 || !isAsync || hint == "" {
|
||||||
hint = utils.Int64ToStr(num)
|
hint = utils.Int64ToStr(num)
|
||||||
|
|||||||
@@ -332,9 +332,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
} else {
|
} else {
|
||||||
syncType = "更新商品"
|
syncType = "更新商品"
|
||||||
}
|
}
|
||||||
if storeID == 669149 {
|
|
||||||
globals.SugarLogger.Debugf("---------storeSkuList := %s", utils.Format4Output(storeSkuList, false))
|
|
||||||
}
|
|
||||||
for i, storeSku := range storeSkuList {
|
for i, storeSku := range storeSkuList {
|
||||||
isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&(model.SyncFlagPriceMask|model.SyncFlagNewMask) != 0
|
isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&(model.SyncFlagPriceMask|model.SyncFlagNewMask) != 0
|
||||||
foodData := make(map[string]interface{})
|
foodData := make(map[string]interface{})
|
||||||
@@ -449,9 +446,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if storeID == 669149 {
|
|
||||||
globals.SugarLogger.Debugf("---------foodDataList:%s", utils.Format4Output(foodDataList, false))
|
|
||||||
}
|
|
||||||
if globals.EnableMtwmStoreWrite {
|
if globals.EnableMtwmStoreWrite {
|
||||||
if len(foodDataList) == 1 {
|
if len(foodDataList) == 1 {
|
||||||
foodDataList[0]["skus"] = string(utils.MustMarshal(foodDataList[0]["skus"]))
|
foodDataList[0]["skus"] = string(utils.MustMarshal(foodDataList[0]["skus"]))
|
||||||
|
|||||||
Reference in New Issue
Block a user