Procházet zdrojové kódy

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

qxm před 4 roky
rodič
revize
d1ddd1cfd8

+ 23 - 17
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -152,20 +152,22 @@ public class EsignController extends ApiBaseController {
     }
 
 
-    @ApiOperation(value = "E签宝个人认证", notes = "参数:{'userId':'XXXXXXX'}" +
-            "\n(userId:待认证用户id)")
+    @ApiOperation(value = "E签宝个人认证", notes = "参数:{'userId':'XXXXXXX','redirectUrl':'xxxx'}" +
+            "\n(userId:待认证用户id" +
+            "\n redirectUrl:认证结束后页面跳转地址url)")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "params", paramType = "body")
     })
     @PostMapping("personRealnVerify")
     public Object personRealnVerify() {
         ParameterObject obj = getParameterObject();
-        obj.checkParameterNotNull("userId");
+        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 = personRealnVerifyService.personRealnVerify(sysUser.getAccountId());
+            result = personRealnVerifyService.personRealnVerify(sysUser.getAccountId(),redirectUrl);
         }
         return result;
     }
@@ -198,22 +200,24 @@ public class EsignController extends ApiBaseController {
     }
 
 
-    @ApiOperation(value = "E签宝企业认证", notes = "参数:{'userId':'XXXXXXX'}" +
-            "\n(userId:待认证e签宝用户id)")
+    @ApiOperation(value = "E签宝企业认证", notes = "参数:{'userId':'XXXXXXX','redirectUrl':'xxxxx'}" +
+            "\n(userId:待认证e签宝用户id" +
+            "\n redirectUrl:企业认证成功跳转URl)")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "params", paramType = "body")
     })
     @PostMapping("organRealVerify")
     public Object organRealVerify() {
         ParameterObject obj = getParameterObject();
-        obj.checkParameterNotNull("userId");
+        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){
             CustomersExt customersExt = customersExtService.selectCustomersExtById(sysUser.getSysUserExt().getOrgCode());
             if (customersExt!=null){
-                result = organRealVerifyService.organRealVerify(sysUser.getAccountId(), customersExt.getOrgId());
+                result = organRealVerifyService.organRealVerify(sysUser.getAccountId(), customersExt.getOrgId(),redirectUrl);
             }
         }
         return result;
