- move some funcs from controller to jxutils.
This commit is contained in:
@@ -32,7 +32,7 @@ func (c *WaybillController) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dada
|
||||
order.Status = model.WaybillStatusNew
|
||||
case dadaapi.OrderStatusAccepted:
|
||||
if result, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
|
||||
order.DesiredFee = controller.StandardPrice2Int(utils.Interface2FloatWithDefault(result["deliveryFee"], 0.0))
|
||||
order.DesiredFee = jxutils.StandardPrice2Int(utils.Interface2FloatWithDefault(result["deliveryFee"], 0.0))
|
||||
}
|
||||
order.Status = model.WaybillStatusAccepted
|
||||
case dadaapi.OrderStatusDelivering:
|
||||
@@ -70,14 +70,14 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
|
||||
billParams := &dadaapi.OperateOrderRequiredParams{
|
||||
ShopNo: utils.Int2Str(order.StoreID), // 当前达达的门店号与京西是一样的
|
||||
OriginID: jxutils.ComposeUniversalOrderID(order.VendorOrderID, order.VendorID),
|
||||
CargoPrice: controller.IntPrice2Standard(order.SalePrice),
|
||||
CargoPrice: jxutils.IntPrice2Standard(order.SalePrice),
|
||||
IsPrepay: 0,
|
||||
ReceiverName: order.ConsigneeName,
|
||||
ReceiverAddress: order.ConsigneeAddress,
|
||||
ReceiverPhone: order.ConsigneeMobile,
|
||||
}
|
||||
if billParams.CityCode, err = controller.GetDataCityCodeFromOrder(order); err == nil {
|
||||
billParams.ReceiverLng, billParams.ReceiverLat, _ = controller.IntCoordinate2MarsStandard(order.ConsigneeLng, order.ConsigneeLat, order.CoordinateType)
|
||||
billParams.ReceiverLng, billParams.ReceiverLat, _ = jxutils.IntCoordinate2MarsStandard(order.ConsigneeLng, order.ConsigneeLat, order.CoordinateType)
|
||||
addParams := map[string]interface{}{
|
||||
"info": order.BuyerComment,
|
||||
"origin_mark": model.VendorNames[order.VendorID],
|
||||
|
||||
Reference in New Issue
Block a user