- don't call FilterMb4 when saving order, instead call FilterMb4 when create waybill.

This commit is contained in:
gazebo
2018-10-31 11:53:35 +08:00
parent f0cd9aee08
commit 0e09f42468
6 changed files with 19 additions and 20 deletions

View File

@@ -211,8 +211,8 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, policy func(del
billParams := &mtpsapi.CreateOrderByShopParam{
OrderID: jxutils.ComposeUniversalOrderID(order.VendorOrderID, order.VendorID),
DeliveryServiceCode: mtpsapi.DeliveryServiceCodeRapid,
ReceiverName: order.ConsigneeName,
ReceiverAddress: order.ConsigneeAddress,
ReceiverName: utils.FilterMb4(order.ConsigneeName),
ReceiverAddress: utils.FilterMb4(order.ConsigneeAddress),
ReceiverPhone: order.ConsigneeMobile,
CoordinateType: model.CoordinateTypeMars,
ReceiverLng: jxutils.StandardCoordinate2Int(lngFloat),
@@ -243,7 +243,7 @@ func (c *DeliveryHandler) CreateWaybill(order *model.GoodsOrder, policy func(del
item.GoodCount += goodItem.GoodCount
}
}
addParams := utils.Params2Map("note", order.BuyerComment, "goods_detail", string(utils.MustMarshal(goods)), "poi_seq", fmt.Sprintf("#%d", order.OrderSeq))
addParams := utils.Params2Map("note", utils.FilterMb4(order.BuyerComment), "goods_detail", string(utils.MustMarshal(goods)), "poi_seq", fmt.Sprintf("#%d", order.OrderSeq))
result, err2 := api.MtpsAPI.CreateOrderByShop(billParams, addParams)
if err = err2; err != nil {
globals.SugarLogger.Debugf("CreateWaybill failed, orderID:%s, billParams:%v, addParams:%v, error:%v", order.VendorOrderID, billParams, addParams, err)