- handle utf8mb4 in elm and jd order.
This commit is contained in:
@@ -118,17 +118,16 @@ func (c *OrderController) getOrderInfo(orderID string) (order *model.GoodsOrder,
|
|||||||
VendorStoreID: utils.Int64ToStr(utils.MustInterface2Int64(result["shopId"])),
|
VendorStoreID: utils.Int64ToStr(utils.MustInterface2Int64(result["shopId"])),
|
||||||
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["openId"]), 0)),
|
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["openId"]), 0)),
|
||||||
StoreName: result["shopName"].(string),
|
StoreName: result["shopName"].(string),
|
||||||
ConsigneeName: result["consignee"].(string),
|
ConsigneeName: utils.FilterMb4(result["consignee"].(string)),
|
||||||
ConsigneeMobile: consigneeMobile,
|
ConsigneeMobile: consigneeMobile,
|
||||||
ConsigneeAddress: result["address"].(string),
|
ConsigneeAddress: utils.FilterMb4(result["address"].(string)),
|
||||||
BuyerComment: strings.Trim(utils.Interface2String(result["description"]), "\n\r\t "),
|
BuyerComment: utils.FilterMb4(strings.Trim(utils.Interface2String(result["description"]), "\n\r\t ")),
|
||||||
ExpectedDeliveredTime: utils.Str2TimeWithDefault(utils.Interface2String(result["deliverTime"]), utils.DefaultTimeValue),
|
ExpectedDeliveredTime: utils.Str2TimeWithDefault(utils.Interface2String(result["deliverTime"]), utils.DefaultTimeValue),
|
||||||
// 取订单的原始status,不合并消息类型(因为当前消息类型没有意义)
|
VendorStatus: utils.Interface2String(result["status"]), // 取订单的原始status,不合并消息类型(因为当前消息类型没有意义)
|
||||||
VendorStatus: utils.Interface2String(result["status"]),
|
OrderSeq: int(utils.MustInterface2Int64(result["daySn"])),
|
||||||
OrderSeq: int(utils.MustInterface2Int64(result["daySn"])),
|
OrderCreatedAt: utils.Str2Time(result["createdAt"].(string)),
|
||||||
OrderCreatedAt: utils.Str2Time(result["createdAt"].(string)),
|
OriginalData: utils.FilterMb4(string(utils.MustMarshal(result))),
|
||||||
OriginalData: string(utils.MustMarshal(result)),
|
Skus: []*model.OrderSku{},
|
||||||
Skus: []*model.OrderSku{},
|
|
||||||
}
|
}
|
||||||
deliveryGeo := strings.Split(utils.Interface2String(result["deliveryGeo"]), ",")
|
deliveryGeo := strings.Split(utils.Interface2String(result["deliveryGeo"]), ",")
|
||||||
if len(deliveryGeo) == 2 {
|
if len(deliveryGeo) == 2 {
|
||||||
|
|||||||
@@ -68,16 +68,16 @@ func (c *OrderController) getOrderInfo(msg *jdapi.CallbackOrderMsg) (order *mode
|
|||||||
VendorStoreID: result["produceStationNo"].(string),
|
VendorStoreID: result["produceStationNo"].(string),
|
||||||
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
|
StoreID: int(utils.Str2Int64WithDefault(utils.Interface2String(result["produceStationNoIsv"]), 0)),
|
||||||
StoreName: result["produceStationName"].(string),
|
StoreName: result["produceStationName"].(string),
|
||||||
ConsigneeName: result["buyerFullName"].(string),
|
ConsigneeName: utils.FilterMb4(result["buyerFullName"].(string)),
|
||||||
ConsigneeMobile: result["buyerMobile"].(string),
|
ConsigneeMobile: result["buyerMobile"].(string),
|
||||||
ConsigneeAddress: result["buyerFullAddress"].(string),
|
ConsigneeAddress: utils.FilterMb4(result["buyerFullAddress"].(string)),
|
||||||
CoordinateType: model.CoordinateTypeMars,
|
CoordinateType: model.CoordinateTypeMars,
|
||||||
BuyerComment: strings.Trim(utils.Interface2String(result["orderBuyerRemark"]), "\n\r\t "),
|
BuyerComment: utils.FilterMb4(strings.Trim(utils.Interface2String(result["orderBuyerRemark"]), "\n\r\t ")),
|
||||||
ExpectedDeliveredTime: utils.Str2TimeWithDefault(utils.Interface2String(result["orderPreEndDeliveryTime"]), utils.DefaultTimeValue),
|
ExpectedDeliveredTime: utils.Str2TimeWithDefault(utils.Interface2String(result["orderPreEndDeliveryTime"]), utils.DefaultTimeValue),
|
||||||
VendorStatus: msg.StatusID,
|
VendorStatus: msg.StatusID,
|
||||||
OrderSeq: int(utils.MustInterface2Int64(result["orderNum"])),
|
OrderSeq: int(utils.MustInterface2Int64(result["orderNum"])),
|
||||||
OrderCreatedAt: utils.Str2Time(result["orderStartTime"].(string)),
|
OrderCreatedAt: utils.Str2Time(result["orderStartTime"].(string)),
|
||||||
OriginalData: string(utils.MustMarshal(result)),
|
OriginalData: utils.FilterMb4(string(utils.MustMarshal(result))),
|
||||||
Skus: []*model.OrderSku{},
|
Skus: []*model.OrderSku{},
|
||||||
}
|
}
|
||||||
coordinateType := utils.Interface2Int64WithDefault(result["buyerCoordType"], 1)
|
coordinateType := utils.Interface2Int64WithDefault(result["buyerCoordType"], 1)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ func (o *OrderController) NewOrder(msg *elmapi.CallbackMsg, orderId string, user
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
retVal = errResponseCallELMAPIError
|
retVal = errResponseCallELMAPIError
|
||||||
} else {
|
} else {
|
||||||
rec.Data = string(utils.MustMarshal(result))
|
rec.Data = utils.FilterMb4(string(utils.MustMarshal(result)))
|
||||||
rec.Consignee = result["consignee"].(string)
|
rec.Consignee = result["consignee"].(string)
|
||||||
rec.Mobile = userMobile
|
rec.Mobile = userMobile
|
||||||
if createdAt, ok := result["createdAt"].(string); ok {
|
if createdAt, ok := result["createdAt"].(string); ok {
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ func newOrder(msg *jdapi.CallbackOrderMsg) error {
|
|||||||
rec.OrderStatusTime = resultList0["orderStatusTime"].(string)
|
rec.OrderStatusTime = resultList0["orderStatusTime"].(string)
|
||||||
|
|
||||||
resultByteArr := utils.MustMarshal(data)
|
resultByteArr := utils.MustMarshal(data)
|
||||||
rec.Data = string(resultByteArr)
|
rec.Data = utils.FilterMb4(string(resultByteArr))
|
||||||
rec.Data4Json = data
|
rec.Data4Json = data
|
||||||
userMobile = resultList0["buyerMobile"].(string)
|
userMobile = resultList0["buyerMobile"].(string)
|
||||||
err = utils.CallFuncLogError(func() error {
|
err = utils.CallFuncLogError(func() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user