This commit is contained in:
苏尹岚
2021-03-10 16:44:05 +08:00
parent f52c1ad837
commit 8859a41bdf
3 changed files with 35 additions and 8 deletions

View File

@@ -1206,7 +1206,7 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
mtapi := apimanager.CurAPIManager.GetAPI(model.VendorIDMTWM, storeMap.VendorOrgCode).(*mtwmapi.API)
if token, err := mtapi.GetAccessToken2(storeMap.VendorStoreID); err == nil && token != nil {
storeMap.MtwmToken = token.AccessToken
storeMap.MtwmToken = token.RefreshToken
storeMap.MtwmRefreshToken = token.RefreshToken
}
}
storeMap.SyncStatus = model.SyncFlagModifiedMask | model.SyncFlagStoreName | model.SyncFlagStoreAddress // 新增绑定门店是修改的概念

View File

@@ -10,8 +10,6 @@ import (
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"github.com/shopspring/decimal"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/partner"
@@ -444,8 +442,7 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
if index2 > len(storeIDs) {
index2 = len(storeIDs) - 1
}
storeIDsPage = storeIDs[offset*pageSize+1 : index2]
fmt.Println("storeIDsPage111111111111", offset, pageSize, index2, storeIDsPage)
storeIDsPage = storeIDs[offset*pageSize : index2]
task := tasksch.NewParallelTask("GetStoreManageState", tasksch.NewParallelConfig().SetParallelCount(20).SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
v := batchItemList[0].(int)
@@ -482,6 +479,7 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f
result.OpenTime = optime * float64(dayCount)
//商品数
skuCount, highSkuCount := 0, 0
dao.GetStoresSkusInfo(db, storeIDs, skuIDs)
storeSkus, _ := dao.GetStoresSkusInfo(db, []int{v}, nil)
for _, v := range storeSkus {
if v.Status == model.StoreSkuBindStatusNormal && v.Stock > 0 {
@@ -567,6 +565,6 @@ func CalculateCoverArea(coordinate []string, vendorID int) (area float64) {
sum += xyList[len(xyList)-1][0]*xyList[0][1] - xyList[0][0]*xyList[len(xyList)-1][1]
sum /= float64(2)
sum = math.Abs(sum)
area, _ = decimal.NewFromFloat(sum).Round(3).Float64()
return area
sum = utils.Str2Float64(fmt.Sprintf("%.2f", sum))
return sum
}