From 973b6c6869021ec24f2746d9e5c869ec6d10d8b6 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 25 Apr 2019 21:35:33 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=BF=BD=E7=95=A5=E5=9C=A8jd=20storeCrud?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=97=B6=E6=89=BE=E4=B8=8D=E5=88=B0=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/storeman.go | 4 ++-- business/partner/purchase/jd/store.go | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/storeman.go b/business/jxstore/cms/storeman.go index 52a62b84d..1dd9b8cce 100644 --- a/business/jxstore/cms/storeman.go +++ b/business/jxstore/cms/storeman.go @@ -63,7 +63,7 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int, } }() if storeKV != nil { - globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeKV:%d", vendorStoreID, utils.Format4Output(storeKV, true)) + globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeKV:%s", vendorStoreID, utils.Format4Output(storeKV, true)) store := &model.Store{} store.ID = storeDetail.Store.ID if err = utils.CallFuncLogError(func() error { @@ -74,7 +74,7 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int, } } if storeMapKV != nil { - globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeMapKV:%d", vendorStoreID, utils.Format4Output(storeMapKV, true)) + globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeMapKV:%s", vendorStoreID, utils.Format4Output(storeMapKV, true)) if err = utils.CallFuncLogError(func() error { _, err = dao.UpdateEntityLogically(db, &model.StoreMap{}, storeMapKV, model.AdminName, map[string]interface{}{ model.FieldStoreID: storeDetail.Store.ID, diff --git a/business/partner/purchase/jd/store.go b/business/partner/purchase/jd/store.go index e7b0216d5..1fb193740 100644 --- a/business/partner/purchase/jd/store.go +++ b/business/partner/purchase/jd/store.go @@ -301,6 +301,7 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorStoreID s return storeStatus, err } +// 当前京东的storeCrud消息不会在门店状态改变时发送,所以意义不大,先放在这里 func (c *PurchaseHandler) onStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) { var err error if msg.StatusID == jdapi.StatusIDUpdateStore { @@ -308,6 +309,11 @@ func (c *PurchaseHandler) onStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jda vendorStoreID := msg.BillID if storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, vendorStoreID); err == nil { err = partner.CurStoreManager.OnStoreStatusChanged(vendorStoreID, model.VendorIDJD, storeStatus) + } else { + // 可能在门店删除的情况下会出查不到门店的错误 + if errExt, ok := err.(*utils.ErrorWithCode); ok && errExt.IntCode() == 4 { + err = nil + } } } return jdapi.Err2CallbackResponse(err, "")