aa
This commit is contained in:
@@ -512,7 +512,7 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// retVal = []*GetStoreManageStateResult{result}
|
// retVal = []*GetStoreManageStateResult{result}
|
||||||
// getStoreManageStateResult = append(getStoreManageStateResult, result)
|
getStoreManageStateResult = append(getStoreManageStateResult, result)
|
||||||
// return retVal, err
|
// return retVal, err
|
||||||
// }, storeIDsPage)
|
// }, storeIDsPage)
|
||||||
// tasksch.HandleTask(task, nil, true).Run()
|
// tasksch.HandleTask(task, nil, true).Run()
|
||||||
|
|||||||
@@ -4,10 +4,13 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxstore/report"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
||||||
"github.com/360EntSecGroup-Skylar/excelize"
|
"github.com/360EntSecGroup-Skylar/excelize"
|
||||||
@@ -1865,18 +1868,29 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
// }, storeMaps)
|
// }, storeMaps)
|
||||||
// tasksch.HandleTask(task, nil, true).Run()
|
// tasksch.HandleTask(task, nil, true).Run()
|
||||||
// _, err = task.GetResult(0)
|
// _, err = task.GetResult(0)
|
||||||
stores := []int{}
|
var (
|
||||||
for i := 1; i < 26; i++ {
|
storeMaps []*model.StoreMap
|
||||||
result, _ := api.JdShop2API.ShopList(i)
|
db = dao.GetDB()
|
||||||
for _, v := range result.List {
|
)
|
||||||
if v.Kilometres == "" {
|
storeMaps, err = dao.GetStoresMapList(db, nil, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
|
||||||
if err = api.JdShop2API.CreateGisFence(v.StoreID, "1"); err != nil {
|
task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||||
stores = append(stores, v.StoreID)
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
|
storeMap := batchItemList[0].(*model.StoreMap)
|
||||||
|
if storeMap.CoverArea == 0 {
|
||||||
|
handler := partner.GetPurchasePlatformFromVendorID(storeMap.VendorID)
|
||||||
|
if store, err := handler.ReadStore(ctx, storeMap.VendorOrgCode, storeMap.VendorStoreID); err == nil {
|
||||||
|
if storeMap.VendorID == model.VendorIDJD && store.DeliveryRangeType != model.DeliveryRangeTypePolygon {
|
||||||
|
storeMap.CoverArea = math.Pi * utils.Str2Float64WithDefault(store.DeliveryRange, 0) * utils.Str2Float64WithDefault(store.DeliveryRange, 0) / float64(10000)
|
||||||
|
} else {
|
||||||
|
storeMap.CoverArea = report.CalculateCoverArea(strings.Split(store.DeliveryRange, ";"), storeMap.VendorID)
|
||||||
|
}
|
||||||
|
dao.UpdateEntity(db, storeMap, "CoverArea")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return retVal, err
|
||||||
}
|
}, storeMaps)
|
||||||
fmt.Println("resultstores112", stores)
|
tasksch.HandleTask(task, nil, true).Run()
|
||||||
|
_, err = task.GetResult(0)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user