Pārlūkot izejas kodu

提交注册返回认证路径接口/认证成功回调接口

zhangding 4 gadi atpakaļ
vecāks
revīzija
3104743e61

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

@@ -114,8 +114,8 @@ esign:
   appSecret: f3dd308ab7e9e1d307ffeddddc3d5b53
   serviceUrl: https://smlopenapi.esign.cn
 #  个人认证回调url
-  personNotifyUrl: xxxxx
+  personNotifyUrl: http://fanfanweb.iask.in/api/eSign/updateUserIsAuthentication
 #  企业认证成功回调url
-  organNotifyUrl: xxxx
+  organNotifyUrl: http://fanfanweb.iask.in/api/eSign/updateCustomersIsAuthentication
 #  签署成功回调url
   signSuccessUrl: http://fanfanweb.iask.in/api/eSign/updateOrderFile

+ 8 - 0
suishenbang-common/src/main/java/com/dgtly/common/core/domain/ParameterObject.java

@@ -73,6 +73,14 @@ public class ParameterObject {
         }
     }
 
+    public Boolean getBoolean(String Key){
+        if (jsonObject!=null){
+            return jsonObject.getBoolean(Key);
+        }else {
+            return null;
+        }
+    }
+
     public void checkParameterNotNull(String fieldNames){
         if(jsonObject!=null){
             String[] fieldList = fieldNames.split(",");

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/mapper/CustomersExtMapper.java

@@ -45,7 +45,7 @@ public interface CustomersExtMapper
      */
     public int updateCustomersExt(CustomersExt customersExt);
 
-    public int updateCustomersIsAuthentication(@Param("isAuthentication") String isAuthentication,@Param("chainsCode") String chainsCode);
+    public int updateCustomersIsAuthentication(@Param("isAuthentication") String isAuthentication,@Param("accountId") String accountId);
 
   /**
      * 删除经销商扩展

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/mapper/SysUserMapper.java

@@ -105,7 +105,7 @@ public interface SysUserMapper
     public int updateUser(SysUser user);
 
     //修改认证状态
-    public int updateIsAuthentication(@Param("isAuthentication") String isAuthentication,@Param("userId") String userId);
+    public int updateIsAuthentication(@Param("isAuthentication") String isAuthentication,@Param("accountId") String accountId);
 
     /**
      * 修改全公司的状态

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/ICustomersExtService.java

@@ -44,7 +44,7 @@ public interface ICustomersExtService
     public int updateCustomersExt(CustomersExt customersExt);
 
     //修改企业认证状态
-    public int updateCustomersIsAuthentication(String isAuthentication,String chainsCode);
+    public int updateCustomersIsAuthentication(String isAuthentication,String accountId);
 
     /**
      * 批量删除经销商扩展

+ 1 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/ISysUserService.java

@@ -134,7 +134,7 @@ public interface ISysUserService
 
 
     //修改认证状态
-    public int updateIsAuthentication(String isAuthentication,String userId);
+    public int updateIsAuthentication(String isAuthentication,String accountId);
 
     /**
      * 修改用户详细信息和销售相关信息

+ 2 - 2
suishenbang-system/src/main/java/com/dgtly/system/service/impl/CustomersExtServiceImpl.java

@@ -69,8 +69,8 @@ public class CustomersExtServiceImpl implements ICustomersExtService
     }
 
     @Override
-    public int updateCustomersIsAuthentication(String isAuthentication, String chainsCode) {
-        return customersExtMapper.updateCustomersIsAuthentication(isAuthentication,chainsCode);
+    public int updateCustomersIsAuthentication(String isAuthentication, String accountId) {
+        return customersExtMapper.updateCustomersIsAuthentication(isAuthentication,accountId);
     }
 
     /**

+ 2 - 2
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysUserServiceImpl.java

@@ -252,8 +252,8 @@ public class SysUserServiceImpl implements ISysUserService
     }
 
     @Override
-    public int updateIsAuthentication(String isAuthentication,String userId) {
-        return userMapper.updateIsAuthentication(isAuthentication,userId);
+    public int updateIsAuthentication(String isAuthentication,String accountId) {
+        return userMapper.updateIsAuthentication(isAuthentication,accountId);
     }
 
     /**

+ 1 - 1
suishenbang-system/src/main/resources/mapper/system/CustomersExtMapper.xml

@@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <update id="updateCustomersIsAuthentication" parameterType="String">
         update customers_ext set is_authentication = #{isAuthentication}
-		where chains_code = #{chainsCode}
+		where org_id = #{accountId}
     </update>
 
     <delete id="deleteCustomersExtById" parameterType="String">

+ 1 - 1
suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -257,7 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<update id="updateIsAuthentication" parameterType="String">
 		update sys_user set is_authentication = #{isAuthentication}
-		where user_id = #{userId}
+		where account_id = #{accountId}
 	</update>
 
 

+ 64 - 4
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -10,10 +10,8 @@ import com.dgtly.system.service.ICustomersExtService;
 import com.dgtly.system.service.ISysUserExtService;
 import com.dgtly.system.service.ISysUserService;
 import com.dgtly.wxportal.domain.OrderFile;
-import com.dgtly.wxportal.service.IEsignOrganRealVerifyService;
-import com.dgtly.wxportal.service.IEsignPersonRealnVerifyService;
-import com.dgtly.wxportal.service.IEsignSignService;
-import com.dgtly.wxportal.service.IOrderFileService;
+import com.dgtly.wxportal.service.*;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -21,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -48,6 +47,9 @@ public class EsignController extends ApiBaseController {
     private ISysUserExtService userExtService;
     @Autowired
     private ICustomersExtService customersExtService;
+    @Autowired
+    private ESignService eSignService;
+
     /**
      * 经销商订单签收方法
      * 没有注册就注册,注册完就认证,然后再点击签署按钮,获取经销商用户id,对应主体id
@@ -83,6 +85,7 @@ public class EsignController extends ApiBaseController {
         if (orderFlag==null) {
 
             /*1、根据传入订单id,查询订单相关信息生成PDF,调用e签宝上传方法返回文件fileId*/
+            String upload = eSignService.upload(orderId);
             String fileId = "f6ada0144a464d7bb90224104d1c4ca3";
             /*2、调用E签宝接口一步发起流程,得到返回的流程id*/
             String flowId = signService.oneStepFlow(businessScene, fileId, fileName, signerAccountId, authorizedAccountId);
@@ -102,6 +105,8 @@ public class EsignController extends ApiBaseController {
         }
     }
 
+
+
     /**
      * 经销商通过签署地址签署后,回调此方法,通过flowId得到签署后的文件下载地址并保存url
      */
@@ -141,6 +146,33 @@ public class EsignController extends ApiBaseController {
         return result;
     }
 
+    @ApiOperation(value = "E签宝个人认证成功回调接口(修改认证状态)",
+                notes = "参数:{" +
+                        "userId:'123'}" +
+                        "错误:" +
+                        "500 修改个人认证状态失败" +
+                        "301 个人认证失败" +
+                        "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("/updateUserIsAuthentication")
+    public Object updateUserIsAuthentication(){
+        ParameterObject obj =  getParameterObject();
+        String accountId = obj.getString("accountId");
+        Boolean success = obj.getBoolean("success");
+        if (success) {
+            int result = userService.updateIsAuthentication("1", accountId);
+            if (result > 0) {
+                return AjaxResult.success().putKV("result", result);
+            } else {
+                return AjaxResult.error(500, "修改个人认证状态失败");
+            }
+        }else {
+            return AjaxResult.error(301,"个人认证失败");
+        }
+    }
+
 
     @ApiOperation(value = "E签宝企业认证", notes = "参数:{'userId':'XXXXXXX'}" +
             "\n(userId:待认证e签宝用户id)")
@@ -163,4 +195,32 @@ public class EsignController extends ApiBaseController {
         return result;
     }
 
+    /*调用修改数据库企业认证状态*/
+    @ApiOperation(value = "E签宝企业认证成功回调接口(修改认证状态)",
+            notes = "参数:{" +
+                    "userId:'123'}" +
+                    "错误:" +
+                    "500 修改企业认证状态失败" +
+                    "301 企业认证失败" +
+                    "")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body")
+    })
+    @PostMapping("/updateCustomersIsAuthentication")
+    public Object updateCustomersIsAuthentication(){
+        ParameterObject obj =  getParameterObject();
+        String accountId = obj.getString("accountId");
+        Boolean success = obj.getBoolean("success");
+        if (success) {
+            int result = customersExtService.updateCustomersIsAuthentication("1", accountId);
+            if (result > 0) {
+                return AjaxResult.success().putKV("result", result);
+            } else {
+                return AjaxResult.error(500, "修改企业认证状态失败");
+            }
+        }else {
+            return AjaxResult.error(301,"企业认证失败");
+        }
+    }
+
 }

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

