causeFlag
This commit is contained in:
@@ -779,15 +779,15 @@ func asyncStoreSkuOpFilter(ctx *jxcontext.Context, isAsync bool) bool {
|
||||
return isAsync
|
||||
}
|
||||
|
||||
func UpdateStoreSku(ctx *jxcontext.Context, storeID int, skuBindInfo *StoreSkuBindInfo, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
return UpdateStoreSkus(ctx, storeID, []*StoreSkuBindInfo{skuBindInfo}, isAsync, isContinueWhenError)
|
||||
func UpdateStoreSku(ctx *jxcontext.Context, causeFlag, storeID int, skuBindInfo *StoreSkuBindInfo, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
return UpdateStoreSkus(ctx, causeFlag, storeID, []*StoreSkuBindInfo{skuBindInfo}, isAsync, isContinueWhenError)
|
||||
}
|
||||
|
||||
func UpdateStoreSkus(ctx *jxcontext.Context, storeID int, skuBindInfos []*StoreSkuBindInfo, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
return UpdateStoresSkus(ctx, []int{storeID}, skuBindInfos, false, isAsync, isContinueWhenError)
|
||||
func UpdateStoreSkus(ctx *jxcontext.Context, causeFlag, storeID int, skuBindInfos []*StoreSkuBindInfo, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
return UpdateStoresSkus(ctx, causeFlag, []int{storeID}, skuBindInfos, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
|
||||
func UpdateStoresSkus(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*StoreSkuBindInfo, isScale, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
func UpdateStoresSkus(ctx *jxcontext.Context, causeFlag int, storeIDs []int, skuBindInfos []*StoreSkuBindInfo, isScale, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debugf("UpdateStoresSkus:%s, storeIDs:%v, skuBindInfos:%s", ctx.GetTrackInfo(), storeIDs, utils.Format4Output(skuBindInfos, true))
|
||||
|
||||
var num int64
|
||||
@@ -799,7 +799,7 @@ func UpdateStoresSkus(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*St
|
||||
isAsync = asyncStoreSkuOpFilter(ctx, isAsync)
|
||||
num = int64(len(skuIDs))
|
||||
if num > 0 {
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, 0, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, causeFlag, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
if num == 0 || !isAsync || hint == "" {
|
||||
hint = utils.Int64ToStr(num)
|
||||
@@ -1752,7 +1752,7 @@ func AcceptStoreOpRequests(ctx *jxcontext.Context, reqIDs []int) (err error) {
|
||||
}
|
||||
}
|
||||
if err2 == nil {
|
||||
_, err2 := UpdateStoresSkus(ctx, []int{op.StoreID}, []*StoreSkuBindInfo{skuBindInfo}, false, false, false)
|
||||
_, err2 := UpdateStoresSkus(ctx, 0, []int{op.StoreID}, []*StoreSkuBindInfo{skuBindInfo}, false, false, false)
|
||||
isLocalSucess := true
|
||||
if err2 != nil {
|
||||
subErrors[reqID] = err2
|
||||
@@ -2585,7 +2585,7 @@ func RefreshJxPriceByExcelBin(ctx *jxcontext.Context, storeIDs []int, reader io.
|
||||
skuBindInfoList = append(skuBindInfoList, v.(*StoreSkuBindInfo))
|
||||
}
|
||||
if isErr {
|
||||
UpdateStoresSkus(ctx, storeIDs, skuBindInfoList, false, isAsync, isContinueWhenError)
|
||||
UpdateStoresSkus(ctx, 0, storeIDs, skuBindInfoList, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
case 3:
|
||||
//写Excel
|
||||
@@ -3239,23 +3239,10 @@ func AutoFocusStoreSkusWithoutFocus(ctx *jxcontext.Context, skuIDs []int, isSync
|
||||
}
|
||||
skuBindInfoList = append(skuBindInfoList, skuBindInfoResult)
|
||||
if isSync {
|
||||
UpdateStoreSkus(ctx, v.StoreID, skuBindInfoList, true, true)
|
||||
UpdateStoreSkus(ctx, 0, v.StoreID, skuBindInfoList, true, true)
|
||||
} else {
|
||||
updateStoresSkusWithoutSync(ctx, db, []int{v.StoreID}, skuBindInfoList, false)
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
func UpdateStoreSkuNamePrice(ctx *jxcontext.Context, storeID, nameID, unitPrice int, isAsync bool) (hint string, err error) {
|
||||
// db := dao.GetDB()
|
||||
// skuList, err := dao.GetSkus(db, nil, []int{nameID}, nil, nil)
|
||||
// if err != nil || len(skuList) == 0 {
|
||||
// return "", err
|
||||
// }
|
||||
// var skuIDs []int
|
||||
// for _, v := range skuList {
|
||||
// skuIDs = append(skuIDs, v.ID)
|
||||
// }
|
||||
// actStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, nil, model.ActSkuDirectDown, []int{storeID}, skuIDs, time.Now(), time.Now())
|
||||
return hint, err
|
||||
}
|
||||
|
||||
@@ -851,7 +851,7 @@ func UpdateJxPriceByWeimob(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo
|
||||
for _, v := range storeSkuBindInfoList {
|
||||
skuBindInfos = append(skuBindInfos, v.(*cms.StoreSkuBindInfo))
|
||||
}
|
||||
cms.UpdateStoresSkus(ctx, storeIDs, skuBindInfos, false, isAsync, isContinueWhenError)
|
||||
cms.UpdateStoresSkus(ctx, 0, storeIDs, skuBindInfos, false, isAsync, isContinueWhenError)
|
||||
case 2:
|
||||
WriteToExcel3(task, dataStoreSkusSuccess.dataStoreSkusSuccessList, dataFailed.dataFailedList)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user