|
@@ -3,6 +3,7 @@ package cn.cslg.report.service.business;
|
|
|
import cn.cslg.report.common.core.base.Constants;
|
|
|
import cn.cslg.report.common.model.dto.ConclusionDTO;
|
|
|
import cn.cslg.report.common.model.dto.EventAddNewDTO;
|
|
|
+import cn.cslg.report.common.model.dto.FollowUpDTO;
|
|
|
import cn.cslg.report.common.model.dto.ReportDTO;
|
|
|
import cn.cslg.report.common.model.vo.*;
|
|
|
import cn.cslg.report.common.utils.*;
|
|
@@ -14,10 +15,7 @@ import cn.cslg.report.entity.*;
|
|
|
import cn.cslg.report.entity.asso.AssoReportFile;
|
|
|
import cn.cslg.report.entity.asso.AssoReportPerson;
|
|
|
import cn.cslg.report.mapper.ReportMapper;
|
|
|
-import cn.cslg.report.service.IAssoEventReportService;
|
|
|
-import cn.cslg.report.service.IAvoidDesignDirectionService;
|
|
|
-import cn.cslg.report.service.IProductService;
|
|
|
-import cn.cslg.report.service.OutInterfaceService;
|
|
|
+import cn.cslg.report.service.*;
|
|
|
import cn.cslg.report.service.business.asso.AssoReportPersonService;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -71,6 +69,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
private final SystemDictItemService systemDictItemService;
|
|
|
private final AssoReportPersonService assoReportPersonService;
|
|
|
private final IAssoEventReportService assoEventReportService;
|
|
|
+ private final IFollowUpService followUpService;
|
|
|
|
|
|
private Report loadReport(ReportDTO reportDto) {
|
|
|
Report report = new Report();
|
|
@@ -167,8 +166,9 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
reportFieldService.addDefaultField(report.getId(), report.getType());
|
|
|
}
|
|
|
|
|
|
+ Integer reportId = report.getId();
|
|
|
|
|
|
- //新增事件(若有事件)
|
|
|
+ //新增事件
|
|
|
List<EventAddNewDTO> eventAddNewDTOs = reportDto.getEventAddNewDTOs();
|
|
|
if (eventAddNewDTOs != null && eventAddNewDTOs.size() > 0) {
|
|
|
List<Integer> eventIds = new ArrayList<>();
|
|
@@ -186,8 +186,16 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
eventIds.add(oldEventAddNewDTO.getId());
|
|
|
}
|
|
|
//新增事件和报告关联
|
|
|
- assoEventReportService.addNew(eventIds, report.getId());
|
|
|
+ assoEventReportService.addNew(eventIds, reportId);
|
|
|
+ }
|
|
|
|
|
|
+ //新增后续事项
|
|
|
+ List<FollowUpDTO> followUps = reportDto.getFollowUps();
|
|
|
+ if (followUps != null && followUps.size() > 0) {
|
|
|
+ for (FollowUpDTO followUp : followUps) {
|
|
|
+ followUp.setReportId(reportId);
|
|
|
+ }
|
|
|
+ followUpService.add(followUps);
|
|
|
}
|
|
|
|
|
|
return report.getId();
|
|
@@ -660,6 +668,16 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
|
if (report.getConclusionIds() != null) {
|
|
|
report.setConclusionId(StringUtils.join(conclusionDTO.getConclusionIds(), ","));
|
|
|
}
|
|
|
+
|
|
|
+ //调新增后续事项业务
|
|
|
+ List<FollowUpDTO> followUps = conclusionDTO.getFollowUps();
|
|
|
+ if (followUps != null && followUps.size() > 0) {
|
|
|
+ for (FollowUpDTO followUp : followUps) {
|
|
|
+ followUp.setReportId(conclusionDTO.getReportId());
|
|
|
+ }
|
|
|
+ followUpService.add(followUps);
|
|
|
+ }
|
|
|
+
|
|
|
return report.updateById();
|
|
|
|
|
|
}
|