aa
This commit is contained in:
@@ -1249,7 +1249,7 @@ func ForceUpdateVendorPrice(ctx *jxcontext.Context, vendorID int, actType int, s
|
|||||||
subTask := tasksch.NewParallelTask("同步平台价格", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
subTask := tasksch.NewParallelTask("同步平台价格", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
storeID := batchItemList[0].(int)
|
storeID := batchItemList[0].(int)
|
||||||
_, err = cms.SyncStoreSkuNew2(ctx, task, 0 /*model.SyncFlagPriceMask*/, vendorID, storeID, storeVendorIDMap[storeID], nil, storeSkuIDMap[storeID], nil, true, false, true)
|
_, err = cms.SyncStoreSkuNew2(ctx, task, 0 /*model.SyncFlagPriceMask*/, vendorID, storeID, storeVendorIDMap[storeID], "", nil, storeSkuIDMap[storeID], nil, true, false, true)
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}, storeIDs)
|
}, storeIDs)
|
||||||
tasksch.HandleTask(subTask, task, true).Run()
|
tasksch.HandleTask(subTask, task, true).Run()
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, parentTask tasksch.
|
|||||||
if setSyncStatus != 0 {
|
if setSyncStatus != 0 {
|
||||||
dao.SetStoreSkuSyncStatus(db, storeMap.VendorID, []int{storeMap.StoreID}, skuIDs, setSyncStatus)
|
dao.SetStoreSkuSyncStatus(db, storeMap.VendorID, []int{storeMap.StoreID}, skuIDs, setSyncStatus)
|
||||||
}
|
}
|
||||||
if _, err = SyncStoreSkuNew(ctx, task, causeFlag, storeMap.VendorID, storeMap.StoreID, storeMap.VendorStoreID, nil, skuIDs, excludeSkuIDs, false, isContinueWhenError); err != nil {
|
if _, err = SyncStoreSkuNew(ctx, task, causeFlag, storeMap.VendorID, storeMap.StoreID, storeMap.VendorStoreID, storeMap.VendorOrgCode, nil, skuIDs, excludeSkuIDs, false, isContinueWhenError); err != nil {
|
||||||
globals.SugarLogger.Debugf("SyncStoresSkus2 failed2 store:%d failed with error:%v", storeMap.StoreID, err)
|
globals.SugarLogger.Debugf("SyncStoresSkus2 failed2 store:%d failed with error:%v", storeMap.StoreID, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,11 +164,11 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
|||||||
return hint, err
|
return hint, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func SyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func SyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, vendorID, storeID int, vendorStoreID, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
return SyncStoreSkuNew2(ctx, parentTask, causeFlag, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, excludeSkuIDs, false, isAsync, isContinueWhenError)
|
return SyncStoreSkuNew2(ctx, parentTask, causeFlag, vendorID, storeID, vendorStoreID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, false, isAsync, isContinueWhenError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, vendorID, storeID int, vendorStoreID, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||||
if singleStoreHandler != nil {
|
if singleStoreHandler != nil {
|
||||||
if err = CreateStoreCategoryByStoreSku(ctx, vendorID, storeID, vendorStoreID, nameIDs, skuIDs); err != nil {
|
if err = CreateStoreCategoryByStoreSku(ctx, vendorID, storeID, vendorStoreID, nameIDs, skuIDs); err != nil {
|
||||||
@@ -183,7 +183,7 @@ func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFla
|
|||||||
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
||||||
}
|
}
|
||||||
return result, err
|
return result, err
|
||||||
}, 2)
|
}, 2)
|
||||||
@@ -211,9 +211,9 @@ func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
|||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
if singleStoreHandler != nil {
|
if singleStoreHandler != nil {
|
||||||
_, err = SyncStoreSkuNew(ctx, task, 0, vendorID, storeID, vendorStoreID, nil, nil, excludeSkuIDs, false, isContinueWhenError)
|
_, err = SyncStoreSkuNew(ctx, task, 0, vendorID, storeID, vendorStoreID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError)
|
||||||
} else {
|
} else {
|
||||||
err = syncStoreSkuNew(ctx, task, 0, true, vendorID, storeID, nil, nil, excludeSkuIDs, false, isContinueWhenError)
|
err = syncStoreSkuNew(ctx, task, 0, true, vendorID, storeID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retVal, err
|
return retVal, err
|
||||||
@@ -411,13 +411,9 @@ func isSkuLockTimeValid(sku *dao.StoreSkuSyncInfo) bool {
|
|||||||
return sku.LockTime != nil && time.Now().Sub(*sku.LockTime) < 0
|
return sku.LockTime != nil && time.Now().Sub(*sku.LockTime) < 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, isFull bool, vendorID, storeID int, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isContinueWhenError bool) (err error) {
|
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, isFull bool, vendorID, storeID int, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isContinueWhenError bool) (err error) {
|
||||||
globals.SugarLogger.Debugf("syncStoreSkuNew causeFlag:%d", causeFlag)
|
globals.SugarLogger.Debugf("syncStoreSkuNew causeFlag:%d", causeFlag)
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
var vendorOrgCode string
|
|
||||||
if vendorID == model.VendorIDJDShop && storeID == model.JdShopMainStoreID2 {
|
|
||||||
vendorOrgCode = "2"
|
|
||||||
}
|
|
||||||
storeDetail, err := dao.GetStoreDetail(db, storeID, vendorID, vendorOrgCode)
|
storeDetail, err := dao.GetStoreDetail(db, storeID, vendorID, vendorOrgCode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user