|
@@ -567,41 +567,49 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
infoData.add(info);
|
|
infoData.add(info);
|
|
});
|
|
});
|
|
//根据项目id查出所有的新增行数据及对应的附件
|
|
//根据项目id查出所有的新增行数据及对应的附件
|
|
- String projectId = reportData.getProjectId();
|
|
|
|
- //根据项目id找出所有的reportID
|
|
|
|
- List<CwProjectReportData> byProjectId = reportMapper.getByProjectId(projectId);
|
|
|
|
- //根据查出的report信息查新建行数据
|
|
|
|
List<CwProjectInfoData> dataList = new ArrayList<>();
|
|
List<CwProjectInfoData> dataList = new ArrayList<>();
|
|
- byProjectId.forEach(by->{
|
|
|
|
- List<CwProjectInfoData> byReportId = infoMapper.getByReportId(by.getId());
|
|
|
|
- byReportId.forEach(byr->{
|
|
|
|
- //保存到work_attachment表中的信息
|
|
|
|
- List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(byr.getId());
|
|
|
|
- List<ProjectReportWorkAttachmentDTO> dtoList = new ArrayList<>();
|
|
|
|
- dtos.forEach(d->{
|
|
|
|
- //根据id查出cw_project_report_file文件表的其他信息
|
|
|
|
- CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId());
|
|
|
|
- d.setFileType(file.getFileType());
|
|
|
|
- d.setSealType(file.getSealType());
|
|
|
|
- d.setSealedFile(file.getSealedFile());
|
|
|
|
- d.setSealUser(file.getSealUser());
|
|
|
|
- d.setSealDate(file.getSealDate());
|
|
|
|
- d.setRemarks(file.getRemarks());
|
|
|
|
- UserDTO userDTO = new UserDTO();
|
|
|
|
- //根据创建人id查出创建人名称
|
|
|
|
- String name = reportMapper.getUserNameById(file.getCreateBy());
|
|
|
|
- userDTO.setId(file.getCreateBy());
|
|
|
|
- userDTO.setName(name);
|
|
|
|
- d.setCreateBy(userDTO);
|
|
|
|
- d.setCreateDate(file.getCreateDate());
|
|
|
|
- dtoList.add(d);
|
|
|
|
|
|
+ if (null !=reportData){
|
|
|
|
+ if (StringUtils.isNotEmpty(reportData.getProjectId())){
|
|
|
|
+ String projectId = reportData.getProjectId();
|
|
|
|
+ //根据项目id找出所有的reportID
|
|
|
|
+ List<CwProjectReportData> byProjectId = reportMapper.getByProjectId(projectId);
|
|
|
|
+ //根据查出的report信息查新建行数据
|
|
|
|
+ byProjectId.forEach(by->{
|
|
|
|
+ List<CwProjectInfoData> byReportId = infoMapper.getByReportId(by.getId());
|
|
|
|
+ byReportId.forEach(byr->{
|
|
|
|
+ //保存到work_attachment表中的信息
|
|
|
|
+ List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(byr.getId());
|
|
|
|
+ List<ProjectReportWorkAttachmentDTO> dtoList = new ArrayList<>();
|
|
|
|
+ dtos.forEach(d->{
|
|
|
|
+ //根据id查出cw_project_report_file文件表的其他信息
|
|
|
|
+ CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId());
|
|
|
|
+ d.setFileType(file.getFileType());
|
|
|
|
+ d.setSealType(file.getSealType());
|
|
|
|
+ d.setSealedFile(file.getSealedFile());
|
|
|
|
+ d.setSealUser(file.getSealUser());
|
|
|
|
+ d.setSealDate(file.getSealDate());
|
|
|
|
+ d.setRemarks(file.getRemarks());
|
|
|
|
+ UserDTO userDTO = new UserDTO();
|
|
|
|
+ //根据创建人id查出创建人名称
|
|
|
|
+ String name = reportMapper.getUserNameById(file.getCreateBy());
|
|
|
|
+ userDTO.setId(file.getCreateBy());
|
|
|
|
+ userDTO.setName(name);
|
|
|
|
+ d.setCreateBy(userDTO);
|
|
|
|
+ d.setCreateDate(file.getCreateDate());
|
|
|
|
+ dtoList.add(d);
|
|
|
|
+ });
|
|
|
|
+ byr.setCwFileInfoList(dtoList);
|
|
|
|
+ byr.setDocumentStatus("已完成");
|
|
|
|
+ dataList.add(byr);
|
|
|
|
+ });
|
|
|
|
+
|
|
});
|
|
});
|
|
- byr.setCwFileInfoList(dtoList);
|
|
|
|
- byr.setDocumentStatus("已完成");
|
|
|
|
- dataList.add(byr);
|
|
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
- });
|
|
|
|
if (infoData != null & !infoData.isEmpty()){
|
|
if (infoData != null & !infoData.isEmpty()){
|
|
reportData.setCwProjectInfoList(infoData);
|
|
reportData.setCwProjectInfoList(infoData);
|
|
}
|
|
}
|