Accept Merge Request #135: (yonghui -> mark)
Merge Request: 同步函数增加parentTask Created By: @苏尹岚 Accepted By: @苏尹岚 URL: https://rosydev.coding.net/p/jx-callback/d/jx-callback/git/merge/135
This commit is contained in:
@@ -1381,7 +1381,7 @@ func UpdateSkuNamesExPrefix(ctx *jxcontext.Context, nameIDs []int, exPrefix, fro
|
||||
if err == nil && len(skuList) > 0 {
|
||||
if skuList[0].ExPrefixBegin != nil {
|
||||
_, err = UpdateSkuName(ctx, nameID, payload)
|
||||
CurVendorSync.SyncStoresSkus2(ctx, db, partner.GetSingleStoreVendorIDs(), nil, false, []int{skuList[0].ID}, nil, model.SyncFlagModifiedMask, true, true)
|
||||
CurVendorSync.SyncStoresSkus2(ctx, nil, db, partner.GetSingleStoreVendorIDs(), nil, false, []int{skuList[0].ID}, nil, model.SyncFlagModifiedMask, true, true)
|
||||
} else {
|
||||
skuName := &model.SkuName{
|
||||
ExPrefix: exPrefix,
|
||||
@@ -1416,7 +1416,7 @@ func UpdateSkuNamesExPrefix(ctx *jxcontext.Context, nameIDs []int, exPrefix, fro
|
||||
for _, v := range skuList {
|
||||
skuIDs = append(skuIDs, v.ID)
|
||||
}
|
||||
CurVendorSync.SyncStoresSkus2(ctx, db, partner.GetSingleStoreVendorIDs(), nil, false, skuIDs, nil, model.SyncFlagModifiedMask, true, true)
|
||||
CurVendorSync.SyncStoresSkus2(ctx, nil, db, partner.GetSingleStoreVendorIDs(), nil, false, skuIDs, nil, model.SyncFlagModifiedMask, true, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,7 +797,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, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
if num == 0 || !isAsync || hint == "" {
|
||||
hint = utils.Int64ToStr(num)
|
||||
@@ -805,7 +805,7 @@ func UpdateStoresSkus(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*St
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func UpdateStoresSkusByBind(ctx *jxcontext.Context, skuBindInfos []*StoreSkuBindInfo, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
func UpdateStoresSkusByBind(ctx *jxcontext.Context, parentTask tasksch.ITask, skuBindInfos []*StoreSkuBindInfo, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
if len(skuBindInfos) > maxStoreNameBind {
|
||||
return "", fmt.Errorf("门店商品信息大于%d", maxStoreNameBind)
|
||||
}
|
||||
@@ -848,7 +848,7 @@ func UpdateStoresSkusByBind(ctx *jxcontext.Context, skuBindInfos []*StoreSkuBind
|
||||
isAsync = asyncStoreSkuOpFilter(ctx, isAsync)
|
||||
if num > 0 {
|
||||
skuIDs := jxutils.IntMap2List(skuIDMap)
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, parentTask, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
if num == 0 || !isAsync || hint == "" {
|
||||
hint = utils.Int64ToStr(num)
|
||||
@@ -1292,7 +1292,7 @@ func UpdateStoresSkusSale(ctx *jxcontext.Context, storeIDs []int, skuBindSkuInfo
|
||||
skuIDs = append(skuIDs, v.SkuID)
|
||||
}
|
||||
db := dao.GetDB()
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
hint, err = CurVendorSync.SyncStoresSkus(ctx, nil, db, nil, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
}
|
||||
if num == 0 || !isAsync || hint == "" {
|
||||
hint = utils.Int64ToStr(num)
|
||||
@@ -2165,7 +2165,7 @@ func AutoSaleStoreSku(ctx *jxcontext.Context, storeIDs []int, isNeedSync bool) (
|
||||
}
|
||||
}
|
||||
if isNeedSync && len(skuIDs) > 0 {
|
||||
if _, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, []int{storeID}, skuIDs, false, true, true); err != nil {
|
||||
if _, err = CurVendorSync.SyncStoresSkus(ctx, nil, db, nil, []int{storeID}, skuIDs, false, true, true); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2232,7 +2232,7 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
skuNameAndPlace, err := dao.GetTopSkusByCityCode(db, cityCode, orderCreate)
|
||||
if storeID > 0 {
|
||||
var skuNameList []*model.SkuName
|
||||
//未关注,不可售的商品nameID列表
|
||||
//不可售的商品nameID列表
|
||||
sql := `
|
||||
SELECT DISTINCT b.name_id id,1 brand_id
|
||||
FROM store_sku_bind a
|
||||
@@ -2276,11 +2276,35 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
if skuNameMap[v.ID] != nil {
|
||||
priceReferList, _ := dao.GetPriceReferSnapshotNoPage(db, []int{cityCode}, nil, []int{v.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||
if len(priceReferList) > 0 {
|
||||
v.Price = priceReferList[0].MidUnitPrice * payPercentage / 100
|
||||
v.UnitPrice = priceReferList[0].MidUnitPrice * payPercentage / 100
|
||||
}
|
||||
v.Type = skuNameMap[v.ID].BrandID
|
||||
skuList, _ := dao.GetSkus(db, nil, []int{v.ID}, nil, nil)
|
||||
v.Skus = skuList
|
||||
for _, vv := range skuList {
|
||||
var storeSkuNameExt []*dao.StoreSkuNameExt
|
||||
var skusList []*dao.StoreSkuExt
|
||||
skus := &dao.StoreSkuExt{
|
||||
SkuID: vv.ID,
|
||||
}
|
||||
skusList = append(skusList, skus)
|
||||
storeSkuName := &dao.StoreSkuNameExt{
|
||||
Skus: skusList,
|
||||
}
|
||||
storeSkuNameExt = append(storeSkuNameExt, storeSkuName)
|
||||
skuNamesInfo := &dao.StoreSkuNamesInfo{
|
||||
SkuNames: storeSkuNameExt,
|
||||
}
|
||||
dao.UpdateActPrice4StoreSkuNameNew(db, []int{storeID}, []int{vv.ID}, skuNamesInfo, -1)
|
||||
vv.StoreSkuStatus = model.StoreSkuBindStatusDontSale
|
||||
if skuNamesInfo.SkuNames[0].Skus[0] != nil {
|
||||
vv.ActPrice = skuNamesInfo.SkuNames[0].Skus[0].ActPrice
|
||||
vv.ActID = skuNamesInfo.SkuNames[0].Skus[0].ActID
|
||||
vv.ActType = skuNamesInfo.SkuNames[0].Skus[0].ActType
|
||||
vv.EarningPrice = skuNamesInfo.SkuNames[0].Skus[0].EarningPrice
|
||||
vv.EarningActID = skuNamesInfo.SkuNames[0].Skus[0].EarningActID
|
||||
}
|
||||
}
|
||||
skuNameAndPlaceList = append(skuNameAndPlaceList, v)
|
||||
}
|
||||
}
|
||||
@@ -2895,6 +2919,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
||||
}
|
||||
}
|
||||
}
|
||||
var storeSkuBindInfo []*StoreSkuBindInfo
|
||||
for k, v := range skuNameMap {
|
||||
skuBindInfo := &StoreSkuBindInfo{
|
||||
StoreID: store.ID,
|
||||
@@ -2904,8 +2929,9 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
||||
IsSale: 1,
|
||||
Skus: skuInfoMap[k],
|
||||
}
|
||||
retVal = []*StoreSkuBindInfo{skuBindInfo}
|
||||
storeSkuBindInfo = append(storeSkuBindInfo, skuBindInfo)
|
||||
}
|
||||
retVal = storeSkuBindInfo
|
||||
return retVal, err
|
||||
}
|
||||
taskParallel := tasksch.NewParallelTask("根据skuID关注商品", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx, taskFunc, storeList)
|
||||
@@ -2916,7 +2942,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
||||
for _, v := range result1 {
|
||||
skuBindInfos = append(skuBindInfos, v.(*StoreSkuBindInfo))
|
||||
}
|
||||
UpdateStoresSkusByBind(ctx, skuBindInfos, true, true)
|
||||
UpdateStoresSkusByBind(ctx, task, skuBindInfos, true, true)
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
@@ -3011,7 +3037,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuBindInfos []*StoreSkuBindInf
|
||||
for _, v := range result1 {
|
||||
skuBindInfos = append(skuBindInfos, v.(*StoreSkuBindInfo))
|
||||
}
|
||||
hint, err = UpdateStoresSkusByBind(ctx, skuBindInfos, isAsync, isContinueWhenError)
|
||||
hint, err = UpdateStoresSkusByBind(ctx, task, skuBindInfos, isAsync, isContinueWhenError)
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
@@ -3029,8 +3055,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuBindInfos []*StoreSkuBindInf
|
||||
func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
db := dao.GetDB()
|
||||
var (
|
||||
skuBindInfoList []*StoreSkuBindInfo
|
||||
result1 []interface{}
|
||||
result1 []interface{}
|
||||
)
|
||||
storeList, err := dao.GetStoreList(db, nil, nil, "")
|
||||
taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
@@ -3075,6 +3100,7 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context, isAsync, i
|
||||
payPercentage = v.PayPercentage
|
||||
}
|
||||
if len(skuNameAndPlaceList) > 0 {
|
||||
var skuBindInfoList []*StoreSkuBindInfo
|
||||
for _, vv := range skuNameAndPlaceList {
|
||||
if skuNameMap[vv.ID] != 0 {
|
||||
priceReferList, err := dao.GetPriceReferSnapshotNoPage(db, []int{vv.CityCode}, nil, []int{vv.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||
@@ -3090,6 +3116,7 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context, isAsync, i
|
||||
}
|
||||
}
|
||||
}
|
||||
retVal = skuBindInfoList
|
||||
}
|
||||
return retVal, err
|
||||
}
|
||||
@@ -3101,7 +3128,7 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context, isAsync, i
|
||||
for _, v := range result1 {
|
||||
skuBindInfos = append(skuBindInfos, v.(*StoreSkuBindInfo))
|
||||
}
|
||||
UpdateStoresSkusByBind(ctx, skuBindInfos, isAsync, isContinueWhenError)
|
||||
UpdateStoresSkusByBind(ctx, nil, skuBindInfos, isAsync, isContinueWhenError)
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
globals.SugarLogger.Debugf("SyncStore2, storeIDs:%d", storeIDs)
|
||||
userName := ctx.GetUserName()
|
||||
isManageIt := len(storeIDs) == 0 || len(storeIDs) > 5
|
||||
_, hint, err = v.LoopStoresMap2(ctx, db, fmt.Sprintf("同步门店信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, mustDirty, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) {
|
||||
_, hint, err = v.LoopStoresMap2(ctx, nil, db, fmt.Sprintf("同步门店信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, mustDirty, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
handler := v.GetStoreHandler(loopMapInfo.VendorID)
|
||||
if handler != nil {
|
||||
@@ -426,10 +426,10 @@ func (v *VendorSync) SyncStoresCategory(ctx *jxcontext.Context, db *dao.DaoDB, v
|
||||
}
|
||||
|
||||
//
|
||||
func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, skuIDs, excludeSkuIDs []int, setSyncStatus int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, parentTask tasksch.ITask, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, skuIDs, excludeSkuIDs []int, setSyncStatus int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("SyncStoresSkus2")
|
||||
isManageIt := len(storeIDs) != 1 || len(skuIDs) == 0 || len(skuIDs) > 8
|
||||
task, hint, err := v.LoopStoresMap2(ctx, db, fmt.Sprintf("同步门店商品信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, false,
|
||||
task, hint, err := v.LoopStoresMap2(ctx, parentTask, db, fmt.Sprintf("同步门店商品信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, false,
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
|
||||
@@ -462,12 +462,12 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, db *dao.DaoDB, vend
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, skuIDs []int, isForce, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, db *dao.DaoDB, vendorIDs []int, storeIDs []int, skuIDs []int, isForce, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
setSyncStatus := 0
|
||||
if isForce {
|
||||
setSyncStatus = model.SyncFlagStoreSkuModifiedMask
|
||||
}
|
||||
return v.SyncStoresSkus2(ctx, db, vendorIDs, storeIDs, true, skuIDs, nil, setSyncStatus, isAsync, isContinueWhenError)
|
||||
return v.SyncStoresSkus2(ctx, parentTask, db, vendorIDs, storeIDs, true, skuIDs, nil, setSyncStatus, isAsync, isContinueWhenError)
|
||||
}
|
||||
|
||||
func (v *VendorSync) proxySyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeMap *model.StoreMap, nameIDs, skuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
@@ -606,7 +606,7 @@ func (v *VendorSync) AmendAndPruneStoreStuff(ctx *jxcontext.Context, vendorIDs [
|
||||
return hint, makeSyncError(err)
|
||||
}
|
||||
|
||||
func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, db *dao.DaoDB, taskName string, isAsync, isManageIt bool, vendorIDs []int, storeIDs []int, mustDirty bool, handler tasksch.WorkFunc, isContinueWhenError bool) (task tasksch.ITask, hint string, err error) {
|
||||
func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.ITask, db *dao.DaoDB, taskName string, isAsync, isManageIt bool, vendorIDs []int, storeIDs []int, mustDirty bool, handler tasksch.WorkFunc, isContinueWhenError bool) (task tasksch.ITask, hint string, err error) {
|
||||
var storeMapList []*model.StoreMap
|
||||
if storeMapList, err = dao.GetStoresMapList2(db, vendorIDs, storeIDs, model.StoreStatusAll, model.StoreIsSyncYes, "", mustDirty); err != nil {
|
||||
return nil, "", err
|
||||
@@ -647,7 +647,7 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, db *dao.DaoDB, taskN
|
||||
}
|
||||
})
|
||||
}
|
||||
tasksch.HandleTask(task, nil, isManageIt).Run()
|
||||
tasksch.HandleTask(task, parentTask, isManageIt).Run()
|
||||
if !isAsync {
|
||||
resultList, err2 := task.GetResult(0)
|
||||
if len(task.GetFailedList()) > 0 {
|
||||
@@ -699,7 +699,7 @@ func buildErrMsgJson(task tasksch.ITask) (resultL []*SyncErrResult) {
|
||||
}
|
||||
|
||||
func (v *VendorSync) LoopStoresMap(ctx *jxcontext.Context, db *dao.DaoDB, taskName string, isAsync, isManageIt bool, vendorIDs []int, storeIDs []int, handler tasksch.WorkFunc, isContinueWhenError bool) (hint string, err error) {
|
||||
_, hint, err = v.LoopStoresMap2(ctx, db, taskName, isAsync, isManageIt, vendorIDs, storeIDs, false, handler, isContinueWhenError)
|
||||
_, hint, err = v.LoopStoresMap2(ctx, nil, db, taskName, isAsync, isManageIt, vendorIDs, storeIDs, false, handler, isContinueWhenError)
|
||||
return hint, err
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ func (v *VendorSync) ChangeStoreSkuSaleStatus(ctx *jxcontext.Context, storeID in
|
||||
}
|
||||
vendorIDs := partner.GetPurchasePlatformVendorIDs()
|
||||
dao.UpdateStoreSkuBindSyncStatusForSaleStatus(db, vendorIDs, storeID)
|
||||
v.SyncStoresSkus(ctx, db, vendorIDs, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
v.SyncStoresSkus(ctx, nil, db, vendorIDs, storeIDs, skuIDs, false, isAsync, isContinueWhenError)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ func syncStoreSku() {
|
||||
})
|
||||
errList.AddErr(err)
|
||||
|
||||
_, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, db, partner.GetMultiStoreVendorIDs(), nil, false, nil, []int{27379}, syncFlag, true, true)
|
||||
_, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, db, partner.GetMultiStoreVendorIDs(), nil, false, nil, []int{27379}, syncFlag, true, true)
|
||||
// _, err = cms.CurVendorSync.FullSyncStoresSkus(jxcontext.AdminCtx, db, partner.GetMultiStoreVendorIDs(), nil, false, []int{27379}, true, true)
|
||||
errList.AddErr(err)
|
||||
case 1:
|
||||
@@ -193,7 +193,7 @@ func syncStoreSku() {
|
||||
errList.AddErr(err)
|
||||
|
||||
SaveImportantTaskID(TaskNameSyncStoreSku, SpecialTaskID)
|
||||
taskID, err2 := cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, db, partner.GetSingleStoreVendorIDs(), nil, false, nil, nil, syncFlag, true, true)
|
||||
taskID, err2 := cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, db, partner.GetSingleStoreVendorIDs(), nil, false, nil, nil, syncFlag, true, true)
|
||||
errList.AddErr(err2)
|
||||
SaveImportantTaskID(TaskNameSyncStoreSku, taskID)
|
||||
}
|
||||
|
||||
@@ -210,12 +210,13 @@ type StoreSkuExt struct {
|
||||
|
||||
type SkuNameAndPlace struct {
|
||||
model.SkuName
|
||||
CityCode int `json:"cityCode"`
|
||||
CityName string `json:"cityName"`
|
||||
Sequence int `json:"sequence"`
|
||||
Count int `json:"count"`
|
||||
Type int `json:"type"`
|
||||
Skus []*model.SkuAndName `json:"skus"`
|
||||
UnitPrice int `json:"unitPrice"`
|
||||
CityCode int `json:"cityCode"`
|
||||
CityName string `json:"cityName"`
|
||||
Sequence int `json:"sequence"`
|
||||
Count int `json:"count"`
|
||||
Type int `json:"type"`
|
||||
Skus []*model.SkuAndName `json:"skus"`
|
||||
}
|
||||
|
||||
type StoreSkuPriceAndWeight struct {
|
||||
|
||||
@@ -231,14 +231,21 @@ type Sku struct {
|
||||
|
||||
type SkuAndName struct {
|
||||
Sku
|
||||
Name string
|
||||
Unit string
|
||||
Prefix string
|
||||
IsSpu int
|
||||
ExPrefix string
|
||||
ExPrefixBegin *time.Time
|
||||
ExPrefixEnd *time.Time
|
||||
Price int
|
||||
Name string `json:"name"`
|
||||
Unit string `json:"unit"`
|
||||
Prefix string `json:"prefix"`
|
||||
IsSpu int `json:"isSpu"`
|
||||
ExPrefix string `json:"exPrefix"`
|
||||
ExPrefixBegin *time.Time `json:"exPrefixBegin"`
|
||||
ExPrefixEnd *time.Time `json:"eExPrefixEndxPrefixEnd"`
|
||||
Price int `json:"price"`
|
||||
StoreSkuStatus int `json:"storeSkuStatus"`
|
||||
ActPrice int `json:"actPrice"`
|
||||
ActID int `orm:"column(act_id)" json:"actID"`
|
||||
ActType int `orm:"column(act_type)" json:"actType"`
|
||||
|
||||
EarningPrice int `json:"earningPrice"`
|
||||
EarningActID int `orm:"column(earning_act_id)" json:"earningActID"`
|
||||
}
|
||||
|
||||
func (*Sku) TableUnique() [][]string {
|
||||
|
||||
@@ -196,7 +196,7 @@ func (c *StoreSkuController) SyncStoresSkus() {
|
||||
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.SkuIDs, &skuIDs, params.VendorIDs, &vendorIDs); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, db, vendorIDs, storeIDs, skuIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, nil, db, vendorIDs, storeIDs, skuIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
@@ -239,7 +239,7 @@ func (c *StoreSkuController) UpdateStoresSkusByBind() {
|
||||
if err = jxutils.Strings2Objs(params.Payload, &skuBindInfos); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
retVal, err = cms.UpdateStoresSkusByBind(params.Ctx, skuBindInfos, params.IsAsync, params.IsContinueWhenError)
|
||||
retVal, err = cms.UpdateStoresSkusByBind(params.Ctx, nil, skuBindInfos, params.IsAsync, params.IsContinueWhenError)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func (c *SyncController) SyncStoresSkus() {
|
||||
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.SkuIDs, &skuIDs, params.VendorIDs, &vendorIDs); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, db, vendorIDs, storeIDs, skuIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
retVal, err = cms.CurVendorSync.SyncStoresSkus(params.Ctx, nil, db, vendorIDs, storeIDs, skuIDs, params.IsForce, params.IsAsync, params.IsContinueWhenError)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user