liuyc 2 lat temu
rodzic
commit
2871e4a7d0

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -793,7 +793,8 @@ public class InformationWriteQueryController extends BladeController {
         //记录状态
         String status = "1";
         //查询填报状态,type=2试验
-        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2));
+        InformationQuery businessData = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
+                .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2)).stream().findAny().orElse(null);
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:

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

@@ -64,7 +64,7 @@
     </delete>
 
     <select id="selectAll" resultType="org.springblade.business.entity.TrialSelfInspectionRecord">
-        select record_no,report_no from u_trial_self_inspection_record where node_id = #{nodeId} and contract_id = #{contractId}
+        select record_no,report_no from u_trial_self_inspection_record where node_id = #{nodeId} and contract_id = #{contractId} and is_deleted = 0
     </select>
 
     <select id="selectSelfSampleRecord" resultType="java.lang.String">

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

@@ -881,7 +881,8 @@ public class TrialSelfInspectionRecordServiceImpl
 
     private void buildNumber(TrialSelfInspectionRecordDTO dto) {
         StringSPUtils spUtils = new StringSPUtils();
-        List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
+        List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId());
+        List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
 
         //两种类型同时生成
         if (dto.getTableType().contains("1,2") || dto.getTableType().contains("2,1")) {

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml

@@ -288,6 +288,7 @@
         d.is_deleted = 0
         AND d.status = 1
         AND d.type = 1
+        AND wbs_type = 1
         <if test="wbsId!=null and wbsId!=''">
             and wbs_id = #{wbsId}
         </if>

+ 18 - 18
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -136,22 +136,22 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     public List<WbsTreeContractTreeAllVO> tree3(String contractId, Integer type) {
         List<WbsTreeContractTreeAllVO> wbsTreeContractVOS = baseMapper.tree5(Long.parseLong(contractId));
 //        if (ObjectUtils.isNotEmpty(type) && type == 1) {
-            //获取所有已填报信息
-            Map<String, Long> allTable = informationQueryClient.getTreeAllTable(contractId);
-            Set<String> keySet = allTable.keySet();
-            for (String key : keySet) {
-                for (WbsTreeContractTreeAllVO vo : wbsTreeContractVOS) {
-                    if (key.equals(vo.getId() + "")) {
-                        vo.setSubmitCounts(allTable.get(key));
-                        vo.setColorStatus(2);
-                    }
+        //获取所有已填报信息
+        Map<String, Long> allTable = informationQueryClient.getTreeAllTable(contractId);
+        Set<String> keySet = allTable.keySet();
+        for (String key : keySet) {
+            for (WbsTreeContractTreeAllVO vo : wbsTreeContractVOS) {
+                if (key.equals(vo.getId() + "")) {
+                    vo.setSubmitCounts(allTable.get(key));
+                    vo.setColorStatus(2);
                 }
             }
-            wbsTreeContractVOS.stream().forEach(wtc -> {
-                if (wtc.getSubmitCounts() == null) {
-                    wtc.setSubmitCounts(0L);
-                }
-            });
+        }
+        wbsTreeContractVOS.stream().forEach(wtc -> {
+            if (wtc.getSubmitCounts() == null) {
+                wtc.setSubmitCounts(0L);
+            }
+        });
 //        }
         return buildWbsTreeByStreamByTreeAll(wbsTreeContractVOS);
     }
@@ -485,10 +485,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     @Override
     public Map<String, Object> trialRelationTree(String wbsId, String projectId, String contractId, String selfId) {
         //合同段树
-        List<WbsTreeContractVO> wbsTreeContractVOS = baseMapper.tree2(Long.parseLong(wbsId), Long.parseLong(projectId), Long.parseLong(contractId), null, null, null);
+        List<WbsTreeContractVO> wbsTreeContractVOS = baseMapper.tree2(null, Long.parseLong(projectId), Long.parseLong(contractId), null, null, null);
         List<WbsTreeContractVO> wbsTreeContractVOList = buildWbsTreeByStream(wbsTreeContractVOS);
         //是否勾选-试验关联工程部位信息
-        List<String> listResult = new ArrayList<>();
+        /*List<String> listResult = new ArrayList<>();
         if (StringUtils.isNotEmpty(selfId)) {
             List<String> list = baseMapper.queryList(selfId);
             if (list.size() > 0) {
@@ -500,10 +500,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                     }
                 }
             }
-        }
+        }*/
         Map<String, Object> maps = new HashMap<>();
         maps.put("treeContractAll", wbsTreeContractVOList);
-        maps.put("isSelectedStatus", listResult.stream().distinct().collect(Collectors.toList()));
+        //maps.put("isSelectedStatus", listResult.stream().distinct().collect(Collectors.toList()));
         return maps;
     }
 

+ 32 - 13
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -42,6 +42,7 @@ import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.springblade.business.entity.InformationQuery;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.feign.OperationLogClient;
@@ -945,7 +946,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 for (Element element : bhtitle) {
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     if (trindex <= 10) {
-                        reData.put(element.attr("keyName"), node.getPartitionCode()==null?"":node.getPartitionCode());
+                        reData.put(element.attr("keyName"), node.getPartitionCode() == null ? "" : node.getPartitionCode());
                     }
                 }
             }
@@ -1114,13 +1115,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 newStyle.cloneStyleFrom(cell.getCellStyle());
 
 
-
                 short fontHeightInPoints = redFont.getFontHeightInPoints();
-                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow<=8) {
+                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow <= 8) {
 
-                    String title=projectInfo.getProjectName();
-                    if(title.length()>=30){
-                        sheet.getRow(fisRow).setHeight((short)900);
+                    String title = projectInfo.getProjectName();
+                    if (title.length() >= 30) {
+                        sheet.getRow(fisRow).setHeight((short) 900);
                         newStyle.setWrapText(true);
                     }
                     redFont.setBold(true);
@@ -1147,7 +1147,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         if (val.indexOf("__") >= 0) {
                             String[] DataVal = val.split("__");
                             String[] xy = DataVal[1].split("_");
-                            if (Integer.parseInt(xy[0])<trs.size()) {
+                            if (Integer.parseInt(xy[0]) < trs.size()) {
                                 Element ytzData = trs.get(Integer.parseInt(xy[0]));
                                 if (ytzData != null) {
                                     Elements tdsx = ytzData.select("td");
@@ -1258,11 +1258,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         String key = e.getColKey();
                         String[] keys = key.split("__");
                         String[] trtd = keys[1].split("_");
-                        if (Integer.parseInt(trtd[0])<trs.size()) {
+                        if (Integer.parseInt(trtd[0]) < trs.size()) {
                             Element ytzData = trs.get(Integer.parseInt(trtd[0]));
                             if (ytzData != null) {
                                 Elements tdsx = ytzData.select("td");
-                                if (Integer.parseInt(trtd[1])<tdsx.size()) {
+                                if (Integer.parseInt(trtd[1]) < tdsx.size()) {
                                     Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
                                     int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
                                     if (x1 == 0) {
@@ -1381,6 +1381,25 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if (tabpdf2.exists()) {
             tabpdf2.delete();
         }
+
+        //TODO ------ 试验pdf关联部位工程及信息 liuYC 2023-03-13 ------
+        //获取试验记录id
+        List<String> recordIds = baseMapper.queryTrialRecordId(nodeId).stream().distinct().collect(Collectors.toList());
+        if (recordIds.size() > 0) {
+            String recordInfoSql = "select detection_category,detection_result,task_status,pdf_url from u_trial_self_inspection_record where id in(" + StringUtils.join(recordIds, ",") + ")";
+            List<TrialSelfInspectionRecord> query = jdbcTemplate.query(recordInfoSql, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
+            if (query.size() > 0) {
+                //只获取已审批合格自检记录,追加试验pdf到质检后面
+                List<String> pdfUrlsTrail = query.stream().filter(f -> ("已审批").equals(f.getTaskStatus())
+                        && (new Integer(1).equals(f.getDetectionResult()))
+                        && (new Integer(1).equals(f.getDetectionCategory()))).map(TrialSelfInspectionRecord::getPdfUrl).collect(Collectors.toList());
+                if (pdfUrlsTrail.size() > 0) {
+                    data.addAll(pdfUrlsTrail);
+                }
+            }
+        }
+
+
         FileUtils.mergePdfPublicMethods(data, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
 
@@ -1388,13 +1407,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
 
         // 获取顺序
-        int sort =0;
-        if(ObjectUtil.isNotEmpty(wbsTreeContract)){
-            if(wbsTreeContract.getSort()!=null){
+        int sort = 0;
+        if (ObjectUtil.isNotEmpty(wbsTreeContract)) {
+            if (wbsTreeContract.getSort() != null) {
                 sort = wbsTreeContract.getSort();
             }
         }
-        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = "+ sort +" where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
+        String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' ,sort = " + sort + " where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
         jdbcTemplate.execute(sql);
     }