From b6dcf8574d2b8091363ce5e126c52f34573b7830 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, 29 Sep 2020 14:33:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=AB=E9=82=AE=E7=AE=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 3b97ebfd1..a5e006fb4 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -3700,17 +3700,11 @@ func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err ) courierStoreList, _ := dao.GetStoreCourierList(db, storeIDs, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll) for _, v := range courierStoreList { + comment := "" tmpDiffStore := &TmpDiffStore{ StoreID: v.StoreID, } - shopInfo, _ := api.MtpsAPI.ShopQuery(utils.Int2Str(v.StoreID)) - if shopInfo == nil { - continue - } - stores, _ := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "") - if len(stores) == 0 { - continue - } + stores, err := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "") store := stores[0] place, _ := dao.GetPlaceByCode(db, store.CityCode) tmpDiffStore.City = place.Name @@ -3718,10 +3712,15 @@ func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err tmpDiffStore.Coordinate = utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lng)) + "," + utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lat)) tmpDiffStore.Address = store.Address tmpDiffStore.Phone = store.Tel1 + shopInfo, err := api.MtpsAPI.ShopQuery(utils.Int2Str(v.StoreID)) + if err != nil { + tmpDiffStore.Comment += err.Error() + tmpDiffStoreList = append(tmpDiffStoreList, tmpDiffStore) + continue + } tmpDiffStore.CoordinateMT = utils.Float64ToStr(jxutils.IntCoordinate2Standard(shopInfo.ShopLng)) + "," + utils.Float64ToStr(jxutils.IntCoordinate2Standard(shopInfo.ShopLat)) tmpDiffStore.AddressMT = shopInfo.ShopAddress tmpDiffStore.PhoneMT = shopInfo.ContactPhone - comment := "" if tmpDiffStore.Coordinate != tmpDiffStore.CoordinateMT { comment += "坐标不同;" } @@ -3731,9 +3730,7 @@ func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err if tmpDiffStore.Phone != tmpDiffStore.PhoneMT { comment += "电话不同;" } - if comment != "" { - tmpDiffStoreList = append(tmpDiffStoreList, tmpDiffStore) - } + tmpDiffStore.Comment = comment } excelConf := &excel.Obj2ExcelSheetConfig{