Преглед изворни кода

E签宝注册认证个人和企业信息修改,认证成功跳转url

qxm пре 4 година
родитељ
комит
9196bd7a34

+ 2 - 1
suishenbang-api/src/main/resources/application-test.yml

@@ -12,6 +12,7 @@ ruoyi:
   addressEnabled: true
   #是否开启swagger
   openSwagger: true
+  cloudPath: http://10.32.2.212:8000/
 #接口安全验证
 security:
   #接口过期时间
@@ -118,4 +119,4 @@ esign:
 #  签署成功回调url
   signSuccessUrl: http://ss.libang.dgtis.com/wxportal-api/eSign/updateOrderFile
 #  下载后的PDF路径
-  fileUrl: /home/suishenbang/file/PDF
+  fileUrl: /home/suishenbang/file/pdf

+ 38 - 25
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -100,7 +100,7 @@ public class EsignController extends ApiBaseController {
         /* 根据订单id关联查询企业代号*/
         String chainsCode = customersExtService.selectchainsCodeByOrderId(orderId);
         /*首先根据订单id-orderId查询订单是否已被签署*/
-        OrderFile orderFlag = orderFileService.selectOrderFileById(orderId);
+//        OrderFile orderFlag = orderFileService.selectOrderFileById(orderId);
             Map<String,Object> map = eSignService.upload(deliveryNumber,shipmentNumber,belongTo,sysUser.getSysUserExt().getOrgName());
             /*1、根据传入订单id,查询订单相关信息生成PDF,调用e签宝上传方法返回文件fileId*/
             Object fileId = map.get("fileId");
@@ -139,17 +139,19 @@ public class EsignController extends ApiBaseController {
     @PostMapping("updateOrderFile")
     public Object updateOrderFile() {
         ParameterObject obj = getParameterObject();
-        obj.checkParameterNotNull("flowId");
+        obj.checkParameterNotNull("flowId,signResult");
         String flowId = obj.getString("flowId");
-        String fileUrl = signService.processDocumentDownload(flowId);
-
-        /*下载保存签署后的文件,返回文件存储地址*/
-        OrderFile orderFlag = orderFileService.selectOrderFileByFlowId(flowId);
-        fileDownloadUtil.downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + "_签收订单.pdf", fileUrl);
-        OrderFile orderFile = new OrderFile();
-        orderFile.setFlowId(flowId);
-        orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/"+"pdf/"+orderFlag.getOrderId() + "_签收订单.pdf");
-        orderFileService.updateOrderFileByFlowId(orderFile);
+        String signResult = obj.getString("signResult");
+        if ("2".equals(signResult)) {
+            String fileUrl = signService.processDocumentDownload(flowId);
+            /*下载保存签署后的文件,返回文件存储地址*/
+            OrderFile orderFlag = orderFileService.selectOrderFileByFlowId(flowId);
+            fileDownloadUtil.downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + "_签收订单.pdf", fileUrl);
+            OrderFile orderFile = new OrderFile();
+            orderFile.setFlowId(flowId);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/"+"pdf/"+orderFlag.getOrderId() + "_签收订单.pdf");
+            orderFileService.updateOrderFileByFlowId(orderFile);
+        }
         return AjaxResult.success();
     }
 
@@ -225,6 +227,26 @@ public class EsignController extends ApiBaseController {
         return result;
     }
 
