+ OpenRemoteStoreByJxStatus
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"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"
|
||||
)
|
||||
|
||||
@@ -242,26 +240,27 @@ func (c *TempOpController) RefreshMtpsWaybillFee() {
|
||||
// @router /TestIt [get]
|
||||
func (c *TempOpController) TestIt() {
|
||||
c.callTestIt(func(params *tTempopTestItParams) (retVal interface{}, errCode string, err error) {
|
||||
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("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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user