- TestIt
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"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/netspider"
|
"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,8 +242,26 @@ 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) {
|
||||||
// err = cms.SaveAndSendAlarmVendorSnapshot(params.Ctx, nil, nil)
|
shopList, err := api.EbaiAPI.ShopList(ebaiapi.SysStatusAll)
|
||||||
err = netspider.RefreshPageStore(params.Ctx)
|
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)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user