diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 781ab548c..1482bed54 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -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) } } diff --git a/business/q_bida/q_bida_server_utils.go b/business/q_bida/q_bida_server_utils.go index b3c14f055..a11793560 100644 --- a/business/q_bida/q_bida_server_utils.go +++ b/business/q_bida/q_bida_server_utils.go @@ -27,6 +27,7 @@ func checkWayFeeIsTrue(param *model.MakeOrderParamReq) error { if err != nil { 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 { return errors.New("价格核算错误,价格不匹配") } diff --git a/controllers/q_bida.go b/controllers/q_bida.go index 3e4dcc732..a9218e1af 100644 --- a/controllers/q_bida.go +++ b/controllers/q_bida.go @@ -48,6 +48,9 @@ func (c *QBiDaExpressController) QueryExpressPrice() { SendPhone: params.SendPhone, } result, err := bidaServer.QueryExpressPrice(param) + for _, v := range result { + fmt.Println(v.Data.TypeName, v.Data.Type, v.Data.ChannelFee) + } return result, "", err }) } @@ -73,7 +76,7 @@ func (c *QBiDaExpressController) QueryExpressPrice() { // @Param senderAddress formData string true "寄件人地址" // @Param senderName formData string true "寄件人姓名" // @Param senderPhone formData string true "寄件人手机号" -// @Param thirdPlatform formData int true "第三方平台" +// @Param thirdPlatform formData int false "第三方平台" // @Param type formData int true "快递公司" // @Param receiveAddressId formData int64 true "收件人地址Id" // @Param senderAddressId formData int64 true "寄件人地址Id"