1
This commit is contained in:
@@ -71,12 +71,7 @@ func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
||||
if shopInfo.ShopLat <= 9999999 {
|
||||
shopInfo.ShopLat *= 10
|
||||
}
|
||||
// 获取品牌名称
|
||||
brandInfo, err := dao.GetBrands(dao.GetDB(), "", storeDetail.BrandID, "", false, "")
|
||||
if err != nil {
|
||||
return "", -1, err
|
||||
}
|
||||
shopInfo.ShopName = brandInfo[0].Name + "-" + storeDetail.Name
|
||||
|
||||
if globals.EnableStoreWrite {
|
||||
shopStatus, err = api.MtpsAPI.ShopCreate(shopInfo)
|
||||
if err == nil {
|
||||
@@ -187,3 +182,13 @@ func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// 美团配送,修改门店名称
|
||||
func UpdateStoreName(storeId, name string) (err error) {
|
||||
shopInfo := &mtpsapi.ShopInfo{
|
||||
ShopID: storeId,
|
||||
ShopName: name,
|
||||
}
|
||||
_, err = api.MtpsAPI.ShopUpdate(shopInfo)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -86,6 +86,17 @@ func (c *DeliveryHandler) OnWaybillExcept(msg *mtpsapi.CallbackOrderExceptionMsg
|
||||
|
||||
func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *mtpsapi.CallbackResponse) {
|
||||
order := c.callbackMsg2Waybill(msg)
|
||||
// 多次取消,只处理第一次
|
||||
if msg.Status == mtpsapi.OrderStatusCanceled {
|
||||
bill, err := partner.CurOrderManager.LoadWaybill(msg.MtPeisongID, model.VendorIDMTPS)
|
||||
if err != nil {
|
||||
return mtpsapi.Err2CallbackResponse(err, fmt.Sprintf("%s", "获取订单状态错误"))
|
||||
}
|
||||
if bill.Status == model.OrderStatusCanceled {
|
||||
return mtpsapi.SuccessResponse
|
||||
}
|
||||
}
|
||||
|
||||
switch msg.Status {
|
||||
case mtpsapi.OrderStatusWaitingForSchedule:
|
||||
data, err := api.MtpsAPI.QueryOrderStatus(msg.DeliveryID, msg.MtPeisongID)
|
||||
|
||||
Reference in New Issue
Block a user