From a09bc75d824021003bbd3e5185f3809d5ed20b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 10 Mar 2021 12:01:29 +0800 Subject: [PATCH] aa --- business/jxstore/report/report.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index 124c331a5..fbbc11b00 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -451,7 +451,11 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f handler := partner.GetPurchasePlatformFromVendorID(vendorID) if store, err := handler.ReadStore(ctx, storeDetail.VendorOrgCode, storeDetail.VendorStoreID); err == nil { if storeMaps, err := dao.GetStoresMapList(db, []int{vendorID}, []int{v}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", ""); len(storeMaps) > 0 && err == nil { - storeMaps[0].CoverArea = CalculateCoverArea(strings.Split(store.DeliveryRange, ";"), vendorID) + if vendorID == model.VendorIDJD && store.DeliveryRangeType != model.DeliveryRangeTypePolygon { + storeMaps[0].CoverArea = math.Pi * utils.Str2Float64WithDefault(store.DeliveryRange, 0) * utils.Str2Float64WithDefault(store.DeliveryRange, 0) / float64(10000) + } else { + storeMaps[0].CoverArea = CalculateCoverArea(strings.Split(store.DeliveryRange, ";"), vendorID) + } dao.UpdateEntity(db, storeMaps[0], "CoverArea") result.CoverArea = storeMaps[0].CoverArea } @@ -515,7 +519,7 @@ func CalculateCoverArea(coordinate []string, vendorID int) (area float64) { var xyList [][2]float64 for _, v := range coordinate { cell := strings.Split(v, ",") - if len(cell) == 0 { + if len(cell) == 0 || len(cell) == 1 { continue } var lat, lng float64