美团poi/save在保存门店状态无效时,并不会报错,改用UpdateStoreStatus统一处理
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user