From 0ec61089fc1ee2fd58860de6438ee92986e5d3e7 Mon Sep 17 00:00:00 2001 From: jsowell <123@jsowell.com> Date: Wed, 24 Jun 2026 14:39:02 +0800 Subject: [PATCH] =?UTF-8?q?update=20qcyun=E5=81=9C=E8=BD=A6=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/domain/ThirdpartyParkingConfig.java | 22 ++- .../mapper/ThirdpartyParkingConfigMapper.java | 10 +- .../ThirdPartyParkingConfigService.java | 8 + .../ThirdPartyParkingConfigServiceImpl.java | 5 + .../pile/ThirdpartyParkingConfigMapper.xml | 81 ++++++++- .../thirdparty/common/CommonService.java | 4 +- .../common/bean/QcyunParkCouponDTO.java | 10 ++ .../parking/service/QcyunsService.java | 3 +- .../service/impl/QcyunsServiceImpl.java | 159 ++++++++++++++---- 9 files changed, 260 insertions(+), 42 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdpartyParkingConfig.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdpartyParkingConfig.java index f4df68cd7..345d658e7 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdpartyParkingConfig.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdpartyParkingConfig.java @@ -26,6 +26,11 @@ public class ThirdpartyParkingConfig { */ private String parkingName; + /** + * 停车平台类型(1-路通云停;2-软杰;3-qcyun) + */ + private String platformType; + /** * 停车场库appId */ @@ -46,6 +51,21 @@ public class ThirdpartyParkingConfig { */ private String couponId; + /** + * qcyun机构ID + */ + private String orgId; + + /** + * qcyun车场ID + */ + private String parkId; + + /** + * 平台接口地址 + */ + private String apiUrl; + private Date createTime; private String createBy; @@ -58,4 +78,4 @@ public class ThirdpartyParkingConfig { * 删除标识(0-正常;1-删除) */ private String delFlag; -} \ No newline at end of file +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdpartyParkingConfigMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdpartyParkingConfigMapper.java index a3d6f5a1c..6f9005412 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdpartyParkingConfigMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdpartyParkingConfigMapper.java @@ -61,4 +61,12 @@ public interface ThirdpartyParkingConfigMapper { * @return */ List selectInfoList(); -} \ No newline at end of file + + /** + * 根据站点查询绑定的停车平台配置 + * + * @param stationId 站点id + * @return 停车平台配置 + */ + ThirdpartyParkingConfig selectByStationId(String stationId); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyParkingConfigService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyParkingConfigService.java index 4d3b57bd2..7a1a9f5e0 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyParkingConfigService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyParkingConfigService.java @@ -57,4 +57,12 @@ public interface ThirdPartyParkingConfigService { * 查询基本信息列表(调用时需分页) */ List selectInfoList(); + + /** + * 根据站点查询绑定的停车平台配置 + * + * @param stationId 站点id + * @return 停车平台配置 + */ + ThirdpartyParkingConfig selectByStationId(String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyParkingConfigServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyParkingConfigServiceImpl.java index b5b6ad5e7..dd57e476a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyParkingConfigServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyParkingConfigServiceImpl.java @@ -59,4 +59,9 @@ public class ThirdPartyParkingConfigServiceImpl implements ThirdPartyParkingConf return thirdpartyParkingConfigMapper.selectInfoList(); } + @Override + public ThirdpartyParkingConfig selectByStationId(String stationId) { + return thirdpartyParkingConfigMapper.selectByStationId(stationId); + } + } diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdpartyParkingConfigMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdpartyParkingConfigMapper.xml index 0784489dd..a45fcd681 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ThirdpartyParkingConfigMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdpartyParkingConfigMapper.xml @@ -6,10 +6,14 @@ + + + + @@ -21,10 +25,14 @@ id, parking_name, + platform_type, app_id, secret_key, parking_merchant_id, coupon_id, + org_id, + park_id, + api_url, create_time, create_by, update_time, @@ -49,12 +57,13 @@ - insert into thirdparty_parking_config (id, parking_name, app_id, - secret_key, parking_merchant_id, coupon_id, + insert into thirdparty_parking_config (id, parking_name, platform_type, app_id, + secret_key, parking_merchant_id, coupon_id, org_id, park_id, api_url, create_time, create_by, update_time, update_by, del_flag) - values (#{id,jdbcType=INTEGER}, #{parkingName,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, + values (#{id,jdbcType=INTEGER}, #{parkingName,jdbcType=VARCHAR}, #{platformType,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{secretKey,jdbcType=VARCHAR}, #{parkingMerchantId,jdbcType=VARCHAR}, #{couponId,jdbcType=VARCHAR}, + #{orgId,jdbcType=VARCHAR}, #{parkId,jdbcType=VARCHAR}, #{apiUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR}) @@ -69,6 +78,9 @@ parking_name, + + platform_type, + app_id, @@ -81,6 +93,15 @@ coupon_id, + + org_id, + + + park_id, + + + api_url, + create_time, @@ -104,6 +125,9 @@ #{parkingName,jdbcType=VARCHAR}, + + #{platformType,jdbcType=VARCHAR}, + #{appId,jdbcType=VARCHAR}, @@ -116,6 +140,15 @@ #{couponId,jdbcType=VARCHAR}, + + #{orgId,jdbcType=VARCHAR}, + + + #{parkId,jdbcType=VARCHAR}, + + + #{apiUrl,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, @@ -141,6 +174,9 @@ parking_name = #{parkingName,jdbcType=VARCHAR}, + + platform_type = #{platformType,jdbcType=VARCHAR}, + app_id = #{appId,jdbcType=VARCHAR}, @@ -153,6 +189,15 @@ coupon_id = #{couponId,jdbcType=VARCHAR}, + + org_id = #{orgId,jdbcType=VARCHAR}, + + + park_id = #{parkId,jdbcType=VARCHAR}, + + + api_url = #{apiUrl,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, @@ -176,10 +221,14 @@ update thirdparty_parking_config set parking_name = #{parkingName,jdbcType=VARCHAR}, + platform_type = #{platformType,jdbcType=VARCHAR}, app_id = #{appId,jdbcType=VARCHAR}, secret_key = #{secretKey,jdbcType=VARCHAR}, parking_merchant_id = #{parkingMerchantId,jdbcType=VARCHAR}, coupon_id = #{couponId,jdbcType=VARCHAR}, + org_id = #{orgId,jdbcType=VARCHAR}, + park_id = #{parkId,jdbcType=VARCHAR}, + api_url = #{apiUrl,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, create_by = #{createBy,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, @@ -193,4 +242,28 @@ from thirdparty_parking_config - \ No newline at end of file + + + diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java index ee9db7d3a..c3f4a96b2 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java @@ -822,7 +822,9 @@ public class CommonService { QcyunParkCouponDTO dto = QcyunParkCouponDTO.builder() .plateNumber(orderBasicInfo.getPlateNumber()) .stationId(orderBasicInfo.getStationId()) - .stationName("深圳停车场") + .grantSerial(orderBasicInfo.getOrderCode()) + .discountType(chargeParkingDiscount.getDiscountType()) + .discountValue(chargeParkingDiscount.getDiscountValue()) .build(); discountFlag = qcyunsService.issuanceOfParkingTickets(dto); } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/common/bean/QcyunParkCouponDTO.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/common/bean/QcyunParkCouponDTO.java index 13f701c36..118617488 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/common/bean/QcyunParkCouponDTO.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/common/bean/QcyunParkCouponDTO.java @@ -33,4 +33,14 @@ public class QcyunParkCouponDTO { // 停车流水, 标识具体某次停车事件, 需保证该停车场下唯一 private String parkingSerial; + + /** + * 优惠类型(1-减时间单位分钟; 2-减金额单位元) + */ + private Integer discountType; + + /** + * 优惠值 + */ + private String discountValue; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/QcyunsService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/QcyunsService.java index 96848240d..7e5dce3a4 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/QcyunsService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/QcyunsService.java @@ -9,8 +9,7 @@ public interface QcyunsService { /** * 发放停车券 - * dto中只需要传入车牌号, 其他参数取配置文件中的参数 - * 现在只有一家车场, parkId在配置文件中, 以后多家车场改为数据库配置 + * dto中需要传入车牌号、站点id和优惠配置,停车场鉴权参数根据站点绑定配置查询 * @return true: 发放成功, false: 失败 */ boolean issuanceOfParkingTickets(QcyunParkCouponDTO dto); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/impl/QcyunsServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/impl/QcyunsServiceImpl.java index 0d00ee7f0..d9b9dfa09 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/impl/QcyunsServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/parking/service/impl/QcyunsServiceImpl.java @@ -6,18 +6,24 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.google.common.collect.Maps; import com.jsowell.common.core.domain.parking.ParkingCommonParam; +import com.jsowell.common.enums.parkplatform.ParkingPlatformEnum; import com.jsowell.common.util.ParkingUtil; import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.id.UUID; +import com.jsowell.pile.domain.ThirdpartyParkingConfig; +import com.jsowell.pile.service.ThirdPartyParkingConfigService; import com.jsowell.thirdparty.parking.common.ServiceApiCmd; import com.jsowell.thirdparty.parking.common.bean.QcyunParkCouponDTO; import com.jsowell.thirdparty.parking.common.bean.TempCarInfo; import com.jsowell.thirdparty.parking.common.response.DataResponse; import com.jsowell.thirdparty.parking.service.QcyunsService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.Map; /** @@ -27,28 +33,36 @@ import java.util.Map; @Service public class QcyunsServiceImpl implements QcyunsService { - @Value("${parking.qcyuns.url}") - private String URL; + private static final String QCYUN_DISCOUNT_TYPE_AMOUNT = "1"; - @Value("${parking.qcyuns.secretKey}") - private String secretKey; + private static final String QCYUN_DISCOUNT_TYPE_TIME = "2"; - @Value("${parking.qcyuns.parkId}") - private String parkId; + private static final Integer DISCOUNT_TYPE_TIME = 1; - @Value("${parking.qcyuns.orgId}") - private String orgId; + private static final Integer DISCOUNT_TYPE_AMOUNT = 2; + + @Value("${parking.qcyuns.url:}") + private String defaultUrl; + + @Autowired + private ThirdPartyParkingConfigService thirdPartyParkingConfigService; /** * 发放停车券 - * dto中只需要传入车牌号, 其他参数取配置文件中的参数 - * 现在只有一家车场, parkId在配置文件中, 以后多家车场改为数据库配置 + * 根据站点绑定的停车场配置动态获取parkId/orgId/secretKey */ @Override public boolean issuanceOfParkingTickets(QcyunParkCouponDTO dto) { - dto.setParkId(parkId); + ThirdpartyParkingConfig parkingConfig = resolveParkingConfig(dto); + if (parkingConfig == null) { + return false; + } + dto.setParkId(parkingConfig.getParkId()); + if (StringUtils.isBlank(dto.getGrantSerial())) { + dto.setGrantSerial(UUID.randomUUID().toString()); + } // 1. 查询车辆信息 - String carInfo = getCarInfo(dto); + String carInfo = getCarInfo(dto, parkingConfig); if (StringUtils.isBlank(carInfo)) { return false; } @@ -60,18 +74,48 @@ public class QcyunsServiceImpl implements QcyunsService { } dto.setParkingSerial(String.valueOf(tempCarInfo.getRecordId())); // 2. 创建停车券 - boolean discountCoupon = createDiscountCoupon(dto); + boolean discountCoupon = createDiscountCoupon(dto, parkingConfig); // 3. 查询优惠抵扣金额 // queryCarInfoDiscountDestory(dto); return discountCoupon; } + private ThirdpartyParkingConfig resolveParkingConfig(QcyunParkCouponDTO dto) { + if (dto == null || StringUtils.isBlank(dto.getStationId())) { + log.warn("qcyun发券失败, stationId为空, dto:{}", JSON.toJSONString(dto)); + return null; + } + ThirdpartyParkingConfig parkingConfig = thirdPartyParkingConfigService.selectByStationId(dto.getStationId()); + if (parkingConfig == null) { + log.warn("qcyun发券失败, 站点未绑定停车场配置, stationId:{}", dto.getStationId()); + return null; + } + if (!StringUtils.equals(ParkingPlatformEnum.SHEN_ZHEN_PLATFORM.getCode(), parkingConfig.getPlatformType())) { + log.warn("qcyun发券失败, 站点绑定的停车平台类型不是qcyun, stationId:{}, parkingConfigId:{}, platformType:{}", + dto.getStationId(), parkingConfig.getId(), parkingConfig.getPlatformType()); + return null; + } + if (StringUtils.isBlank(parkingConfig.getParkId()) + || StringUtils.isBlank(parkingConfig.getOrgId()) + || StringUtils.isBlank(parkingConfig.getSecretKey())) { + log.warn("qcyun发券失败, 停车场配置缺少parkId/orgId/secretKey, stationId:{}, parkingConfigId:{}", + dto.getStationId(), parkingConfig.getId()); + return null; + } + if (StringUtils.isBlank(getRequestUrl(parkingConfig))) { + log.warn("qcyun发券失败, 停车场配置缺少接口地址, stationId:{}, parkingConfigId:{}", + dto.getStationId(), parkingConfig.getId()); + return null; + } + return parkingConfig; + } + /** * 获取车辆信息接口 * 根据车牌号获取车辆信息(临时车,月租车,储值车) */ - private String getCarInfo(QcyunParkCouponDTO dto) { - String parkId = dto.getParkId(); // 使用dto中传入的parkId(写在配置文件中), 也许以后有多家车场改为数据库配置 + private String getCarInfo(QcyunParkCouponDTO dto, ThirdpartyParkingConfig parkingConfig) { + String parkId = dto.getParkId(); // 业务参数 Map data = Maps.newHashMap(); data.put("parkId", parkId); @@ -81,13 +125,16 @@ public class QcyunsServiceImpl implements QcyunsService { param.setService(ServiceApiCmd.CarInfo); param.setVersion("01"); param.setMsgId(UUID.randomUUID().toString()); - // param.setOrgId(dto.getOrgId()); - param.setOrgId(orgId); + param.setOrgId(parkingConfig.getOrgId()); param.setData(data); // 生成sign - ParkingUtil.generateAndSetSign(param, secretKey); + ParkingUtil.generateAndSetSign(param, parkingConfig.getSecretKey()); // 发送请求 - String result = HttpUtil.post(URL, JSON.toJSONString(param)); + String result = HttpUtil.post(getRequestUrl(parkingConfig), JSON.toJSONString(param)); + if (StringUtils.isBlank(result)) { + log.warn("获取车辆信息接口返回为空, param:{}", JSON.toJSONString(param)); + return null; + } DataResponse dataResponse = JSONUtil.toBean(result, DataResponse.class); log.info("获取车辆信息接口成功, param:{}, response:{}", JSON.toJSONString(param), JSON.toJSONString(dataResponse)); if (dataResponse.getRetCode() == 0) { @@ -99,28 +146,39 @@ public class QcyunsServiceImpl implements QcyunsService { /** * 商家减免 */ - private boolean createDiscountCoupon(QcyunParkCouponDTO dto) { + private boolean createDiscountCoupon(QcyunParkCouponDTO dto, ThirdpartyParkingConfig parkingConfig) { + String qcyunDiscountType = getQcyunDiscountType(dto); + String qcyunDiscountValue = getQcyunDiscountValue(dto); + if (StringUtils.isBlank(qcyunDiscountType) || StringUtils.isBlank(qcyunDiscountValue)) { + log.warn("qcyun创建优惠券失败, 优惠配置错误, stationId:{}, discountType:{}, discountValue:{}", + dto.getStationId(), dto.getDiscountType(), dto.getDiscountValue()); + return false; + } // 业务参数 Map data = Maps.newHashMap(); data.put("parkingSerial", dto.getParkingSerial()); data.put("grantSerial", dto.getGrantSerial()); // 对接方唯一id data.put("plate", dto.getPlateNumber()); // 车牌号 - data.put("storeName", dto.getStationName()); // 商家名称 - data.put("type", "1"); // 优惠类型: 1.金额, 2.时长, 3.全免 - data.put("value", String.valueOf(10 * 100)); // 当type=1时单位为分;当type=2时单位为分钟 + data.put("storeName", StringUtils.defaultIfBlank(dto.getStationName(), + StringUtils.defaultIfBlank(parkingConfig.getParkingName(), "充电停车优惠"))); // 商家名称 + data.put("type", qcyunDiscountType); // 优惠类型: 1.金额, 2.时长, 3.全免 + data.put("value", qcyunDiscountValue); // 当type=1时单位为分;当type=2时单位为分钟 data.put("parkId", dto.getParkId()); // 车场id // 组装请求体 ParkingCommonParam param = new ParkingCommonParam(); param.setService(ServiceApiCmd.DiscountCreate); param.setVersion("01"); param.setMsgId(UUID.randomUUID().toString()); - // param.setOrgId(dto.getOrgId()); - param.setOrgId(orgId); + param.setOrgId(parkingConfig.getOrgId()); param.setData(data); // 生成sign - ParkingUtil.generateAndSetSign(param, secretKey); + ParkingUtil.generateAndSetSign(param, parkingConfig.getSecretKey()); // 发送请求 - String result = HttpUtil.post(URL, JSON.toJSONString(param)); + String result = HttpUtil.post(getRequestUrl(parkingConfig), JSON.toJSONString(param)); + if (StringUtils.isBlank(result)) { + log.warn("创建优惠券返回为空, param:{}", JSON.toJSONString(param)); + return false; + } DataResponse dataResponse = JSONUtil.toBean(result, DataResponse.class); log.info("创建优惠券成功, param:{}, response:{}", JSON.toJSONString(param), JSON.toJSONString(dataResponse)); @@ -130,30 +188,65 @@ public class QcyunsServiceImpl implements QcyunsService { return false; } + private String getQcyunDiscountType(QcyunParkCouponDTO dto) { + if (DISCOUNT_TYPE_AMOUNT.equals(dto.getDiscountType())) { + return QCYUN_DISCOUNT_TYPE_AMOUNT; + } + if (DISCOUNT_TYPE_TIME.equals(dto.getDiscountType())) { + return QCYUN_DISCOUNT_TYPE_TIME; + } + return null; + } + + private String getQcyunDiscountValue(QcyunParkCouponDTO dto) { + if (StringUtils.isBlank(dto.getDiscountValue())) { + return null; + } + try { + BigDecimal discountValue = new BigDecimal(dto.getDiscountValue()); + if (discountValue.compareTo(BigDecimal.ZERO) <= 0) { + return null; + } + if (DISCOUNT_TYPE_AMOUNT.equals(dto.getDiscountType())) { + return discountValue.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP).toPlainString(); + } + if (DISCOUNT_TYPE_TIME.equals(dto.getDiscountType())) { + return discountValue.setScale(0, RoundingMode.HALF_UP).toPlainString(); + } + } catch (NumberFormatException e) { + log.warn("qcyun优惠值转换失败, discountValue:{}", dto.getDiscountValue(), e); + } + return null; + } + + private String getRequestUrl(ThirdpartyParkingConfig parkingConfig) { + return StringUtils.defaultIfBlank(parkingConfig.getApiUrl(), defaultUrl); + } + /** * 查询优惠抵扣金额 */ - private void queryCarInfoDiscountDestory(QcyunParkCouponDTO dto) { + private void queryCarInfoDiscountDestory(QcyunParkCouponDTO dto, ThirdpartyParkingConfig parkingConfig) { // 业务参数 Map data = Maps.newHashMap(); data.put("parkingSerial", dto.getParkingSerial()); data.put("grantSerial", dto.getGrantSerial()); // 对接方唯一id data.put("plate", dto.getPlateNumber()); // 车牌号 data.put("storeName", dto.getStationName()); // 商家名称 - data.put("type", "1"); // 优惠类型: 1.金额, 2.时长, 3.全免 - data.put("value", String.valueOf(10 * 100)); // 当type=1时单位为分;当type=2时单位为分钟 + data.put("type", getQcyunDiscountType(dto)); // 优惠类型: 1.金额, 2.时长, 3.全免 + data.put("value", getQcyunDiscountValue(dto)); // 当type=1时单位为分;当type=2时单位为分钟 data.put("parkId", dto.getParkId()); // // 组装请求体 ParkingCommonParam param = new ParkingCommonParam(); param.setService(ServiceApiCmd.CarInfoDiscountDestory); param.setVersion("01"); param.setMsgId(UUID.randomUUID().toString()); - param.setOrgId(orgId); + param.setOrgId(parkingConfig.getOrgId()); param.setData(data); // 生成sign - ParkingUtil.generateAndSetSign(param, secretKey); + ParkingUtil.generateAndSetSign(param, parkingConfig.getSecretKey()); // 发送请求 - String result = HttpUtil.post(URL, JSON.toJSONString(param)); + String result = HttpUtil.post(getRequestUrl(parkingConfig), JSON.toJSONString(param)); DataResponse dataResponse = JSONUtil.toBean(result, DataResponse.class); log.info("查询优惠抵扣金额, param:{}, response:{}", JSON.toJSONString(param), JSON.toJSONString(dataResponse)); }