This commit is contained in:
richboo111
2023-08-09 10:35:10 +08:00
parent e828320575
commit 33aba471ef

View File

@@ -93,14 +93,27 @@ func (d DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee i
var (
weight int
productDetail []*sfps2.ProductDetail
param = &sfps2.CreateOrderReq{}
)
if order.Weight >= 49500 || order.Weight <= model.NO {
weight = 49500
} else {
weight = order.Weight
}
param := &sfps2.CreateOrderReq{
// 城市维度获取顺丰门店id
if len(store.CityName) > 0 {
globals.SugarLogger.Debugf("sfps CreateWaybill store.CityName==%s", store.CityName)
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.CreateOrderReq{
ShopId: sfps2.SFShopStoreID,
ShopOrderId: order.VendorOrderID,
OrderSource: GetVendorSource(order.VendorID),
@@ -219,6 +232,7 @@ func (d DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo
}
// 城市维度获取顺丰门店id
if len(store.CityName) > 0 {
globals.SugarLogger.Debugf("sfps GetWaybillFee store.CityName==%s", store.CityName)
for k, v := range sfps2.SFCityStoreIDs {
if strings.Contains(k, store.CityName) {
param.ShopId = v