From a15a8cfd7b01ce4bba6fe9fd876f6704ca23a12d Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 07 一月 2025 16:40:32 +0800
Subject: [PATCH] 1、取水口用水日统计表中增加金额、次数字段; 2、优化或重写“累计流量超过指定值的取水口”、“累计流量低于指定值的取水口”、“指定时间段内用水量超过指定值的取水口”、“指定时间段内消费金额超过指定值的取水口”几个统计查询; 3、改“指定时间段内用水时长超过指定值的取水口”为“指定时间段内用水次数超过指定值的取水口”

---
 pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateWechatCertConfig.java |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateWechatCertConfig.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateWechatCertConfig.java
index 5a3c7d4..2f7c259 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateWechatCertConfig.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/config/RestTemplateWechatCertConfig.java
@@ -1,10 +1,13 @@
 package com.dy.pipIrrSell.config;
 
+import com.dy.pipIrrGlobal.cert.WxCertUtil;
 import com.dy.pipIrrSell.wechatpay.PayInfo;
 import okhttp3.OkHttpClient;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ResourceLoader;
 import org.springframework.http.client.ClientHttpRequestFactory;
 import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
 
@@ -12,8 +15,7 @@
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509TrustManager;
-import java.io.File;
-import java.io.FileInputStream;
+import java.io.InputStream;
 import java.security.KeyStore;
 
 /**
@@ -25,16 +27,18 @@
 
 @Configuration
 public class RestTemplateWechatCertConfig {
+
     String mchid = PayInfo.mchid;
+    @Autowired
+    private ResourceLoader resourceLoader;
 
     @Bean
     @ConfigurationProperties(prefix = "org.liurb.core.rest-template.config.connection")
     public ClientHttpRequestFactory wechatHttpRequestFactory() throws Exception {
 
         KeyStore keyStore = KeyStore.getInstance("PKCS12");
-        //InputStream cp = this.getClass().getResourceAsStream("apiclient_cert.p12");
-        FileInputStream instream = new FileInputStream(new File("C:\\webchat\\apiclient_cert.p12"));
-        keyStore.load(instream, mchid.toCharArray());
+        InputStream in = WxCertUtil.getCert_p12InputStream(resourceLoader);
+        keyStore.load(in, mchid.toCharArray());
 
         KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
         keyManagerFactory.init(keyStore, mchid.toCharArray());

--
Gitblit v1.8.0