+    @ApiOperation(value = "E签宝企业认证", notes = "参数:{'userId':'XXXXXXX','redirectUrl':'xxxxx'}" +
+            "\n(userId:待认证e签宝用户id" +
+            "\n redirectUrl:企业认证成功跳转URl)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params", paramType = "body")
+    })
+    @PostMapping("organRealVerify1")
+    public Object organRealVerify1() {
+        ParameterObject obj = getParameterObject();
+        obj.checkParameterNotNull("userId,redirectUrl");
+        String userId = obj.getString("userId");
+        String redirectUrl = obj.getString("redirectUrl");
+        SysUser sysUser = userService.selectUserById(Long.parseLong(userId));
+        String result="";
+        if (sysUser!=null){
+                result = organRealVerifyService.organRealVerify(sysUser.getAccountId(), "customersExt.getOrgId()",redirectUrl);
+        }
+        return result;
+    }
+
     /*调用修改数据库企业认证状态*/
     @ApiOperation(value = "E签宝企业认证成功回调接口(修改认证状态)",
             notes = "参数:{" +
@@ -263,7 +285,7 @@ public class EsignController extends ApiBaseController {
 
     @ApiOperation(value = "E签宝个人注册返回认证接口",
             notes = "参数:{" +
-                    "userId:'123','userName':'真实姓名','redirectUrl':'跳转url(http://baidu.com)'}" +
+                    "userId:'123','redirectUrl':'跳转url(http://baidu.com)'}" +
                     "错误:" +
                     "301  用户已经注册且认证" +
                     "500 注册失败" +
@@ -276,13 +298,12 @@ public class EsignController extends ApiBaseController {
     public Object createPersonalAccount(){
         ParameterObject obj =  getParameterObject();
         //判断参数
-        obj.checkParameterNotNull("userId,userName,idNumber,redirectUrl");
+        obj.checkParameterNotNull("userId,redirectUrl");
         String userId = obj.getString("userId");
-        String userName = obj.getString("userName");
         String redirectUrl = obj.getString("redirectUrl");
         //根据用户loginName查询用户信息
         SysUser user = userService.selectUserById(Long.parseLong(userId));
-        user.setUserName(userName);
+//        user.setUserName(userName);
         //判断是否注册
         if (user.getAccountId()!=null&&user.getAccountId()!=""){//已经注册
             //判断是否认证
@@ -321,9 +342,7 @@ public class EsignController extends ApiBaseController {
      */
     @ApiOperation(value = "E签宝企业注册返回认证接口",
             notes = "参数:{" +
-                    "userId:'123',customersName:'机构名称(XXX商贸公司)'," +
-                    "orgLegalIdNumber:'企业法定代表人证件号','orgLegalName':'企业法定代表人名称'" +
-                    ",'redirectUrl':'认证成功跳转url'}" +
+                    "userId:'123','redirectUrl':'认证成功跳转url'}" +
                     "错误:" +
                     "301  企业已经注册且认证" +
                     "201  个人未注册" +
@@ -336,11 +355,8 @@ public class EsignController extends ApiBaseController {
     @PostMapping("/createThirdParty")
     public Object createThirdParty(){
         ParameterObject obj =  getParameterObject();
-        obj.checkParameterNotNull("userId,customersName,orgLegalIdNumber,orgLegalName");
+        obj.checkParameterNotNull("userId,redirectUrl");
         Long userId = obj.getLong("userId");
-        String customersName = obj.getString("customersName");
-        String orgLegalIdNumber = obj.getString("orgLegalIdNumber");
-        String orgLegalName = obj.getString("orgLegalName");
         String redirectUrl = obj.getString("redirectUrl");
         SysUser user = userService.selectUserById(userId);
 //        CustomersExt customersExt = obj.parseBean(CustomersExt.class);
@@ -353,9 +369,6 @@ public class EsignController extends ApiBaseController {
                 return AjaxResult.error(201,"个人未注册");
             }
             customersExt.setChainsCode(user.getSysUserExt().getOrgCode());
-            customersExt.setCustomersName(customersName);
-            customersExt.setOrgLegalidNumber(orgLegalIdNumber);
-            customersExt.setOrgLegalName(orgLegalName);
         }
         //判断是否注册
         if (customersExt.getOrgId()!=null&&customersExt.getOrgId()!=""){//已经注册

+ 4 - 4
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/ESignServiceImpl.java

@@ -83,7 +83,7 @@ public class ESignServiceImpl implements ESignService {
     public SysUser createPersonalAccount(SysUser user) {
         JSONObject json = new JSONObject();
         json.put("thirdPartyUserId",user.getLoginName());
-        json.put("name",user.getUserName());
+//        json.put("name",user.getUserName());
         json.put("idType","CRED_PSN_CH_IDCARD");
 //        json.put("idNumber",user.getIdNumber());
 //        json.put("mobile",user.getPhonenumber());
@@ -104,11 +104,11 @@ public class ESignServiceImpl implements ESignService {
         int isok = 1;
         json.put("thirdPartyUserId",customersExt.getChainsCode());
         json.put("creator",customersExt.getCreator());
-        json.put("name",customersExt.getCustomersName());
+//        json.put("name",customersExt.getCustomersName());
 //        json.put("idType","CRED_ORG_USCC");
 //        json.put("idNumber",customersExt.getIdNumber());
-        json.put("orgLegalIdNumber",customersExt.getOrgLegalidNumber());
-        json.put("orgLegalName",customersExt.getOrgLegalName());
+//        json.put("orgLegalIdNumber",customersExt.getOrgLegalidNumber());
+//        json.put("orgLegalName",customersExt.getOrgLegalName());
         JSONObject resule = eSignHttpUtil.doPostGetJson(ESignUrl.CreateThirdParty,json);
         customersExt.setOrgId(resule.getJSONObject("data").getString("orgId"));
         isok = customersExtService.insertCustomersExt(customersExt);