njs 1 year ago
parent
commit
643fcac88e

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

@@ -88,12 +88,12 @@ public class EsignSignServiceImpl implements IEsignSignService {
     }
 
     /**
-    * @description: 司机授权书
-    * @param: [businessScene, fileId, posX, posY, posX2, posY2, fileName, signerAccountId, authorizedAccountId, redirectUrl]
-    * @return: java.lang.String
-    * @author: njs
-    * @date: 2023/2/28 16:10
-    */
+     * @description: 司机授权书
+     * @param: [businessScene, fileId, posX, posY, posX2, posY2, fileName, signerAccountId, authorizedAccountId, redirectUrl]
+     * @return: java.lang.String
+     * @author: njs
+     * @date: 2023/2/28 16:10
+     */
     @Override
     public String oneStepFlowDriver(String businessScene, String fileId, float posX, float posY, float posX2, float posY2, String fileName, String signerAccountId, String authorizedAccountId, String redirectUrl) {
         JSONObject json = buildParamDriver(businessScene, fileId,posX,posY,posX2,posY2, fileName, signerAccountId,authorizedAccountId,redirectUrl);
@@ -260,14 +260,14 @@ public class EsignSignServiceImpl implements IEsignSignService {
         orderFile.setFlowId(flowId);
         if(orderFlag.getTypes()==1){
             downloadFile(Global.getPdfPath(), orderFlag.getOrderId()+uId + ".pdf", fileUrl);
-            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_司机授权.pdf");
-            tmsCertificate(orderFlag.getDeliveryNumber(),Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_司机授权.pdf");
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + ".pdf");
+            tmsCertificate(orderFlag.getDeliveryNumber(),Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + ".pdf");
         }else if( orderFlag.getTypes()==2){
-            downloadFile(Global.getPdfPath(), orderFlag.getFlowId()+uId + "_签收订单.pdf", fileUrl);
-            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getFlowId()+uId + "_签收订单.pdf");
+            downloadFile(Global.getPdfPath(), orderFlag.getFlowId()+uId + "_授权委托.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getFlowId()+uId + "_授权委托.pdf");
         }else{
-            downloadFile(Global.getPdfPath(), orderFlag.getOrderId()+uId + "_授权委托.pdf", fileUrl);
-            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_授权委托.pdf");
+            downloadFile(Global.getPdfPath(), orderFlag.getOrderId()+uId + "_签收订单.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_签收订单.pdf");
 
         }
 //        orderFile.setFileUrl(refile);
@@ -277,7 +277,7 @@ public class EsignSignServiceImpl implements IEsignSignService {
      * @description: orders交货单
      * @param: [orders, certificateUrl]
      * @return: void
-     * @author: njs     
+     * @author: njs
      * @date: 2023/4/12 18:29
      */
     @Override
@@ -369,29 +369,21 @@ public class EsignSignServiceImpl implements IEsignSignService {
         List<Attachment> attachments = new ArrayList<>();
 
         // 抄送人列表 这里模拟有一个抄送人
-        Copier copier = new Copier();
-        copier.setCopierAccountId(signerAccountId);
-        copier.setCopierIdentityAccountType(0);
+        Copier copier = new Copier(signerAccountId, 0, null);
         List<Copier> copiers = new ArrayList<>(); // Lists.newArrayList() 是guava 的写法
         copiers.add(copier);
 
         // 待签文件列表,这里模拟只有一个待签文件
-        Doc doc = new Doc();
-        doc.setFileId(fileId);
-        doc.setFileName(fileName);
+        Doc doc = new Doc(fileId, fileName);
+
         List<Doc> docs = new ArrayList<>();//Lists.newArrayList(doc);
         docs.add(doc);
 
         // 流程配置,可以不配置,使用默认配置
         String noticeDeveloperUrl = eSignConfig.getSignSuccessUrl();//回调通知URL
-        FlowConfigInfo flowConfigInfo = new FlowConfigInfo();
-        flowConfigInfo.setNoticeDeveloperUrl(noticeDeveloperUrl);
-        flowConfigInfo.setNoticeType("1,2");
-        FlowInfo flowInfo = new FlowInfo();
-        flowInfo.setAutoArchive(true);
-        flowInfo.setAutoInitiate(true);
-        flowInfo.setBusinessScene(businessScene);
-        flowInfo.setFlowConfigInfo(flowConfigInfo);
+        FlowConfigInfo flowConfigInfo = new FlowConfigInfo(noticeDeveloperUrl, "1,2", null, null);
+        FlowInfo flowInfo = new FlowInfo(true,true,businessScene,flowConfigInfo);
+
         // 签署方信息
         // 平台方
         PosBeanInfo posBean1 = new PosBeanInfo("1", posX, posY); // 签署位置
@@ -404,13 +396,8 @@ public class EsignSignServiceImpl implements IEsignSignService {
         signfields.add(signfield1);
         signfields.add(signfield2);
 //        SignerAccount signAccount = new SignerAccount(signerAccountId, signerAccountId);//签署方账号
-        SignerAccount signAccount = new SignerAccount();//签署方账号
-        signAccount.setSignerAccountId(authorizedAccountId);
-        Signer signer1 = new Signer(); // 签署方
-        signer1.setPlatformSign(false);
-        signer1.setSignOrder(1);
-        signer1.setSignerAccount(signAccount);
-        signer1.setSignfields(signfields);
+        SignerAccount signAccount = new SignerAccount(authorizedAccountId);//签署方账号
+        Signer signer1 = new Signer(false, 1, signAccount, signfields, null); // 签署方
         // 用户方
 //        PosBeanInfo posBean2 = new PosBeanInfo("1", 200F, 100F); // 签署位置
 //        SignfieldInfo signfield2 = new SignfieldInfo(false, null, fileId, null, null, null, posBean2, null); // 签署区
@@ -420,7 +407,7 @@ public class EsignSignServiceImpl implements IEsignSignService {
         List<Signer> signers = new ArrayList<>();//Lists.newArrayList(signer1, signer2);
         signers.add(signer1);
 //        signers.add(signer2);
-        log.info("E签宝拼接需要的参数++++", signers);
+
         //拼接参数
         return buildOneStepFlowParam(attachments, copiers, docs, flowInfo, signers);
     }
@@ -455,9 +442,9 @@ public class EsignSignServiceImpl implements IEsignSignService {
      * @description: 下载文件
      * @param: [filePath, fileName, httpUrl]
      * @return: void
-     * @author: qxm      
+     * @author: qxm
      * @date: 2020/10/27 9:58
-     */ 
+     */
     public static void downloadFile(String filePath,String fileName,String httpUrl){
         BufferedInputStream bis=null;
         BufferedOutputStream bos=null;