|
@@ -20,6 +20,7 @@ import com.jeeplus.test.cw.projectReport.domain.*;
|
|
|
import com.jeeplus.test.cw.projectReport.mapper.CwProjectInfoMapper;
|
|
|
import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportCancelMapper;
|
|
|
import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
|
|
|
+import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
|
|
|
import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportDTO;
|
|
|
import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
|
|
|
import com.jeeplus.test.cw.projectReport.service.mapstruct.CwProjectReportFileWrapper;
|
|
@@ -57,6 +58,9 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
private CwProjectInfoMapper infoMapper;
|
|
|
|
|
|
@Resource
|
|
|
+ private ProjectReportWorkAttachmentMapper attachmentMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private CwProjectReportMapper reportMapper;
|
|
|
|
|
|
/**
|
|
@@ -136,23 +140,36 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
|
report.setUpdateBy(userDTO.getId());
|
|
|
report.setUpdateDate(new Date());
|
|
|
- //向存放报废报告号表中添加数据
|
|
|
- CwProjectReportCancel cancel = new CwProjectReportCancel();
|
|
|
- cancel.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
- cancel.setReportNo(reportData.getReportNo());
|
|
|
- cancelMapper.insert(cancel);
|
|
|
+
|
|
|
applyMapper.updateById(report);
|
|
|
//修改报告管理的del_flag
|
|
|
- CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
|
|
|
- //根据newLine的reportid找到报告表
|
|
|
- CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
|
|
|
- if (report.getStatus().equals("2")){
|
|
|
- projectReport.setDelFlag(1);
|
|
|
- reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
- }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
|
|
|
- projectReport.setDelFlag(0);
|
|
|
- reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
+ if (report.getStatus().equals("5")){
|
|
|
+ //当审核通过的时候,删除新建行的newLine信息
|
|
|
+ infoMapper.deleteById(report.getReportNewLineId());
|
|
|
+ //删除新建行下的文件信息
|
|
|
+ //删除work_attachment_id信息
|
|
|
+ attachmentMapper.deleteByAttachMnentId(report.getReportNewLineId());
|
|
|
+ //向存放报废报告号表中添加数据
|
|
|
+ CwProjectReportCancel cancel = new CwProjectReportCancel();
|
|
|
+ cancel.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
+ cancel.setReportNo(reportData.getReportNo());
|
|
|
+ cancelMapper.insert(cancel);
|
|
|
}
|
|
|
+ //驳回撤回操作
|
|
|
+// if (report.getStatus().equals("3") || report.getStatus().equals("4")){
|
|
|
+// //根据新建行id修改newLine的作废删除标记
|
|
|
+// infoMapper.updateSignById(report.getReportNewLineId(),"1");
|
|
|
+// }
|
|
|
+// CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
|
|
|
+// //根据newLine的reportid找到报告表
|
|
|
+// CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
|
|
|
+// if (report.getStatus().equals("2")){
|
|
|
+// projectReport.setDelFlag(1);
|
|
|
+// reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
+// }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
|
|
|
+// projectReport.setDelFlag(0);
|
|
|
+// reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
+// }
|
|
|
|
|
|
return report.getId();
|
|
|
}
|
|
@@ -174,25 +191,28 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
report.setId(id);
|
|
|
}
|
|
|
}
|
|
|
- //向存放报废报告号表中添加数据
|
|
|
- CwProjectReportCancel cancel = new CwProjectReportCancel();
|
|
|
- cancel.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
- cancel.setReportNo(reportData.getReportNo());
|
|
|
- cancelMapper.insert(cancel);
|
|
|
- this.applyMapper.insert(report);
|
|
|
- applyMapper.updateById(report);
|
|
|
+ //根据新建行id修改newLine的作废删除标记
|
|
|
+ infoMapper.updateSignById(report.getReportNewLineId(),"1");
|
|
|
|
|
|
- //修改报告管理的del_flag
|
|
|
- CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
|
|
|
- //根据newLine的reportid找到报告表
|
|
|
- CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
|
|
|
- if (report.getStatus().equals("2")){
|
|
|
- projectReport.setDelFlag(1);
|
|
|
- reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
- }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
|
|
|
- projectReport.setDelFlag(0);
|
|
|
- reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
- }
|
|
|
+ this.applyMapper.insert(report);
|
|
|
+// //向存放报废报告号表中添加数据
|
|
|
+// CwProjectReportCancel cancel = new CwProjectReportCancel();
|
|
|
+// cancel.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
+// cancel.setReportNo(reportData.getReportNo());
|
|
|
+// cancelMapper.insert(cancel);
|
|
|
+// applyMapper.updateById(report);
|
|
|
+//
|
|
|
+// //修改报告管理的del_flag
|
|
|
+// CwProjectInfoData newLine = infoMapper.getById(report.getReportNewLineId());
|
|
|
+// //根据newLine的reportid找到报告表
|
|
|
+// CwProjectReport projectReport = reportMapper.selectById(newLine.getReportId());
|
|
|
+// if (report.getStatus().equals("2")){
|
|
|
+// projectReport.setDelFlag(1);
|
|
|
+// reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
+// }else if (report.getStatus().equals("1") || report.getStatus().equals("4") || report.getStatus().equals("3")){
|
|
|
+// projectReport.setDelFlag(0);
|
|
|
+// reportMapper.updateDelFlag(projectReport.getDelFlag(),projectReport.getId());
|
|
|
+// }
|
|
|
|
|
|
return report.getId();
|
|
|
}
|
|
@@ -209,6 +229,7 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
|
|
|
queryWrapper.eq("a.del_flag","0");
|
|
|
queryWrapper.eq("a.status","5");
|
|
|
+ queryWrapper.eq("b.delete_sign","0");
|
|
|
queryWrapper.orderByDesc("a.create_date");
|
|
|
if (StringUtils.isNotEmpty(reportInfoDto.getProjectName())) {
|
|
|
queryWrapper.like("c.project_name", reportInfoDto.getProjectName());
|
|
@@ -223,6 +244,12 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
//删除前先将报告文号给复原
|
|
|
ArrayList<String> strings = Lists.newArrayList(idArray);
|
|
|
for (int i=0;i<strings.size();i++){
|
|
|
+ //修改新建行的del_flag为0,delete_sign为0
|
|
|
+ ReportCancellApply cancellApply = applyMapper.selectById(strings.get(i));
|
|
|
+ CwProjectInfoData infoData = infoMapper.getById(cancellApply.getReportNewLineId());
|
|
|
+ infoData.setDelFlag(0);
|
|
|
+ infoData.setDeleteSign("0");
|
|
|
+ infoMapper.updateById(infoData);
|
|
|
ReportInfoDto reportInfoDto = applyMapper.queryById(strings.get(i));
|
|
|
cancelMapper.deleteByReportNo(reportInfoDto.getReportNo());
|
|
|
}
|