Browse Source

医保移动支付优化

lighter 11 months ago
parent
commit
8cea2a9c21

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>wxservice-server</artifactId>
-    <version>12.2.2</version>
+    <version>12.2.3</version>
     <name>wxservice-server</name>
     <description>server for wxservice-web</description>
 

+ 2 - 1
src/main/java/thyyxxk/wxservice_server/Test.java

@@ -4,7 +4,8 @@ import thyyxxk.wxservice_server.utils.TokenUtil;
 
 public class Test {
     public static void main(String[] args) {
-        String t = TokenUtil.getInstance().createToken("oao6f0y4oF7jd60QhzPzMD9C3bBU");
+//        String t = TokenUtil.getInstance().createToken("oao6f0y4oF7jd60QhzPzMD9C3bBU");
+        String t = TokenUtil.getInstance().createToken("oao6f04NLOQLVT1rD0OzBn1jtW9E");
         System.out.println(t);
     }
 

+ 11 - 0
src/main/java/thyyxxk/wxservice_server/controller/WeChatRedirectController.java

@@ -71,4 +71,15 @@ public class WeChatRedirectController {
         }
     }
 
+    @PassToken
+    @GetMapping("/pathEntry")
+    public void pathEntry(@RequestParam("path") String path, HttpServletResponse response) {
+        try {
+            response.sendRedirect("https://open.weixin.qq.com/connect/oauth2/authorize?" +
+                    "appid=wxbde6b16acad84204&redirect_uri=http://staticweb.hnthyy.cn/wxserver/redirect/page2?" +
+                    "to=" + path + "&response_type=code&scope=snsapi_base&state=1#wechat_redirect");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }

+ 5 - 3
src/main/java/thyyxxk/wxservice_server/controller/api/PowersiMiPayPlugin.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
@@ -44,7 +45,8 @@ public class PowersiMiPayPlugin {
     private final IdCardAnalyzeService idCardAnalyzeService;
     private final ThmzService thmzService;
 
-    private static final String MZ_API_URL = "http://172.16.30.26:1100/mobilePayApi";
+    @Value("${hisMipUrl}")
+    private String hisMipUrl;
 
     private final DataHandler dataHandler = DataHandler.newInstance();
 
@@ -112,7 +114,7 @@ public class PowersiMiPayPlugin {
                 if (billInfo.getVipFlag() == 1) {
                     continue;
                 }
-                String url = MZ_API_URL + "/writeMtReceipt?hisOrdNum=" + billInfo.getBizId();
+                String url = hisMipUrl + "/writeMtReceipt?hisOrdNum=" + billInfo.getBizId();
                 String writeMtReceipt = new RestTemplate().getForObject(url, String.class);
                 if (Objects.equals(writeMtReceipt, "SUCCESS")) {
                     billInfo.setIdNo(request.getString("idNo"));
@@ -157,7 +159,7 @@ public class PowersiMiPayPlugin {
         request.put("patNo", arr[0]);
         request.put("times", Integer.parseInt(arr[1]));
 
-        Upload6201 upload6201 = new RestTemplate().postForObject(MZ_API_URL + "/getUpload6201", request, Upload6201.class);
+        Upload6201 upload6201 = new RestTemplate().postForObject(hisMipUrl + "/getUpload6201", request, Upload6201.class);
         if (null == upload6201) {
             JSONObject res = new JSONObject();
             res.put("code", -1);

+ 11 - 4
src/main/java/thyyxxk/wxservice_server/utils/mip/DataHandler.java

@@ -12,10 +12,17 @@ import thyyxxk.wxservice_server.config.exception.BizException;
 
 @Slf4j
 public class DataHandler {
-    private final static String appID = "FBEBNX3X60526RPYJQ7PZ4CRPNZO8NC9";
-    private final static String secret = "SN7YCGQA4R1JJELBZNGKEMV3O4P9KF9F";
-    private final static String prvKey = "ATePKWH4x/ooLSoA5A5rxDrCgCbhFzPG/FvdqF2RkEI=";
-    private final static String pubKey = "BLaISfgVDY1OdD22WBSXO1z/PwHialH1lKxeB1SN7ZkCPEutbMCUpIJnl/009sXoXw7ubAHxfpHyn2aSgXAvkHI=";
+//    private final static String appID = "FBEBNX3X60526RPYJQ7PZ4CRPNZO8NC9";
+//    private final static String secret = "SN7YCGQA4R1JJELBZNGKEMV3O4P9KF9F";
+//    private final static String prvKey = "ATePKWH4x/ooLSoA5A5rxDrCgCbhFzPG/FvdqF2RkEI=";
+//    private final static String pubKey = "BLaISfgVDY1OdD22WBSXO1z/PwHialH1lKxeB1SN7ZkCPEutbMCUpIJnl/009sXoXw7ubAHxfpHyn2aSgXAvkHI=";
+
+    private final static String appID = "4RB94HUMN03WOV9M301JKXIF2L8T6ZJR";
+    private final static String secret = "8GPMQXC2KHVU5C9W232XCKHYM2B9XPJU";
+    private final static String prvKey = "ALXJ5ibdGg/zXFdTzNx/e3UvsvSRE62hcmQkSjFpBkP4";
+    private final static String chanelPubKey = "BAfZ9tFGd7FOHsL/9Nx312V6vxlnoilmrjPXiEXLLGmuJ6d0/JWqjpnpm72i++ZfObOxKBzPE6O1e2bjRbZo7v0=";
+    private final static String platPubKey = "BJIs/FnYE+UZ1ktuIRdFChYNZUGo2rTeOHbNFw9RJ8yZmdfHsJnF3V1SF5wrJ4BkDNw0/Mk7sSbSxF0KXtI2uPY=";
+
     Base64.Decoder decoder = Base64.getDecoder();
     private final byte[] encryptKeys;
     private final String privateKeys;

+ 1 - 0
src/main/resources/application-8083.yml

@@ -80,6 +80,7 @@ management:
       enabled: true
 
 siMzApiUrl: http://172.16.32.166:1100/mzFee
+hisMipUrl: http://172.16.32.166:1100/mobilePayApi
 hrgApiUrl: http://172.16.32.160:81/thmz/api/v1
 chronicUrl: http://172.16.32.160:8077/chronicDisease
 inspectionUrl: http://172.16.32.178:622/pushservice.asmx?wsdl

+ 1 - 0
src/main/resources/application-8085.yml

@@ -80,6 +80,7 @@ management:
       enabled: true
 
 siMzApiUrl: http://172.16.32.166:1100/mzFee
+hisMipUrl: http://172.16.32.166:1100/mobilePayApi
 hrgApiUrl: http://172.16.32.160:81/thmz/api/v1
 chronicUrl: http://172.16.32.160:8077/chronicDisease
 inspectionUrl: http://172.16.32.178:622/pushservice.asmx?wsdl

+ 53 - 0
src/main/resources/application-dev.yml

@@ -0,0 +1,53 @@
+server:
+  port: 8805
+  servlet:
+    context-path: /wxserver
+spring:
+  application:
+    name: wxservice-server
+  thymeleaf:
+    cache: false
+  datasource:
+    url: "jdbc:sqlserver://172.16.32.179:1433;databaseName=thxyhisdb"
+    username: "sa"
+    password:
+    driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+    druid:
+      initial-size: 40
+      max-active: 100
+      min-idle: 40
+      max-wait: 60000
+      use-unfair-lock: true
+      validation-query: SELECT 1
+      test-while-idle: true
+      test-on-borrow: true
+      test-on-return: false
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      filters: stat
+      pool-prepared-statements: false
+      max-pool-prepared-statement-per-connection-size: 200
+      remove-abandoned: true
+      remove-abandoned-timeout: 180
+      log-abandoned: true
+  jackson:
+    time-zone: GMT+8
+    date-format: yyyy-MM-dd HH:mm:ss
+  mvc:
+    format:
+      date: yyyy-MM-dd
+      date-time: yyyy-MM-dd HH:mm:ss
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+
+siMzApiUrl: http://172.16.30.26:1100/mzFee
+hisMipUrl: http://172.16.30.26:1100/mobilePayApi
+chronicUrl: http://localhost:8706/chronicDisease
+#hrgApiUrl: http://demo.hnthyy.cn:8089/thmz/api/v1
+hrgApiUrl: http://172.16.30.119:8089/thmz/api/v1
+inspectionUrl: http://172.16.32.178:622/pushservice.asmx?wsdl
+physicalCheck: http://172.16.32.183:8888/bdp/dataservice/api/
+
+
+production: false

+ 52 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,52 @@
+server:
+  port: 8805
+  servlet:
+    context-path: /wxserver
+spring:
+  application:
+    name: wxservice-server
+  thymeleaf:
+    cache: false
+  datasource:
+    url: "jdbc:sqlserver://172.16.32.168:1433;databaseName=thxyhisdb"
+    username: "sa"
+    password:
+    driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
+    druid:
+      initial-size: 40
+      max-active: 100
+      min-idle: 40
+      max-wait: 60000
+      use-unfair-lock: true
+      validation-query: SELECT 1
+      test-while-idle: true
+      test-on-borrow: true
+      test-on-return: false
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      filters: stat
+      pool-prepared-statements: false
+      max-pool-prepared-statement-per-connection-size: 200
+      remove-abandoned: true
+      remove-abandoned-timeout: 180
+      log-abandoned: true
+  jackson:
+    time-zone: GMT+8
+    date-format: yyyy-MM-dd HH:mm:ss
+  mvc:
+    format:
+      date: yyyy-MM-dd
+      date-time: yyyy-MM-dd HH:mm:ss
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+
+
+siMzApiUrl: http://172.16.32.166:1100/mzFee
+hisMipUrl: http://172.16.32.166:1100/mobilePayApi
+hrgApiUrl: http://172.16.32.160:81/thmz/api/v1
+chronicUrl: http://172.16.32.160:8077/chronicDisease
+inspectionUrl: http://172.16.32.178:622/pushservice.asmx?wsdl
+physicalCheck: http://172.16.32.183:8888/bdp/dataservice/api/
+
+production: false

+ 2 - 54
src/main/resources/application.yml

@@ -1,55 +1,3 @@
-server:
-  port: 8805
-  servlet:
-    context-path: /wxserver
 spring:
-  application:
-    name: wxservice-server
-  thymeleaf:
-    cache: false
-  datasource:
-    url: "jdbc:sqlserver://172.16.32.179:1433;databaseName=thxyhisdb"
-#    url: "jdbc:sqlserver://172.16.32.168:1433;databaseName=thxyhisdb"
-    username: "sa"
-    password:
-    driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
-    druid:
-      initial-size: 40
-      max-active: 100
-      min-idle: 40
-      max-wait: 60000
-      use-unfair-lock: true
-      validation-query: SELECT 1
-      test-while-idle: true
-      test-on-borrow: true
-      test-on-return: false
-      time-between-eviction-runs-millis: 60000
-      min-evictable-idle-time-millis: 300000
-      filters: stat
-      pool-prepared-statements: false
-      max-pool-prepared-statement-per-connection-size: 200
-      remove-abandoned: true
-      remove-abandoned-timeout: 180
-      log-abandoned: true
-  jackson:
-    time-zone: GMT+8
-    date-format: yyyy-MM-dd HH:mm:ss
-  mvc:
-    format:
-      date: yyyy-MM-dd
-      date-time: yyyy-MM-dd HH:mm:ss
-mybatis-plus:
-  configuration:
-    map-underscore-to-camel-case: true
-
-siMzApiUrl: http://172.16.30.26:1100/mzFee
-
-chronicUrl: http://demo.hnthyy.cn:8706/chronicDisease
-#chronicUrl: http://localhost:8706/chronicDisease
-
-#hrgApiUrl: http://demo.hnthyy.cn:8089/thmz/api/v1
-hrgApiUrl: http://172.16.30.119:8089/thmz/api/v1
-
-inspectionUrl: http://172.16.32.178:622/pushservice.asmx?wsdl
-physicalCheck: http://172.16.32.183:8888/bdp/dataservice/api/
-production: false
+  profiles:
+    active: dev