From fae910b4352758ff1e13c8d0780722fd319fee99 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 23 Oct 2019 16:29:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E5=9B=A2poi/save=E5=9C=A8=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E9=97=A8=E5=BA=97=E7=8A=B6=E6=80=81=E6=97=A0=E6=95=88?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=B9=B6=E4=B8=8D=E4=BC=9A=E6=8A=A5=E9=94=99?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E7=94=A8UpdateStoreStatus=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/mtwm/store.go | 31 ++++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index 90df1bada..7f43095f0 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -113,7 +113,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin return err } mergedStoreStatus := jxutils.MergeStoreStatus(storeDetail.Status, storeDetail.VendorStatus) - openLevel, isOnline := bizStatusJX2Mtwm(mergedStoreStatus) + // openLevel, isOnline := bizStatusJX2Mtwm(mergedStoreStatus) params := map[string]interface{}{ "name": remoteStoreInfo.Name, //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM), "address": storeDetail.Address, // 美团好像地址也不能改的? @@ -122,25 +122,28 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin "phone": storeDetail.Tel1, "shipping_fee": remoteStoreInfo.ShippingFee, "shipping_time": remoteStoreInfo.ShippingTime, - "open_level": openLevel, - "is_online": isOnline, + "open_level": remoteStoreInfo.OpenLevel, + "is_online": remoteStoreInfo.IsOnline, "third_tag_name": remoteStoreInfo.ThirdTagName, } // globals.SugarLogger.Debug(utils.Format4Output(params, false)) if globals.EnableMtwmStoreWrite { - err = api.MtwmAPI.PoiSave(storeDetail.VendorStoreID, params) + errList.AddErr(api.MtwmAPI.PoiSave(storeDetail.VendorStoreID, params)) } // PoiSave有时会报错:商家已接入美团配送,不可修改门店配送相关信息,这里放弃信息修改 - if err != nil { - if utils.IsErrMatch(err, utils.Int2Str(mtwmapi.ErrCodeCanNotModifyStoreDeliveryInfo), nil) { - globals.SugarLogger.Infof("mtwm UpdateStore vendorStoreID:%s, params:%s failed with err:%v", storeDetail.VendorStoreID, utils.Format4Output(params, true), err) - if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 { - err = p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, mergedStoreStatus) - } else { - err = nil - } - } - errList.AddErr(err) + // if err != nil { + // if utils.IsErrMatch(err, utils.Int2Str(mtwmapi.ErrCodeCanNotModifyStoreDeliveryInfo), nil) { + // globals.SugarLogger.Infof("mtwm UpdateStore vendorStoreID:%s, params:%s failed with err:%v", storeDetail.VendorStoreID, utils.Format4Output(params, true), err) + // if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 { + // err = p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, mergedStoreStatus) + // } else { + // err = nil + // } + // } + // errList.AddErr(err) + // } + if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 { + errList.AddErr(p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, mergedStoreStatus)) } errList.AddErr(p.UpdateStoreOpTime(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, storeDetail.GetOpTimeList())) return errList.GetErrListAsOne()