Browse Source

Merge remote-tracking branch 'origin/master'

王鑫刚 1 week ago
parent
commit
a082278bae

+ 11 - 5
src/main/java/cn/hanghui/outapi/platform/alipay/service/impl/AlipayOpenApiServiceImpl.java

@@ -166,9 +166,13 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
         AlipayUserStateOpenApiRequest userStateRequest = new AlipayUserStateOpenApiRequest();
         userStateRequest.setIsvPid(openApiRequest.getIsvPid());
         userStateRequest.setOrgOutId(openApiRequest.getOrgOutId());
-        userStateRequest.setVid(vid);
         userStateRequest.setAppId(openApiRequest.getAppId());
+        userStateRequest.setVid(vid);
         Boolean existed = queryUserState(userStateRequest);
+        openApiRequest.setIsvPid(Preconditions.isNotBlank(openApiRequest.getIsvPid()) ? openApiRequest.getIsvPid() : userStateRequest.getAppId());
+        openApiRequest.setOrgOutId(Preconditions.isNotBlank(openApiRequest.getOrgOutId()) ? openApiRequest.getOrgOutId() : userStateRequest.getOrgOutId());
+        openApiRequest.setComponentOutId(Preconditions.isNotBlank(openApiRequest.getComponentOutId()) ? openApiRequest.getComponentOutId() : getComponentOutId("common"));
+        openApiRequest.setAppId(Preconditions.isNotBlank(openApiRequest.getAppId()) ? openApiRequest.getAppId() : userStateRequest.getAppId());
         AlipayOpenIotvspUserwithimageResponse userwithimageResponse = new AlipayOpenIotvspUserwithimageResponse();
         if (existed != null && existed) {
             log.error("--->用户{}信息已入库vid:{}", openApiRequest.getCertName(), vid);
@@ -217,7 +221,7 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
     public RestResult createOperateRecordWithverified(AlipayOpenIotvspUserwithimageRequest openApiRequest) {
         log.info("--->自定义vid设备端实名入库入参:{}", JSONObject.toJSONString(openApiRequest));
         //查询用户是否在库
-        if (openApiRequest == null || openApiRequest.getCertNo() == null || openApiRequest.getAppId() == null) {
+        if (openApiRequest == null || openApiRequest.getCertNo() == null) {
             log.error("--->自定义vid设备端实名入库参数错误");
             return RestResponse.error("参数错误");
         }
@@ -226,6 +230,7 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
         openApiRequest.setComponentOutId(Preconditions.isNotBlank(openApiRequest.getComponentOutId()) ? openApiRequest.getComponentOutId() : getComponentOutId("verified"));
         openApiRequest.setIsvPid(Preconditions.isNotBlank(openApiRequest.getIsvPid()) ? openApiRequest.getIsvPid() : isvInfo.getIsvPid());
         openApiRequest.setOrgOutId(Preconditions.isNotBlank(openApiRequest.getOrgOutId()) ? openApiRequest.getOrgOutId() : isvInfo.getOrgOutId());
+        openApiRequest.setAppId(Preconditions.isNotBlank(openApiRequest.getAppId()) ? openApiRequest.getAppId() : isvInfo.getAppId());
         return createOperateRecordWithoutImage(openApiRequest);
     }
 
@@ -251,7 +256,7 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
     public RestResult createOperateRecordWithverifiedcommon(AlipayOpenIotvspUserwithimageRequest openApiRequest) {
         log.info("--->自定义vid接口实名入库入参:{}", JSONObject.toJSONString(openApiRequest));
         //查询用户是否在库
-        if (openApiRequest == null || openApiRequest.getCertNo() == null || openApiRequest.getAppId() == null) {
+        if (openApiRequest == null || openApiRequest.getCertNo() == null) {
             log.error("--->自定义vid接口实名入库参数错误");
             return RestResponse.error("参数错误");
         }
@@ -260,6 +265,7 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
         openApiRequest.setComponentOutId(Preconditions.isNotBlank(openApiRequest.getComponentOutId()) ? openApiRequest.getComponentOutId() : getComponentOutId("common"));
         openApiRequest.setIsvPid(Preconditions.isNotBlank(openApiRequest.getIsvPid()) ? openApiRequest.getIsvPid() : isvInfo.getIsvPid());
         openApiRequest.setOrgOutId(Preconditions.isNotBlank(openApiRequest.getOrgOutId()) ? openApiRequest.getOrgOutId() : isvInfo.getOrgOutId());
+        openApiRequest.setAppId(Preconditions.isNotBlank(openApiRequest.getAppId()) ? openApiRequest.getAppId() : isvInfo.getAppId());
         return createOperateRecordWithoutImage(openApiRequest);
     }
 
@@ -551,7 +557,7 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
         IsvInfo isvInfo = getIsvInfo(openApiRequest.getAppId());
         openApiRequest.setIsvPid(Preconditions.isNotBlank(openApiRequest.getIsvPid()) ? openApiRequest.getIsvPid() : isvInfo.getIsvPid());
         openApiRequest.setOrgOutId(Preconditions.isNotBlank(openApiRequest.getOrgOutId()) ? openApiRequest.getOrgOutId() : isvInfo.getOrgOutId());
-
+        openApiRequest.setAppId(Preconditions.isNotBlank(openApiRequest.getAppId()) ? openApiRequest.getAppId() : isvInfo.getAppId());
         List<String> vids = openApiRequest.getVidList().stream().distinct().collect(Collectors.toList());
         for (String vid : vids) {
             AlipayOpenIotvspUserDeleteRequest request = new AlipayOpenIotvspUserDeleteRequest();
@@ -591,7 +597,7 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
         IsvInfo isvInfo = getIsvInfo(openApiRequest.getAppId());
         openApiRequest.setIsvPid(isvInfo.getIsvPid());
         openApiRequest.setOrgOutId(isvInfo.getOrgOutId());
-
+        openApiRequest.setAppId(isvInfo.getAppId());
         AlipayOpenIotvspUserstateQueryRequest request = new AlipayOpenIotvspUserstateQueryRequest();
         request.setBizContent(JSON.toJSONString(openApiRequest));
         try {

+ 5 - 4
src/main/java/cn/hanghui/outapi/platform/common/service/BaseService.java

@@ -224,19 +224,19 @@ public class BaseService {
      * @return
      */
     public IsvInfo getIsvInfo(String appId) {
-        IsvInfo isvInfo = new IsvInfo(componentOutId2188, isvPid2188, orgOutId2188);
+        IsvInfo isvInfo = new IsvInfo(componentOutId2188, isvPid2188, orgOutId2188, appId2188);
         if (appId == null || appId2188.equals(appId)) {
             return isvInfo;
         }
 
         if (appId2189.equals(appId)) {
-            return new IsvInfo(componentOutId2189, isvPid2189, orgOutId2189);
+            return new IsvInfo(componentOutId2189, isvPid2189, orgOutId2189, appId2189);
         }
         if (appId5069.equals(appId)) {
-            return new IsvInfo(componentOutId5069, isvPid5069, orgOutId5069);
+            return new IsvInfo(componentOutId5069, isvPid5069, orgOutId5069, appId5069);
         }
         if (appId9881.equals(appId)) {
-            return new IsvInfo(componentOutId9881, isvPid9881, orgOutId9881);
+            return new IsvInfo(componentOutId9881, isvPid9881, orgOutId9881, appId9881);
         }
         return isvInfo;
     }
@@ -281,6 +281,7 @@ public class BaseService {
         private String componentOutId;
         private String isvPid;
         private String orgOutId;
+        private String appId;
     }
 
     public <T> IPage<T> initEmptyPage() {

+ 4 - 4
src/main/resources/application-prod.yml

@@ -47,14 +47,14 @@ spring:
       datasource:
         master:
           driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://192.168.1.4:3306/hanghui_outapi_platform?characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://115.227.36.101:13307/hanghui_outapi_platform?characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
           username: root
-          password: Nqj##361
+          password: Nqj##117521
         mysqltiprove:
           driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://192.168.1.4:3306/ti_prove?characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://115.227.36.101:13307/ti_prove?characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
           username: root
-          password: Nqj##361
+          password: Nqj##117521
 
 --- # redis
 spring:

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

@@ -29,5 +29,5 @@ logging:
     com.yx.face.dao: error
   logback:
     rollingpolicy:
-      max-history: 3
+      max-history: 1
       max-file-size: 50MB