|
@@ -10,9 +10,11 @@ import cn.cslg.report.entity.*;
|
|
|
|
|
|
import cn.cslg.report.entity.asso.AssoReportFile;
|
|
|
import cn.cslg.report.entity.asso.AssoReportPerson;
|
|
|
+import cn.cslg.report.entity.invalidReReport.InvalidReReport;
|
|
|
import cn.cslg.report.mapper.ReportMapper;
|
|
|
import cn.cslg.report.service.*;
|
|
|
import cn.cslg.report.service.business.asso.AssoReportPersonService;
|
|
|
+import cn.cslg.report.service.impl.InvalidReReportServiceImpl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -22,6 +24,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -61,6 +64,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
private final AssoReportPersonService assoReportPersonService;
|
|
|
private final IAssoEventReportService assoEventReportService;
|
|
|
private final IFollowUpService followUpService;
|
|
|
+ private final InvalidReReportServiceImpl invalidReReportService;
|
|
|
|
|
|
private Report loadReport(ReportDTO reportDto) {
|
|
|
Report report = new Report();
|
|
@@ -135,7 +139,19 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
report.setConclusionId(null);
|
|
|
}
|
|
|
report.insert();
|
|
|
- //TODO 当是无效应对报告时,在无效应对报告里插入信息
|
|
|
+
|
|
|
+ //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);
|
|
|
+ }
|
|
|
+
|
|
|
if (files != null && files.size() != 0) {
|
|
|
//当
|
|
|
if (report.getStatus() != 3) {
|
|
@@ -429,7 +445,22 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
List<Integer> fileIdList = reportFileService.uploadFiles(files);
|
|
|
assoReportFileService.addAsso(reportDto.getId(), fileIdList);
|
|
|
}
|
|
|
- //TODO 如果是无效应对报告,更新无效应对报告表
|
|
|
+ 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();
|
|
|
|
|
|
}
|
|
@@ -467,8 +498,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
reportReferencesService.deleteByReportId(id);
|
|
|
//删除对比信息
|
|
|
compareMessageService.deleteByreportID(id);
|
|
|
- //TODO 当时无效应对报告时,删除无效应对报告内容
|
|
|
-
|
|
|
+ //TODO 当是无效应对报告,删除无效应对报告表数据
|
|
|
+ invalidReReportService.remove(new LambdaQueryWrapper<InvalidReReport>().eq(InvalidReReport::getReportId, id));
|
|
|
|
|
|
Boolean dele = this.removeById(id);
|
|
|
if (dele == true) {
|
|
@@ -703,16 +734,16 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @autor 谢翔
|
|
|
* @param ReportId
|
|
|
* @return
|
|
|
+ * @autor 谢翔
|
|
|
*/
|
|
|
public ReportDeDTO reReportDetail(int ReportId) {
|
|
|
- ReportDeDTO reportDeDTO =null;
|
|
|
- //根据报告id获得报告
|
|
|
+ ReportDeDTO reportDeDTO = null;
|
|
|
+ //根据报告id获得报告
|
|
|
//若根据报告id未获取到报告返回空
|
|
|
//若报告为无效应对报告则从无效应对报告表中获得无效对应报告拓展信息
|
|
|
//装载报告信息,无效对应报告拓展信息到ReportDeDTO并返回
|
|
|
- return reportDeDTO;
|
|
|
+ return reportDeDTO;
|
|
|
}
|
|
|
}
|