添加快递渠道
This commit is contained in:
27
business/q_bida/q_bida_server.go
Normal file
27
business/q_bida/q_bida_server.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user