Jelajahi Sumber

Merge remote-tracking branch 'origin/master' into master

yangyj 1 tahun lalu
induk
melakukan
e7cb416d5d
19 mengubah file dengan 321 tambahan dan 126 penghapusan
  1. 3 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/BusinessTaskFailedPageVO.java
  2. 1 1
      blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClient.java
  3. 46 0
      blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClientFallBack.java
  4. 10 9
      blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileTaskController.java
  5. 16 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractTreeDrawingsController.java
  6. 33 24
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  7. 10 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  8. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  9. 2 2
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/feign/EVisaClientImpl.java
  10. 1 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/EVisaService.java
  11. 26 24
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  12. 1 1
      blade-service/blade-land/src/main/java/org/springblade/land/controller/AgreementFileController.java
  13. 48 11
      blade-service/blade-land/src/main/java/org/springblade/land/controller/CompensationInfoController.java
  14. 3 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.java
  15. 3 0
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.xml
  16. 3 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/IAgreementFileService.java
  17. 3 3
      blade-service/blade-land/src/main/java/org/springblade/land/service/ICompensationInfoService.java
  18. 9 0
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/AgreementFileServiceImpl.java
  19. 101 48
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/CompensationInfoServiceImpl.java

+ 3 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/BusinessTaskFailedPageVO.java

@@ -43,4 +43,7 @@ public class BusinessTaskFailedPageVO implements Serializable {
     @ApiModelProperty(value = "签字人员集合(电签任务人)")
     private List<TaskParallel> taskApproveUserNamesList;
 
+    @ApiModelProperty(value = "电签PDF路径")
+    private String sigPdf;
+
 }

+ 1 - 1
blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClient.java

@@ -36,7 +36,7 @@ public interface EVisaClient {
      * 电签(自定义签章)
      */
     @PostMapping(API_PREFIX + "/eVisa/custom")
-    void eVisaCustom(@RequestBody org.springblade.evisa.vo.TaskArchiveDTO eVisaObj);
+    String eVisaCustom(@RequestBody org.springblade.evisa.vo.TaskArchiveDTO eVisaObj);
 
     /**
      * 创建印模

+ 46 - 0
blade-service-api/blade-e-visa-api/src/main/java/org/springblade/evisa/feign/EVisaClientFallBack.java

@@ -0,0 +1,46 @@
+package org.springblade.evisa.feign;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springblade.evisa.vo.CertBeanVO;
+import org.springblade.evisa.vo.EVisaMakeSealVO;
+import org.springblade.evisa.vo.EVisaTaskApprovalVO;
+import org.springblade.evisa.vo.TaskArchiveDTO;
+import org.springframework.stereotype.Component;
+
+@Component
+public class EVisaClientFallBack implements EVisaClient {
+
+    private static final Logger logger = LoggerFactory.getLogger(EVisaClientFallBack.class);
+
+    @Override
+    public String eVisaContractSeal(EVisaTaskApprovalVO task, String finalPdfUrl) {
+        return null;
+    }
+
+    @Override
+    public String eVisa(EVisaTaskApprovalVO task) {
+        return null;
+    }
+
+    @Override
+    public String eVisaCustom(TaskArchiveDTO eVisaObj) {
+        logger.info("-----------------远程feign调用电签自定义签章服务EVisaCustom方法失败-----------------");
+        return "500";
+    }
+
+    @Override
+    public String createSeal(EVisaMakeSealVO vo) {
+        return null;
+    }
+
+    @Override
+    public String certification(String pdfUrl, String fileName, String contractId) {
+        return null;
+    }
+
+    @Override
+    public CertBeanVO onlineCheckSeal(String pdfUrl) {
+        return null;
+    }
+}

+ 10 - 9
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileTaskController.java

@@ -103,20 +103,21 @@ public class ArchiveFileTaskController extends BladeController {
                             signList.add(sign);
                         }
                         eVISATaskArchiveDTO.setSealStrategy(signList);
+                        eVISATaskArchiveDTO.setTaskId(archiveFile.getId().toString());
+                        eVISATaskArchiveDTO.setType(2); //认证
 
-                        try {
-                            //TODO ============= 电签认证 =============
-                            eVISATaskArchiveDTO.setTaskId(archiveFile.getId().toString());
-                            eVISATaskArchiveDTO.setType(2); //认证
-                            this.eVisaClient.eVisaCustom(eVISATaskArchiveDTO);
-                        } catch (Exception e) {
-                            e.getStackTrace();
-                            throw new ServiceException("电签服务器调用失败,请联系管理员,原因:" + e.getMessage());
+                        //TODO ============= 电签认证 =============
+                        String resultMsg = this.eVisaClient.eVisaCustom(eVISATaskArchiveDTO);
+                        if (StringUtils.isEmpty(resultMsg) || ("500").equals(resultMsg)) {
+                            throw new ServiceException("电签服务发生异常,请联系管理员!");
+                        }
+                        if (resultMsg.contains("success@@@@")) {
+                            return R.data(true);
                         }
                     }
                 }
-                return R.data(true);
             }
+            return R.fail("操作失败");
         }
         return R.data(300, false, "没有找到证书文件或PDF文件");
     }

+ 16 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractTreeDrawingsController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.business.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -83,4 +84,19 @@ public class ContractTreeDrawingsController extends BladeController {
         }
     }
 
+    /**
+     * 根据节点pkeyId查看图纸
+     */
+    @GetMapping("/getTreeDrawings")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "获取节点图纸,传入接单PkeyId")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "primaryKeyId", value = "节点primaryKeyId", required = true)
+    })
+    public R<String> getTreeDrawings(Long primaryKeyId){
+        ContractTreeDrawings one = contractTreeDrawingsService.getOne(new LambdaQueryWrapper<ContractTreeDrawings>()
+                .eq(ContractTreeDrawings::getProcessId, primaryKeyId));
+        return R.data(one.getFileUrl());
+    }
+
 }

