src/main/java/org/springblade/common/config/WxPayConfig.java
@@ -12,6 +12,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import java.io.FileInputStream; import java.nio.charset.StandardCharsets; @@ -19,7 +20,6 @@ @Configuration // @PropertySource("classpath:wxpay.properties") //读取配置文件 @ConfigurationProperties(prefix = "wxpay") //读取wxpay节点 @Data //使用set方法将wxpay节点中的值填充到当前类的属性中 @Slf4j @@ -111,7 +111,7 @@ * * @return */ @Bean // @Bean public ScheduledUpdateCertificatesVerifier getVerifier() { log.info("获取签名验证器"); @@ -140,7 +140,7 @@ * @param verifier * @return */ @Bean(name = "wxPayClient") // @Bean(name = "wxPayClient") public CloseableHttpClient getWxPayClient(ScheduledUpdateCertificatesVerifier verifier) { log.info("获取httpClient"); @@ -162,7 +162,7 @@ /** * 获取HttpClient,无需进行应答签名验证,跳过验签的流程 */ @Bean(name = "wxPayNoSignClient") // @Bean(name = "wxPayNoSignClient") public CloseableHttpClient getWxPayNoSignClient() { //获取商户私钥 src/main/java/org/springblade/modules/pay/controller/OrderInfoController.java
@@ -94,7 +94,7 @@ /** * 创建订单信息 */ @PostMapping("/save") @PostMapping("/add") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入orderInfo") public R save(@RequestParam Long propertyChargeRecordId) { src/main/java/org/springblade/modules/pay/entity/OrderInfoEntity.java
@@ -95,6 +95,6 @@ /** 物业id */ @ApiModelProperty(value = "物业id", example = "") @TableId("proper_id") @TableField("proper_id") private Long properId; } src/main/java/org/springblade/modules/pay/mapper/OrderInfoMapper.xml
@@ -3,7 +3,7 @@ <mapper namespace="org.springblade.modules.pay.mapper.OrderInfoMapper"> <!-- 通用查询映射结果 --> <resultMap id="orderInfoResultMap" type="org.springblade.modules.pay.entity.OrderInfoEntity"> <resultMap id="orderInfoResultMap" type="org.springblade.modules.pay.vo.OrderInfoVO"> </resultMap> src/main/java/org/springblade/modules/pay/service/impl/WxPayServiceImpl.java
@@ -57,8 +57,8 @@ @Resource private WxPayConfig wxPayConfig; @Resource private CloseableHttpClient wxPayClient; // @Resource // private CloseableHttpClient wxPayClient; @Resource private IOrderInfoService orderInfoService; @@ -145,7 +145,7 @@ httpGet.setHeader("Accept", "application/json"); //完成签名并执行请求 CloseableHttpResponse response = wxPayClient.execute(httpGet); CloseableHttpResponse response = null;//wxPayClient.execute(httpGet); try { String bodyAsString = EntityUtils.toString(response.getEntity());//响应体 @@ -257,7 +257,7 @@ httpPost.setHeader("Accept", "application/json");//设置响应报文格式 //完成签名并执行请求,并完成验签 CloseableHttpResponse response = wxPayClient.execute(httpPost); CloseableHttpResponse response =null;// wxPayClient.execute(httpPost); try { @@ -303,7 +303,7 @@ httpGet.setHeader("Accept", "application/json"); //完成签名并执行请求 CloseableHttpResponse response = wxPayClient.execute(httpGet); CloseableHttpResponse response = null;//wxPayClient.execute(httpGet); try { String bodyAsString = EntityUtils.toString(response.getEntity()); @@ -460,7 +460,7 @@ httpPost.setHeader("Accept", "application/json"); //完成签名并执行请求 CloseableHttpResponse response = wxPayClient.execute(httpPost); CloseableHttpResponse response = null;//wxPayClient.execute(httpPost); try { String bodyAsString = EntityUtils.toString(response.getEntity());//响应体 @@ -582,7 +582,7 @@ httpPost.setHeader("Accept", "application/json"); //完成签名并执行请求 CloseableHttpResponse response = wxPayClient.execute(httpPost); CloseableHttpResponse response = null;//wxPayClient.execute(httpPost); try { int statusCode = response.getStatusLine().getStatusCode();//响应状态码