- 忽略在jd storeCrud消息时找不到门店的错误
This commit is contained in:
@@ -63,7 +63,7 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if storeKV != nil {
|
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 := &model.Store{}
|
||||||
store.ID = storeDetail.Store.ID
|
store.ID = storeDetail.Store.ID
|
||||||
if err = utils.CallFuncLogError(func() error {
|
if err = utils.CallFuncLogError(func() error {
|
||||||
@@ -74,7 +74,7 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if storeMapKV != nil {
|
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 {
|
if err = utils.CallFuncLogError(func() error {
|
||||||
_, err = dao.UpdateEntityLogically(db, &model.StoreMap{}, storeMapKV, model.AdminName, map[string]interface{}{
|
_, err = dao.UpdateEntityLogically(db, &model.StoreMap{}, storeMapKV, model.AdminName, map[string]interface{}{
|
||||||
model.FieldStoreID: storeDetail.Store.ID,
|
model.FieldStoreID: storeDetail.Store.ID,
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorStoreID s
|
|||||||
return storeStatus, err
|
return storeStatus, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前京东的storeCrud消息不会在门店状态改变时发送,所以意义不大,先放在这里
|
||||||
func (c *PurchaseHandler) onStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) {
|
func (c *PurchaseHandler) onStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) {
|
||||||
var err error
|
var err error
|
||||||
if msg.StatusID == jdapi.StatusIDUpdateStore {
|
if msg.StatusID == jdapi.StatusIDUpdateStore {
|
||||||
@@ -308,6 +309,11 @@ func (c *PurchaseHandler) onStoreMsg(msg *jdapi.CallbackOrderMsg) (response *jda
|
|||||||
vendorStoreID := msg.BillID
|
vendorStoreID := msg.BillID
|
||||||
if storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, vendorStoreID); err == nil {
|
if storeStatus, err = c.GetStoreStatus(jxcontext.AdminCtx, vendorStoreID); err == nil {
|
||||||
err = partner.CurStoreManager.OnStoreStatusChanged(vendorStoreID, model.VendorIDJD, storeStatus)
|
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, "")
|
return jdapi.Err2CallbackResponse(err, "")
|
||||||
|
|||||||
Reference in New Issue
Block a user