@@ -52,8 +52,6 @@ public class ESignServiceImpl implements ESignService {
         String fileId = urlData.getString("fileId");
         //文件上传路径
         String uploadUrl = urlData.getString("uploadUrl");
-
-
         //上传文件
         String res = eSignHttpUtil.upLoadFile(uploadUrl,filePath,md5,contentTtpe,fileLength);
 
@@ -68,7 +66,6 @@ public class ESignServiceImpl implements ESignService {
     @Override
     public SysUser createPersonalAccount(SysUser user) {
         JSONObject json = new JSONObject();
-
         json.put("thirdPartyUserId",user.getLoginName());
         json.put("name",user.getUserName());
 //        json.put("idType","CRED_PSN_CH_IDCARD");

+ 3 - 116
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/utils/pdf/PDFUtil.java

@@ -183,7 +183,7 @@ public class PDFUtil {
                 document.addCreator("");// 创建者
 
                 // 4.向文档中添加内容
-                PDFUtil.generatePDF(document);
+                PDFUtil.generateEPDF(document,"XXX公司");
 
                 // 5.关闭文档
                 document.close();
@@ -279,7 +279,7 @@ public class PDFUtil {
         table.addCell(createCell("cg000005", textfont));
         table.addCell(createCell("100000", textfont));
         table.addCell(createCell("2020-08-13", textfont));
-//            document.add(table);
+            document.add(table);
 
         table = createTable(new float[] { 80, 80, 80, 80, 80, 80 ,80});
         table.addCell(createCell("明细名称", keyfont, Element.ALIGN_CENTER));
@@ -298,7 +298,7 @@ public class PDFUtil {
         table.addCell(createCell("适配", textfont));
         table.addCell(createCell("2020-08-13",textfont));
 
-//            document.add(table);
+//      document.add(table);
         document.add(p1);
 
         paragraph = new Paragraph("中标供应商信息", titlefont);
@@ -311,120 +311,7 @@ public class PDFUtil {
         paragraph.setSpacingAfter(10f); //设置段落下空白
 //            document.add(paragraph);
 
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("供应商名称", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系人", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系方式", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("邮箱", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("测试供应商", textfont));
-        table.addCell(createCell("张三", textfont));
-        table.addCell(createCell("8337971871", textfont));
-        table.addCell(createCell("langss@dgtis.com", textfont));
-//            document.add(table);
-
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("报价编号", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("总价", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("报价时间", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("状态", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已报价", textfont));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已作废", textfont));
-//            document.add(table);
-//            document.add(p3);
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("供应商名称", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系人", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系方式", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("邮箱", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("测试供应商", textfont));
-        table.addCell(createCell("张三", textfont));
-        table.addCell(createCell("8337971871", textfont));
-        table.addCell(createCell("langss@dgtis.com", textfont));
-//            document.add(table);
-
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("报价编号", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("总价", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("报价时间", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("状态", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已报价", textfont));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已作废", textfont));
-//            document.add(table);
-
-        document.add(p1);//添加实线
-
-        paragraph = new Paragraph("未中标供应商信息", titlefont);
-        paragraph.setAlignment(0); //设置文字居中 0靠左   1,居中     2,靠右
-        paragraph.setIndentationLeft(12); //设置左缩进
-        paragraph.setIndentationRight(12); //设置右缩进
-        paragraph.setFirstLineIndent(24); //设置首行缩进
-        paragraph.setLeading(20f); //行间距
-        paragraph.setSpacingBefore(5f); //设置段落上空白
-        paragraph.setSpacingAfter(10f); //设置段落下空白
-        document.add(paragraph);
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("供应商名称", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系人", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系方式", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("邮箱", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("测试供应商", textfont));
-        table.addCell(createCell("张三", textfont));
-        table.addCell(createCell("8337971871", textfont));
-        table.addCell(createCell("langss@dgtis.com", textfont));
-//            document.add(table);
-
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("报价编号", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("总价", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("报价时间", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("状态", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已报价", textfont));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已作废", textfont));
-//            document.add(table);
 
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("供应商名称", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系人", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("联系方式", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("邮箱", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("测试供应商", textfont));
-        table.addCell(createCell("张三", textfont));
-        table.addCell(createCell("8337971871", textfont));
-        table.addCell(createCell("langss@dgtis.com", textfont));
-//            document.add(table);
-        document.add(p3);
-        table = createTable(new float[] { 80, 80, 80, 80});
-        table.addCell(createCell("报价编号", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("总价", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("报价时间", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("状态", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已报价", textfont));
-        table.addCell(createCell("P20200812104", textfont));
-        table.addCell(createCell("70000.0", textfont));
-        table.addCell(createCell("2020-08-12", textfont));
-        table.addCell(createCell("已作废", textfont));
-//            document.add(table);
     }
 
         // 生成PDF文件