This commit is contained in:
gazebo
2019-07-23 16:38:39 +08:00
parent 4ca53f7283
commit 834a011a1f

View File

@@ -1,9 +1,11 @@
package controllers
import (
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
"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/globals/api"
"github.com/astaxie/beego"
)
@@ -240,27 +242,27 @@ func (c *TempOpController) RefreshMtpsWaybillFee() {
// @router /TestIt [get]
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)
// task := tasksch.NewParallelTask("tttt", 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{})
// if err == nil && skuInfo.Total > 500 {
// errSkuCount := 0
// for _, sku := range skuInfo.List {
// if sku.CustomCatIDs == "" {
// errSkuCount++
// }
// }
// if errSkuCount > len(skuInfo.List)/3 {
// retVal = []string{shop.ShopID}
// }
// }
// return retVal, err
// }, shopList)
// task.Run()
// retVal, err = task.GetResult(0)
// retVal, err = cms.OpenRemoteStoreByJxStatus(params.Ctx, nil, nil, false, true, true)
shopList, err := api.EbaiAPI.ShopList(ebaiapi.SysStatusAll)
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{})
if err == nil && skuInfo.Total > 500 {
errSkuCount := 0
for _, sku := range skuInfo.List {
if sku.CustomCatIDs == "" {
errSkuCount++
}
}
if errSkuCount > len(skuInfo.List)/3 {
retVal = []string{shop.ShopID}
}
}
return retVal, err
}, shopList)
task.Run()
retVal, err = task.GetResult(0)
return retVal, "", err
})
}