|
@@ -87,12 +87,19 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
} else {
|
|
} else {
|
|
report.setCreatePersonId(reportDto.getCreatePersonId());
|
|
report.setCreatePersonId(reportDto.getCreatePersonId());
|
|
}
|
|
}
|
|
|
|
+ //负责人
|
|
|
|
+ if(reportDto.getPersonId()!=null){
|
|
|
|
+ report.setPersonId(reportDto.getPersonId());
|
|
|
|
+ }
|
|
//类型
|
|
//类型
|
|
report.setType(reportDto.getType());
|
|
report.setType(reportDto.getType());
|
|
//装载状态
|
|
//装载状态
|
|
if (reportDto.getType().equals(4) || reportDto.getType().equals(5)) {
|
|
if (reportDto.getType().equals(4) || reportDto.getType().equals(5)) {
|
|
report.setStatus(2);
|
|
report.setStatus(2);
|
|
- } else {
|
|
|
|
|
|
+ } else if(reportDto.getStatus()==null||reportDto.getStatus()!=3) {
|
|
|
|
+ report.setStatus(1);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
report.setStatus(reportDto.getStatus());
|
|
report.setStatus(reportDto.getStatus());
|
|
}
|
|
}
|
|
// 装载客户
|
|
// 装载客户
|
|
@@ -105,7 +112,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
report.setCronConclusion(reportDto.getCronConclusion());
|
|
report.setCronConclusion(reportDto.getCronConclusion());
|
|
//装载核心结论
|
|
//装载核心结论
|
|
if (reportDto.getConclusionIds() != null) {
|
|
if (reportDto.getConclusionIds() != null) {
|
|
- report.setScenarioId(StringUtils.join(reportDto.getConclusionIds(), ","));
|
|
|
|
|
|
+ report.setConclusionId(StringUtils.join(reportDto.getConclusionIds(), ","));
|
|
}
|
|
}
|
|
//装载承担部门
|
|
//装载承担部门
|
|
report.setDepartmentId(reportDto.getDepartmentId());
|
|
report.setDepartmentId(reportDto.getDepartmentId());
|
|
@@ -138,12 +145,14 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
assoReportFileService.addAsso(report.getId(), fileIds);
|
|
assoReportFileService.addAsso(report.getId(), fileIds);
|
|
}
|
|
}
|
|
//当报告是已完成时
|
|
//当报告是已完成时
|
|
- if (report.getStatus() != null && report.getStatus().equals(3)) {
|
|
|
|
|
|
+ if (reportDto.getTrack()!=null&&reportDto.getTrack()) {
|
|
//复制父报告自定义栏位
|
|
//复制父报告自定义栏位
|
|
LambdaQueryWrapper<ReportField> fieldWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ReportField> fieldWrapper = new LambdaQueryWrapper<>();
|
|
fieldWrapper.eq(ReportField::getReportId, reportDto.getAssociateReportId());
|
|
fieldWrapper.eq(ReportField::getReportId, reportDto.getAssociateReportId());
|
|
List<ReportField> fields = reportFieldService.list(fieldWrapper);
|
|
List<ReportField> fields = reportFieldService.list(fieldWrapper);
|
|
- List<ReportField> oldFields = new ArrayList<>(fields);
|
|
|
|
|
|
+
|
|
|
|
+ String re = JSONObject.toJSON(fields).toString();
|
|
|
|
+ List<ReportField> oldFields = JSONArray.parseArray(re,ReportField.class);
|
|
if (fields.size() != 0) {
|
|
if (fields.size() != 0) {
|
|
for (ReportField reportField : fields) {
|
|
for (ReportField reportField : fields) {
|
|
reportField.setId(null);
|
|
reportField.setId(null);
|
|
@@ -154,11 +163,13 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
//复制
|
|
//复制
|
|
if (reportDto.getCopyIds() != null) {
|
|
if (reportDto.getCopyIds() != null) {
|
|
//复制对比文件
|
|
//复制对比文件
|
|
- if (reportDto.getCopyIds().contains(Arrays.asList())) {
|
|
|
|
|
|
+ List<Integer> c1s =new ArrayList<>(Arrays.asList(0,2,4,6));
|
|
|
|
+ if ( !Collections.disjoint (reportDto.getCopyIds(),c1s)) {
|
|
copyService.CopyComparePatents(reportDto.getAssociateReportId(), report.getId());
|
|
copyService.CopyComparePatents(reportDto.getAssociateReportId(), report.getId());
|
|
}
|
|
}
|
|
|
|
+ List<Integer> c2s =new ArrayList<>(Arrays.asList(1,3,5,7));
|
|
//复制标引信息
|
|
//复制标引信息
|
|
- if (reportDto.getCopyIds().contains(Arrays.asList())) {
|
|
|
|
|
|
+ if ( !Collections.disjoint (reportDto.getCopyIds(),c2s)) {
|
|
copyService.CopyPatentLabels(oldFields, fields);
|
|
copyService.CopyPatentLabels(oldFields, fields);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -188,7 +199,6 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
//新增事件和报告关联
|
|
//新增事件和报告关联
|
|
assoEventReportService.addNew(eventIds, reportId);
|
|
assoEventReportService.addNew(eventIds, reportId);
|
|
}
|
|
}
|
|
-
|
|
|
|
//新增后续事项
|
|
//新增后续事项
|
|
List<FollowUpDTO> followUps = reportDto.getFollowUps();
|
|
List<FollowUpDTO> followUps = reportDto.getFollowUps();
|
|
if (followUps != null && followUps.size() > 0) {
|
|
if (followUps != null && followUps.size() > 0) {
|
|
@@ -197,9 +207,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
}
|
|
}
|
|
followUpService.add(followUps);
|
|
followUpService.add(followUps);
|
|
}
|
|
}
|
|
-
|
|
|
|
return report.getId();
|
|
return report.getId();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//查询报告
|
|
//查询报告
|
|
@@ -240,7 +248,10 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
if (reportVO.getSize() != null && reportVO.getCurrent() != null) {
|
|
if (reportVO.getSize() != null && reportVO.getCurrent() != null) {
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
List<Report> reports = this.page(new Page<>(reportVO.getCurrent(), reportVO.getSize()), queryWrapper).getRecords();
|
|
List<Report> reports = this.page(new Page<>(reportVO.getCurrent(), reportVO.getSize()), queryWrapper).getRecords();
|
|
- reports = this.reportData(reports);
|
|
|
|
|
|
+ if(reports.size()>0){
|
|
|
|
+ reports = this.reportData(reports);
|
|
|
|
+ }
|
|
|
|
+
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
SecurityUtils.startDataScope("/pcs/report/query");
|
|
Long count = this.count(queryWrapper);
|
|
Long count = this.count(queryWrapper);
|
|
return Response.success(reports, DataUtils.setPageColumn(reportVO.getSize(), reportVO.getCurrent(), Math.toIntExact(count)));
|
|
return Response.success(reports, DataUtils.setPageColumn(reportVO.getSize(), reportVO.getCurrent(), Math.toIntExact(count)));
|
|
@@ -388,6 +399,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public Boolean updateReport(ReportDTO reportDto, List<MultipartFile> files) throws IOException {
|
|
public Boolean updateReport(ReportDTO reportDto, List<MultipartFile> files) throws IOException {
|
|
Report report = this.loadReport(reportDto);
|
|
Report report = this.loadReport(reportDto);
|
|
|
|
+ report.setId(reportDto.getId());
|
|
// 根据报告Id查询对应的附件Id
|
|
// 根据报告Id查询对应的附件Id
|
|
LambdaQueryWrapper<AssoReportFile> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<AssoReportFile> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(AssoReportFile::getReportId, reportDto.getId());
|
|
wrapper.eq(AssoReportFile::getReportId, reportDto.getId());
|
|
@@ -610,7 +622,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
creates.forEach(
|
|
creates.forEach(
|
|
item -> {
|
|
item -> {
|
|
if (map.get(item.getId()) == null) {
|
|
if (map.get(item.getId()) == null) {
|
|
- List<Integer> roles = new ArrayList<>(0);
|
|
|
|
|
|
+ List<Integer> roles = new ArrayList<>();
|
|
|
|
+ roles.add(0);
|
|
map.put(item.getId(), roles);
|
|
map.put(item.getId(), roles);
|
|
} else {
|
|
} else {
|
|
List<Integer> roles = map.get(item.getId());
|
|
List<Integer> roles = map.get(item.getId());
|
|
@@ -629,7 +642,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
dutys.forEach(
|
|
dutys.forEach(
|
|
item -> {
|
|
item -> {
|
|
if (map.get(item.getId()) == null) {
|
|
if (map.get(item.getId()) == null) {
|
|
- List<Integer> roles = new ArrayList<>(1);
|
|
|
|
|
|
+ List<Integer> roles = new ArrayList<>();
|
|
|
|
+ roles.add(1);
|
|
map.put(item.getId(), roles);
|
|
map.put(item.getId(), roles);
|
|
} else {
|
|
} else {
|
|
List<Integer> roles = map.get(item.getId());
|
|
List<Integer> roles = map.get(item.getId());
|
|
@@ -648,13 +662,14 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
shares.forEach(
|
|
shares.forEach(
|
|
item -> {
|
|
item -> {
|
|
if (map.get(item.getReportId()) == null) {
|
|
if (map.get(item.getReportId()) == null) {
|
|
- List<Integer> roles = new ArrayList<>(2);
|
|
|
|
- map.put(item.getId(), roles);
|
|
|
|
|
|
+ List<Integer> roles = new ArrayList<>();
|
|
|
|
+ roles.add(2);
|
|
|
|
+ map.put(item.getReportId(), roles);
|
|
} else {
|
|
} else {
|
|
List<Integer> roles = map.get(item.getReportId());
|
|
List<Integer> roles = map.get(item.getReportId());
|
|
if (!roles.contains(2)) {
|
|
if (!roles.contains(2)) {
|
|
roles.add(2);
|
|
roles.add(2);
|
|
- map.put(item.getId(), roles);
|
|
|
|
|
|
+ map.put(item.getReportId(), roles);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|