diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index 4cb8acc52..325f89ae9 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -440,7 +440,6 @@ func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, f store, _ := handler.ReadStore(ctx, storeDetail.VendorOrgCode, storeDetail.VendorStoreID) 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, ";")) - fmt.Println("store.DeliveryRange", store.DeliveryRange) dao.UpdateEntity(db, storeMaps[0], "CoverArea") result.CoverArea = storeMaps[0].CoverArea } @@ -462,12 +461,13 @@ func CalculateCoverArea(coordinate []string) (area float64) { xys := jxutils.MillierConvertion(lat, lng) xyList = append(xyList, xys) } - fmt.Println("xyList", xyList) var sum float64 for i := 0; i < len(xyList)-1; i++ { sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i+1][1]) } sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1]) + fmt.Println("1111111111111111111111111111111111111111", sum) sum /= float64(2) + fmt.Println("1111111111111111111111111111111111111111", sum) return math.Round(sum) }