From 900544560bde3b3910c418846b731deebf031514 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 20 Sep 2019 11:53:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?-=20=E7=BE=8E=E5=9B=A2=E5=A4=96=E5=8D=96?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=90=8C=E6=AD=A5=E4=B8=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=EF=BC=88=E8=A6=81=E6=8A=A5=E9=94=99=EF=BC=8C?= =?UTF-8?q?=E5=B7=B2=E6=8E=A5=E5=85=A5=E7=BE=8E=E5=9B=A2=E9=85=8D=E9=80=81?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=8F=AF=E4=BF=AE=E6=94=B9=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E9=85=8D=E9=80=81=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/mtwm/store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index 02c16f2f2..0db80b950 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -114,8 +114,8 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin } openLevel, isOnline := bizStatusJX2Mtwm(storeDetail.Status) params := map[string]interface{}{ - "name": remoteStoreInfo.Name, //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM), - "address": storeDetail.Address, + "name": remoteStoreInfo.Name, //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM), + "address": remoteStoreInfo.Address, // storeDetail.Address, // 美团好像地址也不能改的 "longitude": jxutils.IntCoordinate2Standard(int(remoteStoreInfo.Longitude)), "latitude": jxutils.IntCoordinate2Standard(int(remoteStoreInfo.Latitude)), "phone": storeDetail.Tel1, From 877ffb2becfef1dbd3fc164f974136f672e0f7a5 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 20 Sep 2019 12:04:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?-=20JxBadComments.Createtime=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/legacymodel/jxbadcomments.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/legacymodel/jxbadcomments.go b/business/model/legacymodel/jxbadcomments.go index af1800cd0..dfde18ec7 100644 --- a/business/model/legacymodel/jxbadcomments.go +++ b/business/model/legacymodel/jxbadcomments.go @@ -9,7 +9,7 @@ type JxBadComments struct { Jxstoreid string `json:"jxstoreid" orm:"column(jxstoreid);size(11);index" description:"京西门店ID"` Userphone string `json:"userPhone" orm:"column(userphone);size(255);null" description:"评价的用户的联系方式"` Status int `json:"status" orm:"column(status)" description:"当前评论的状态(0:未解决 1:已解决)"` - Createtime string `json:"createTime" orm:"column(createtime);size(255);null" description:"评论的创建时间"` + Createtime string `json:"createTime" orm:"column(createtime);size(255);null;index" description:"评论的创建时间"` Maxmodifytime int `json:"maxModifyTime" orm:"column(maxmodifytime);null" description:"评论可修改的最大时间"` Score int `json:"score4" orm:"column(score)" description:"评论的星级"` Scorecontent string `json:"score4Content" orm:"column(scorecontent);size(255);null" description:"评论的内容"` From 7e1104c0684a712ef55b58b6ddf5823a17b12385 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 20 Sep 2019 14:20:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=E7=BE=8E=E5=9B=A2?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E4=BF=AE=E6=94=B9=E7=8A=B6=E6=80=81=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=90=88=E5=B9=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/mtwm/store.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index 0db80b950..84e1bd572 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -112,10 +112,11 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin if err != nil { return err } - openLevel, isOnline := bizStatusJX2Mtwm(storeDetail.Status) + mergedStoreStatus := jxutils.MergeStoreStatus(storeDetail.Status, storeDetail.VendorStatus) + openLevel, isOnline := bizStatusJX2Mtwm(mergedStoreStatus) params := map[string]interface{}{ - "name": remoteStoreInfo.Name, //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM), - "address": remoteStoreInfo.Address, // storeDetail.Address, // 美团好像地址也不能改的 + "name": remoteStoreInfo.Name, //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM), + "address": storeDetail.Address, // 美团好像地址也不能改的? "longitude": jxutils.IntCoordinate2Standard(int(remoteStoreInfo.Longitude)), "latitude": jxutils.IntCoordinate2Standard(int(remoteStoreInfo.Latitude)), "phone": storeDetail.Tel1, @@ -131,7 +132,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin } // if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 { - // errList.AddErr(p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, jxutils.MergeStoreStatus(storeDetail.Status, storeDetail.VendorStatus))) + // errList.AddErr(p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, mergedStoreStatus)) // } errList.AddErr(p.UpdateStoreOpTime(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, storeDetail.GetOpTimeList())) return errList.GetErrListAsOne() From 4a8c3190fb9186039035822fecdf6d3b1ad5e77b Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 20 Sep 2019 14:38:10 +0800 Subject: [PATCH 4/4] =?UTF-8?q?-=20=E5=A4=84=E7=90=86=E7=BE=8E=E5=9B=A2?= =?UTF-8?q?=E5=A4=96=E5=8D=96poi/save=E6=97=B6=EF=BC=8C=E6=8A=A5=E9=94=99?= =?UTF-8?q?=EF=BC=9A=E5=95=86=E5=AE=B6=E5=B7=B2=E6=8E=A5=E5=85=A5=E7=BE=8E?= =?UTF-8?q?=E5=9B=A2=E9=85=8D=E9=80=81=EF=BC=8C=E4=B8=8D=E5=8F=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=97=A8=E5=BA=97=E9=85=8D=E9=80=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=E9=94=99=E8=AF=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/mtwm/store.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index 84e1bd572..a3b2983c9 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -128,12 +128,20 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin } // globals.SugarLogger.Debug(utils.Format4Output(params, false)) if globals.EnableMtwmStoreWrite { - errList.AddErr(api.MtwmAPI.PoiSave(storeDetail.VendorStoreID, params)) + err = 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 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() }