@@ -257,7 +261,7 @@ public class EsignController extends ApiBaseController {
 
     @ApiOperation(value = "E签宝个人注册返回认证接口",
             notes = "参数:{" +
-                    "userId:'123','userName':'真实姓名','idNumber':'身份证号'}" +
+                    "userId:'123','userName':'真实姓名','redirectUrl':'跳转url(http://baidu.com)'}" +
                     "错误:" +
                     "301  用户已经注册且认证" +
                     "500 注册失败" +
@@ -270,14 +274,13 @@ public class EsignController extends ApiBaseController {
     public Object createPersonalAccount(){
         ParameterObject obj =  getParameterObject();
         //判断参数
-        obj.checkParameterNotNull("userId,userName,idNumber");
+        obj.checkParameterNotNull("userId,userName,idNumber,redirectUrl");
         String userId = obj.getString("userId");
         String userName = obj.getString("userName");
-        String idNumber = obj.getString("idNumber");
+        String redirectUrl = obj.getString("redirectUrl");
         //根据用户loginName查询用户信息
         SysUser user = userService.selectUserById(Long.parseLong(userId));
         user.setUserName(userName);
-        user.setIdNumber(idNumber);
         //判断是否注册
         if (user.getAccountId()!=null&&user.getAccountId()!=""){//已经注册
             //判断是否认证
@@ -288,7 +291,7 @@ public class EsignController extends ApiBaseController {
                 int result = eSignService.updatePersonalAccount(user);
                 if (result > 0){
                     //获取认证路径
-                    String url = personRealnVerifyService.personRealnVerify(user.getAccountId());
+                    String url = personRealnVerifyService.personRealnVerify(user.getAccountId(),redirectUrl);
                     return AjaxResult.success("url",url);
                 }else{
                     return AjaxResult.error("认证失败");
@@ -299,7 +302,7 @@ public class EsignController extends ApiBaseController {
             SysUser euser = eSignService.createPersonalAccount(user);
             if (euser!=null) {
                 //注册完以后获取认证路径
-                String url = personRealnVerifyService.personRealnVerify(euser.getAccountId());
+                String url = personRealnVerifyService.personRealnVerify(euser.getAccountId(),redirectUrl);
                 return AjaxResult.success("url", url);
             }else {
                 return AjaxResult.error(500,"注册失败");
@@ -316,7 +319,9 @@ public class EsignController extends ApiBaseController {
      */
     @ApiOperation(value = "E签宝企业注册返回认证接口",
             notes = "参数:{" +
-                    "userId:'123',customersName:'机构名称(XXX商贸公司)',orgLegalIdNumber:'企业法定代表人证件号','orgLegalName':'企业法定代表人名称'}" +
+                    "userId:'123',customersName:'机构名称(XXX商贸公司)'," +
+                    "orgLegalIdNumber:'企业法定代表人证件号','orgLegalName':'企业法定代表人名称'" +
+                    ",'redirectUrl':'认证成功跳转url'}" +
                     "错误:" +
                     "301  企业已经注册且认证" +
                     "201  个人未注册" +
@@ -334,6 +339,7 @@ public class EsignController extends ApiBaseController {
         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);
         CustomersExt customersExt = customersExtService.selectCustomersExtById(user.getSysUserExt().getOrgCode());
@@ -359,7 +365,7 @@ public class EsignController extends ApiBaseController {
                 int result = eSignService.updateThirdParty(customersExt);
                 if (result>0){
                     //获取认证路径
-                    String url = organRealVerifyService.organRealVerify(customersExt.getOrgId(),customersExt.getCreator());
+                    String url = organRealVerifyService.organRealVerify(customersExt.getOrgId(),customersExt.getCreator(),redirectUrl);
                     return AjaxResult.success("url",url);
                 }else{
                     return AjaxResult.error("认证失败");
@@ -370,7 +376,7 @@ public class EsignController extends ApiBaseController {
             CustomersExt ecustomersExt = eSignService.createThirdParty(customersExt);
             if (ecustomersExt!=null) {
                 //注册完以后获取认证路径
-                String url = organRealVerifyService.organRealVerify(ecustomersExt.getOrgId(),ecustomersExt.getCreator());
+                String url = organRealVerifyService.organRealVerify(ecustomersExt.getOrgId(),ecustomersExt.getCreator(),redirectUrl);
                 return AjaxResult.success("url", url);
             }else {
                 return AjaxResult.error(500,"注册失败");

+ 1 - 1
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IEsignOrganRealVerifyService.java

@@ -14,6 +14,6 @@ public interface IEsignOrganRealVerifyService {
      * @author: qxm
      * @date: 2020/10/12 16:09
      */
-    public String organRealVerify(String accountId, String agentAccountId);
+    public String organRealVerify(String accountId, String agentAccountId,String redirectUrl);
 
 }

+ 1 - 1
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/IEsignPersonRealnVerifyService.java

@@ -14,6 +14,6 @@ public interface IEsignPersonRealnVerifyService {
      * @author: qxm
      * @date: 2020/10/12 16:05
      */
-    public String personRealnVerify(String accountId);
+    public String personRealnVerify(String accountId,String redirectUrl);
 
 }

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

@@ -86,7 +86,7 @@ public class ESignServiceImpl implements ESignService {
         json.put("thirdPartyUserId",user.getLoginName());
         json.put("name",user.getUserName());
         json.put("idType","CRED_PSN_CH_IDCARD");
-        json.put("idNumber",user.getIdNumber());
+//        json.put("idNumber",user.getIdNumber());
 //        json.put("mobile",user.getPhonenumber());
 //        json.put("email",user.getEmail());
         JSONObject resule = eSignHttpUtil.doPostGetJson(ESignUrl.CreatePersonalAccount,json);

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

@@ -30,17 +30,16 @@ public class EsignOrganRealVerifyServiceImpl implements IEsignOrganRealVerifySer
      * @date: 2020/10/12 15:13
      */
     @Override
-    public String organRealVerify(String accountId, String agentAccountId) {
-        JSONObject json = buildParam(accountId,agentAccountId);
+    public String organRealVerify(String accountId, String agentAccountId,String redirectUrl) {
+        JSONObject json = buildParam(accountId,agentAccountId,redirectUrl);
         JSONObject jsonObject = eSignHttpUtil.doPostGetJson(ESignUrl.OrgIdentityUrl, json, accountId);
         JSONObject result = (JSONObject)jsonObject.get("data");
         return result.get("shortLink").toString();
     }
 
-    private JSONObject buildParam(String accountId, String agentAccountId) {
-        //个人认证参数
+    private JSONObject buildParam(String accountId, String agentAccountId,String redirectUrl) {
+        //企业认证参数
         String notifyUrl = eSignConfig.getOrganNotifyUrl();
-        String redirectUrl = "";
         ContextInfo contextInfo = new ContextInfo(notifyUrl, redirectUrl);
         //认证配置信息
         String[] arr = {"name", "certNo", "legalRepName", "legalRepCertNo","agentName","agentIdNo"};

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

@@ -31,17 +31,16 @@ public class EsignPersonReaLnVerifyServiceImpl implements IEsignPersonRealnVerif
      * @date: 2020/10/12 15:13
      */
     @Override
-    public String personRealnVerify(String accountId) {
-        JSONObject json = buildParam(accountId, "");
+    public String personRealnVerify(String accountId,String redirectUrl) {
+        JSONObject json = buildParam(accountId, "",redirectUrl);
         JSONObject jsonObject = eSignHttpUtil.doPostGetJson(ESignUrl.IndivIdentityUrl, json, accountId);
         JSONObject result = (JSONObject)jsonObject.get("data");
         return result.get("shortLink").toString();
     }
 
-    private JSONObject buildParam(String accountId, String receiveUrlMobileNo) {
+    private JSONObject buildParam(String accountId, String receiveUrlMobileNo,String redirectUrl) {
         //个人认证参数
         String notifyUrl = eSignConfig.getPersonNotifyUrl();
-        String redirectUrl = "";
         ContextInfo contextInfo = new ContextInfo(notifyUrl, redirectUrl);
         //认证配置信息
         String[] arr = {"name", "certNo", "mobileNo", "bankCardNo"};

+ 2 - 2
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/EsignSignServiceImpl.java

@@ -162,8 +162,8 @@ public class EsignSignServiceImpl implements IEsignSignService {
             posY =posY-11F;
         }
         PosBeanInfo posBean1 = new PosBeanInfo("1", posX, posY); // 签署位置
-//        SignfieldInfo signfield1 = new SignfieldInfo(false,"2", fileId, null, null, null, posBean1, null); // 签署区(签署主体是公司)
-        SignfieldInfo signfield1 = new SignfieldInfo(false, fileId, null, null, null, posBean1, null); // 签署区(个人签署)
+        SignfieldInfo signfield1 = new SignfieldInfo(false,"2", fileId, null, null, null, posBean1, null); // 签署区(签署主体是公司)
+//        SignfieldInfo signfield1 = new SignfieldInfo(false, fileId, null, null, null, posBean1, null); // 签署区(个人签署)
         List<SignfieldInfo> signfields = new ArrayList<>();
         signfields.add(signfield1);
 //        SignerAccount signAccount = new SignerAccount(signerAccountId, signerAccountId);//签署方账号