From 8c64104b495b0832607d4f0ac6e9b2c9919f7fe9 Mon Sep 17 00:00:00 2001 From: fl <3098731433@qq.com> Date: Mon, 28 Apr 2025 18:13:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E4=B8=8B=E8=BD=BD=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/controller/search/EpcController.java | 16 ++++ .../controller/search/SouthController.java | 17 ++++ .../com/bonus/tool/dto/ComCorePersonBean.java | 2 +- .../bonus/tool/dto/ComOtherPersonBean.java | 4 +- .../bonus/tool/dto/ComPerformanceBean.java | 6 +- .../com/bonus/tool/dto/PersonFileBean.java | 30 +++++++ .../main/java/com/bonus/tool/dto/SubBean.java | 5 ++ .../bonus/tool/dto/SubOtherPeopleBean.java | 2 +- .../bonus/tool/dto/SubPerformanceBean.java | 8 +- .../bonus/tool/mapper/StateGridMapper.java | 8 ++ .../com/bonus/tool/service/EpcService.java | 7 ++ .../com/bonus/tool/service/SouthService.java | 7 ++ .../tool/service/impl/EpcServiceImpl.java | 69 +++++++++++++++ .../tool/service/impl/SouthServiceImpl.java | 74 +++++++++++++++- .../service/impl/StateGridServiceImpl.java | 88 ++++++++++++++++++- .../main/resources/mapper/StateGridMapper.xml | 6 ++ 16 files changed, 334 insertions(+), 15 deletions(-) create mode 100644 search-tool/src/main/java/com/bonus/tool/dto/PersonFileBean.java diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/EpcController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/EpcController.java index f00f6d2..05c4a53 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/EpcController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/EpcController.java @@ -114,5 +114,21 @@ public class EpcController extends BaseController { } } + /** + * EPC模版下载 + * @param + * @return + */ + @ApiOperation(value = "EPC模版下载") + // @PreAuthorize("@ss.hasPermi('key:people:add')") + @PostMapping("/downloadEpcTemp") + public AjaxResult downloadEpcTemp(@RequestBody TbGwModelDto o) { + try { + return service.downloadEpcTemp(o); + }catch (Exception e){ + log.info("国网模版修改失败{}",e.getMessage()); + return error(e.getMessage()); + } + } } diff --git a/search-tool/src/main/java/com/bonus/tool/controller/search/SouthController.java b/search-tool/src/main/java/com/bonus/tool/controller/search/SouthController.java index 98ecd7b..384f7d4 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/search/SouthController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/search/SouthController.java @@ -115,5 +115,22 @@ public class SouthController extends BaseController { } } + /** + * 南网模版下载 + * @param + * @return + */ + @ApiOperation(value = "南网模版下载") + // @PreAuthorize("@ss.hasPermi('key:people:add')") + @PostMapping("/downloadEpcTemp") + public AjaxResult downloadSouthTemp(@RequestBody TbGwModelDto o) { + try { + return service.downloadSouthTemp(o); + }catch (Exception e){ + log.info("国网模版修改失败{}",e.getMessage()); + return error(e.getMessage()); + } + } + } diff --git a/search-tool/src/main/java/com/bonus/tool/dto/ComCorePersonBean.java b/search-tool/src/main/java/com/bonus/tool/dto/ComCorePersonBean.java index db50cc9..b67be6e 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/ComCorePersonBean.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/ComCorePersonBean.java @@ -11,7 +11,7 @@ import java.util.List; * @date 2025/4/21 */ @Data -public class ComCorePersonBean { +public class ComCorePersonBean extends PersonFileBean{ private Long parentId; 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 ad3dde0..1d5fc82 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 @@ -3,12 +3,14 @@ package com.bonus.tool.dto; import com.bonus.common.annotation.Excel; import lombok.Data; +import java.util.List; + /** * @author fly * @date 2025/4/21 */ @Data -public class ComOtherPersonBean { +public class ComOtherPersonBean extends PersonFileBean{ private Long parentId; diff --git a/search-tool/src/main/java/com/bonus/tool/dto/ComPerformanceBean.java b/search-tool/src/main/java/com/bonus/tool/dto/ComPerformanceBean.java index f57ff5a..ce0eea7 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/ComPerformanceBean.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/ComPerformanceBean.java @@ -59,7 +59,6 @@ public class ComPerformanceBean { /** * 承包范围 */ - @Excel(name = "承包范围", sort = 8) private String contractRang; /** @@ -72,5 +71,10 @@ public class ComPerformanceBean { */ private String ownerPhone; + /** + * 文件 + */ + private List fileList; + } diff --git a/search-tool/src/main/java/com/bonus/tool/dto/PersonFileBean.java b/search-tool/src/main/java/com/bonus/tool/dto/PersonFileBean.java new file mode 100644 index 0000000..0a8f4ac --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/dto/PersonFileBean.java @@ -0,0 +1,30 @@ +package com.bonus.tool.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @author fly + * @date 2025/4/21 + */ +@Data +public class PersonFileBean { + + /** + * 身份证照片 第一个正面 第二个反面 + */ + private List idCardFileList; + + + /** + * 资格证书照片 + */ + private List diplomaFileList; + + /** + * 其他资质照片 + */ + private List otherFileList; + +} diff --git a/search-tool/src/main/java/com/bonus/tool/dto/SubBean.java b/search-tool/src/main/java/com/bonus/tool/dto/SubBean.java index 0ef1025..7066c08 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/SubBean.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/SubBean.java @@ -36,4 +36,9 @@ public class SubBean { */ private List subPersonList; + /** + * 文件 + */ + private List subFileList; + } diff --git a/search-tool/src/main/java/com/bonus/tool/dto/SubOtherPeopleBean.java b/search-tool/src/main/java/com/bonus/tool/dto/SubOtherPeopleBean.java index 3fb12e2..6f03ffa 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/SubOtherPeopleBean.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/SubOtherPeopleBean.java @@ -11,7 +11,7 @@ import java.util.List; * @date 2025/4/22 */ @Data -public class SubOtherPeopleBean { +public class SubOtherPeopleBean extends PersonFileBean{ private Long parentId; diff --git a/search-tool/src/main/java/com/bonus/tool/dto/SubPerformanceBean.java b/search-tool/src/main/java/com/bonus/tool/dto/SubPerformanceBean.java index 9d627be..3ee33a5 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/SubPerformanceBean.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/SubPerformanceBean.java @@ -71,9 +71,9 @@ public class SubPerformanceBean { */ private String htRemark; - - - - + /** + * 文件 + */ + private List subPerfFileList; } diff --git a/search-tool/src/main/java/com/bonus/tool/mapper/StateGridMapper.java b/search-tool/src/main/java/com/bonus/tool/mapper/StateGridMapper.java index d4d9b08..1467c8e 100644 --- a/search-tool/src/main/java/com/bonus/tool/mapper/StateGridMapper.java +++ b/search-tool/src/main/java/com/bonus/tool/mapper/StateGridMapper.java @@ -121,4 +121,12 @@ public interface StateGridMapper { * @return */ int updateStateGridTemp(TbGwModelDto o); + + /** + * 根据表名和id获取对应附件列表 + * @param id + * @param tableName + * @return + */ + List getFileSourceList(@Param("id") Long id,@Param("tableName") String tableName); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/EpcService.java b/search-tool/src/main/java/com/bonus/tool/service/EpcService.java index 996dc3c..6f6c38e 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/EpcService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/EpcService.java @@ -41,4 +41,11 @@ public interface EpcService { * @return */ AjaxResult updateEpcTemp(TbGwModelDto o); + + /** + * EPC模版下载 + * @param + * @return + */ + AjaxResult downloadEpcTemp(TbGwModelDto o); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/SouthService.java b/search-tool/src/main/java/com/bonus/tool/service/SouthService.java index b7f2684..ec03354 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/SouthService.java +++ b/search-tool/src/main/java/com/bonus/tool/service/SouthService.java @@ -41,4 +41,11 @@ public interface SouthService { * @return */ AjaxResult updateSouthTemp(TbGwModelDto o); + + /** + * 南网模版下载 + * @param o + * @return + */ + AjaxResult downloadSouthTemp(TbGwModelDto o); } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java index 47fa45b..19be38a 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java @@ -1,15 +1,18 @@ package com.bonus.tool.service.impl; import com.bonus.common.core.domain.AjaxResult; +import com.bonus.common.enums.TableType; import com.bonus.common.utils.SecurityUtils; import com.bonus.tool.dto.*; import com.bonus.tool.mapper.EpcMapper; +import com.bonus.tool.mapper.StateGridMapper; import com.bonus.tool.service.EpcService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -23,6 +26,9 @@ public class EpcServiceImpl implements EpcService { @Resource private EpcMapper mapper; + @Resource + private StateGridMapper stateGridMapper; + /** * Epc模版列表查询 * @@ -146,6 +152,69 @@ public class EpcServiceImpl implements EpcService { return AjaxResult.success("Epc模板修改成功"); } + @Override + public AjaxResult downloadEpcTemp(TbGwModelDto o) { + AjaxResult ajaxResult = getEpcTempById(o); + if (ajaxResult.isSuccess()) { + TbGwModelVo data = (TbGwModelVo) ajaxResult.get("data"); + //将每种数据的文件查出来封装进去 + //1.2公司核心人员文件 + data.getComCoreList().forEach(item -> { + //获取附件信息 + List comCoreList = stateGridMapper.getFileSourceList(item.getId(),TableType.TB_KEY_PEOPLE.getCode()); + personFileGroup(item, comCoreList); + }); + //1.3公司其他人员文件 + data.getComOtherList().forEach(item -> { + //获取附件信息 + List comOtherList = stateGridMapper.getFileSourceList(item.getId(),TableType.TB_OTHER_PEOPLE.getCode()); + personFileGroup(item, comOtherList); + }); + + //2.2拟派人员材料 + data.getSubPersonList().forEach(item -> { + //获取附件信息 + List comOtherList = stateGridMapper.getFileSourceList(item.getId(),TableType.TB_SUB_PEOPLE.getCode()); + personFileGroup(item, comOtherList); + }); + + } + return AjaxResult.success(); + } + + /** + * 根据文件类型对文件列表进行分组,并设置到item对象中。 + * @param 继承自PersonFileBean的类型 + * @param item 继承自PersonFileBean的具体实例 + * @param list 文件源列表 + */ + private void personFileGroup(T item, List list) { + List type1List = new ArrayList<>(); + List type2List = new ArrayList<>(); + List type3List = new ArrayList<>(); + for (TbFileSourceVo file : list) { + int fileType = Integer.parseInt(file.getFileType()); + switch (fileType) { + case 1: + type1List.add(file); + break; + case 2: + type2List.add(file); + break; + case 3: + type3List.add(file); + break; + default: + // 如果有其他 fileType,可以在这里处理 + break; + } + } + // 设置到 item 对应的字段中 + item.setIdCardFileList(type1List); + item.setDiplomaFileList(type2List); + item.setOtherFileList(type3List); + } + /** * 删除Epc模版关联数据 * diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java index 4caaa98..3a77a87 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java @@ -1,18 +1,18 @@ package com.bonus.tool.service.impl; import com.bonus.common.core.domain.AjaxResult; +import com.bonus.common.enums.TableType; import com.bonus.common.utils.SecurityUtils; -import com.bonus.tool.dto.ComCorePersonBean; -import com.bonus.tool.dto.ComOtherPersonBean; -import com.bonus.tool.dto.TbGwModelDto; -import com.bonus.tool.dto.TbGwModelVo; +import com.bonus.tool.dto.*; import com.bonus.tool.mapper.SouthMapper; +import com.bonus.tool.mapper.StateGridMapper; import com.bonus.tool.service.SouthService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -26,6 +26,9 @@ public class SouthServiceImpl implements SouthService { @Resource private SouthMapper mapper; + @Resource + private StateGridMapper stateGridMapper; + /** * 南网模版列表查询 * @@ -149,6 +152,69 @@ public class SouthServiceImpl implements SouthService { return AjaxResult.success("South模板修改成功"); } + @Override + public AjaxResult downloadSouthTemp(TbGwModelDto o) { + AjaxResult ajaxResult = getSouthTempById(o); + if (ajaxResult.isSuccess()) { + TbGwModelVo data = (TbGwModelVo) ajaxResult.get("data"); + //将每种数据的文件查出来封装进去 + //1.2公司核心人员文件 + data.getComCoreList().forEach(item -> { + //获取附件信息 + List comCoreList = stateGridMapper.getFileSourceList(item.getId(), TableType.TB_KEY_PEOPLE.getCode()); + personFileGroup(item, comCoreList); + }); + //1.3公司其他人员文件 + data.getComOtherList().forEach(item -> { + //获取附件信息 + List comOtherList = stateGridMapper.getFileSourceList(item.getId(),TableType.TB_OTHER_PEOPLE.getCode()); + personFileGroup(item, comOtherList); + }); + + //2.2拟派人员材料 + data.getSubPersonList().forEach(item -> { + //获取附件信息 + List comOtherList = stateGridMapper.getFileSourceList(item.getId(),TableType.TB_SUB_PEOPLE.getCode()); + personFileGroup(item, comOtherList); + }); + + } + return AjaxResult.success(); + } + + /** + * 根据文件类型对文件列表进行分组,并设置到item对象中。 + * @param 继承自PersonFileBean的类型 + * @param item 继承自PersonFileBean的具体实例 + * @param list 文件源列表 + */ + private void personFileGroup(T item, List list) { + List type1List = new ArrayList<>(); + List type2List = new ArrayList<>(); + List type3List = new ArrayList<>(); + for (TbFileSourceVo file : list) { + int fileType = Integer.parseInt(file.getFileType()); + switch (fileType) { + case 1: + type1List.add(file); + break; + case 2: + type2List.add(file); + break; + case 3: + type3List.add(file); + break; + default: + // 如果有其他 fileType,可以在这里处理 + break; + } + } + // 设置到 item 对应的字段中 + item.setIdCardFileList(type1List); + item.setDiplomaFileList(type2List); + item.setOtherFileList(type3List); + } + /** * 删除南网模版关联数据 * 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 24fc408..864c810 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 @@ -1,6 +1,7 @@ package com.bonus.tool.service.impl; import com.bonus.common.core.domain.AjaxResult; +import com.bonus.common.enums.TableType; import com.bonus.common.utils.SecurityUtils; import com.bonus.tool.dto.*; import com.bonus.tool.mapper.StateGridMapper; @@ -10,6 +11,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -195,15 +197,95 @@ public class StateGridServiceImpl implements StateGridService { if (ajaxResult.isSuccess()) { TbGwModelVo data = (TbGwModelVo) ajaxResult.get("data"); //将每种数据的文件查出来封装进去 + //1.1公司业绩文件 + data.getComPerfList().forEach(item -> { + //获取附件信息 + List comPerfFileList = getFileSourceList(item.getId(),TableType.TB_COMPANY_PERF.getCode()); + item.setFileList(comPerfFileList); + }); + //1.2公司核心人员文件 + data.getComCoreList().forEach(item -> { + //获取附件信息 + List comCoreList = getFileSourceList(item.getId(),TableType.TB_KEY_PEOPLE.getCode()); + personFileGroup(item, comCoreList); + }); + + //1.3公司其他人员文件 + data.getComOtherList().forEach(item -> { + //获取附件信息 + List comOtherList = getFileSourceList(item.getId(),TableType.TB_OTHER_PEOPLE.getCode()); + personFileGroup(item, comOtherList); + }); + + //1.4 分包资质 + data.getSubList().forEach(item -> { + //获取附件信息 + List subFileList = getFileSourceList(item.getId(),TableType.TB_SUB.getCode()); + item.setSubFileList(subFileList); + + //2.1分包业绩证明材料 + item.getSubPerfList().forEach(perfItem -> { + //获取附件信息 + List subPerfList = getFileSourceList(perfItem.getId(),TableType.TB_SUB_PERF.getCode()); + perfItem.setSubPerfFileList(subPerfList); + }); + //2.2拟派人员材料 + item.getSubPersonList().forEach(personItem -> { + //获取附件信息 + List comOtherList = getFileSourceList(personItem.getId(),TableType.TB_SUB_PEOPLE.getCode()); + personFileGroup(personItem, comOtherList); + }); + + }); } - return null; + return AjaxResult.success(); } - private List getFileSourceList(TbGwModelDto o) { - return null; + /** + * 根据文件类型对文件列表进行分组,并设置到item对象中。 + * @param 继承自PersonFileBean的类型 + * @param item 继承自PersonFileBean的具体实例 + * @param list 文件源列表 + */ + private void personFileGroup(T item, List list) { + List type1List = new ArrayList<>(); + List type2List = new ArrayList<>(); + List type3List = new ArrayList<>(); + for (TbFileSourceVo file : list) { + int fileType = Integer.parseInt(file.getFileType()); + switch (fileType) { + case 1: + type1List.add(file); + break; + case 2: + type2List.add(file); + break; + case 3: + type3List.add(file); + break; + default: + // 如果有其他 fileType,可以在这里处理 + break; + } + } + // 设置到 item 对应的字段中 + item.setIdCardFileList(type1List); + item.setDiplomaFileList(type2List); + item.setOtherFileList(type3List); } + /** + * 查询文件源信息 + * @param id + * @param tableName + * @return + */ + private List getFileSourceList(Long id, String tableName) { + return mapper.getFileSourceList(id,tableName); + } + + /** * 删除国网模版关联数据 * diff --git a/search-tool/src/main/resources/mapper/StateGridMapper.xml b/search-tool/src/main/resources/mapper/StateGridMapper.xml index b0443fa..0e5de7f 100644 --- a/search-tool/src/main/resources/mapper/StateGridMapper.xml +++ b/search-tool/src/main/resources/mapper/StateGridMapper.xml @@ -242,4 +242,10 @@ AND tgsu.sub_id = #{subId} + +