Pārlūkot izejas kodu

修改订单签署自动签章,PDF签章位置修改

qxm 4 gadi atpakaļ
vecāks
revīzija
25364f0f24

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

@@ -101,23 +101,24 @@ public class EsignController extends ApiBaseController {
         String fileName = orderId+"_签收订单.pdf";
         /*根据userId查询个人注册后accountId*/
         String signerAccountId = "";
-        SysUser sysUser = userService.selectUserById(Long.parseLong(userId));
-        if (sysUser!=null){
-            signerAccountId=sysUser.getAccountId();
-        }
-        /*根据订单id关联查询企业注册后id*/
-        String authorizedAccountId =customersExtService.selectOrgIdByOrderId(orderId);
-        /* 根据订单id关联查询企业代号*/
+        try {
+            SysUser sysUser = userService.selectUserById(Long.parseLong(userId));
+            if (sysUser!=null){
+                signerAccountId=sysUser.getAccountId();
+            }
+            /*根据订单id关联查询企业注册后id*/
+            String authorizedAccountId =customersExtService.selectOrgIdByOrderId(orderId);
+            /* 根据订单id关联查询企业代号*/
 //        String chainsCode = customersExtService.selectChainsCodeByOrderId(orderId);
-        /*首先根据订单id-orderId查询订单是否已被签署*/
+            /*首先根据订单id-orderId查询订单是否已被签署*/
 //        OrderFile orderFlag = orderFileService.selectOrderFileById(orderId);
-             ESignUpPDFModal fileModal = eSignService.upload(deliveryNumber,shipmentNumber,belongTo,sysUser.getSysUserExt().getOrgName(),sysUser.getUserName());
+            ESignUpPDFModal fileModal = eSignService.upload(deliveryNumber,shipmentNumber,belongTo,sysUser.getSysUserExt().getOrgName(),sysUser.getUserName());
             /*1、根据传入订单id,查询订单相关信息生成PDF,调用e签宝上传方法返回文件fileId*/
             Object fileId =fileModal.getFileId();
             /*2、调用E签宝接口一步发起流程,得到返回的流程id*/
             String flowId = signService.oneStepFlow(businessScene, fileId.toString(),fileModal.getX(),fileModal.getY(), fileName, signerAccountId, authorizedAccountId,redirectUrl);
             /*3、调用E签宝获取签署地址*/
-            String result = signService.processExecuteUrl(flowId, signerAccountId, authorizedAccountId);
+//            String result = signService.processExecuteUrl(flowId, signerAccountId, authorizedAccountId);
             /*4、保存订单id和flowId*/
             OrderFile orderFile = new OrderFile();
             orderFile.setOrderId(orderId);
@@ -131,7 +132,11 @@ public class EsignController extends ApiBaseController {
             orderFile.setSignerName(sysUser.getUserName());
             orderFile.setFlowId(flowId);
             orderFileService.insertOrderFile(orderFile);
-            return result;
+            return AjaxResult.success("签收成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error("签收失败");
+        }
     }
 
 
@@ -212,7 +217,7 @@ public class EsignController extends ApiBaseController {
         if(orderFile != null){
             return AjaxResult.success().putKV("url",serverConfig.getUrl()+orderFile.getFileUrl());
         }else{
-            return AjaxResult.success("文件不存在");
+            return AjaxResult.error(301,"文件不存在");
         }
 
     }

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

@@ -212,8 +212,8 @@ public class ESignServiceImpl implements ESignService {
             e.printStackTrace();
         }
         //计算宽高
-        Float fosX = 310F;
-        Float fosY = 520F;
+        Float fosX = 500F;
+        Float fosY = 700F;
 //        for (int i =0;i<size;i++){
 //           fosY = fosY-11f;
 //        }

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

@@ -172,7 +172,7 @@ public class EsignSignServiceImpl implements IEsignSignService {
             orderFileService.updateOrderFileByFlowId(orderFile);
         } catch (RestClientException e) {
             e.printStackTrace();
-            logger.error("查询基础订单详情报错",e);
+            logger.error("修改订单回调错误",e);
             throw e;
         }
     }
@@ -219,19 +219,19 @@ public class EsignSignServiceImpl implements IEsignSignService {
 
         // 流程配置,可以不配置,使用默认配置
         String noticeDeveloperUrl = eSignConfig.getSignSuccessUrl();//回调通知URL
-        FlowConfigInfo flowConfigInfo = new FlowConfigInfo(noticeDeveloperUrl, "1,2", redirectUrl, null);
+        FlowConfigInfo flowConfigInfo = new FlowConfigInfo(noticeDeveloperUrl, "1,2", null, null);
         FlowInfo flowInfo = new FlowInfo(true,true,businessScene,flowConfigInfo);
 
         // 签署方信息
         // 平台方
         PosBeanInfo posBean1 = new PosBeanInfo("1", posX, posY); // 签署位置
-        SignfieldInfo signfield1 = new SignfieldInfo(false,"2", fileId, null, null, null, posBean1, null); // 签署区(签署主体是公司)
+        SignfieldInfo signfield1 = new SignfieldInfo(true,"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);//签署方账号
         SignerAccount signAccount = new SignerAccount(signerAccountId, authorizedAccountId);//签署方账号
-        Signer signer1 = new Signer(false, 1, signAccount, signfields, null); // 签署方
+        Signer signer1 = new Signer(true, 1, signAccount, signfields, null); // 签署方
         // 用户方
 //        PosBeanInfo posBean2 = new PosBeanInfo("1", 200F, 100F); // 签署位置
 //        SignfieldInfo signfield2 = new SignfieldInfo(false, null, fileId, null, null, null, posBean2, null); // 签署区