|
@@ -2721,4 +2721,347 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
public void updateAnnotatorById(CwProjectReport cwProjectReport) {
|
|
|
reportMapper.updateAnnotatorById(cwProjectReport);
|
|
|
}
|
|
|
+
|
|
|
+ public CwProjectReportData queryContainDelById(String id) {
|
|
|
+
|
|
|
+ CwProjectReportData reportData = reportMapper.queryById(id);
|
|
|
+
|
|
|
+ //将新增行数据查询出来放入到cwProjectInfoList中
|
|
|
+ CwProjectInfoData cwProjectInfoData = infoMapper.selectByReportId(id);
|
|
|
+ if (null != cwProjectInfoData){
|
|
|
+ reportData.setServedUnitName(cwProjectInfoData.getServedUnitName());
|
|
|
+ reportData.setServedUnitId(cwProjectInfoData.getServedUnitId());
|
|
|
+ reportData.setReportDate(cwProjectInfoData.getReportDate());
|
|
|
+ reportData.setReportType(cwProjectInfoData.getReportType());
|
|
|
+ reportData.setReportNumber(cwProjectInfoData.getReportNumber());
|
|
|
+ reportData.setReportNo(cwProjectInfoData.getReportNo());
|
|
|
+ reportData.setSealType(cwProjectInfoData.getSealType());
|
|
|
+ }
|
|
|
+
|
|
|
+// List<CwProjectInfoData> infoData = new ArrayList<>();
|
|
|
+
|
|
|
+ List<ProjectReportWorkAttachmentDTO> dtoList = new ArrayList<>();
|
|
|
+ List<ProjectReportWorkAttachmentDTO> signatureList = new ArrayList<>();
|
|
|
+ if ( null != reportData){
|
|
|
+ List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(reportData.getId());
|
|
|
+ if (null != dtos){
|
|
|
+
|
|
|
+ Iterator<ProjectReportWorkAttachmentDTO> it = dtos.iterator();
|
|
|
+ while(it.hasNext()){
|
|
|
+ ProjectReportWorkAttachmentDTO d = it.next();
|
|
|
+ //根据id查出cw_project_report_file文件表的其他信息
|
|
|
+ //未签章附件
|
|
|
+ CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId(),"0");
|
|
|
+ if (null != file) {
|
|
|
+ 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);
|
|
|
+ it.remove();
|
|
|
+ }
|
|
|
+
|
|
|
+ //已签章附件
|
|
|
+ CwProjectReportFile signatureFile = attachmentMapper.selectInfoByFileId(d.getId(),"1");
|
|
|
+ if (null != signatureFile){
|
|
|
+ d.setFileType(signatureFile.getFileType());
|
|
|
+ d.setSealType(signatureFile.getSealType());
|
|
|
+ d.setSealedFile(signatureFile.getSealedFile());
|
|
|
+ d.setSealUser(signatureFile.getSealUser());
|
|
|
+ d.setSealDate(signatureFile.getSealDate());
|
|
|
+ d.setRemarks(signatureFile.getRemarks());
|
|
|
+ UserDTO userDTO2 = new UserDTO();
|
|
|
+ //根据创建人id查出创建人名称
|
|
|
+ String name2 = reportMapper.getUserNameById(signatureFile.getCreateBy());
|
|
|
+ userDTO2.setId(signatureFile.getCreateBy());
|
|
|
+ userDTO2.setName(name2);
|
|
|
+ d.setCreateBy(userDTO2);
|
|
|
+ d.setCreateDate(signatureFile.getCreateDate());
|
|
|
+ signatureList.add(d);
|
|
|
+ it.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reportData.setCwFileInfoList(dtoList);
|
|
|
+ reportData.setSignatureFileList(signatureList);
|
|
|
+ }
|
|
|
+
|
|
|
+ //将附件信息查出
|
|
|
+ // 查询附件信息
|
|
|
+ List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(id);
|
|
|
+ List<WorkAttachmentDto> reportFileList = Lists.newArrayList();
|
|
|
+ if(CollectionUtils.isNotEmpty(dtos) && CollectionUtils.isNotEmpty(fileInfo2)){
|
|
|
+ for (ProjectReportWorkAttachmentDTO dto : dtos) {
|
|
|
+ for (WorkAttachmentDto workAttachmentDto : fileInfo2) {
|
|
|
+ if(dto.getId().equals(workAttachmentDto.getId())){
|
|
|
+ reportFileList.add(workAttachmentDto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
+ for (WorkAttachmentDto i : reportFileList) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reportData.setCwFileInfoList2(reportFileList);
|
|
|
+ //设置历史报告列表
|
|
|
+ //根据项目id查出所有的信息
|
|
|
+ List<CwProjectReportData> byProjectList = reportMapper.getByProjectId(reportData.getProjectId());
|
|
|
+ List<CwProjectInfoData> dataInfoList = new ArrayList<>();
|
|
|
+ if (null != byProjectList) {
|
|
|
+ CwProjectReportData finalReportData1 = reportData;
|
|
|
+ byProjectList.forEach(pro->{
|
|
|
+ //根据reportid查出新增行数据
|
|
|
+ CwProjectInfoData infoData = infoMapper.getByReportId(pro.getId());
|
|
|
+ //根据reportid查出所有的附件信息
|
|
|
+ List<ProjectReportWorkAttachmentDTO> fileList = new ArrayList<>();
|
|
|
+ List<ProjectReportWorkAttachmentDTO> cwFileInfoList = attachmentMapper.selectByInfoIdAndNewLineId(finalReportData1.getId());
|
|
|
+ //历史的附件信息是否是查改reportid对应的所有附件
|
|
|
+ if (null != cwFileInfoList){
|
|
|
+ cwFileInfoList.forEach(fi->{
|
|
|
+ //未签章附件
|
|
|
+ CwProjectReportFile file = attachmentMapper.selectInfoByFileId(fi.getId(),"0");
|
|
|
+ if (null != file) {
|
|
|
+ fi.setFileType(file.getFileType());
|
|
|
+ fi.setSealType(file.getSealType());
|
|
|
+ fi.setSealedFile(file.getSealedFile());
|
|
|
+ fi.setSealUser(file.getSealUser());
|
|
|
+ fi.setSealDate(file.getSealDate());
|
|
|
+ fi.setRemarks(file.getRemarks());
|
|
|
+ UserDTO userDTO = new UserDTO();
|
|
|
+ //根据创建人id查出创建人名称
|
|
|
+ String name = reportMapper.getUserNameById(file.getCreateBy());
|
|
|
+ userDTO.setId(file.getCreateBy());
|
|
|
+ userDTO.setName(name);
|
|
|
+ fi.setCreateBy(userDTO);
|
|
|
+ fi.setCreateDate(file.getCreateDate());
|
|
|
+ fileList.add(fi);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //设置附件信息
|
|
|
+ infoData.setCwFileInfoList(fileList);
|
|
|
+ if (pro.getStatus().equals("5")) {
|
|
|
+ infoData.setDocumentStatus("已完成");
|
|
|
+ }
|
|
|
+ dataInfoList.add(infoData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ reportData.setCwWorkClientContactDTOList(dataInfoList);
|
|
|
+
|
|
|
+ //将复核数据查出来
|
|
|
+ CwProjectReview review = reviewMapper.selectByReportId(reportData.getId());
|
|
|
+ if ( null != review) {
|
|
|
+ reportData.setReviewStatus(review.getReviewStatus());
|
|
|
+ reportData.setAllPrintNum(review.getAllPrintNum());
|
|
|
+ reportData.setIssueNum(review.getIssueNum());
|
|
|
+ reportData.setPlaceOnFileNum(review.getPlaceOnFileNum());
|
|
|
+ reportData.setPrintedBy(review.getPrintedBy());
|
|
|
+ reportData.setCheckAutograph(review.getCheckAutograph());
|
|
|
+ reportData.setReportTitleType(review.getReportTitleType());
|
|
|
+ reportData.setNeedUpdate1(review.getNeedUpdate1());
|
|
|
+ reportData.setNeedUpdate2(review.getNeedUpdate2());
|
|
|
+ reportData.setNeedUpdate3(review.getNeedUpdate3());
|
|
|
+ reportData.setRemark1(review.getRemark1());
|
|
|
+ reportData.setRemark2(review.getRemark2());
|
|
|
+ reportData.setRemark3(review.getRemark3());
|
|
|
+ reportData.setComputerNo(review.getComputerNo());
|
|
|
+ reportData.setReportReviewNo(review.getReportReviewNo());
|
|
|
+ reportData.setReviewBy(review.getReviewBy());
|
|
|
+ //将一级复核等填入数据查出
|
|
|
+ List<CwProofreadDetail> details = detailMapper.findByReportInfoId(review.getId());
|
|
|
+ if (null != details) {
|
|
|
+ reportData.setDetails(details);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //根据报告类型查询下一节点用户
|
|
|
+ List<ReviewUser> stringList = new ArrayList<>();
|
|
|
+ //如果是苏州分部,这里写死
|
|
|
+ String officeId = reportMapper.getOfficeId("苏州分部");
|
|
|
+ if (reportData.getOfficeId().equals(officeId)){
|
|
|
+ stringList = reportMapper.getReviewByPost("质控-苏州分布");
|
|
|
+ }else if (reportData.getReportType().equals("1")) {
|
|
|
+ stringList = reportMapper.getReviewByPost("质控-财务-苏兴会基字");
|
|
|
+ } else {
|
|
|
+ stringList = reportMapper.getReviewByPost("质控-财务-非苏兴会基字");
|
|
|
+ }
|
|
|
+ reportData.setReviewBys(stringList);
|
|
|
+ } else {
|
|
|
+ //传来的是复核表的id
|
|
|
+ CwProjectReview review = reviewMapper.selectById(id);
|
|
|
+ if (null != review) {
|
|
|
+ reportData = reportMapper.queryById(review.getReportId());
|
|
|
+ if ( null != reportData){
|
|
|
+ List<ProjectReportWorkAttachmentDTO> dtos = attachmentMapper.selectByInfoId(reportData.getId());
|
|
|
+ if (null != dtos){
|
|
|
+ dtos.forEach(d->{
|
|
|
+ //根据id查出cw_project_report_file文件表的其他信息
|
|
|
+ //未签章附件
|
|
|
+ CwProjectReportFile file = attachmentMapper.selectInfoByFileId(d.getId(),"0");
|
|
|
+ if (null != file) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ //已签章附件
|
|
|
+ CwProjectReportFile signatureFile = attachmentMapper.selectInfoByFileId(d.getId(),"1");
|
|
|
+ if (null != signatureFile){
|
|
|
+ d.setFileType(signatureFile.getFileType());
|
|
|
+ d.setSealType(signatureFile.getSealType());
|
|
|
+ d.setSealedFile(signatureFile.getSealedFile());
|
|
|
+ d.setSealUser(signatureFile.getSealUser());
|
|
|
+ d.setSealDate(signatureFile.getSealDate());
|
|
|
+ d.setRemarks(signatureFile.getRemarks());
|
|
|
+ UserDTO userDTO2 = new UserDTO();
|
|
|
+ //根据创建人id查出创建人名称
|
|
|
+ String name2 = reportMapper.getUserNameById(signatureFile.getCreateBy());
|
|
|
+ userDTO2.setId(signatureFile.getCreateBy());
|
|
|
+ userDTO2.setName(name2);
|
|
|
+ d.setCreateBy(userDTO2);
|
|
|
+ d.setCreateDate(signatureFile.getCreateDate());
|
|
|
+ signatureList.add(d);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ reportData.setCwFileInfoList(dtoList);
|
|
|
+ reportData.setSignatureFileList(signatureList);
|
|
|
+ }
|
|
|
+ // 查询附件信息
|
|
|
+ List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
+ if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
+ for (WorkAttachmentDto i : fileInfo2) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reportData.setCwFileInfoList2(fileInfo2);
|
|
|
+ //设置历史报告列表
|
|
|
+ //根据项目id查出所有的信息
|
|
|
+ List<CwProjectReportData> byProjectList = reportMapper.getByProjectId(reportData.getProjectId());
|
|
|
+ List<CwProjectInfoData> dataInfoList = new ArrayList<>();
|
|
|
+ if (null != byProjectList) {
|
|
|
+ CwProjectReportData finalReportData = reportData;
|
|
|
+ byProjectList.forEach(pro->{
|
|
|
+ //根据reportid查出新增行数据
|
|
|
+ CwProjectInfoData infoData = infoMapper.getContainDelByReportId(pro.getId());
|
|
|
+ //根据reportid查出所有的附件信息
|
|
|
+ List<ProjectReportWorkAttachmentDTO> fileList = new ArrayList<>();
|
|
|
+ List<ProjectReportWorkAttachmentDTO> cwFileInfoList = attachmentMapper.selectByInfoIdAndNewLineId(finalReportData.getId());
|
|
|
+ //历史的附件信息是否是查改reportid对应的所有附件
|
|
|
+ if (null != cwFileInfoList){
|
|
|
+ cwFileInfoList.forEach(fi->{
|
|
|
+ //未签章附件
|
|
|
+ CwProjectReportFile file = attachmentMapper.selectInfoByFileId(fi.getId(),"0");
|
|
|
+ if (null != file) {
|
|
|
+ fi.setFileType(file.getFileType());
|
|
|
+ fi.setSealType(file.getSealType());
|
|
|
+ fi.setSealedFile(file.getSealedFile());
|
|
|
+ fi.setSealUser(file.getSealUser());
|
|
|
+ fi.setSealDate(file.getSealDate());
|
|
|
+ fi.setRemarks(file.getRemarks());
|
|
|
+ UserDTO userDTO = new UserDTO();
|
|
|
+ //根据创建人id查出创建人名称
|
|
|
+ String name = reportMapper.getUserNameById(file.getCreateBy());
|
|
|
+ userDTO.setId(file.getCreateBy());
|
|
|
+ userDTO.setName(name);
|
|
|
+ fi.setCreateBy(userDTO);
|
|
|
+ fi.setCreateDate(file.getCreateDate());
|
|
|
+ fileList.add(fi);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //设置附件信息
|
|
|
+ infoData.setCwFileInfoList(fileList);
|
|
|
+ if (pro.getStatus().equals("5")) {
|
|
|
+ infoData.setDocumentStatus("已完成");
|
|
|
+ }
|
|
|
+ dataInfoList.add(infoData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ reportData.setCwWorkClientContactDTOList(dataInfoList);
|
|
|
+
|
|
|
+ //将复核数据查出来
|
|
|
+// CwProjectReview review = reviewMapper.selectByReportId(reportData.getId());
|
|
|
+// if ( null != review) {
|
|
|
+//
|
|
|
+// }
|
|
|
+ reportData.setReviewStatus(review.getReviewStatus());
|
|
|
+ reportData.setAllPrintNum(review.getAllPrintNum());
|
|
|
+ reportData.setIssueNum(review.getIssueNum());
|
|
|
+ reportData.setPlaceOnFileNum(review.getPlaceOnFileNum());
|
|
|
+ reportData.setPrintedBy(review.getPrintedBy());
|
|
|
+ reportData.setCheckAutograph(review.getCheckAutograph());
|
|
|
+ reportData.setReportTitleType(review.getReportTitleType());
|
|
|
+ reportData.setNeedUpdate1(review.getNeedUpdate1());
|
|
|
+ reportData.setNeedUpdate2(review.getNeedUpdate2());
|
|
|
+ reportData.setNeedUpdate3(review.getNeedUpdate3());
|
|
|
+ reportData.setRemark1(review.getRemark1());
|
|
|
+ reportData.setRemark2(review.getRemark2());
|
|
|
+ reportData.setRemark3(review.getRemark3());
|
|
|
+ reportData.setComputerNo(review.getComputerNo());
|
|
|
+ reportData.setReviewBy(review.getReviewBy());
|
|
|
+
|
|
|
+ //将一级复核等填入数据查出
|
|
|
+ List<CwProofreadDetail> details = detailMapper.findByReportInfoId(review.getId());
|
|
|
+ if (null != details) {
|
|
|
+ reportData.setDetails(details);
|
|
|
+ }
|
|
|
+ //根据报告类型查询下一节点用户
|
|
|
+ List<ReviewUser> stringList = new ArrayList<>();
|
|
|
+ //如果是苏州分部,这里写死
|
|
|
+ String officeId = reportMapper.getOfficeId("苏州分部");
|
|
|
+ /*if (reportData.getOfficeId().equals(officeId)){
|
|
|
+ stringList = reportMapper.getReviewByS("13");
|
|
|
+ }else if (reportData.getReportType().equals("1")) {
|
|
|
+ stringList = reportMapper.getReviewByS("1");
|
|
|
+ } else {
|
|
|
+ stringList = reportMapper.getReviewByS("非苏兴会基字");
|
|
|
+ }*/
|
|
|
+ if (reportData.getOfficeId().equals(officeId)){
|
|
|
+ stringList = reportMapper.getReviewByPost("质控-苏州分布");
|
|
|
+ }else if (reportData.getReportType().equals("1")) {
|
|
|
+ stringList = reportMapper.getReviewByPost("质控-财务-苏兴会基字");
|
|
|
+ } else {
|
|
|
+ stringList = reportMapper.getReviewByPost("质控-财务-非苏兴会基字");
|
|
|
+ }
|
|
|
+ reportData.setReviewBys(stringList);
|
|
|
+ //将新增行数据查询出来放入到cwProjectInfoList中
|
|
|
+ cwProjectInfoData = infoMapper.selectByReportId(reportData.getId());
|
|
|
+ if (null != cwProjectInfoData){
|
|
|
+ reportData.setServedUnitName(cwProjectInfoData.getServedUnitName());
|
|
|
+ reportData.setServedUnitId(cwProjectInfoData.getServedUnitId());
|
|
|
+ reportData.setReportDate(cwProjectInfoData.getReportDate());
|
|
|
+ reportData.setReportType(cwProjectInfoData.getReportType());
|
|
|
+ reportData.setReportNumber(cwProjectInfoData.getReportNumber());
|
|
|
+ reportData.setReportNo(cwProjectInfoData.getReportNo());
|
|
|
+ reportData.setSealType(cwProjectInfoData.getSealType());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return reportData;
|
|
|
+ }
|
|
|
}
|