This commit is contained in:
邹宗楠
2022-06-30 17:47:22 +08:00
parent 9339f35c11
commit b4d94c7979
3 changed files with 14 additions and 5 deletions

View File

@@ -29,14 +29,16 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
if err != nil {
continue
}
fmt.Println("原价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
if fee.Code != 0 {
result[fmt.Sprintf("%d", i)] = fee
continue
}
if fee.Data.ChannelFee != 0 {
addFee := fee.Data.ChannelFee + utils.Int2Float64(param.Width*2)
fee.Data.ChannelFee = addFee
addFee := int(fee.Data.ChannelFee*100) + param.Weight*20
fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100)
result[fmt.Sprintf("%d", i)] = fee
fmt.Println("加价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
}
}
} else {
@@ -48,10 +50,13 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
// result[fmt.Sprintf("%d", param.Type)] = fee
return nil, errors.New(fee.Msg)
}
fmt.Println("原价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
if fee.Data.ChannelFee != 0 {
addFee := fee.Data.ChannelFee + utils.Int2Float64(param.Width*2)
fee.Data.ChannelFee = addFee
addFee := int(fee.Data.ChannelFee*100) + param.Weight*20
fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100)
result[fmt.Sprintf("%d", param.Type)] = fee
fmt.Println("加价:", fee.Data.TypeName, fee.Data.Type, fee.Data.ChannelFee)
}
}