Browse Source

质检-日志填报
1、按月封装 调整责任者名称
2、合并pdf 如果有电签pdf优先使用电签pdf

LHB 1 month ago
parent
commit
bab5e1f7e8

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java

@@ -282,7 +282,7 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
                 try {
                     //查询节点名称
                     nodeName = jdbcTemplate.queryForObject("select node_name from m_wbs_tree_private where p_key_id = " + contractLog.getWbsNodeId(), String.class);
-                    contractName = jdbcTemplate.queryForObject("select contract_name from m_contract_info where id = " + contractLog.getContractId(), String.class);
+                    contractName = jdbcTemplate.queryForObject("select case when contract_type = 1 then construction_unit_name else supervision_unit_name end from m_contract_info where id = " + contractLog.getContractId(), String.class);
                 } catch (DataAccessException e) {}
                 if(nodeName != null && contractName != null){
                     ContractLogMonthPack contractLogMonthPack = new ContractLogMonthPack();
@@ -298,7 +298,12 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
 
                     //排序
                     monthLogs.sort(Comparator.comparing(ContractLog::getRecordTime));
-                    List<String> pdfFiles = monthLogs.stream().map(ContractLog::getPdfUrl).collect(Collectors.toList());
+                    List<String> pdfFiles = monthLogs.stream().map(m -> {
+                        if(StringUtil.isNotBlank(m.getEVisaPdfUrl())){
+                            return m.getEVisaPdfUrl();
+                        }
+                        return m.getPdfUrl();
+                    }).collect(Collectors.toList());
 
                     try {
                         String filePath = FileUtils.getSysLocalFileUrl();