1
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user