This commit is contained in:
邹宗楠
2023-11-23 10:26:25 +08:00
parent 8f12a4f753
commit 687eb45bef
5 changed files with 69 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ package cms
import (
"errors"
"fmt"
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
"github.com/astaxie/beego/server/web"
beego "github.com/astaxie/beego/server/web"
"regexp"
@@ -96,6 +97,24 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
func(rootTask *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
level := step + 1
catList, err := dao.GetDirtyStoreCategories(db, vendorID, storeID, level, skuIDs)
// 保证下面api成功率添加校验
if vendorID == model.VendorIDEBAI {
status, err := api.EbaiAPI.ShopStatusGet("", utils.Str2Int64(vendorStoreID))
if err != nil {
return nil, err
}
switch status {
case ebaiapi.ShopCheckStatusCheckSuccess:
case ebaiapi.ShopCheckStatusNew, ebaiapi.ShopCheckStatusWaitCheck, ebaiapi.ShopCheckStatusUpdateWaitCheck:
return nil, fmt.Errorf("门店审核中,请联系饿了么工作人员加快审核")
case ebaiapi.ShopCheckStatusGoLiveFail:
return nil, fmt.Errorf("门店上线审核失败,请联系饿了么工作人员加快审核")
case ebaiapi.ShopCheckStatusCheckFail:
return nil, fmt.Errorf("门店审核未通过")
}
}
if len(catList) > 0 {
num += len(catList)
task := tasksch.NewParallelTask(fmt.Sprintf("%s SyncStoreCategory step2, level=%d", model.VendorChineseNames[vendorID], level),