sanlin.shi 2 weeks ago
parent
commit
511df9e475

+ 8 - 2
src/main/java/cn/hanghui/outapi/platform/alipay/service/impl/AlipayOpenApiServiceImpl.java

@@ -167,8 +167,13 @@ public class AlipayOpenApiServiceImpl extends BaseService implements AlipayOpenA
         userStateRequest.setIsvPid(openApiRequest.getIsvPid());
         userStateRequest.setOrgOutId(openApiRequest.getOrgOutId());
         userStateRequest.setVid(vid);
-        userStateRequest.setAppId(openApiRequest.getAppId());
         Boolean existed = queryUserState(userStateRequest);
+
+        userStateRequest.setAppId(openApiRequest.getAppId());
+        openApiRequest.setIsvPid(Preconditions.isNotBlank(openApiRequest.getIsvPid()) ? openApiRequest.getIsvPid() : userStateRequest.getAppId());
+        openApiRequest.setOrgOutId(Preconditions.isNotBlank(openApiRequest.getIsvPid()) ? openApiRequest.getIsvPid() : userStateRequest.getAppId());
+        openApiRequest.setComponentOutId(Preconditions.isNotBlank(openApiRequest.getComponentOutId()) ? openApiRequest.getComponentOutId() : getComponentOutId("common"));
+
         AlipayOpenIotvspUserwithimageResponse userwithimageResponse = new AlipayOpenIotvspUserwithimageResponse();
         if (existed != null && existed) {
             log.error("--->用户{}信息已入库vid:{}", openApiRequest.getCertName(), vid);
@@ -226,6 +231,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);
     }
 
@@ -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() {