1
This commit is contained in:
@@ -29,14 +29,16 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
fmt.Println("原价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
|
||||||
if fee.Code != 0 {
|
if fee.Code != 0 {
|
||||||
result[fmt.Sprintf("%d", i)] = fee
|
result[fmt.Sprintf("%d", i)] = fee
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if fee.Data.ChannelFee != 0 {
|
if fee.Data.ChannelFee != 0 {
|
||||||
addFee := fee.Data.ChannelFee + utils.Int2Float64(param.Width*2)
|
addFee := int(fee.Data.ChannelFee*100) + param.Weight*20
|
||||||
fee.Data.ChannelFee = addFee
|
fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100)
|
||||||
result[fmt.Sprintf("%d", i)] = fee
|
result[fmt.Sprintf("%d", i)] = fee
|
||||||
|
fmt.Println("加价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -48,10 +50,13 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
|
|||||||
// result[fmt.Sprintf("%d", param.Type)] = fee
|
// result[fmt.Sprintf("%d", param.Type)] = fee
|
||||||
return nil, errors.New(fee.Msg)
|
return nil, errors.New(fee.Msg)
|
||||||
}
|
}
|
||||||
|
fmt.Println("原价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
|
||||||
|
|
||||||
if fee.Data.ChannelFee != 0 {
|
if fee.Data.ChannelFee != 0 {
|
||||||
addFee := fee.Data.ChannelFee + utils.Int2Float64(param.Width*2)
|
addFee := int(fee.Data.ChannelFee*100) + param.Weight*20
|
||||||
fee.Data.ChannelFee = addFee
|
fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100)
|
||||||
result[fmt.Sprintf("%d", param.Type)] = fee
|
result[fmt.Sprintf("%d", param.Type)] = fee
|
||||||
|
fmt.Println("加价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ func checkWayFeeIsTrue(param *model.MakeOrderParamReq) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
fmt.Println(orderWayFee[fmt.Sprintf("%d", param.Type)].Data.TypeName, orderWayFee[fmt.Sprintf("%d", param.Type)].Data.Type, orderWayFee[fmt.Sprintf("%d", param.Type)].Data.ChannelFee)
|
||||||
if fee, ok := orderWayFee[fmt.Sprintf("%d", param.Type)]; !ok || fee.Code != 0 || fee.Data.ChannelFee != param.ChannelFee {
|
if fee, ok := orderWayFee[fmt.Sprintf("%d", param.Type)]; !ok || fee.Code != 0 || fee.Data.ChannelFee != param.ChannelFee {
|
||||||
return errors.New("价格核算错误,价格不匹配")
|
return errors.New("价格核算错误,价格不匹配")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ func (c *QBiDaExpressController) QueryExpressPrice() {
|
|||||||
SendPhone: params.SendPhone,
|
SendPhone: params.SendPhone,
|
||||||
}
|
}
|
||||||
result, err := bidaServer.QueryExpressPrice(param)
|
result, err := bidaServer.QueryExpressPrice(param)
|
||||||
|
for _, v := range result {
|
||||||
|
fmt.Println(v.Data.TypeName, v.Data.Type, v.Data.ChannelFee)
|
||||||
|
}
|
||||||
return result, "", err
|
return result, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -73,7 +76,7 @@ func (c *QBiDaExpressController) QueryExpressPrice() {
|
|||||||
// @Param senderAddress formData string true "寄件人地址"
|
// @Param senderAddress formData string true "寄件人地址"
|
||||||
// @Param senderName formData string true "寄件人姓名"
|
// @Param senderName formData string true "寄件人姓名"
|
||||||
// @Param senderPhone formData string true "寄件人手机号"
|
// @Param senderPhone formData string true "寄件人手机号"
|
||||||
// @Param thirdPlatform formData int true "第三方平台"
|
// @Param thirdPlatform formData int false "第三方平台"
|
||||||
// @Param type formData int true "快递公司"
|
// @Param type formData int true "快递公司"
|
||||||
// @Param receiveAddressId formData int64 true "收件人地址Id"
|
// @Param receiveAddressId formData int64 true "收件人地址Id"
|
||||||
// @Param senderAddressId formData int64 true "寄件人地址Id"
|
// @Param senderAddressId formData int64 true "寄件人地址Id"
|
||||||
|
|||||||
Reference in New Issue
Block a user