+ 33 - 24
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -618,36 +618,36 @@ public class TaskController extends BladeController {
                     //通过checkArchiveTaskUserByCurrent检查,说明当前登陆用户是该条任务的审批人,修改审批任务状态
                     Task task = jdbcTemplate.queryForObject("select process_instance_id,form_data_id from u_task where id = " + taskArchiveDTO.getTaskId(), new BeanPropertyRowMapper<>(Task.class));
                     if (task != null) {
-                        //TODO ============ 档案电签推送(每个人都要电签,按照顺序) ============
                         org.springblade.evisa.vo.TaskArchiveDTO eVisaObj = new org.springblade.evisa.vo.TaskArchiveDTO();
                         BeanUtils.copyProperties(taskArchiveDTO, eVisaObj);
                         eVisaObj.setType(1); //审批
-                        try {
-                            this.eVisaClient.eVisaCustom(eVisaObj);
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                            throw new ServiceException("电签服务器调用失败,请联系管理员,原因:" + e.getMessage());
-                        }
 
-                        //获取审批任务关联用户的详情
-                        List<TaskParallel> taskParallels = jdbcTemplate.query("select id,process_instance_id,task_user,task_user_name from u_task_parallel where process_instance_id = '" + task.getProcessInstanceId() + "'", new BeanPropertyRowMapper<>(TaskParallel.class));
-                        if (taskParallels.size() > 0) {
-                            //当前用户任务
-                            TaskParallel taskParallelCurrentUser = taskParallels.stream().filter(f -> f.getTaskUser().equals(SecureUtil.getUserId().toString())).findAny().orElse(null);
-                            if (taskParallelCurrentUser != null) {
-                                //修改当前用户任务为已审批、电签任务状态为成功
-                                jdbcTemplate.execute("update u_task_parallel set status = 2,e_visa_status = 1 where id = " + taskParallelCurrentUser.getId());
-                            }
+                        //TODO ============ 电签审批(每个人都需要电签,按照顺序垂直审批) ============
+                        String resultMsg = this.eVisaClient.eVisaCustom(eVisaObj);
+                        if (StringUtils.isEmpty(resultMsg) || ("500").equals(resultMsg)) {
+                            throw new ServiceException("电签服务发生异常,请联系管理员!");
                         }
+                        if (resultMsg.contains("success@@@@")) {
+                            //获取审批任务关联用户的详情
+                            List<TaskParallel> taskParallels = jdbcTemplate.query("select id,process_instance_id,task_user,task_user_name from u_task_parallel where process_instance_id = '" + task.getProcessInstanceId() + "'", new BeanPropertyRowMapper<>(TaskParallel.class));
+                            if (taskParallels.size() > 0) {
+                                //当前用户任务
+                                TaskParallel taskParallelCurrentUser = taskParallels.stream().filter(f -> f.getTaskUser().equals(SecureUtil.getUserId().toString())).findAny().orElse(null);
+                                if (taskParallelCurrentUser != null) {
+                                    //修改当前用户任务为已审批、电签任务状态为成功
+                                    jdbcTemplate.execute("update u_task_parallel set status = 2,e_visa_status = 1 where id = " + taskParallelCurrentUser.getId());
+                                }
+                            }
 
-                        //获取最新任务状态,判断是否存在未完成的审批任务(最后一个人审批完成);如果没有就闭环,修改审批任务状态、业务数据状态
-                        List<TaskParallel> taskParallelsNow = jdbcTemplate.query("select status from u_task_parallel where process_instance_id = '" + task.getProcessInstanceId() + "'", new BeanPropertyRowMapper<>(TaskParallel.class));
-                        List<TaskParallel> pendingApprovalTask = taskParallelsNow.stream().filter(f -> f.getStatus() != 2).collect(Collectors.toList());
-                        if (pendingApprovalTask.size() == 0) {
-                            //修改审批任务状态
-                            jdbcTemplate.execute("update u_task set status = 2 where id = " + taskArchiveDTO.getTaskId());
-                            //修改业务数据状态
-                            jdbcTemplate.execute("update u_archive_file set status = 2 where id = " + task.getFormDataId());
+                            //获取最新任务状态,判断是否存在未完成的审批任务(最后一个人审批完成);如果没有就闭环,修改审批任务状态、业务数据状态
+                            List<TaskParallel> taskParallelsNow = jdbcTemplate.query("select status from u_task_parallel where process_instance_id = '" + task.getProcessInstanceId() + "'", new BeanPropertyRowMapper<>(TaskParallel.class));
+                            List<TaskParallel> pendingApprovalTask = taskParallelsNow.stream().filter(f -> f.getStatus() != 2).collect(Collectors.toList());
+                            if (pendingApprovalTask.size() == 0) {
+                                //修改审批任务状态
+                                jdbcTemplate.execute("update u_task set status = 2 where id = " + taskArchiveDTO.getTaskId());
+                                //修改业务数据状态
+                                jdbcTemplate.execute("update u_archive_file set status = 2 where id = " + task.getFormDataId());
+                            }
                         }
                     }
                 }
@@ -1502,6 +1502,14 @@ public class TaskController extends BladeController {
 
         //解析page分页数据
         IPage<BusinessTaskFailedPageVO> page = new Page<>(current, size);
+        if (resultList == null || resultList.size() == 0){
+            return R.data(page);
+        }
+        //获取节点pdf ,先获取formData集合
+        List<String> queryIds = resultList.stream().map(l -> l.getFormDataId()).collect(Collectors.toList());
+        String join = StringUtils.join(queryIds, ",");
+        Map<Long, String> query = jdbcTemplate.query("select id ,e_visa_pdf_url from u_information_query where is_deleted = 0 and id in ( "+join+")", new BeanPropertyRowMapper<>(InformationQuery.class)).stream().collect(Collectors.toMap(InformationQuery::getId, l-> StringUtils.isBlank(l.getEVisaPdfUrl())?"":l.getEVisaPdfUrl()));
+
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         List<BusinessTaskFailedPageVO> pageList = resultList.stream()
                 .map(task -> {
@@ -1513,6 +1521,7 @@ public class TaskController extends BladeController {
                     vo.setTaskStatusName(task.getStatus().equals(1) ? "待审批" : task.getStatus().equals(2) ? "已审批" : "已废除");
                     vo.setEVisaStatusName(eVisaStatus == 1 ? "电签失败" : "电签成功");
                     vo.setTaskReportUserName(nameMap.get(Long.parseLong(task.getReportUser())));
+                    vo.setSigPdf(query.get(Long.parseLong(task.getFormDataId())));
                     List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
                     if (taskParallelList != null && taskParallelList.size() > 0) {
                         //判断签字人的验证 2=绿色 3=黄色 999=红色 其他代表=灰色

+ 10 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -758,7 +758,16 @@
         iq.is_deleted = 0
         and iq.classify = #{query.classify}
         and iq.contract_id = #{query.contractId}
-        <if test="query.taskStatus != null and query.taskStatus != ''">and iq.status = #{query.taskStatus}</if>
+        <if test="query.taskStatus != null and query.taskStatus != ''">
+          <choose>
+              <when test="query.taskStatus == 0">
+                  and (iq.status = 0 or iq.status = 3)
+              </when>
+              <otherwise>
+                  and iq.status = #{query.taskStatus}
+              </otherwise>
+          </choose>
+        </if>
         <if test="query.sourceType != null and query.sourceType != ''">and iq.source_type = #{query.sourceType}</if>
         <if test="query.reportNumber != null and query.reportNumber != ''">and t.batch = #{query.reportNumber}</if>
         <if test="query.fileUserIdAndName != null and query.fileUserIdAndName != ''">and iq.file_user_id_and_name like

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -519,7 +519,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                 if (ObjectUtil.isNotEmpty(vor.getCreateTime())) {
                     vor.setStartTime(DateUtil.format(vor.getCreateTime(), "yyyy-MM-dd"));
                 }
-                vor.setTaskStatusStr(new Integer("0").equals(vor.getStatus()) ? "未上报" : new Integer("1").equals(vor.getStatus()) ? "待审批" : new Integer("2").equals(vor.getStatus()) ? "已审批" : "已废除");
+                //已废除归到未上报
+                vor.setTaskStatusStr(new Integer("0").equals(vor.getStatus()) ? "未上报" : new Integer("1").equals(vor.getStatus()) ? "待审批" : new Integer("2").equals(vor.getStatus()) ? "已审批" : "未上报");
                 try {
                     //填报人
                     String fileUserIdAndName = vor.getFileUserIdAndName();

+ 2 - 2
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/feign/EVisaClientImpl.java

@@ -48,8 +48,8 @@ public class EVisaClientImpl implements EVisaClient {
     }
 
     @Override
-    public void eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO eVisaObj) {
-        this.eVisaService.eVisaCustom(eVisaObj);
+    public String eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO eVisaObj) {
+        return this.eVisaService.eVisaCustom(eVisaObj);
     }
 
     @Override

+ 1 - 1
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/EVisaService.java

@@ -26,7 +26,7 @@ public interface EVisaService {
     /**
      * 电签(档案-批量自定义)
      */
-    void eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO eVisaObj);
+    String eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO eVisaObj);
 
     /**
      * 创建印模

+ 26 - 24
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -241,7 +241,7 @@ public class EVisaServiceImpl implements EVisaService {
                 String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,b.certificate_password,b.certificate_user_name from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
                 List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
                 System.out.println("合同-" + contractId + "--" + sqlinfo);
-                if(maps==null ||maps.isEmpty()){
+                if (maps == null || maps.isEmpty()) {
                     return finalPdfUrl;
                 }
                 //准备签章策略
@@ -436,17 +436,17 @@ public class EVisaServiceImpl implements EVisaService {
                     String sqlinfo = " SELECT a.id as keyWord,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
                     System.out.println("东方中讯-个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
                     List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
-                    if(maps != null && !maps.isEmpty()){
+                    if (maps != null && !maps.isEmpty()) {
                         String fileUrl = pdfUrl;
-                        for(Map<String, Object> dataMap : maps){
-                            HashMap<String,Object> daMa = new HashMap<>();
-                            daMa.put("keyWord",dataMap.get("keyWord"));
-                            daMa.put("sealId",dataMap.get("sealId"));
+                        for (Map<String, Object> dataMap : maps) {
+                            HashMap<String, Object> daMa = new HashMap<>();
+                            daMa.put("keyWord", dataMap.get("keyWord"));
+                            daMa.put("sealId", dataMap.get("sealId"));
 
                             byte[] fileByte;
-                            if(fileUrl.indexOf("aliyuncs.com")>=0){
+                            if (fileUrl.indexOf("aliyuncs.com") >= 0) {
                                 fileByte = CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(fileUrl));
-                            }else {
+                            } else {
                                 FileReader fileReader = new FileReader(fileUrl);
                                 fileByte = fileReader.readBytes();
                             }
@@ -454,23 +454,23 @@ public class EVisaServiceImpl implements EVisaService {
                             String originalFileB64 = Base64.toBase64String(fileByte);
                             daMa.put("fileB64", originalFileB64);
                             daMa.put("lastSignFlag", false);
-                            String reData =  signPdfByDFZX(daMa);
-                            if(reData.indexOf("success@")>=0){
+                            String reData = signPdfByDFZX(daMa);
+                            if (reData.indexOf("success@") >= 0) {
                                 fileUrl = reData.split("@@@@")[1];
                             }
                         }
-                        if(fileUrl.indexOf("aliyuncs.com")>=0){
+                        if (fileUrl.indexOf("aliyuncs.com") >= 0) {
                             return E_VISA_ERROR;
-                        }else{
-                            BladeFile bladeFile = this.newIOSSClient.uploadFile(fileUrl.substring(fileUrl.lastIndexOf("/")+1,fileUrl.length()),fileUrl);
+                        } else {
+                            BladeFile bladeFile = this.newIOSSClient.uploadFile(fileUrl.substring(fileUrl.lastIndexOf("/") + 1, fileUrl.length()), fileUrl);
                             if (bladeFile != null) {
-                                System.out.println("pdf上传="+bladeFile.getLink());
+                                System.out.println("pdf上传=" + bladeFile.getLink());
                                 return SUCCESS + "@@@@" + bladeFile.getLink();
                             } else {
                                 return E_VISA_ERROR;
                             }
                         }
-                    }else{
+                    } else {
                         RedisTemplate.delete("sign-" + task.getFormDataId());
                         return SUCCESS + "@@@@" + taskFile.getApprovalFileList().get(0).getFileUrl();
                     }
@@ -540,7 +540,7 @@ public class EVisaServiceImpl implements EVisaService {
      *
      * @param taskArchiveDTO
      */
-    public void eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO taskArchiveDTO) {
+    public String eVisaCustom(org.springblade.evisa.vo.TaskArchiveDTO taskArchiveDTO) {
         //type=1表示任务审批自定义签章,type=2表示认证电签签章(不涉及审批任务)
         if (taskArchiveDTO.getSealStrategy().size() > 0 && taskArchiveDTO.getType() == 1) {
             //获取档案任务
@@ -599,15 +599,18 @@ public class EVisaServiceImpl implements EVisaService {
                                     jdbcTemplate.execute("update u_archive_file set e_visa_file = '" + bladeFile.getLink() + "' where id = " + task.getFormDataId());
                                     String successMsg = SUCCESS + "@@@@" + bladeFile.getLink();
                                     logger.info(successMsg);
+                                    return successMsg;
                                 }
                             }
                         }
                     } catch (Exception e) {
                         logger.error(e.getMessage());
                         e.printStackTrace();
+                        return e.getMessage();
                     }
                 }
             }
+            return "";
         } else if (taskArchiveDTO.getSealStrategy().size() > 0 && taskArchiveDTO.getType() == 2) {
             //此时的taskArchiveDTO.taskId=档案数据业务id(档案认证不涉及审批流任务)
             //获取档案任务的文件信息(这里根据id再查询一次,入参的时候不想重新构造入参的dto了)
@@ -655,11 +658,6 @@ public class EVisaServiceImpl implements EVisaService {
                     //返回结果集
                     if (result != null) {
                         if (result[0] != null) {
-                            /*byte[] byteArray = IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0]));
-                            String dataUrl = "C:\\pdfFiles\\" + SnowFlakeUtil.getId() + ".pdf";
-                            File file1 = new File(dataUrl);
-                            FileUtils.writeByteArrayToFile(file1, byteArray);*/
-
                             MultipartFile newFiles = new MockMultipartFile("file", SnowFlakeUtil.getId() + ".pdf", "text/plain", IOUtils.toByteArray(new ByteArrayInputStream((byte[]) result[0])));
                             BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
                             if (bladeFile != null) {
@@ -667,15 +665,18 @@ public class EVisaServiceImpl implements EVisaService {
                                 jdbcTemplate.execute("update u_archive_file set is_certification = 1,e_visa_file = '" + bladeFile.getLink() + "',certification_time = '" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "' where id = " + taskArchiveDTO.getTaskId());
                                 String successMsg = SUCCESS + "@@@@" + bladeFile.getLink();
                                 logger.info(successMsg);
+                                return successMsg;
                             }
                         }
                     }
                 } catch (Exception e) {
                     logger.error(e.getMessage());
                     e.printStackTrace();
+                    return e.getMessage();
                 }
             }
         }
+        return "";
     }
 
   /*  public static void main(String[] args) throws Exception {
@@ -714,16 +715,17 @@ public class EVisaServiceImpl implements EVisaService {
             System.out.println(fileUrl);
         }
     }*/
+
     /**
      * 东方 中讯
      *
      * @throws Exception
      */
-    public static String signPdfByDFZX(HashMap<String, Object> request)  {
+    public static String signPdfByDFZX(HashMap<String, Object> request) {
         String url = "http://47.110.251.215:9125/FrontSysGs/SealServicezx/FileSignByKeyWord";
         String sysLocalFileUrl = FileUtils.getSysLocalFileUrl();
         String filecode = SnowFlakeUtil.getId() + "";
-        String dataFileUrl = sysLocalFileUrl+"/pdf/"+filecode+".pdf";
+        String dataFileUrl = sysLocalFileUrl + "/pdf/" + filecode + ".pdf";
         try {
             HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory();
             httpRequestFactory.setConnectionRequestTimeout(30000);
@@ -762,7 +764,7 @@ public class EVisaServiceImpl implements EVisaService {
             fout.close();
             return SUCCESS + "@@@@" + dataFileUrl;
         } catch (Exception e) {
-            return  ERROR + "@@@@异常出错";
+            return ERROR + "@@@@异常出错";
         }
     }
 

+ 1 - 1
blade-service/blade-land/src/main/java/org/springblade/land/controller/AgreementFileController.java

@@ -60,7 +60,7 @@ public class AgreementFileController {
             @ApiImplicitParam(name = "agreementId", value = "协议id", required = true)
     })
     public R<List<AgreementFile>> getFileList(Long agreementId) {
-        return R.data(fileService.list(new LambdaQueryWrapper<AgreementFile>().eq(AgreementFile::getAgreementId,agreementId)));
+        return R.data(fileService.getFileList(agreementId));
     }
 
 

+ 48 - 11
blade-service/blade-land/src/main/java/org/springblade/land/controller/CompensationInfoController.java

@@ -38,18 +38,33 @@ public class CompensationInfoController extends BladeController {
     private final ICompensationInfoService compensationInfoService;
 
 
+//    /**
+//     * 新增协议
+//     */
+//    @GetMapping("/add")
+//    @ApiOperationSupport(order = 1)
+//    @ApiOperation(value = "新增协议", notes = "返回协议id")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+//            @ApiImplicitParam(name = "areaId", value = "当前树节点id", required = true),
+//            @ApiImplicitParam(name = "type", value = "协议类型1征地补偿2坟地补偿3专项设施", required = true)
+//    })
+//    public R<Long> add(Long projectId,Long areaId,Integer type){
+//        return R.data(compensationInfoService.add(projectId,areaId,type));
+//    }
+
     /**
      * 新增协议
      */
     @GetMapping("/add")
     @ApiOperationSupport(order = 1)
-    @ApiOperation(value = "新增协议", notes = "返回协议id")
+    @ApiOperation(value = "新增协议", notes = "返回协议列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
             @ApiImplicitParam(name = "areaId", value = "当前树节点id", required = true),
             @ApiImplicitParam(name = "type", value = "协议类型1征地补偿2坟地补偿3专项设施", required = true)
     })
-    public R<Long> add(Long projectId,Long areaId,Integer type){
+    public R<List<AgreementLinkTable>> add(Long projectId,Long areaId,Integer type){
         return R.data(compensationInfoService.add(projectId,areaId,type));
     }
 
@@ -74,10 +89,10 @@ public class CompensationInfoController extends BladeController {
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "协议表单-生成html", notes = "协议表单-生成html")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "id", value = "当前表单id", required = true)
+            @ApiImplicitParam(name = "tableId", value = "当前表单tableId", required = true)
     })
