- WaybillStatusFailed也会重新创建三方运单

- dadaapi.OrderStatusExpired映射为WaybillStatusCanceled(之前为WaybillStatusFailed)
- 达达重新创建运单时,判断之前的运单状态,如果是WaybillStatusFailed,则为新增订单
- 去掉dao. WrapDB
This commit is contained in:
gazebo
2019-04-27 10:58:19 +08:00
parent 3b2a5d9b1c
commit beb6482a1a
7 changed files with 29 additions and 53 deletions

View File

@@ -12,7 +12,6 @@ import (
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego/orm"
)
const (
@@ -57,10 +56,10 @@ func CallCreateWaybillPolicy(policy partner.CreateWaybillPolicy, refDeliveryFee,
return nil
}
func CalculateOrderDeliveryFee(order *model.GoodsOrder, billTime time.Time, db orm.Ormer) (deliveryFee, addFee int64, err error) {
func CalculateOrderDeliveryFee(order *model.GoodsOrder, billTime time.Time, db *dao.DaoDB) (deliveryFee, addFee int64, err error) {
globals.SugarLogger.Debugf("CalculateOrderDeliveryFee orderID:%s", order.VendorOrderID)
if db == nil {
db = orm.NewOrm()
db = dao.GetDB()
}
jxStoreID := jxutils.GetSaleStoreIDFromOrder(order)
var lng, lat float64
@@ -69,8 +68,7 @@ func CalculateOrderDeliveryFee(order *model.GoodsOrder, billTime time.Time, db o
Lng int
Lat int
}{}
db2 := dao.WrapDB(db)
if err = dao.GetRow(db2, priceInfo, `
if err = dao.GetRow(db, priceInfo, `
SELECT t2.mtps_price price, t1.lng, t1.lat
FROM store t1
JOIN place t2 ON t1.city_code = t2.code