This commit is contained in:
苏尹岚
2021-02-23 16:06:15 +08:00
parent cdbb242778
commit d2c1998dc8
5 changed files with 41 additions and 15 deletions

View File

@@ -18,10 +18,12 @@ const (
var (
auditStatusMap = map[int]int{
mtpsapi.ShopStatusAuditCreated: model.StoreAuditStatusCreated,
mtpsapi.ShopStatusAuditRejected: model.StoreAuditStatusRejected,
mtpsapi.ShopStatusAuditPassed: model.StoreAuditStatusCreated,
mtpsapi.ShopStatusAuditOnline: model.StoreAuditStatusOnline,
mtpsapi.ShopStatusAuditCreated: model.StoreAuditStatusCreated,
mtpsapi.ShopStatusAuditRejected: model.StoreAuditStatusRejected,
mtpsapi.ShopStatusAuditPassed: model.StoreAuditStatusCreated,
mtpsapi.ShopStatusAuditOnline: model.StoreAuditStatusOnline,
mtpsapi.ShopStatusAuditUpdatePassed: model.StoreAuditStatusUpdated,
mtpsapi.ShopStatusAuditUpdateRejected: model.StoreAuditStatusRejected,
}
)
@@ -38,7 +40,7 @@ func OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (retVal *mtpsapi.Callback
func (c *DeliveryHandler) OnStoreStatus(msg *mtpsapi.CallbackShopStatusMsg) (retVal *mtpsapi.CallbackResponse) {
globals.SugarLogger.Debugf("mtps OnStoreStatus, msg:%s", utils.Format4Output(msg, true))
err := partner.CurStoreManager.OnCourierStoreStatusChanged(jxcontext.AdminCtx, msg.ShopID, model.VendorIDMTPS, getAuditStatus(msg.Status))
err := partner.CurStoreManager.OnCourierStoreStatusChanged(jxcontext.AdminCtx, msg.ShopID, model.VendorIDMTPS, getAuditStatus(msg.Status), msg.RejectMessage)
retVal = mtpsapi.Err2CallbackResponse(err, "mtps OnStoreStatus")
return retVal
}
@@ -134,8 +136,17 @@ func (c *DeliveryHandler) IsErrStoreExist(err error) bool {
}
func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (err error) {
// if globals.EnableStoreWrite {
// err = api.MtpsAPI.PagePoiUpdate(storeDetail.VendorStoreID, storeDetail.PayeeName, storeDetail.Tel1, fakeContactEmail)
// }
if globals.EnableStoreWrite {
// err = api.MtpsAPI.PagePoiUpdate(storeDetail.VendorStoreID, storeDetail.PayeeName, storeDetail.Tel1, fakeContactEmail)
shopInfo := &mtpsapi.ShopInfo{
ShopID: utils.Int2Str(storeDetail.ID),
ContactName: storeDetail.PayeeName,
ContactPhone: storeDetail.Tel1,
ShopAddress: storeDetail.Address,
ShopLat: storeDetail.Lat,
ShopLng: storeDetail.Lng,
}
_, err = api.MtpsAPI.ShopUpdate(shopInfo)
}
return err
}