From 54746540129d062741b2ac6893f8f89ef018eb7e 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 09:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=88=B7=E6=96=B0=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/orderman_ext.go | 19 ++++++---- business/jxstore/cms/store.go | 39 ++++++++++++++++++-- controllers/cms_store.go | 11 ++++++ 3 files changed, 58 insertions(+), 11 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 8fa33571c..d9aee3a87 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -1299,15 +1299,18 @@ func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, ord } for _, v := range results.BillList.Result { if v.DueAmount != 0 { - order := &model.GoodsOrder{} - order.VendorOrderID = utils.Int64ToStr(v.OrderID) - dao.GetEntity(db, order, "VendorOrderID") - storeDeatil, _ := dao.GetStoreDetail(db, jxutils.GetSaleStoreIDFromOrder(order), order.VendorID) - order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100) - if order.NewEarningPrice == 0 { - jxutils.RefreshOrderEarningPrice2(order, storeDeatil.PayPercentage) + order, _ := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(v.OrderID), model.VendorIDJD) + stores, _ := dao.GetStoreList(db, []int{jxutils.GetSaleStoreIDFromOrder(order)}, nil, nil, nil, "") + if len(stores) > 0 { + store := stores[0] + if order.NewEarningPrice == 0 { + jxutils.RefreshOrderEarningPrice2(order, store.PayPercentage) + } + if order.TotalShopMoney == 0 { + order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100) + } + dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice") } - dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice") } } return err diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 07d6ad1d5..3b97ebfd1 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -3694,18 +3694,51 @@ func GetDiffJxStoreAndMTWMStoreInfo(ctx *jxcontext.Context, storeIDs []int) (err "对比情况", } sheetList []*excel.Obj2ExcelSheetConfig - tmpDiffStore []*TmpDiffStore + tmpDiffStoreList []*TmpDiffStore downloadURL, fileName string db = dao.GetDB() ) courierStoreList, _ := dao.GetStoreCourierList(db, storeIDs, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll) for _, v := range courierStoreList { - fmt.Println(v) + 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 + } + store := stores[0] + place, _ := dao.GetPlaceByCode(db, store.CityCode) + tmpDiffStore.City = place.Name + tmpDiffStore.StoreName = store.Name + tmpDiffStore.Coordinate = utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lng)) + "," + utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lat)) + tmpDiffStore.Address = store.Address + tmpDiffStore.Phone = store.Tel1 + 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 += "坐标不同;" + } + if tmpDiffStore.Address != tmpDiffStore.AddressMT { + comment += "地址不同;" + } + if tmpDiffStore.Phone != tmpDiffStore.PhoneMT { + comment += "电话不同;" + } + if comment != "" { + tmpDiffStoreList = append(tmpDiffStoreList, tmpDiffStore) + } } excelConf := &excel.Obj2ExcelSheetConfig{ Title: "sheet1", - Data: tmpDiffStore, + Data: tmpDiffStoreList, CaptionList: excelTitle, } sheetList = append(sheetList, excelConf) diff --git a/controllers/cms_store.go b/controllers/cms_store.go index 410a2a3df..de0e1f8cc 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -903,3 +903,14 @@ func (c *StoreController) StoreAudit() { return retVal, "", err }) } + +// @Title 比较美团配送门店信息 +// @Description 比较美团配送门店信息 +// @Param token header string true "认证token" +// @Param storeIDs formData string true "门店ids" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /GetDiffJxStoreAndMTWMStoreInfo [post] +func (c *StoreController) GetDiffJxStoreAndMTWMStoreInfo() { + +}