-    public R getExcelHtmlByBuss(Long id) throws Exception {
-        return compensationInfoService.getExcelHtmlByBuss(id);
+    public R getExcelHtmlByBuss(Long tableId) throws Exception {
+        return compensationInfoService.getExcelHtmlByBuss(tableId);
     }
 
 
@@ -88,10 +103,10 @@ public class CompensationInfoController extends BladeController {
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "协议表单-获取坐标位置", notes = "协议表单-获取坐标位置")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "id", value = "当前表单id", required = true)
+            @ApiImplicitParam(name = "tableId", value = "当前表单的tableId", required = true)
     })
-    public R getHtmlBussCols(Long id) throws Exception {
-        return compensationInfoService.getHtmlBussCols(id);
+    public R getHtmlBussCols(Long tableId) throws Exception {
+        return compensationInfoService.getHtmlBussCols(tableId);
     }
 
     /**
@@ -102,11 +117,33 @@ public class CompensationInfoController extends BladeController {
     @ApiOperation(value = "协议表单-获取用户保存数据", notes = "协议表单-获取用户保存数据")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "id", value = "当前表单的id", required = true),
+            @ApiImplicitParam(name = "tableId", value = "当前表单的tableId", required = true),
     })
-    public R getBussDataInfo(Long id) throws FileNotFoundException {
-        return compensationInfoService.getBussDataInfo(id);
+    public R getBussDataInfo(Long id,Long tableId)  {
+        return compensationInfoService.getBussDataInfo(id,tableId);
     }
 
+//    /**
+//     * 用户保存接口
+//     * @param dataInfo
+//     * @return
+//     * @throws Exception
+//     */
+//    @PostMapping("/save_buss_data")
+//    @ApiOperationSupport(order = 6)
+//    @ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存,返回当前协议id")
+//    @ApiImplicitParams(value = {
+//            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+//            @ApiImplicitParam(name = "agreementId", value = "协议的id,修改时放的agreementId", required = true),
+//            @ApiImplicitParam(name = "linkId", value = "当前表单的id,修改时返回的id", required = true),
+//            @ApiImplicitParam(name = "areaId", value = "当前树节点id", required = true),
+//            @ApiImplicitParam(name = "tableId", value = "表单的tableId", required = true)
+//    })
+//    public R saveBussData(@Valid @RequestBody JSONObject dataInfo) throws Exception {
+//        return compensationInfoService.saveBussData(dataInfo);
+//    }
+
+
     /**
      * 用户保存接口
      * @param dataInfo
@@ -123,7 +160,7 @@ public class CompensationInfoController extends BladeController {
             @ApiImplicitParam(name = "areaId", value = "当前树节点id", required = true),
             @ApiImplicitParam(name = "tableId", value = "表单的tableId", required = true)
     })
-    public R saveBussData(@Valid @RequestBody JSONObject dataInfo) throws Exception {
+    public R saveBussData(@RequestBody JSONObject dataInfo){
         return compensationInfoService.saveBussData(dataInfo);
     }
 

+ 3 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.java

@@ -81,4 +81,7 @@ public interface CompensationInfoMapper extends BaseMapper<CompensationInfo> {
     List<Long> getPdfIsNull(@Param("projectId") Long projectId);
 
     void deleteBatch(@Param("ids") List<Long> ids);
+
+    //根据tableId直接获取项目下表单
+    WbsTreePrivate getTableInfo(@Param("tableId") Long id);
 }

+ 3 - 0
blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.xml

@@ -105,6 +105,9 @@
     <select id="getPdfIsNull" resultType="java.lang.Long">
         select id from l_compensation_info where project_id = #{projectId} and merge_pdf_url is null
     </select>
+    <select id="getTableInfo" resultType="org.springblade.manager.entity.WbsTreePrivate">
+        SELECT * FROM m_wbs_tree_private WHERE init_table_id = #{tableId} limit 1
+    </select>
 
 
 </mapper>

+ 3 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/IAgreementFileService.java

@@ -23,6 +23,8 @@ import org.springblade.land.dto.SettlementIntervalDTO;
 import org.springblade.land.entity.AgreementFile;
 import org.springblade.land.entity.SettlementInterval;
 
+import java.util.List;
+
 
 /**
  *  服务类
@@ -33,4 +35,5 @@ import org.springblade.land.entity.SettlementInterval;
 public interface IAgreementFileService extends IService<AgreementFile> {
 
 
+    List<AgreementFile> getFileList(Long agreementId);
 }

+ 3 - 3
blade-service/blade-land/src/main/java/org/springblade/land/service/ICompensationInfoService.java

@@ -50,9 +50,9 @@ public interface ICompensationInfoService extends BaseService<CompensationInfo>
 
     R getHtmlBussCols(Long id) throws Exception;
 
-    R getBussDataInfo(Long linkId);
+    R getBussDataInfo(Long linkId,Long tableId);
 
-    R saveBussData(JSONObject dataInfo) throws Exception;
+    R saveBussData(JSONObject dataInfo);
 
     R getBussPdfDataInfo(Long id);
 
@@ -66,7 +66,7 @@ public interface ICompensationInfoService extends BaseService<CompensationInfo>
 
     IPage<CompensationInfo> page (Query query,CompensationInfo info);
 
-    Long add(Long projectId, Long areaId, Integer type);
+    List<AgreementLinkTable> add(Long projectId, Long areaId, Integer type);
 
     void remove(List<Long> ids);
 

+ 9 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/AgreementFileServiceImpl.java

@@ -1,6 +1,7 @@
 package org.springblade.land.service.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.AllArgsConstructor;
 import org.springblade.core.log.exception.ServiceException;
@@ -22,4 +23,12 @@ import java.util.List;
 public class AgreementFileServiceImpl extends ServiceImpl<AgreementFileMapper, AgreementFile> implements IAgreementFileService {
 
 
+    @Override
+    public List<AgreementFile> getFileList(Long agreementId) {
+        if (agreementId == null){
+            throw new ServiceException("请先保存一次资料再上传附件");
+        }else {
+            return this.list(new LambdaQueryWrapper<AgreementFile>().eq(AgreementFile::getAgreementId,agreementId));
+        }
+    }
 }

+ 101 - 48
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/CompensationInfoServiceImpl.java

@@ -96,7 +96,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
     @Override
     public R getExcelHtmlByBuss(Long id) throws Exception {
         //获取表单信息
-        AgreementLinkTable linkTable = linkTableService.getById(id);
+        WbsTreePrivate linkTable = baseMapper.getTableInfo(id);
         if (StringUtils.isBlank(linkTable.getHtmlUrl())){
             return R.fail("没有获取到表单!");
         }
@@ -111,7 +111,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         Document doc = Jsoup.parse(htmlString);
         Element table = doc.select("table").first();
         // 添加标题显示
-        ProjectInfo projectInfo = baseMapper.getProjectInfo(linkTable.getProjectId());
+        ProjectInfo projectInfo = baseMapper.getProjectInfo(Long.parseLong(linkTable.getProjectId()));
         Elements trs = table.select("tr");
         for (int i = 1; i < 6; i++) {
             Element tr = trs.get(i);
@@ -140,7 +140,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         //获取表单信息
-        AgreementLinkTable linkTable = linkTableService.getById(id);
+        WbsTreePrivate linkTable = baseMapper.getTableInfo(id);
         String fileUrl = linkTable.getHtmlUrl();
         if (StringUtils.isBlank(fileUrl)){
             return R.fail("没有获取到表单!");
@@ -195,7 +195,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
      * 协议表单获取用户保存数据
      */
     @Override
-    public R getBussDataInfo(Long linkId) {
+    public R getBussDataInfo(Long linkId,Long tableId) {
         Map<String, Object> reData = new HashMap<>();
         //获取表单数据
         List<Map<String, Object>> mapList = baseMapper.getBussDataInfo(linkId);
@@ -207,10 +207,21 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         }
         //需要自动生成的字典集合,项目名称197
         List<Integer> buildDict = Arrays.asList(197);
+        String htmlUrl;
+        Long projectId;
         //获取当前表单
         AgreementLinkTable linkTable = linkTableService.getById(linkId);
+        //如果是新增,中间表是空的,就直接去获取项目下的表单配置
+        if (linkTable == null){
+            WbsTreePrivate wbs = baseMapper.getTableInfo(tableId);
+            htmlUrl = wbs.getHtmlUrl();
+            projectId = Long.parseLong(wbs.getProjectId());
+        }else {
+            htmlUrl = linkTable.getHtmlUrl();
+            projectId = linkTable.getProjectId();
+        }
         //获取当前表单配置字典
-        List<WbsFormElement> tableElement = baseMapper.getTableElement(Arrays.asList(linkTable.getTableId()));
+        List<WbsFormElement> tableElement = baseMapper.getTableElement(Arrays.asList(tableId));
         Map<Integer, List<WbsFormElement>> map = tableElement.stream().collect(Collectors.groupingBy(WbsFormElement::getDynamicDict));
         List<Integer> list = tableElement.stream().map(l -> l.getDynamicDict()).collect(Collectors.toList());
         //获取当前表单内需要自动生成的字典
@@ -219,7 +230,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         if (list.size() > 0) {
             Document doc = null;
             try {
-                doc = Jsoup.parse(new File(linkTable.getHtmlUrl()), "utf-8");
+                doc = Jsoup.parse(new File(htmlUrl), "utf-8");
 //                doc = Jsoup.parse(new File("C:\\Users\\泓创研发01\\Desktop\\privateUrl\\1704045947043971072.html"), "utf-8");
             } catch (IOException e) {
                 throw new ServiceException("解析表单html出错");
@@ -242,7 +253,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
                 switch (dict){
                     case 197 :
                         //项目名称
-                        String projectName = jdbcTemplate.queryForObject("select project_name from m_project_info where id = " + linkTable.getProjectId(), String.class);
+                        String projectName = jdbcTemplate.queryForObject("select project_name from m_project_info where id = " + projectId, String.class);
                         reData.put(key,projectName);
                         break;
                 }
@@ -256,7 +267,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
      */
     @Override
     @Transactional
-    public R saveBussData(JSONObject dataInfo) throws Exception {
+    public R saveBussData(JSONObject dataInfo){
         JSONArray dataArray = new JSONArray();
         if (dataInfo.containsKey("dataInfo")) { //节点保存
             JSONObject jsonObject = dataInfo.getJSONObject("dataInfo");
@@ -267,6 +278,61 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         JSONObject tableInfo1 = dataArray.getJSONObject(0);
         Long id = tableInfo1.getLong("agreementId");
         Long areaId = tableInfo1.getLong("areaId");
+        Long projectId = tableInfo1.getLong("projectId");
+        Integer agreeType = Math.toIntExact(tableInfo1.getLong("type"));
+        //如果id为null证明从来没保存过,先新增
+        if (id == null){
+            //补偿id
+            Long agreeId = SnowFlakeUtil.getId();
+            //先新增中间表
+            List<WbsTreePrivate> tables = baseMapper.getTables(projectId, agreeType);
+            //ExcelId与中间表id的映射
+            Map<Long,Long> map = new HashMap<>();
+            for (int i = 0; i < dataArray.size(); i++) {
+                JSONObject jsonObject = dataArray.getJSONObject(i);
+                map.put(jsonObject.getLong("tableId"),jsonObject.getLong("linkId"));
+            }
+            List<AgreementLinkTable> linkTables = tables.stream().map(l -> {
+                AgreementLinkTable table = new AgreementLinkTable();
+                table.setTableId(Long.parseLong(l.getInitTableId()));
+                table.setProjectId(projectId);
+                table.setTableDataId(SnowFlakeUtil.getId());
+                if (map.get(Long.parseLong(l.getInitTableId())) != null){
+                    table.setId(map.get(Long.parseLong(l.getInitTableId())));
+                }else {
+                    table.setId(SnowFlakeUtil.getId());
+                }
+                table.setAgreementId(agreeId);
+                table.setPrivateId(l.getId());
+                table.setSort(l.getSort());
+                table.setExcelId(l.getExcelId());
+                table.setHtmlUrl(l.getHtmlUrl());
+                table.setTableName(l.getNodeName());
+                return table;
+            }).collect(Collectors.toList());
+            id = agreeId;
+            linkTableService.saveBatch(linkTables);
+            for (int i = 0; i < dataArray.size(); i++) {
+                JSONObject jsonObject = dataArray.getJSONObject(i);
+                jsonObject.put("linkId",map.get(jsonObject.getLong("tableId")));
+            }
+            //再保存协议
+            CompensationInfo info = new CompensationInfo();
+            info.setId(agreeId);
+            info.setName("默认名称");
+            //获取当前节点名称
+            RegionTreeInfo treeInfo = treeInfoService.getById(areaId);
+            //获取编号
+            String num = getNumber(areaId);
+            info.setNumber(treeInfo.getAreaName()+num);
+            info.setAreaId(areaId);
+            info.setProjectId(projectId);
+            info.setType(agreeType);
+            info.setLandMoney(new BigDecimal(0));
+            info.setCropsMoney(new BigDecimal(0));
+            info.setAllMoney(new BigDecimal(0));
+            this.save(info);
+        }
         //中间表tableId与dataId的映射
         Map<Long,Long> linkMap = new HashMap<>();
         //获取表单id与数据id的映射
@@ -276,14 +342,18 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         }
         linkTables.stream().forEach(l->linkMap.put(l.getTableDataId(),l.getTableId()));
 
-        for (int i=0; i<dataArray.size();i++) {
-            JSONObject jsonObject = dataArray.getJSONObject(i);
-            //删除原来保存的数据
-            baseMapper.deleteOldData(jsonObject.getLong("linkId"));
-            this.SaveOneTabInfo(jsonObject);
+        try {
+            for (int i = 0; i < dataArray.size(); i++) {
+                JSONObject jsonObject = dataArray.getJSONObject(i);
+                //删除原来保存的数据
+                baseMapper.deleteOldData(jsonObject.getLong("linkId"));
+                this.SaveOneTabInfo(jsonObject);
+            }
+            //合并PDF
+            this.mergePdfs(id);
+        }catch (Exception e){
+            throw new ServiceException("合并PDF出现异常");
         }
-        //合并PDF
-        this.mergePdfs(id);
         //地类补偿金额
         BigDecimal b1 = new BigDecimal(0);
         //青苗
@@ -450,7 +520,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
         }
         //保存协议信息
         this.updateById(info);
-        return R.success("保存成功");
+        return R.data(200,id,"保存成功");
     }
 
     @Override
@@ -498,6 +568,9 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
     @Override
     public R updateCopeTab(Long id) {
         AgreementLinkTable linkTable = linkTableService.getById(id);
+        if (linkTable == null){
+            throw new ServiceException("请先保存一次表单再复制");
+        }
         AgreementLinkTable table = new AgreementLinkTable();
         BeanUtils.copyProperties(linkTable,table);
         table.setId(null);
@@ -514,53 +587,33 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
     @Override
     public IPage<CompensationInfo> page(Query query, CompensationInfo info) {
         //查看列表先删除之前未保存的补偿协议
-        List<Long> ids = baseMapper.getPdfIsNull(info.getProjectId());
-        if (ids != null && ids.size() > 0){
-            linkTableService.deleteByAgreementIds(ids);
-            baseMapper.deleteBatch(ids);
-        }
+//        List<Long> ids = baseMapper.getPdfIsNull(info.getProjectId());
+//        if (ids != null && ids.size() > 0){
+//            linkTableService.deleteByAgreementIds(ids);
+//            baseMapper.deleteBatch(ids);
+//        }
         IPage<CompensationInfo> iPage = new Page<>(query.getCurrent(),query.getSize());
         return baseMapper.page(iPage,info);
     }
 
+
     @Override
-    public Long add(Long projectId, Long areaId, Integer type) {
-        //新增复制
-        Long agreeId = SnowFlakeUtil.getId();
-        //先新增中间表,再复制
+    public List<AgreementLinkTable> add(Long projectId, Long areaId, Integer type) {
+        //获取列表
         List<WbsTreePrivate> tables = baseMapper.getTables(projectId, type);
         List<AgreementLinkTable> linkTables = tables.stream().map(l -> {
             AgreementLinkTable table = new AgreementLinkTable();
             table.setTableId(Long.parseLong(l.getInitTableId()));
             table.setProjectId(projectId);
-            table.setTableDataId(SnowFlakeUtil.getId());
-            table.setId(SnowFlakeUtil.getId());
-            table.setAgreementId(agreeId);
             table.setPrivateId(l.getId());
             table.setSort(l.getSort());
+            table.setId(SnowFlakeUtil.getId());
             table.setExcelId(l.getExcelId());
             table.setHtmlUrl(l.getHtmlUrl());
             table.setTableName(l.getNodeName());
             return table;
         }).collect(Collectors.toList());
-        linkTableService.saveBatch(linkTables);
-        //再保存协议
-        CompensationInfo info = new CompensationInfo();
-        info.setId(agreeId);
-        info.setName("默认名称");
-        //获取当前节点名称
-        RegionTreeInfo treeInfo = treeInfoService.getById(areaId);
-        //获取编号
-        String num = getNumber(areaId);
-        info.setNumber(treeInfo.getAreaName()+num);
-        info.setAreaId(areaId);
-        info.setProjectId(projectId);
-        info.setType(type);
-        info.setLandMoney(new BigDecimal(0));
-        info.setCropsMoney(new BigDecimal(0));
-        info.setAllMoney(new BigDecimal(0));
-        this.save(info);
-        return agreeId;
+        return linkTables;
     }
 
     /**
@@ -625,7 +678,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
     public void unSave(Long agreementId) {
         CompensationInfo info = this.getById(agreementId);
         //如果从未保存过,直接删除
-        if (StringUtils.isBlank(info.getMergePdfUrl())){
+        if (info != null && StringUtils.isBlank(info.getMergePdfUrl())){
             List<Long> list = Arrays.asList(agreementId);
             //删除中间表数据
             linkTableService.deleteByAgreementIds(list);
@@ -965,7 +1018,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
             return R.fail("未获取到清表信息");
         }
         if (DataInfo == null) {
-            DataInfo = (Map<String, Object>) getBussDataInfo(id).getData();
+            DataInfo = (Map<String, Object>) getBussDataInfo(id,linkTable.getTableId()).getData();
         }
 
         //获取excel流 和 html流