|
|
@@ -268,4 +268,55 @@ public class PipeUseRegistrationReportServiceImpl extends ServiceImpl<PipeUseReg
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<PipeUseRegistrationReportExportVO> getPipeUseRegistrationReportExportList(PipeUseRegistrationReportPageReqVO pageReqVO) {
|
|
|
+ List<PipeUseRegistrationReportDO> list;
|
|
|
+ if (pageReqVO.getIds() != null && !pageReqVO.getIds().isEmpty()) {
|
|
|
+ // 导出勾选的数据
|
|
|
+ String[] idArray = pageReqVO.getIds().split(",");
|
|
|
+ list = pipeUseRegistrationReportMapper.selectBatchIds(Arrays.asList(idArray));
|
|
|
+ } else {
|
|
|
+ // 导出全部(不加分页限制)
|
|
|
+ pageReqVO.setPageNo(1);
|
|
|
+ pageReqVO.setPageSize(Integer.MAX_VALUE);
|
|
|
+ list = pipeUseRegistrationReportMapper.selectPage(pageReqVO).getList();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取部门名称
|
|
|
+ List<String> deptIds = list.stream().map(PipeUseRegistrationReportDO::getDeptId)
|
|
|
+ .filter(Objects::nonNull).toList();
|
|
|
+ Map<String, String> deptNameMap = new HashMap<>();
|
|
|
+ if (!deptIds.isEmpty()) {
|
|
|
+ List<DeptRespDTO> deptRespDTOS = deptApi.getDeptList(deptIds).getCheckedData();
|
|
|
+ deptRespDTOS.forEach(d -> deptNameMap.put(d.getId(), d.getName()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 转换为导出VO
|
|
|
+ List<PipeUseRegistrationReportExportVO> exportList = new ArrayList<>();
|
|
|
+ for (PipeUseRegistrationReportDO item : list) {
|
|
|
+ PipeUseRegistrationReportExportVO vo = new PipeUseRegistrationReportExportVO();
|
|
|
+ vo.setProjectNo(item.getProjectNo());
|
|
|
+ vo.setUnitName(item.getUnitName());
|
|
|
+ vo.setReportNo(item.getReportNo());
|
|
|
+ vo.setSubmitTime(item.getSubmitTime());
|
|
|
+ vo.setApprovalTime(item.getApprovalTime());
|
|
|
+ vo.setRemark(item.getRemark());
|
|
|
+ vo.setDeptName(deptNameMap.get(item.getDeptId()));
|
|
|
+ // 审核状态转文本
|
|
|
+ if (item.getStatus() == null) {
|
|
|
+ vo.setStatusStr("-");
|
|
|
+ } else if (item.getStatus() == 100) {
|
|
|
+ vo.setStatusStr("审核中");
|
|
|
+ } else if (item.getStatus() == 200) {
|
|
|
+ vo.setStatusStr("已通过");
|
|
|
+ } else if (item.getStatus() == 300) {
|
|
|
+ vo.setStatusStr("已拒绝");
|
|
|
+ } else {
|
|
|
+ vo.setStatusStr("-");
|
|
|
+ }
|
|
|
+ exportList.add(vo);
|
|
|
+ }
|
|
|
+ return exportList;
|
|
|
+ }
|
|
|
+
|
|
|
}
|