- TestIt
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
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/jxstore/tempop"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"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"
|
"github.com/astaxie/beego"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -240,27 +242,27 @@ func (c *TempOpController) RefreshMtpsWaybillFee() {
|
|||||||
// @router /TestIt [get]
|
// @router /TestIt [get]
|
||||||
func (c *TempOpController) TestIt() {
|
func (c *TempOpController) TestIt() {
|
||||||
c.callTestIt(func(params *tTempopTestItParams) (retVal interface{}, errCode string, err error) {
|
c.callTestIt(func(params *tTempopTestItParams) (retVal interface{}, errCode string, err error) {
|
||||||
retVal, err = cms.OpenRemoteStoreByJxStatus(params.Ctx, nil, nil, false, true, true)
|
// 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)
|
||||||
// task := tasksch.NewParallelTask("tttt", nil, params.Ctx,
|
task := tasksch.NewParallelTask("TestIt", nil, params.Ctx,
|
||||||
// func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
// shop := batchItemList[0].(*ebaiapi.ShopInfo)
|
shop := batchItemList[0].(*ebaiapi.ShopInfo)
|
||||||
// skuInfo, err := api.EbaiAPI.SkuList(shop.ShopID, &ebaiapi.SkuListParams{})
|
skuInfo, err := api.EbaiAPI.SkuList(shop.ShopID, &ebaiapi.SkuListParams{})
|
||||||
// if err == nil && skuInfo.Total > 500 {
|
if err == nil && skuInfo.Total > 500 {
|
||||||
// errSkuCount := 0
|
errSkuCount := 0
|
||||||
// for _, sku := range skuInfo.List {
|
for _, sku := range skuInfo.List {
|
||||||
// if sku.CustomCatIDs == "" {
|
if sku.CustomCatIDs == "" {
|
||||||
// errSkuCount++
|
errSkuCount++
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if errSkuCount > len(skuInfo.List)/3 {
|
if errSkuCount > len(skuInfo.List)/3 {
|
||||||
// retVal = []string{shop.ShopID}
|
retVal = []string{shop.ShopID}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// return retVal, err
|
return retVal, err
|
||||||
// }, shopList)
|
}, shopList)
|
||||||
// task.Run()
|
task.Run()
|
||||||
// retVal, err = task.GetResult(0)
|
retVal, err = task.GetResult(0)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user