This commit is contained in:
richboo111
2023-01-14 09:55:15 +08:00
parent a134b95fd0
commit b09025c0c3
2 changed files with 9 additions and 17 deletions

View File

@@ -43,19 +43,18 @@ func init() {
//计算运单价格 //计算运单价格
func TestGetWaybillPrice(t *testing.T) { func TestGetWaybillPrice(t *testing.T) {
param := &GetOrderPriceReq{ param := &GetOrderPriceReq{
OriginID: "T00001", OriginID: "T20230114M",
FromAddress: "郑州国际会展中心", FromAddress: "万科加州湾V派",
ToAddress: "商务外环路17号", ToAddress: "嘉华酒店",
CityName: "郑州市", CityName: "成都市",
SendType: "0", SendType: "0",
ToLat: "34.784275", ToLat: "30.691134",
ToLng: "113.736445", ToLng: "104.042307",
FromLat: "34.778494", FromLat: "30.693001",
FromLng: "113.736858", FromLng: "104.04546",
} }
price := utils.Struct2Map(param, "", false) price := utils.Struct2Map(param, "", false)
needPayMoney, priceToken, err := api.GetOrderPrice(price) needPayMoney, priceToken, err := api.GetOrderPrice(price)
fmt.Println(needPayMoney, priceToken, err) fmt.Println(needPayMoney, priceToken, err)
} }

View File

@@ -55,16 +55,9 @@ func (a *API) signParam(params map[string]interface{}) (sign string) {
for k, v := range params { for k, v := range params {
if k != signKey { if k != signKey {
temp := fmt.Sprint(v) temp := fmt.Sprint(v)
if k == "goods_weight" && temp == "0" { if (k == "goods_weight" || k == "shop_id" || k == "goods_price") && temp == "0" {
continue continue
} }
if k == "shop_id" && temp == "0" {
continue
}
if k == "goods_price" && temp == "0" {
continue
}
if temp != "" { if temp != "" {
keyValues = append(keyValues, k+"="+temp) keyValues = append(keyValues, k+"="+temp)
} }