Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -3,9 +3,11 @@ package sfps
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
|
||||
@@ -201,6 +203,7 @@ func (d DeliveryHandler) CancelWaybill(bill *model.Waybill, cancelReasonID int,
|
||||
func (d DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo *partner.WaybillFeeInfo, err error) {
|
||||
var (
|
||||
weight int
|
||||
param *sfps2.PreCreateOrderReq
|
||||
)
|
||||
|
||||
// 默认重量
|
||||
@@ -214,8 +217,20 @@ func (d DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
param := &sfps2.PreCreateOrderReq{
|
||||
ShopId: sfps2.SFShopStoreID,
|
||||
// 城市维度获取顺丰门店id
|
||||
if len(store.CityName) > 0 {
|
||||
for k, v := range sfps2.SFCityStoreIDs {
|
||||
if strings.Contains(k, store.CityName) {
|
||||
param.ShopId = v
|
||||
} else {
|
||||
return nil, errors.New("此城市暂时不在顺丰配送业务范围")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return nil, errors.New("门店不允许没有城市名,请检查门店信息")
|
||||
}
|
||||
param = &sfps2.PreCreateOrderReq{
|
||||
//ShopId: sfps2.SFShopStoreID,
|
||||
UserLng: utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLng)),
|
||||
UserLat: utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLat)),
|
||||
UserAddress: order.ConsigneeAddress,
|
||||
|
||||
Reference in New Issue
Block a user