1
This commit is contained in:
@@ -1522,7 +1522,6 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
|
|||||||
return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID)
|
return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID)
|
||||||
}
|
}
|
||||||
if vendorID == model.VendorIDDD { //抖店绑定店铺时 检查并补充创建
|
if vendorID == model.VendorIDDD { //抖店绑定店铺时 检查并补充创建
|
||||||
globals.SugarLogger.Debugf("vendorID ==============%d", vendorID)
|
|
||||||
if err2 := tiktok_store.CreateOrUpdateAll(vendorOrgCode, int64(storeMap.StoreID), utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.DeliveryFeeDeductionFee), utils.Str2Int64(storeMap.YbStorePrefix)); err2 != nil {
|
if err2 := tiktok_store.CreateOrUpdateAll(vendorOrgCode, int64(storeMap.StoreID), utils.Str2Int64(storeMap.VendorStoreID), int64(storeMap.DeliveryFeeDeductionFee), utils.Str2Int64(storeMap.YbStorePrefix)); err2 != nil {
|
||||||
errList.AddErr(err2)
|
errList.AddErr(err2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
|||||||
db2 = dao.GetDB()
|
db2 = dao.GetDB()
|
||||||
}
|
}
|
||||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||||
globals.SugarLogger.Debugf("1.IsSyncStatusNew(storeMap.SyncStatus)")
|
|
||||||
storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID, storeMap.VendorOrgCode)
|
storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID, storeMap.VendorOrgCode)
|
||||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, storeDetail); err == nil {
|
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, storeDetail); err == nil {
|
||||||
resultList = append(resultList, 1)
|
resultList = append(resultList, 1)
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ func getMultiStoreVendorInfoList() (list []*MultiStoreVendorInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, catList []*dao.SkuStoreCatInfo, isAsync bool) (hint string, err error) {
|
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 {
|
if len(catList) > 0 {
|
||||||
// todo 按vendorID orgCode合并操作
|
// todo 按vendorID orgCode合并操作
|
||||||
task := tasksch.NewParallelTask(fmt.Sprintf("同步分类2:%d", len(catList)), tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
task := tasksch.NewParallelTask(fmt.Sprintf("同步分类2:%d", len(catList)), tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||||
@@ -96,7 +95,6 @@ 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) {
|
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()
|
db := dao.GetDB()
|
||||||
catList, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, catIDs, true)
|
catList, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, catIDs, true)
|
||||||
if err == nil && len(catList) > 0 {
|
if err == nil && len(catList) > 0 {
|
||||||
@@ -141,7 +139,6 @@ 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) {
|
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()
|
db := dao.GetDB()
|
||||||
skuList, err := dao.GetSkusWithVendor(db, vendorIDs, appOrgCodes, nameIDs, skuIDs, true)
|
skuList, err := dao.GetSkusWithVendor(db, vendorIDs, appOrgCodes, nameIDs, skuIDs, true)
|
||||||
|
|
||||||
@@ -553,7 +550,6 @@ func amendAndPruneVendorStuff(ctx *jxcontext.Context, parentTask tasksch.ITask,
|
|||||||
switch step {
|
switch step {
|
||||||
case 0:
|
case 0:
|
||||||
localSkuList, err := dao.GetSkusWithVendor(db, []int{vendorID}, []string{vendorOrgCode}, nil, nil, false)
|
localSkuList, err := dao.GetSkusWithVendor(db, []int{vendorID}, []string{vendorOrgCode}, nil, nil, false)
|
||||||
globals.SugarLogger.Debugf("GetSkusWithVendor err := %s", err)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFla
|
|||||||
case 0:
|
case 0:
|
||||||
if singleStoreHandler != nil {
|
if singleStoreHandler != nil {
|
||||||
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
||||||
globals.SugarLogger.Debugf("SyncStoreCategories in SyncStoreSkuNew2 err on: %s", err)
|
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
||||||
@@ -815,7 +814,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
}
|
}
|
||||||
case 6:
|
case 6:
|
||||||
if len(priceList) > 0 {
|
if len(priceList) > 0 {
|
||||||
globals.SugarLogger.Debugf("更新门店商品价格=====")
|
|
||||||
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品价格", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
|
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品价格", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
|
||||||
if isNeedHandleAct(causeFlag) {
|
if isNeedHandleAct(causeFlag) {
|
||||||
cancelStoreSkuActs(ctx, task, vendorID, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList, true)
|
cancelStoreSkuActs(ctx, task, vendorID, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList, true)
|
||||||
|
|||||||
@@ -205,7 +205,6 @@ func (p *PurchaseHandler) DeleteStoreSkus(ctx *jxcontext.Context, storeID int, v
|
|||||||
if v.VendorMainId == "" {
|
if v.VendorMainId == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("=========storeSkuList====:= %s", utils.Format4Output(v, false))
|
|
||||||
if err = getAPI(storeSkuList[0].VendorOrgCode, storeID, vendorStoreID).DeleteStoreCommodity(utils.Str2Int64(v.VendorMainId)); err != nil {
|
if err = getAPI(storeSkuList[0].VendorOrgCode, storeID, vendorStoreID).DeleteStoreCommodity(utils.Str2Int64(v.VendorMainId)); err != nil {
|
||||||
failedList = append(failedList, putils.GetErrMsg2FailedSingleList(v, err, storeID, model.VendorChineseNames[model.VendorIDDD], "删除主商品")...)
|
failedList = append(failedList, putils.GetErrMsg2FailedSingleList(v, err, storeID, model.VendorChineseNames[model.VendorIDDD], "删除主商品")...)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user