This commit is contained in:
邹宗楠
2022-11-17 10:48:40 +08:00
parent 0af9e320cb
commit 68c6245880
2 changed files with 6 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ func getMultiStoreVendorInfoList() (list []*MultiStoreVendorInfo) {
}
func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, catList []*dao.SkuStoreCatInfo, isAsync bool) (hint string, err error) {
defer globals.SugarLogger.Debugf("syncCategories err := %s", err)
if len(catList) > 0 {
// todo 按vendorID orgCode合并操作
task := tasksch.NewParallelTask(fmt.Sprintf("同步分类2:%d", len(catList)), tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
@@ -95,6 +96,7 @@ func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.IT
}
func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs []int, appOrgCodes []string, catIDs []int, isAsync bool) (hint string, err error) {
defer globals.SugarLogger.Debugf("SyncCategories err := %s", err)
db := dao.GetDB()
catList, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, catIDs, true)
if err == nil && len(catList) > 0 {
@@ -139,6 +141,7 @@ func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs
}
func SyncSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs []int, appOrgCodes []string, nameIDs, skuIDs []int, isAsync bool) (hint string, err error) {
defer globals.SugarLogger.Debugf("SyncSkus err := %s", err)
db := dao.GetDB()
skuList, err := dao.GetSkusWithVendor(db, vendorIDs, appOrgCodes, nameIDs, skuIDs, true)
@@ -535,6 +538,7 @@ func updateThingMapEntity(db *dao.DaoDB, thingMap *model.ThingMap) {
}
func amendAndPruneVendorStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID, vendorID int, vendorOrgCode string, isAsync, isContinueWhenError bool, opType int, isForceUpdate bool) (hint string, err error) {
defer globals.SugarLogger.Debugf("amendAndPruneVendorStuff err := %s", err)
handler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IMultipleStoresHandler)
if handler == nil {
return "", fmt.Errorf("平台:%s不支持此操作", model.VendorChineseNames[vendorID])

View File

@@ -1,6 +1,7 @@
package dao
import (
"git.rosy.net.cn/jx-callback/globals"
"time"
"git.rosy.net.cn/baseapi/platformapi/aliupcapi"
@@ -227,6 +228,7 @@ func GetSkuByCats(db *DaoDB, catIDs []int) (skuList []*model.Sku, err error) {
// 多门店平台使用,当前只有京东
func GetSkuCategoryWithVendor(db *DaoDB, vendorIDs []int, appOrgCodes []string, parentCatID int, catIDs []int, mustDirty bool) (catList []*SkuStoreCatInfo, err error) {
defer globals.SugarLogger.Debugf("GetSkuCategoryWithVendor err := %s", err)
sqlParams := []interface{}{}
sql := `
SELECT