- Interface2FloatWithDefault to Interface2Float64WithDefault

This commit is contained in:
gazebo
2019-04-02 14:33:31 +08:00
parent 38b32cc10d
commit c5d1eb78c5
6 changed files with 11 additions and 11 deletions

View File

@@ -112,8 +112,8 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
}
deliveryGeo := userMap["coord"].(map[string]interface{})
originalLng := utils.Interface2FloatWithDefault(deliveryGeo["longitude"], 0.0) // 饿百的订单在过一段时间后,经纬度信息会变成字符串"**"
originalLat := utils.Interface2FloatWithDefault(deliveryGeo["latitude"], 0.0)
originalLng := utils.Interface2Float64WithDefault(deliveryGeo["longitude"], 0.0) // 饿百的订单在过一段时间后,经纬度信息会变成字符串"**"
originalLat := utils.Interface2Float64WithDefault(deliveryGeo["latitude"], 0.0)
lng, lat, err2 := api.AutonaviAPI.CoordinateConvert(originalLng, originalLat, autonavi.CoordSysBaidu)
if err2 == nil {
originalLng = lng

View File

@@ -184,7 +184,7 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
VendorSkuID: utils.Int64ToStr(utils.Interface2Int64WithDefault(product["vfoodId"], 0)),
SkuName: product["name"].(string),
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])),
Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))),
Weight: int(math.Round(utils.Interface2Float64WithDefault(product["weight"], 0.0))),
}
if sku.VendorSkuID == "0" {
sku.VendorSkuID = utils.Int64ToStr(utils.MustInterface2Int64(product["id"])) // 2018-09-28日饿了么迁移到饿百后这个字段发生了变化

View File

@@ -24,8 +24,8 @@ func (c *PurchaseHandler) onWaybillStatusMsg(msg *elmapi.CallbackWaybillStatusMs
order.Status = model.WaybillStatusNew
} else if msg.MsgType == elmapi.MsgTypeWaybillPickingUp {
if result, err := api.ElmAPI.GetOrder(msg.OrderID); err == nil {
order.DesiredFee = jxutils.StandardPrice2Int(utils.Interface2FloatWithDefault(result["deliverFee"], 0.0) +
utils.Interface2FloatWithDefault(result["vipDeliveryFeeDiscount"], 0.0))
order.DesiredFee = jxutils.StandardPrice2Int(utils.Interface2Float64WithDefault(result["deliverFee"], 0.0) +
utils.Interface2Float64WithDefault(result["vipDeliveryFeeDiscount"], 0.0))
}
order.Status = model.WaybillStatusAccepted
} else if msg.MsgType == elmapi.MsgTypeWaybillCourierArrived {