lwhhszx 2 年之前
父節點
當前提交
b94df5a322

+ 1 - 1
RMS/src/main/java/cn/cslg/report/common/model/dto/ReportDTO.java

@@ -190,5 +190,5 @@ public class ReportDTO  {
      * 后续事项
      */
     private List<FollowUpDTO> followUps;
-
+    private Boolean track;
 }

+ 4 - 3
RMS/src/main/java/cn/cslg/report/controller/ReportController.java

@@ -132,18 +132,19 @@ public class ReportController {
         return Response.success( reportService.reportVisual(reportVO));
     }
 
-    @GetMapping (value = "getPermession")
+    @GetMapping (value = "getPermission")
     @Operation(summary = "获得报告权限")
     @Transactional(rollbackFor = Exception.class)
-    public String  getPermession() throws IOException {
+    public String  getPermission() throws IOException {
         return Response.success( reportService.getPermession());
     }
+
     @PostMapping (value = "addConclusions")
     @Operation(summary = "添加核心结论")
     @Transactional(rollbackFor = Exception.class)
     public String  addConclusions(@RequestBody ConclusionDTO conclusionDTO) throws IOException {
         Boolean flag =reportService.addConclusions(conclusionDTO);
-        if(flag){return Response.success("添加成功" );}
+        if(flag){return Response.success("添加成功");}
         return Response.error("添加失败");
     }
 

+ 6 - 0
RMS/src/main/java/cn/cslg/report/service/business/CopyService.java

@@ -79,7 +79,9 @@ public class CopyService {
                         item.setFieldId(newField.getId());
                         item.setOptionId(texts.getId());
                         item.setReportId(newField.getReportId());
+                        item.setId(null);
                     });
+                    reportFieldPatentLinkService.saveBatch(links);
                 }
             }
             //当字段类型为选项类型时
@@ -104,7 +106,9 @@ public class CopyService {
                         item.setFieldId(newField.getId());
                         item.setOptionId(options.getId());
                         item.setReportId(newField.getReportId());
+                        item.setId(null);
                     });
+                    reportFieldPatentLinkService.saveBatch(links);
                 }
             }
             //当字段类型为树类型时
@@ -129,7 +133,9 @@ public class CopyService {
                         item.setFieldId(newField.getId());
                         item.setOptionId(tree.getId());
                         item.setReportId(newField.getReportId());
+                        item.setId(null);
                     });
+                    reportFieldPatentLinkService.saveBatch(links);
                     //更新
                     fieldTrees.forEach(item -> {
                         if (item.getParentId().equals(oldId)) {

+ 30 - 15
RMS/src/main/java/cn/cslg/report/service/business/ReportService.java

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