浏览代码

test分支提交代码

chendayu 2 年之前
父节点
当前提交
f07c6ef668

+ 15 - 15
RMS/src/main/java/cn/cslg/report/controller/CompareMessageController.java

@@ -22,21 +22,20 @@ import java.util.List;
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class CompareMessageController {
     private final CompareMessageService compareMessageService;
+
     @PostMapping("addCompareMessage")
     @Operation(summary = "添加FTO对比记录")
     public String addCompareMessage(@RequestBody List<CompareMessageVO> compareMessageVOS) throws IOException {
-        if(compareMessageService.addCompareMessage(compareMessageVOS))
-        {
+        if (compareMessageService.addCompareMessage(compareMessageVOS)) {
             return Response.success("添加成功");
         }
-      return Response.error("添加失败");
+        return Response.error("添加失败");
     }
 
     @PostMapping("updateCompareMessage")
     @Operation(summary = "更新FTO对比记录")
     public String updateCompareMessage(@RequestBody List<CompareMessage> compareMessages) throws IOException {
-        if(compareMessageService.updateCompareMessage(compareMessages))
-        {
+        if (compareMessageService.updateCompareMessage(compareMessages)) {
             return Response.success("更新成功");
         }
         return Response.error("更新失败");
@@ -45,8 +44,7 @@ public class CompareMessageController {
     @PostMapping("removeCompareMessage")
     @Operation(summary = "删除FTO对比记录")
     public String removeCompareMessage(List<Integer> ids) throws IOException {
-        if(compareMessageService.removeCompareMessage(ids))
-        {
+        if (compareMessageService.removeCompareMessage(ids)) {
             return Response.success("删除成功");
         }
         return Response.error("删除失败");
@@ -54,32 +52,34 @@ public class CompareMessageController {
 
     @GetMapping("queryCompareMessage")
     @Operation(summary = "查找FTO对比记录")
-    public String queryCompareMessage(Integer taskId,String patentNo,Integer reportId) throws IOException {
-        return Response.success(compareMessageService.queryCompareMessage(taskId,patentNo,reportId));
+    public String queryCompareMessage(Integer taskId, String patentNo, Integer reportId) throws IOException {
+        return Response.success(compareMessageService.queryCompareMessage(taskId, patentNo, reportId));
     }
 
     @GetMapping("querySynery")
     @Operation(summary = "查找协同对比记录")
-    public String querySynery(Integer taskId,String patentNo) throws IOException {
-        return Response.success(compareMessageService.querySynery(taskId,patentNo));
+    public String querySynery(Integer taskId, String patentNo) throws IOException {
+        return Response.success(compareMessageService.querySynery(taskId, patentNo));
     }
 
     @PostMapping("addSynery")
     @Operation(summary = "添加协同对比记录")
     public String addSynery(@RequestBody AddSyneryVo addSyneryVo) throws IOException {
-        if(compareMessageService.addSynery(addSyneryVo)) {
+        if (compareMessageService.addSynery(addSyneryVo)) {
             return Response.success();
         }
-        return  Response.error();
+        return Response.error();
     }
+
     @PostMapping("queryComparedMessage")
     @Operation(summary = "查找FTO已经对比的专利")
     public String queryComparedMessage(@RequestBody QueryCMVO queryCMVO) throws IOException {
         return Response.success(compareMessageService.queryComparedMessage(queryCMVO));
     }
+
     @GetMapping("queryAllCompareMessage")
     @Operation(summary = "查找对比结果(带协同结果)")
-    public String queryAllCompareMessage(Integer reportId,String patentNo) throws IOException {
-        return Response.success(compareMessageService.queryAllCompareMessage(patentNo,reportId));
+    public String queryAllCompareMessage(Integer reportId, String patentNo) throws IOException {
+        return Response.success(compareMessageService.queryAllCompareMessage(patentNo, reportId));
     }
 }

+ 10 - 8
RMS/src/main/java/cn/cslg/report/controller/FeatureController.java

@@ -33,23 +33,25 @@ public class FeatureController {
     @RequestMapping(value = "/splitPatentRight", method = RequestMethod.POST)
     @Operation(summary = "拆分权要")
     public String splitPatentRight(@RequestBody SplitVO splitVO) throws IOException {
-     String res =   featureService.splitPatentRight(splitVO);
+        String res = featureService.splitPatentRight(splitVO);
         return res;
     }
+
     @RequestMapping(value = "/getFeatures", method = RequestMethod.GET)
     @Operation(summary = "获得报告创建人查询的特征")
     @Parameters(value = {
-            @Parameter(name = "patentNo",description = "专利号",required = true),
-            @Parameter(name = "ReportId",description = "报告Id"),
+            @Parameter(name = "patentNo", description = "专利号", required = true),
+            @Parameter(name = "ReportId", description = "报告Id"),
     })
-    public String getFeatures(String patentNo,Integer reportId) throws IOException {
-        String res =   featureService.getFeatures(patentNo,reportId);
+    public String getFeatures(String patentNo, Integer reportId) throws IOException {
+        String res = featureService.getFeatures(patentNo, reportId);
         return res;
     }
+
     @RequestMapping(value = "/addPatentRight", method = RequestMethod.POST)
     @Operation(summary = "保存权要")
     public String addPatentRight(@RequestBody List<PatentRightVo> patentRightVos) throws IOException {
-        String res =  featureService.addFeatures(patentRightVos);
+        String res = featureService.addFeatures(patentRightVos);
         return res;
     }
 
@@ -61,7 +63,7 @@ public class FeatureController {
 
     @RequestMapping(value = "/getSplitMessage", method = RequestMethod.GET)
     @Operation(summary = "根据专利号和任务Id获得拆分信息")
-    public String getSplitMessage(Integer taskId,String patentNo,Integer reportId) throws IOException {
-        return Response.success(assoTaskPatentSplitService.getSplitMessage(taskId,patentNo,reportId));
+    public String getSplitMessage(Integer taskId, String patentNo, Integer reportId) throws IOException {
+        return Response.success(assoTaskPatentSplitService.getSplitMessage(taskId, patentNo, reportId));
     }
 }

+ 123 - 121
RMS/src/main/java/cn/cslg/report/service/business/CompareMessageService.java

@@ -47,72 +47,73 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
         // 获取登录人信息
         PersonnelVO personnelVO = cacheUtils.getLoginUser(StpUtil.getLoginIdAsInt());
         List<CompareMessage> compareMessages = new ArrayList<>();
-        Features feature=new Features();
+        Features feature = new Features();
         //根据登录人Id,报告Id,标的专利号查询特征
         LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<>();
         if (vos.get(0).getTaskId() != null && vos.get(0).getSignPatentNo() != null) {
             wrapper.eq(Features::getTaskId, vos.get(0).getTaskId())
                     .eq(Features::getSignPatentNo, vos.get(0).getSignPatentNo());
             feature = featureService.list(wrapper).get(0);
-        }if(vos.get(0).getReportId()!=null &&  vos.get(0).getSignPatentNo() != null ){
+        }
+        if (vos.get(0).getReportId() != null && vos.get(0).getSignPatentNo() != null) {
             wrapper.eq(Features::getReportId, vos.get(0).getReportId())
                     .eq(Features::getSignPatentNo, vos.get(0).getSignPatentNo());
-             feature = featureService.list(wrapper).get(0);
+            feature = featureService.list(wrapper).get(0);
         }
-            //根据特征Id删除对比记录
-            List<Features> features = featureService.list(wrapper);
-            if (features != null && features.size() > 0) {
-                List<Integer> Ids = featureService.list(wrapper).stream().map(Features::getId).collect(Collectors.toList());
-                LambdaQueryWrapper<CompareMessage> queryWrapper = new LambdaQueryWrapper<CompareMessage>();
-                queryWrapper.in(CompareMessage::getFeatureId, Ids);
-                this.remove(queryWrapper);
+        //根据特征Id删除对比记录
+        List<Features> features = featureService.list(wrapper);
+        if (features != null && features.size() > 0) {
+            List<Integer> Ids = featureService.list(wrapper).stream().map(Features::getId).collect(Collectors.toList());
+            LambdaQueryWrapper<CompareMessage> queryWrapper = new LambdaQueryWrapper<CompareMessage>();
+            queryWrapper.in(CompareMessage::getFeatureId, Ids);
+            this.remove(queryWrapper);
+        }
+        //根据登录人Id,报告Id,标的专利号删除原有特征
+        featureService.remove(wrapper);
+        for (int i = 0; i < vos.size(); i++) {
+            int order = 1;
+            Features features1 = new Features();
+            features1.setContent(vos.get(i).getContent());
+            features1.setFeaturesOrder(order);
+            if (vos.get(i).getTaskId() != null) {
+                features1.setTaskId(vos.get(i).getTaskId());
             }
-            //根据登录人Id,报告Id,标的专利号删除原有特征
-            featureService.remove(wrapper);
-            for (int i = 0; i < vos.size(); i++) {
-                int order = 1;
-                Features features1 = new Features();
-                features1.setContent(vos.get(i).getContent());
-                features1.setFeaturesOrder(order);
-                if(vos.get(i).getTaskId()!=null) {
-                    features1.setTaskId(vos.get(i).getTaskId());
-                }
-                features1.setSplitType(feature.getSplitType());
-                features1.setSplitBy(feature.getSplitBy());
-                features1.setPartnerId(personnelVO.getId());
-                features1.setReportId(feature.getReportId());
-                features1.setRightName(vos.get(i).getRightName());
-                features1.setRightType(vos.get(i).getRightType());
-                features1.setRightId(vos.get(i).getRightId());
-                features1.setSignPatentNo(vos.get(i).getSignPatentNo());
-                features1.setContentOut(vos.get(i).getContentOut());
-                features1.setExplainText(vos.get(i).getExplainText());
-                features1.insert();
-                CompareMessage compareMessage = new CompareMessage();
-                compareMessage.setFeatureId(features1.getId());
-                compareMessage.setCompareResult(vos.get(i).getCompareResult());
-                compareMessage.setTargetDescription(vos.get(i).getTargetDescription());
-                compareMessage.setCompareDescription(vos.get(i).getCompareDescription());
-                compareMessage.setReportId(feature.getReportId());
-                if(feature.getTaskId()!=null) {
-                    compareMessage.setTaskId(feature.getTaskId());
-                }
-                compareMessages.add(compareMessage);
-                order += 1;
+            features1.setSplitType(feature.getSplitType());
+            features1.setSplitBy(feature.getSplitBy());
+            features1.setPartnerId(personnelVO.getId());
+            features1.setReportId(feature.getReportId());
+            features1.setRightName(vos.get(i).getRightName());
+            features1.setRightType(vos.get(i).getRightType());
+            features1.setRightId(vos.get(i).getRightId());
+            features1.setSignPatentNo(vos.get(i).getSignPatentNo());
+            features1.setContentOut(vos.get(i).getContentOut());
+            features1.setExplainText(vos.get(i).getExplainText());
+            features1.insert();
+            CompareMessage compareMessage = new CompareMessage();
+            compareMessage.setFeatureId(features1.getId());
+            compareMessage.setCompareResult(vos.get(i).getCompareResult());
+            compareMessage.setTargetDescription(vos.get(i).getTargetDescription());
+            compareMessage.setCompareDescription(vos.get(i).getCompareDescription());
+            compareMessage.setReportId(feature.getReportId());
+            if (feature.getTaskId() != null) {
+                compareMessage.setTaskId(feature.getTaskId());
             }
+            compareMessages.add(compareMessage);
+            order += 1;
+        }
 
         return this.saveBatch(compareMessages);
     }
 
     public Boolean updateCompareMessage(List<CompareMessage> compareMessageList) {
-        List<Integer> ids =compareMessageList.stream().map(CompareMessage::getFeatureId).collect(Collectors.toList());
-        if(ids.size()!=0){
-            LambdaQueryWrapper<CompareMessage> queryWrapper =new LambdaQueryWrapper<CompareMessage>();
-            queryWrapper.in(CompareMessage::getFeatureId,ids).isNull(CompareMessage::getTaskType);
+        List<Integer> ids = compareMessageList.stream().map(CompareMessage::getFeatureId).collect(Collectors.toList());
+        if (ids.size() != 0) {
+            LambdaQueryWrapper<CompareMessage> queryWrapper = new LambdaQueryWrapper<CompareMessage>();
+            queryWrapper.in(CompareMessage::getFeatureId, ids).isNull(CompareMessage::getTaskType);
             this.remove(queryWrapper);
 
 
-           return this.saveOrUpdateBatch(compareMessageList);
+            return this.saveOrUpdateBatch(compareMessageList);
         }
         return true;
     }
@@ -122,9 +123,9 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
     }
 
     public Map<String, Object> queryCompareMessage(Integer taskId, String patentNo, Integer reportId) throws IOException {
-        if(taskId!=null){
-            Task task =taskService.getById(taskId);
-            reportId =task.getReportId();
+        if (taskId != null) {
+            Task task = taskService.getById(taskId);
+            reportId = task.getReportId();
         }
         List<PatentRightVo> patentRightVos = new ArrayList<>();
         String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
@@ -132,7 +133,7 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
         //解析jason获得标的专利的权要
         List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
         //处理权要
-        List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin,patentNo);
+        List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin, patentNo);
         //查询特征
         LambdaQueryWrapper<Features> queryWrapper = new LambdaQueryWrapper<>();
         if (reportId != null && reportId != 0) {
@@ -141,21 +142,20 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
         queryWrapper.eq(Features::getSignPatentNo, patentNo);
         List<Features> features = featureService.list(queryWrapper);
         List<Integer> featureIds = features.stream().map(Features::getId).collect(Collectors.toList());
-        List<CompareMessage> compareMessages=new ArrayList<>();
-        if(featureIds.size()>0){
-        LambdaQueryWrapper<CompareMessage> queryWrapper1 = new LambdaQueryWrapper<>();
-        queryWrapper1.in(CompareMessage::getFeatureId, featureIds);
-        if (taskId != null) {
-            queryWrapper1.eq(CompareMessage::getTaskId, taskId);
-        }
-        else {
-            queryWrapper1.isNull(CompareMessage::getTaskType);
-        }
+        List<CompareMessage> compareMessages = new ArrayList<>();
+        if (featureIds.size() > 0) {
+            LambdaQueryWrapper<CompareMessage> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.in(CompareMessage::getFeatureId, featureIds);
+            if (taskId != null) {
+                queryWrapper1.eq(CompareMessage::getTaskId, taskId);
+            } else {
+                queryWrapper1.isNull(CompareMessage::getTaskType);
+            }
             compareMessages = this.list(queryWrapper1);
         }
 
         List<CompareMessageVO> compareMessageVOS = new ArrayList<>();
-        for (Features item: features){
+        for (Features item : features) {
             CompareMessageVO compareMessageVO = new CompareMessageVO();
             BeanUtil.copyProperties(item, compareMessageVO);
             CompareMessage compareMessage = new CompareMessage();
@@ -192,13 +192,14 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
             patentRightVo.setSignPatentNo(patentNo);
             patentRightVos.add(patentRightVo);
         }
-        Map<String, Object> map1 = assoTaskPatentSplitService.getSplitMessage(taskId, patentNo,reportId);
+        Map<String, Object> map1 = assoTaskPatentSplitService.getSplitMessage(taskId, patentNo, reportId);
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("patentRightVos", patentRightVos);
         map.put("splitBy", map1.get("splitBy"));
         map.put("splitType", map1.get("splitType"));
         return map;
     }
+
     public IPage<JSONObject> queryComparedMessage(QueryCMVO queryCMVO) throws IOException {
         List<String> patentNos = this.baseMapper.getComparedMessage(queryCMVO);
 
@@ -236,18 +237,18 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
      * @Deserption 查找协同任务对比记录
      */
     public Map<String, Object> querySynery(Integer taskId, String patentNo) throws IOException {
-        Task task =taskService.getById(taskId);
+        Task task = taskService.getById(taskId);
         //根据 reportId 和 专利号查询特征Id
-        LambdaQueryWrapper<Features>  wrapper =new LambdaQueryWrapper<>();
-        wrapper.eq(Features::getReportId,task.getReportId())
-                .eq(Features::getSignPatentNo,patentNo);
-        List<Features> features =featureService.list(wrapper);
-        List<Integer> featureIds =features.stream().map(Features::getId).collect(Collectors.toList());
-        LambdaQueryWrapper<CompareMessage> queryWrapper =new LambdaQueryWrapper<>();
-        queryWrapper.eq(CompareMessage::getTaskId,taskId)
-        .in(CompareMessage::getFeatureId,featureIds);
-        List<CompareMessage> compareMessages =this.list(queryWrapper);
-        if(compareMessages.size()==0){
+        LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Features::getReportId, task.getReportId())
+                .eq(Features::getSignPatentNo, patentNo);
+        List<Features> features = featureService.list(wrapper);
+        List<Integer> featureIds = features.stream().map(Features::getId).collect(Collectors.toList());
+        LambdaQueryWrapper<CompareMessage> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(CompareMessage::getTaskId, taskId)
+                .in(CompareMessage::getFeatureId, featureIds);
+        List<CompareMessage> compareMessages = this.list(queryWrapper);
+        if (compareMessages.size() == 0) {
             Map<String, Object> map = this.queryCompareMessage(null, patentNo, task.getReportId());
             return map;
         }
@@ -257,17 +258,17 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
 
     }
 
-    public Map<String, Object> queryAllCompareMessage( String patentNo, Integer reportId) throws IOException {
+    public Map<String, Object> queryAllCompareMessage(String patentNo, Integer reportId) throws IOException {
         List<PatentRightVo> patentRightVos = new ArrayList<>();
         String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
         JSONObject jsonObject = JSONObject.parseObject(resBody);
         //解析jason获得标的专利的权要
         List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
         //处理权要
-        List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin,patentNo);
+        List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin, patentNo);
         //查询特征
         LambdaQueryWrapper<Features> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(Features::getReportId, reportId);
+        queryWrapper.eq(Features::getReportId, reportId);
         queryWrapper.eq(Features::getSignPatentNo, patentNo);
         List<Features> features = featureService.list(queryWrapper);
         List<Integer> featureIds = features.stream().map(Features::getId).collect(Collectors.toList());
@@ -282,14 +283,13 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
             if (compareMessages.size() != 0) {
                 List<CompareMessage> compareMessageList = compareMessages.stream().filter(tem -> tem.getFeatureId().equals(item.getId())).collect(Collectors.toList());
                 compareMessageList.forEach(
-                        tem->{
-                            if(tem.getTaskType()==null){
+                        tem -> {
+                            if (tem.getTaskType() == null) {
                                 compareMessageVO.setCompareResult(tem.getCompareResult());
                                 compareMessageVO.setCompareDescription(tem.getCompareDescription());
                                 compareMessageVO.setTargetDescription(tem.getTargetDescription());
                                 compareMessageVO.setCMid(tem.getId());
-                            }
-                            else  if(tem.getTaskType().equals(1)){
+                            } else if (tem.getTaskType().equals(1)) {
                                 compareMessageVO.setCompareResult2(tem.getCompareResult());
                                 compareMessageVO.setCompareDescription2(tem.getCompareDescription());
                                 compareMessageVO.setTargetDescription2(tem.getTargetDescription());
@@ -322,7 +322,7 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
             patentRightVo.setSignPatentNo(patentNo);
             patentRightVos.add(patentRightVo);
         }
-        Map<String, Object> map1 = assoTaskPatentSplitService.getSplitMessage(null, patentNo,reportId);
+        Map<String, Object> map1 = assoTaskPatentSplitService.getSplitMessage(null, patentNo, reportId);
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("patentRightVos", patentRightVos);
         map.put("splitBy", map1.get("splitBy"));
@@ -331,38 +331,39 @@ public class CompareMessageService extends ServiceImpl<CompareMessageMapper, Com
     }
 
     /**
-     * @autor lrj
      * @param addSyneryVo
      * @return
+     * @autor lrj
      * @Descprtion 添加协同记录
      */
 
-    public Boolean addSynery(AddSyneryVo addSyneryVo){
+    public Boolean addSynery(AddSyneryVo addSyneryVo) {
         // 根据任务Id获得任务信息
         Task task = taskService.getById(addSyneryVo.getTaskId());
         //根据专利号和报告ID获得特征Id
-        LambdaQueryWrapper<Features> wrapper =new LambdaQueryWrapper<Features>();
+        LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<Features>();
         wrapper.select(Features::getId);
-        wrapper.eq(Features::getReportId,task.getReportId());
-        wrapper.eq(Features::getSignPatentNo,addSyneryVo.getPatentNo());
-List<Features> features =featureService.list(wrapper);
-List<Integer> Ids =features.stream().map(Features::getId).collect(Collectors.toList());
+        wrapper.eq(Features::getReportId, task.getReportId());
+        wrapper.eq(Features::getSignPatentNo, addSyneryVo.getPatentNo());
+        List<Features> features = featureService.list(wrapper);
+        List<Integer> Ids = features.stream().map(Features::getId).collect(Collectors.toList());
         //装载对比结果信息
-        List<CompareMessage> compareMessages =addSyneryVo.getCompareMessageList();
+        List<CompareMessage> compareMessages = addSyneryVo.getCompareMessageList();
         compareMessages.forEach(
-                item->{
+                item -> {
                     item.setTaskId(task.getId());
                     item.setTaskType(1);
                     item.setId(null);
                 }
         );
         //删除对比记录
-        if(Ids.size()!=0){
-        LambdaQueryWrapper<CompareMessage> queryWrapper =new LambdaQueryWrapper<>();
-        queryWrapper.eq(CompareMessage::getTaskId,task.getId())
-                    .in(CompareMessage::getFeatureId,Ids);
-        this.remove(queryWrapper);}
-   return     this.saveBatch(compareMessages);
+        if (Ids.size() != 0) {
+            LambdaQueryWrapper<CompareMessage> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(CompareMessage::getTaskId, task.getId())
+                    .in(CompareMessage::getFeatureId, Ids);
+            this.remove(queryWrapper);
+        }
+        return this.saveBatch(compareMessages);
 
     }
 
@@ -380,7 +381,7 @@ List<Integer> Ids =features.stream().map(Features::getId).collect(Collectors.toL
         //解析jason获得标的专利的权要
         List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
         //处理权要
-        List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin,patentNo);
+        List<PatentRight> patentRights = featureService.FormatPatentRights(patentRightsOrgin, patentNo);
         //查询特征
         LambdaQueryWrapper<Features> queryWrapper = new LambdaQueryWrapper<>();
         if (reportId != null && reportId != 0) {
@@ -389,14 +390,15 @@ List<Integer> Ids =features.stream().map(Features::getId).collect(Collectors.toL
         queryWrapper.eq(Features::getSignPatentNo, patentNo);
         List<Features> features = featureService.list(queryWrapper);
         List<Integer> featureIds = features.stream().map(Features::getId).collect(Collectors.toList());
-        List<CompareMessage> compareMessages=new ArrayList<>();
-        if(featureIds.size()>0){
+        List<CompareMessage> compareMessages = new ArrayList<>();
+        if (featureIds.size() > 0) {
             LambdaQueryWrapper<CompareMessage> queryWrapper1 = new LambdaQueryWrapper<>();
             queryWrapper1.in(CompareMessage::getFeatureId, featureIds);
-                queryWrapper1.isNull(CompareMessage::getTaskType);
-            compareMessages = this.list(queryWrapper1);}
+            queryWrapper1.isNull(CompareMessage::getTaskType);
+            compareMessages = this.list(queryWrapper1);
+        }
         List<CompareMessageVO> compareMessageVOS = new ArrayList<>();
-        for (Features item: features){
+        for (Features item : features) {
             CompareMessageVO compareMessageVO = new CompareMessageVO();
             BeanUtil.copyProperties(item, compareMessageVO);
             CompareMessage compareMessage = new CompareMessage();
@@ -412,13 +414,14 @@ List<Integer> Ids =features.stream().map(Features::getId).collect(Collectors.toL
             compareMessageVO.setTargetDescription(compareMessage.getTargetDescription());
             compareMessageVOS.add(compareMessageVO);
         }
-        Integer mainRight =0;
-        Integer right=0;
+        Integer mainRight = 0;
+        Integer right = 0;
         //将拆解的权要和特征装载到对象PatentRightVo
         for (int i = 0; i < patentRights.size(); i++) {
-            if(patentRights.get(i).getType()==1)
-            {mainRight++;}
-          right++;
+            if (patentRights.get(i).getType() == 1) {
+                mainRight++;
+            }
+            right++;
             List<CompareMessageVO> featuresList = new ArrayList<>();
             //对需要拆解的权要进行拆解
             if (compareMessageVOS != null && compareMessageVOS.size() != 0) {
@@ -427,15 +430,13 @@ List<Integer> Ids =features.stream().map(Features::getId).collect(Collectors.toL
             }
             for (CompareMessageVO item : featuresList) {
                 item.setRightName("权要" + (patentRights.get(i).getSort() + 1));
-                if(item.getCompareResult()==null){
+                if (item.getCompareResult() == null) {
                     item.setResultStr("待定");
-                }
-               else if(item.getCompareResult()==0){
+                } else if (item.getCompareResult() == 0) {
                     item.setResultStr("不同");
-                }
-                else if(item.getCompareResult()==1)
-                {item.setResultStr("相同");}
-                else  {
+                } else if (item.getCompareResult() == 1) {
+                    item.setResultStr("相同");
+                } else {
                     item.setResultStr("待定");
                 }
             }
@@ -443,18 +444,19 @@ List<Integer> Ids =features.stream().map(Features::getId).collect(Collectors.toL
         }
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("compareMessageVOs", lists);
-        map.put("mainRight",mainRight);
-        map.put("right",right);
+        map.put("mainRight", mainRight);
+        map.put("right", right);
         return map;
     }
+
     /**
      * funtion:删除报告时删除
      */
-    public String deleteByreportID(Integer repotID){
-        LambdaQueryWrapper<CompareMessage> queryWrapper =new LambdaQueryWrapper<>();
-        queryWrapper.eq(CompareMessage::getReportId,repotID);
+    public String deleteByreportID(Integer repotID) {
+        LambdaQueryWrapper<CompareMessage> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(CompareMessage::getReportId, repotID);
         List<CompareMessage> list = this.list(queryWrapper);
-        if(list==null||list.size()==0){
+        if (list == null || list.size() == 0) {
             return Response.success();
         }
         remove(queryWrapper);

+ 25 - 15
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -55,16 +55,23 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
      * @function 对权要进行合并操作
      */
 
-    public List<PatentRight> FormatPatentRights(List<PatentRight> patentRights,String patentNo) {
-        StringBuilder stringBuilder =new StringBuilder();
-    patentRights.forEach(item->{
-        stringBuilder.append(item.getContent());
-    });
-        PatentRightParams params =new PatentRightParams();
+    public List<PatentRight> FormatPatentRights(List<PatentRight> patentRights, String patentNo) {
+        StringBuilder stringBuilder = new StringBuilder();
+        patentRights.forEach(item -> {
+            stringBuilder.append(item.getContent());
+        });
+
+        StringBuilder stringBuilder2 = new StringBuilder();
+        patentRights.forEach(item -> {
+            stringBuilder2.append(item.getContentOut());
+        });
+
+        PatentRightParams params = new PatentRightParams();
         params.setPatentNo(patentNo);
         params.setPatentId(-1);
         params.setContent(stringBuilder.toString());
-        patentRightUtils.formatPatentRight(params);
+        params.setContentOut(stringBuilder2.toString());
+        patentRights = patentRightUtils.formatPatentRight(params);
         return patentRights;
     }
 
@@ -152,15 +159,18 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
         //解析jason获得标的专利的权要
         List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
         //给权要进行格式更改
-        List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin,patentNo);
-        List<Integer> partRightIds = new ArrayList<>();
-        List<String> flags = new ArrayList<>();
+        List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin, patentNo);
+        //List<Integer> partRightIds = new ArrayList<>();  //权要ids
+        List<Integer> partRightSorts = new ArrayList<>();  //权要sorts
+        List<String> flags = new ArrayList<>();  //拆分方式字符
         // 当splitType=0仅拆解主权要
         if (splitType.equals(0)) {
-            partRightIds = patentRights.stream().filter(item -> item.getType().equals(1)).map(PatentRight::getId).collect(Collectors.toList());
+            //partRightIds = patentRights.stream().filter(item -> item.getType().equals(1)).map(PatentRight::getId).collect(Collectors.toList());
+            partRightSorts = patentRights.stream().filter(item -> item.getType().equals(1)).map(PatentRight::getSort).collect(Collectors.toList());
         }// 当splitType=1拆解全部权要
         else if (splitType.equals(1)) {
-            partRightIds = patentRights.stream().map(PatentRight::getId).collect(Collectors.toList());
+            //partRightIds = patentRights.stream().map(PatentRight::getId).collect(Collectors.toList());
+            partRightSorts = patentRights.stream().map(PatentRight::getSort).collect(Collectors.toList());
         }
         //当splitBy=0时仅仅根据“,”拆解
         if (splitBy == 0) {
@@ -221,7 +231,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
                 List<String> contentOuts = Arrays.asList(patentRights.get(i).getContentOut());
                 List<String> contents = Arrays.asList(patentRights.get(i).getContent());
                 //如果是需要拆解的权要
-                if (partRightIds.contains(patentRights.get(i).getId())) {
+                if (partRightSorts.contains(patentRights.get(i).getSort())) {
                     //获得权要的译文并且拆解
                     contentOuts = this.splitStringByFlags(patentRights.get(i).getContentOut(), flags);
                     //获得权要的原文并且拆解
@@ -298,7 +308,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
         //解析jason获得标的专利的权要
         List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
         //处理权要
-        List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin,patentNo);
+        List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin, patentNo);
         Features featureTO = new Features();
         featureTO.setReportId(reportId);
         featureTO.setSignPatentNo(patentNo);
@@ -354,7 +364,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
                         attrs.set(v, attrs.get(v) + flags.get(i));
                     }
                     if (attrs.get(v).equals("其特征在于" + flags.get(i))) {
-                        tem.set(tem.size() - 1,tem.get(tem.size() - 1)+attrs.get(v));
+                        tem.set(tem.size() - 1, tem.get(tem.size() - 1) + attrs.get(v));
                     } else {
                         tem.add(attrs.get(v));
                     }