添加快递渠道

This commit is contained in:
邹宗楠
2022-06-24 17:33:26 +08:00
parent 24be6bcab3
commit 09fd5e8762
6 changed files with 112 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
package q_bida
import (
"errors"
bida "git.rosy.net.cn/baseapi/platformapi/q_bida"
"git.rosy.net.cn/jx-callback/globals/api"
)
func QueryExpressPrice(param *bida.GetExpressPriceReq) ([]*bida.GetExpressPriceData, error) {
if param.Weight <= 0 {
return nil, errors.New("物品重量必须大于0")
}
fee, err := api.QBiDaAPI.GetExpressPrice(param)
if err != nil {
return nil, err
}
// 渠道费每公斤加价两毛
for _, v := range fee {
if v.ChannelFee != 0 {
addFee := v.ChannelFee + int64(param.Width*2)
v.ChannelFee = addFee
}
}
return fee, nil
}