From d1e28ccd4e8de275831149b7aa87ac572c3e8f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 1 Sep 2020 17:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=90=88=E5=B9=B6=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/tempop/tempop.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index ac15da539..86de6121f 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "math" "regexp" "strings" "time" @@ -1595,6 +1596,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { type SpecialtyStoreSkus struct { StoreID int `json:"门店ID"` StoreName string `json:"门店名"` + City string `json:"城市"` Area float64 `json:"面积"` } var ( @@ -1602,6 +1604,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { excelTitle = []string{ "门店ID", "门店名", + "城市", "面积", } sheetList []*excel.Obj2ExcelSheetConfig @@ -1619,7 +1622,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { strs := strings.Split(station.DeliveryRange, ";") ss = append(ss, &tmp{ JdID: v.VendorStoreID, - S: jxutils.ComputeSignedArea(strs[:len(strs)-1]), + S: math.Round(jxutils.ComputeSignedArea(strs[:len(strs)-1])), }) } } @@ -1634,9 +1637,11 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { } for _, v := range ss { storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), v.JdID, model.VendorIDJD) + place, _ := dao.GetPlaceByCode(dao.GetDB(), storeDetail.CityCode) specialtyStoreSku := &SpecialtyStoreSkus{ StoreID: storeDetail.ID, StoreName: storeDetail.Name, + City: place.Name, Area: v.S, } specialtyStoreSkus = append(specialtyStoreSkus, specialtyStoreSku)