- TestIt
This commit is contained in:
@@ -2,9 +2,12 @@ package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/tempop"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
@@ -243,11 +246,13 @@ func (c *TempOpController) RefreshMtpsWaybillFee() {
|
||||
func (c *TempOpController) TestIt() {
|
||||
c.callTestIt(func(params *tTempopTestItParams) (retVal interface{}, errCode string, err error) {
|
||||
// retVal, err = cms.OpenRemoteStoreByJxStatus(params.Ctx, nil, nil, false, true, true)
|
||||
shopList, err := api.EbaiAPI.ShopList(ebaiapi.SysStatusAll)
|
||||
// shopList, err := api.EbaiAPI.ShopList(ebaiapi.SysStatusAll)
|
||||
shopList, err := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDEBAI}, nil, model.StoreStatusAll, model.StoreIsSyncYes, "")
|
||||
task := tasksch.NewParallelTask("TestIt", nil, params.Ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
shop := batchItemList[0].(*ebaiapi.ShopInfo)
|
||||
skuInfo, err := api.EbaiAPI.SkuList(shop.ShopID, &ebaiapi.SkuListParams{})
|
||||
// shopID := batchItemList[0].(*ebaiapi.ShopInfo).ShopID
|
||||
shopID := utils.Int2Str(batchItemList[0].(*model.StoreMap).StoreID)
|
||||
skuInfo, err := api.EbaiAPI.SkuList(shopID, &ebaiapi.SkuListParams{})
|
||||
if err == nil && skuInfo.Total > 500 {
|
||||
errSkuCount := 0
|
||||
for _, sku := range skuInfo.List {
|
||||
@@ -256,7 +261,7 @@ func (c *TempOpController) TestIt() {
|
||||
}
|
||||
}
|
||||
if errSkuCount > len(skuInfo.List)/3 {
|
||||
retVal = []string{shop.ShopID}
|
||||
retVal = []string{shopID}
|
||||
}
|
||||
}
|
||||
return retVal, err
|
||||
|
||||
Reference in New Issue
Block a user