|
@@ -11,10 +11,11 @@ import cn.cslg.report.entity.*;
|
|
import cn.cslg.report.entity.asso.AssoReportFile;
|
|
import cn.cslg.report.entity.asso.AssoReportFile;
|
|
import cn.cslg.report.entity.asso.AssoReportPerson;
|
|
import cn.cslg.report.entity.asso.AssoReportPerson;
|
|
import cn.cslg.report.entity.invalidReReport.InvalidReReport;
|
|
import cn.cslg.report.entity.invalidReReport.InvalidReReport;
|
|
|
|
+import cn.cslg.report.exception.XiaoShiException;
|
|
import cn.cslg.report.mapper.ReportMapper;
|
|
import cn.cslg.report.mapper.ReportMapper;
|
|
import cn.cslg.report.service.*;
|
|
import cn.cslg.report.service.*;
|
|
|
|
+import cn.cslg.report.service.business.InvalidReReport.InvalidReReportService;
|
|
import cn.cslg.report.service.business.asso.AssoReportPersonService;
|
|
import cn.cslg.report.service.business.asso.AssoReportPersonService;
|
|
-import cn.cslg.report.service.impl.InvalidReReportServiceImpl;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -64,7 +65,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
private final AssoReportPersonService assoReportPersonService;
|
|
private final AssoReportPersonService assoReportPersonService;
|
|
private final IAssoEventReportService assoEventReportService;
|
|
private final IAssoEventReportService assoEventReportService;
|
|
private final IFollowUpService followUpService;
|
|
private final IFollowUpService followUpService;
|
|
- private final InvalidReReportServiceImpl invalidReReportService;
|
|
|
|
|
|
+ private final InvalidReReportService invalidReReportService;
|
|
|
|
|
|
private Report loadReport(ReportDTO reportDto) {
|
|
private Report loadReport(ReportDTO reportDto) {
|
|
Report report = new Report();
|
|
Report report = new Report();
|
|
@@ -139,19 +140,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
report.setConclusionId(null);
|
|
report.setConclusionId(null);
|
|
}
|
|
}
|
|
report.insert();
|
|
report.insert();
|
|
-
|
|
|
|
- //TODO 当是无效应对报告时,在无效应对报告表里插入信息
|
|
|
|
- if (reportDto.getType().equals(7)) {
|
|
|
|
- PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
|
- InvalidReReport invalidReReport = new InvalidReReport();
|
|
|
|
- BeanUtils.copyProperties(reportDto, invalidReReport);
|
|
|
|
- invalidReReport.setReportId(report.getId());
|
|
|
|
- invalidReReport.setCreateId(personnelVO.getId());
|
|
|
|
- //无效应对报告数据入库
|
|
|
|
- log.info("无效应对报告表新增数据");
|
|
|
|
- invalidReReportService.save(invalidReReport);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ //TODO 当是无效应对报告时,在无效应对报告里插入信息
|
|
if (files != null && files.size() != 0) {
|
|
if (files != null && files.size() != 0) {
|
|
//当
|
|
//当
|
|
if (report.getStatus() != 3) {
|
|
if (report.getStatus() != 3) {
|
|
@@ -445,22 +434,6 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
List<Integer> fileIdList = reportFileService.uploadFiles(files);
|
|
List<Integer> fileIdList = reportFileService.uploadFiles(files);
|
|
assoReportFileService.addAsso(reportDto.getId(), fileIdList);
|
|
assoReportFileService.addAsso(reportDto.getId(), fileIdList);
|
|
}
|
|
}
|
|
- report.updateById();
|
|
|
|
-
|
|
|
|
- //TODO 当是无效应对报告,修改无效应对报告表数据
|
|
|
|
- if (reportDto.getType().equals(7)) {
|
|
|
|
- List<InvalidReReport> invalidReReports = invalidReReportService.list(new LambdaQueryWrapper<InvalidReReport>().eq(InvalidReReport::getReportId, report.getId()));
|
|
|
|
- if (invalidReReports != null && invalidReReports.size() > 0) {
|
|
|
|
- InvalidReReport invalidReReport = invalidReReports.get(0);
|
|
|
|
- InvalidReReport updateInvalidReReport = new InvalidReReport();
|
|
|
|
- BeanUtils.copyProperties(reportDto, updateInvalidReReport);
|
|
|
|
- updateInvalidReReport.setId(invalidReReport.getId());
|
|
|
|
- //无效应对报告表修改数据
|
|
|
|
- log.info("无效应对报告表修改数据");
|
|
|
|
- invalidReReportService.updateById(updateInvalidReReport);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return report.updateById();
|
|
return report.updateById();
|
|
|
|
|
|
}
|
|
}
|
|
@@ -498,8 +471,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
reportReferencesService.deleteByReportId(id);
|
|
reportReferencesService.deleteByReportId(id);
|
|
//删除对比信息
|
|
//删除对比信息
|
|
compareMessageService.deleteByreportID(id);
|
|
compareMessageService.deleteByreportID(id);
|
|
- //TODO 当是无效应对报告,删除无效应对报告表数据
|
|
|
|
- invalidReReportService.remove(new LambdaQueryWrapper<InvalidReReport>().eq(InvalidReReport::getReportId, id));
|
|
|
|
|
|
+ //TODO 当时无效应对报告时
|
|
|
|
+
|
|
|
|
|
|
Boolean dele = this.removeById(id);
|
|
Boolean dele = this.removeById(id);
|
|
if (dele == true) {
|
|
if (dele == true) {
|
|
@@ -734,16 +707,45 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * @autor 谢翔
|
|
* @param ReportId
|
|
* @param ReportId
|
|
* @return
|
|
* @return
|
|
- * @autor 谢翔
|
|
|
|
*/
|
|
*/
|
|
- public ReportDeDTO reReportDetail(int ReportId) {
|
|
|
|
- ReportDeDTO reportDeDTO = null;
|
|
|
|
|
|
+ public ReportDeVO reReportDetail(Integer reportId) {
|
|
|
|
+ ReportDeVO reportDeVO = new ReportDeVO();
|
|
|
|
+ //检测传入参数合法性
|
|
|
|
+ if(reportId == null && reportId <=0){
|
|
|
|
+ throw new XiaoShiException("传入参数异常");
|
|
|
|
+ }
|
|
//根据报告id获得报告
|
|
//根据报告id获得报告
|
|
|
|
+ Report report = this.getById(reportId);
|
|
//若根据报告id未获取到报告返回空
|
|
//若根据报告id未获取到报告返回空
|
|
- //若报告为无效应对报告则从无效应对报告表中获得无效对应报告拓展信息
|
|
|
|
- //装载报告信息,无效对应报告拓展信息到ReportDeDTO并返回
|
|
|
|
- return reportDeDTO;
|
|
|
|
|
|
+ if(report == null){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ List<Report> reports = new ArrayList<>();
|
|
|
|
+ reports.add(report);
|
|
|
|
+ try {
|
|
|
|
+ //调用this.reportData装载报告
|
|
|
|
+ List<Report> reports1 = this.reportData(reports);
|
|
|
|
+ Report report1 = reports1.get(0);
|
|
|
|
+ //若报告为无效应对报告则从无效应对报告表中获得无效对应报告拓展信息
|
|
|
|
+ if(report1.getType().equals(7)){
|
|
|
|
+ LambdaQueryWrapper<InvalidReReport> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(InvalidReReport::getReportId, report1.getId());
|
|
|
|
+ InvalidReReport invalidReReport = invalidReReportService.getOne(queryWrapper);
|
|
|
|
+ if(invalidReReport == null){
|
|
|
|
+ throw new XiaoShiException("未查询到无效应对报告信息");
|
|
|
|
+ }
|
|
|
|
+ //装载报告信息,无效对应报告拓展信息到ReportDeDTO并返回
|
|
|
|
+ BeanUtils.copyProperties(report1, reportDeVO);
|
|
|
|
+ BeanUtils.copyProperties(invalidReReport, reportDeVO);
|
|
|
|
+ } else {
|
|
|
|
+ BeanUtils.copyProperties(report1, reportDeVO);
|
|
|
|
+ }
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return reportDeVO;
|
|
}
|
|
}
|
|
}
|
|
}
|