From 758ee01647bd8a6ffa66370df7bece7968e434f8 Mon Sep 17 00:00:00 2001 From: fl <3098731433@qq.com> Date: Fri, 27 Jun 2025 17:23:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=97=E7=BD=91,epc=E5=92=8C=E5=9B=BD?= =?UTF-8?q?=E7=BD=91=E6=A8=A1=E6=9D=BF=E4=B8=8B=E8=BC=89=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/tool/dto/ComOtherPersonBean.java | 5 ++ .../service/impl/StateGridServiceImpl.java | 85 ++++++++++++++----- .../main/resources/mapper/StateGridMapper.xml | 3 +- 3 files changed, 70 insertions(+), 23 deletions(-) diff --git a/search-tool/src/main/java/com/bonus/tool/dto/ComOtherPersonBean.java b/search-tool/src/main/java/com/bonus/tool/dto/ComOtherPersonBean.java index 6c80437..3481824 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/ComOtherPersonBean.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/ComOtherPersonBean.java @@ -73,4 +73,9 @@ public class ComOtherPersonBean extends PersonFileBean{ */ private Integer isNormal; + /** + * 职工类型 + */ + private String workType; + } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java index 1908d9e..985ece8 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java @@ -23,6 +23,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.*; +import java.util.stream.Collectors; /** * @author fly @@ -381,6 +382,10 @@ public class StateGridServiceImpl implements StateGridService { //项目关键人员 if (tbData.getComCoreList() != null && !tbData.getComCoreList().isEmpty()) { for (ComCorePersonBean item : tbData.getComCoreList()) { + + if(!("项目经理".equals(item.getPostName()) || "项目负责人".equals(item.getPostName()))){ + continue; + } // 【拟投入项目经理(项目负责人)一览表】 Map map = new HashMap<>(); map.put("bName", ""); // 标的名称 @@ -414,7 +419,7 @@ public class StateGridServiceImpl implements StateGridService { map2.put("level", item2.getLevel()); // 项目经理(项目负责人)级别 } if ("项目经理B证".equals(item2.getDiploma())) { - map2.put("bCode", ""); // 项目经理(项目负责人)B证证书编号 + map2.put("bCode", item2.getDiploma()+item2.getDiplomaNum()); // 项目经理(项目负责人)B证证书编号 } }); } @@ -503,6 +508,7 @@ public class StateGridServiceImpl implements StateGridService { //本项目现场作业人员统计表 if (tbData.getComOtherList() != null && !tbData.getComOtherList().isEmpty()) { for (ComOtherPersonBean item : tbData.getComOtherList()) { + //表格 数据 Map map = new HashMap<>(); map.put("name", item.getUserName() != null ? item.getUserName() : "" ); // 姓名 map.put("position", item.getPostName() != null ? item.getPostName() : "" ); // 工作岗位 @@ -520,7 +526,19 @@ public class StateGridServiceImpl implements StateGridService { // 投入本项目主要项目团队(施工团队)一览表 if (tbData.getComOtherList() != null && !tbData.getComOtherList().isEmpty()) { - for (ComOtherPersonBean item : tbData.getComOtherList()) { + + //使用 Java 8 Stream 进行分组、排序并每组只取一个 + Map groupedMap = tbData.getComOtherList().stream() + .filter(Objects::nonNull) // 非空过滤 + .sorted(Comparator.comparing(ComOtherPersonBean::getPostName)) // 按 postName 排序 + .collect(Collectors.toMap( + ComOtherPersonBean::getPostName, // 分组字段 + item -> item, // 当前元素本身 + (existing, replacement) -> existing // 如果键冲突,保留第一个出现的元素 + )); + // 获取去重后的有序列表 + List result = new ArrayList<>(groupedMap.values()); + for (ComOtherPersonBean item : result) { Map map = new HashMap<>(); List proList = new ArrayList<>(); map.put("name", item.getUserName() != null ? item.getUserName() : ""); // 姓名 @@ -542,7 +560,15 @@ public class StateGridServiceImpl implements StateGridService { Map map2 = new HashMap<>(); List> imgList = new ArrayList<>(); // 项目副经理证书图片及其他个人材料图片 map.put("title", item.getTitle() != null ? item.getTitle() : ""); // 项目名称 - item.getOtherFileList().forEach(item2 -> { + List allFileList = new ArrayList<>(); + List certList = item.getCertList(); + if (certList != null && !certList.isEmpty()) { + certList.forEach(item1 -> { + allFileList.addAll(item1.getTbFileSourceVoList()); + }); + } + allFileList.addAll(item.getOtherFileList()); + allFileList.forEach(item2 -> { Map imgMap = new HashMap<>(); try { imgMap.put("index", IdUtils.fastSimpleUUID()); @@ -742,24 +768,35 @@ public class StateGridServiceImpl implements StateGridService { otherMap.put("zw", item.getPostName() != null ? item.getPostName() : ""); otherMap.put("name", item.getUserName() != null ? item.getUserName() : ""); otherMap.put("zc", item.getTitle() != null ? item.getTitle() : ""); - otherMap.put("yg", item.getDiploma()); - otherMap.put("zs", item.getDiploma() != null ? item.getDiploma() : ""); - otherMap.put("jb", item.getLevel() != null ? item.getLevel() : ""); - otherMap.put("zh", item.getDiplomaNum() != null ? item.getDiplomaNum() : ""); - otherMap.put("zy", item.getMajor() != null ? item.getMajor() : ""); - otherMap.put("bh", ""); // 处理证书列表 List> zsList = new ArrayList<>(); + otherMap.put("yg", item.getWorkType() != null ? item.getWorkType() : ""); +// otherMap.put("zs", ""); +// otherMap.put("jb", ""); +// otherMap.put("zh", ""); +// otherMap.put("zy", ""); +// otherMap.put("bh", ""); + if(!item.getCertList().isEmpty()){ + for (int i = 0; i < item.getCertList().size(); i++) { + TbCertificationVo cert = item.getCertList().get(i); + if(i == 0){ + otherMap.put("zs", cert.getDiploma() != null ? cert.getDiploma() : ""); + otherMap.put("jb", cert.getLevel() != null ? cert.getLevel() : ""); + otherMap.put("zh", cert.getDiplomaNum() != null ? cert.getDiplomaNum() : ""); + otherMap.put("zy", item.getMajor() != null ? item.getMajor() : ""); + otherMap.put("bh", ""); + }else{ + Map zsMap = new HashMap<>(); + zsMap.put("zs", cert.getDiploma() != null ? cert.getDiploma() : ""); + zsMap.put("jb", cert.getLevel() != null ? cert.getLevel() : ""); + zsMap.put("zh", cert.getDiplomaNum() != null ? cert.getDiplomaNum() : ""); + zsMap.put("zy", item.getMajor() != null ? item.getMajor() : ""); + zsMap.put("bh", ""); + zsList.add(zsMap); + } + } + } //表设计是不可能有两个证件,后续修改,将item.getDiploma()改成集合存储 -// if (item.getDiploma() != null || item.getDiplomaNum() != null || item.getMajor() != null || item.getLevel() != null) { -// Map zsMap = new HashMap<>(); -// zsMap.put("zs", item.getDiploma() != null ? item.getDiploma() : ""); -// zsMap.put("jb", item.getLevel() != null ? item.getLevel() : ""); -// zsMap.put("zh", item.getDiplomaNum() != null ? item.getDiplomaNum() : ""); -// zsMap.put("zy", item.getMajor() != null ? item.getMajor() : ""); -// zsMap.put("bh", ""); -// zsList.add(zsMap); -// } otherMap.put("zsList", zsList); otherUserList.add(otherMap); // 处理人员证件图片 @@ -777,8 +814,10 @@ public class StateGridServiceImpl implements StateGridService { } } - if (item.getDiplomaFileList() != null) { - allImages.addAll(item.getDiplomaFileList()); + if (!item.getCertList().isEmpty()) { + item.getCertList().forEach(item2 -> { + allImages.addAll(item2.getTbFileSourceVoList()); + }); } if (item.getOtherFileList() != null) { allImages.addAll(item.getOtherFileList()); @@ -884,8 +923,10 @@ public class StateGridServiceImpl implements StateGridService { // 处理人员证件图片 // 处理身份证、资格证书和其他资质的图片 List allImages = new ArrayList<>(); - if (item.getDiplomaFileList() != null) { - allImages.addAll(item.getDiplomaFileList()); + if (!item.getCertList().isEmpty()) { + item.getCertList().forEach(item2 -> { + allImages.addAll(item2.getTbFileSourceVoList()); + }); } if (item.getOtherFileList() != null) { allImages.addAll(item.getOtherFileList()); diff --git a/search-tool/src/main/resources/mapper/StateGridMapper.xml b/search-tool/src/main/resources/mapper/StateGridMapper.xml index 68b1ad0..1b37dc1 100644 --- a/search-tool/src/main/resources/mapper/StateGridMapper.xml +++ b/search-tool/src/main/resources/mapper/StateGridMapper.xml @@ -222,7 +222,8 @@ tkp.diploma_num, tkp.major, tkp.`level`, - tgou.position as post_name + tgou.position as post_name, + if(tkp.work_type = 1,'正式职工','劳务派遣') as workType FROM tb_gw_other_user tgou LEFT JOIN tb_other_people tkp ON tgou.other_id = tkp.id WHERE tgou.gw_id = #{id}