فهرست منبع

获得权要接口

lwhhszx 2 سال پیش
والد
کامیت
7d409e76ed

+ 61 - 0
RMS/src/main/java/cn/cslg/report/common/model/dto/FeaturesDTO.java

@@ -0,0 +1,61 @@
+package cn.cslg.report.common.model.dto;
+
+import cn.cslg.report.common.model.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * 特征表
+ */
+@Data
+
+public class FeaturesDTO {
+    /**
+     * 专利号
+     */
+    private String signPatentNo;
+
+    /**
+     * 特征翻译
+     */
+    private String contentOut;
+    /**
+     * 特征
+     */
+    private String content;
+
+    /**
+     * 权要ID
+     */
+    private Integer rightId;
+
+    /**
+     * 特征拆分人ID
+     */
+    private Integer partnerId;
+
+    /**
+     * 是否最终
+     */
+    private Integer isFinal;
+
+    /**
+     * 所属报告
+     */
+    private Integer reportId;
+
+    @TableField(value = "RIGHT_NAME")
+    private String rightName;
+
+    @TableField(value = "RIGHT_TYPE")
+    private Integer rightType;
+
+    @TableField(value = "FEATURES_ORDER")
+    private Integer featuresOrder;
+
+}

+ 22 - 13
RMS/src/main/java/cn/cslg/report/controller/FeatureController.java

@@ -1,6 +1,7 @@
 package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.model.dto.FeaturesDTO;
 import cn.cslg.report.common.model.vo.PatentRightVo;
 import cn.cslg.report.common.model.vo.PatentVO;
 
@@ -33,23 +34,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,8 +64,8 @@ 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));
     }
 
     @RequestMapping(value = "/getRights", method = RequestMethod.GET)
@@ -70,11 +73,17 @@ public class FeatureController {
     public String getRights(String patentNO) throws IOException {
         return Response.success(featureService.getRightNames(patentNO));
     }
-    //TODO
-    @RequestMapping(value = "/addFeatures", method = RequestMethod.GET)
-    @Operation(summary = "添加特征")
-    public String addFeatures(String patentNO) throws IOException {
-        return Response.success(featureService.getRightNames(patentNO));
+
+
+    @RequestMapping(value = "/addSingleFeature", method = RequestMethod.GET)
+    @Operation(summary = "添加单个特征")
+    public String addSingleFeature(@RequestBody FeaturesDTO featuresDTO) throws IOException {
+        Boolean flag = featureService.addSingleFeature(featuresDTO);
+        if (!flag) {
+            return Response.error();
+        }
+
+        return Response.success();
     }
 
 

+ 0 - 1
RMS/src/main/java/cn/cslg/report/entity/Features.java

@@ -34,7 +34,6 @@ public class Features extends BaseEntity<Features> {
     @TableField(value = "CONTENT")
     private String content;
 
-
     /**
      * 权要ID
      */

+ 1 - 1
RMS/src/main/java/cn/cslg/report/entity/invalidReReport/AssoFeatureProof.java

@@ -18,7 +18,7 @@ import java.util.Date;
 public class AssoFeatureProof extends BaseEntity<AssoFeatureProof> {
 
     @TableField("ID")
-    private String ID ;
+    private Integer ID ;
 
     @TableField("FEATURE_ID")
     private String feature_ID ;

+ 16 - 5
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -1,6 +1,7 @@
 package cn.cslg.report.service.business;
 
 import cn.cslg.report.common.model.PatentRightParams;
+import cn.cslg.report.common.model.dto.FeaturesDTO;
 import cn.cslg.report.common.model.vo.PatentRightVo;
 import cn.cslg.report.common.model.vo.PatentVO;
 import cn.cslg.report.common.model.vo.PersonnelVO;
@@ -22,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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;
@@ -534,7 +536,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
         return 1;
     }
     @Transactional(rollbackFor = Exception.class)
-    public Map<Integer,Object> getRightNames(String patentNo) throws IOException {
+    public List<PatentRight> getRightNames(String patentNo) throws IOException {
         Map<Integer,Object> map =new HashMap<>();
         String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
         JSONObject jsonObject = JSONObject.parseObject(resBody);
@@ -548,10 +550,19 @@ PatentRightParams params =new PatentRightParams();
 params.setContent(stringBuilder.toString());
 params.setPatentNo(patentNo);
 List<PatentRight> patentRights = PatentRightUtils.formatPatentRight(params);
-    patentRights.forEach(item->{
-        map.put(item.getSort(),"权要"+(item.getSort()+1));
-    });
-    return map;
+patentRights.forEach(item->{
+    item.setRightName("权要"+(item.getSort()+1));
+});
+    return patentRights;
+    }
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean addSingleFeature(FeaturesDTO featuresDTO) throws IOException {
+        if(featuresDTO.getReportId()==null||featuresDTO.getRightId()==null){
+            return false;
+        }
+        Features features =new Features();
+        BeanUtils.copyProperties(featuresDTO,features);
+        return features.insert();
     }
 
 

+ 78 - 62
RMS/src/main/java/cn/cslg/report/service/business/InvalidReReport/ArgumentsService.java

@@ -4,12 +4,11 @@ import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsDTO;
 import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsQueryDTO;
 import cn.cslg.report.common.model.vo.invalidReReport.ArgumentsVO;
 import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
-import cn.cslg.report.entity.invalidReReport.Arguments;
-import cn.cslg.report.entity.invalidReReport.AssoArguments;
-import cn.cslg.report.entity.invalidReReport.Proof;
-import cn.cslg.report.entity.invalidReReport.Scratch;
+import cn.cslg.report.entity.Features;
+import cn.cslg.report.entity.invalidReReport.*;
 import cn.cslg.report.mapper.InvalidReReport.ArgumentsMapper;
 import cn.cslg.report.mapper.InvalidReReport.AssoArgumentsMapper;
+import cn.cslg.report.service.business.FeatureService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import io.swagger.v3.oas.models.security.SecurityScheme;
@@ -33,6 +32,9 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
     private static LoginUtils loginUtils;
     private static ScratchService scratchService;
     private static AssoArgumentsService assoArgumentsService;
+    private static FeatureService featureService;
+    private static AssoFeatureProofService assoFeatureProofService;
+
     /**
      * 添加陈述意见
      *
@@ -40,25 +42,25 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      */
     public void addArguments(ArgumentsDTO argumentsDTO) {
         // 检验参数
-        if (argumentsDTO == null||argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null||argumentsDTO.getProofId()==null) {
+        if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null) {
             return;
         }
-        Integer  loginId=loginUtils.getId();
+        Integer loginId = loginUtils.getId();
         //装载陈述意见实体类
         Arguments arguments = new Arguments();
         BeanUtils.copyProperties(argumentsDTO, arguments);
         arguments.setCreateId(loginId);
         arguments.insert();
         //若划词不为空
-        if(argumentsDTO.getContent()!=null){
-            Scratch scratch =new Scratch();
-            BeanUtils.copyProperties(argumentsDTO,scratch);
+        if (argumentsDTO.getContent() != null) {
+            Scratch scratch = new Scratch();
+            BeanUtils.copyProperties(argumentsDTO, scratch);
             //根据证据类型获得证据的专利号
-           Proof proof = proofService.getById(arguments.getProofId());
-           String patenNo =proof.getPatentNo();
-           scratch.setPatentNo(patenNo);
-           scratch.setCreateId(loginId);
-           scratch.insert();
+            Proof proof = proofService.getById(arguments.getProofId());
+            String patenNo = proof.getPatentNo();
+            scratch.setPatentNo(patenNo);
+            scratch.setCreateId(loginId);
+            scratch.insert();
         }
 
     }
@@ -69,25 +71,25 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      * @param argumentsId
      */
     public ArgumentsVO queryArgumentsDetail(Integer argumentsId) {
-      //判断argumentsId是否为空
-        if(argumentsId==null){
+        //判断argumentsId是否为空
+        if (argumentsId == null) {
             return null;
         }
-        ArgumentsVO argumentsVO =new ArgumentsVO();
-      //根据argumentsId查询陈述意见
-     Arguments arguments =this.getById(argumentsId);
-        BeanUtils.copyProperties(arguments,argumentsVO);
+        ArgumentsVO argumentsVO = new ArgumentsVO();
+        //根据argumentsId查询陈述意见
+        Arguments arguments = this.getById(argumentsId);
+        BeanUtils.copyProperties(arguments, argumentsVO);
         //根据证据id获得专利号
-        Proof proof =proofService.getById(arguments.getProofId());
-        if(proof.getPatentNo()!=null){
+        Proof proof = proofService.getById(arguments.getProofId());
+        if (proof.getPatentNo() != null) {
             //根据专利号和报告id获得划词内容
-            LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper =new LambdaQueryWrapper<>();
-            scratchLambdaQueryWrapper.eq(Scratch::getPatentNo,proof.getPatentNo());
-            scratchLambdaQueryWrapper.eq(Scratch::getReportId,arguments.getReportId());
-            List<Scratch> scratchList =scratchService.list(scratchLambdaQueryWrapper);
-            if(scratchList.size()>0){
-                Scratch scratch =scratchList.get(0);
-                BeanUtils.copyProperties(scratch,argumentsVO);
+            LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            scratchLambdaQueryWrapper.eq(Scratch::getPatentNo, proof.getPatentNo());
+            scratchLambdaQueryWrapper.eq(Scratch::getReportId, arguments.getReportId());
+            List<Scratch> scratchList = scratchService.list(scratchLambdaQueryWrapper);
+            if (scratchList.size() > 0) {
+                Scratch scratch = scratchList.get(0);
+                BeanUtils.copyProperties(scratch, argumentsVO);
             }
         }
 
@@ -101,35 +103,35 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      */
     public void deleteArguments(List<Integer> argumentsIds) {
         //判断argumentsId是否为空
-        if(argumentsIds==null){
-            return ;
+        if (argumentsIds == null) {
+            return;
         }
         //判断陈述意见方案中是否有正在使用的陈述意见
-        LambdaQueryWrapper<AssoArguments> assoArgumentsWrapper=new LambdaQueryWrapper<>();
-        assoArgumentsWrapper.in(AssoArguments::getArgumentId,argumentsIds);
-        List<AssoArguments> assoArguments =assoArgumentsService.list(assoArgumentsWrapper);
-        if(assoArguments.size()>0){
-            return ;
+        LambdaQueryWrapper<AssoArguments> assoArgumentsWrapper = new LambdaQueryWrapper<>();
+        assoArgumentsWrapper.in(AssoArguments::getArgumentId, argumentsIds);
+        List<AssoArguments> assoArguments = assoArgumentsService.list(assoArgumentsWrapper);
+        if (assoArguments.size() > 0) {
+            return;
         }
         //根据argumentsId查询陈述意见
-        LambdaQueryWrapper<Arguments> argumentsWrapper=new LambdaQueryWrapper<>();
-        argumentsWrapper.in(Arguments::getId,argumentsIds);
-        List<Arguments> arguments =this.list(argumentsWrapper);
-        List<Integer> proofIds =arguments.stream().map(Arguments::getProofId).collect(Collectors.toList());
+        LambdaQueryWrapper<Arguments> argumentsWrapper = new LambdaQueryWrapper<>();
+        argumentsWrapper.in(Arguments::getId, argumentsIds);
+        List<Arguments> arguments = this.list(argumentsWrapper);
+        List<Integer> proofIds = arguments.stream().map(Arguments::getProofId).collect(Collectors.toList());
         //根据proofIds获得proof
-        LambdaQueryWrapper<Proof> proofWrapper =new LambdaQueryWrapper<>();
-        proofWrapper.in(Proof::getId,proofIds);
+        LambdaQueryWrapper<Proof> proofWrapper = new LambdaQueryWrapper<>();
+        proofWrapper.in(Proof::getId, proofIds);
         List<Proof> proofs = proofService.list(proofWrapper);
-        List<String> patentNos =proofs.stream().map(Proof::getPatentNo).collect(Collectors.toList());
-        if(patentNos.size()>0){
+        List<String> patentNos = proofs.stream().map(Proof::getPatentNo).collect(Collectors.toList());
+        if (patentNos.size() > 0) {
             //根据专利号和报告id获得划词内容
-            LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper =new LambdaQueryWrapper<>();
-            scratchLambdaQueryWrapper.in(Scratch::getPatentNo,patentNos);
-            scratchLambdaQueryWrapper.eq(Scratch::getReportId,arguments.get(0).getReportId());
+            LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            scratchLambdaQueryWrapper.in(Scratch::getPatentNo, patentNos);
+            scratchLambdaQueryWrapper.eq(Scratch::getReportId, arguments.get(0).getReportId());
             scratchService.remove(scratchLambdaQueryWrapper);
         }
-         this.remove(argumentsWrapper);
-        return ;
+        this.remove(argumentsWrapper);
+        return;
     }
 
     /**
@@ -139,13 +141,13 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      */
     public void queryArguments(ArgumentsQueryDTO argumentsQueryDTO) {
         //判断reportId是否为空
-        if(argumentsQueryDTO.getReportId()==null){
+        if (argumentsQueryDTO.getReportId() == null) {
             return;
         }
-        LambdaQueryWrapper<Arguments> argumentsLambdaQueryWrapper =new LambdaQueryWrapper<>();
-        argumentsLambdaQueryWrapper.eq(Arguments::getReportId,argumentsQueryDTO.getReportId());
-        if(argumentsQueryDTO.getReportId()!=null){
-            argumentsLambdaQueryWrapper.eq(Arguments::getRightId,argumentsQueryDTO.getRightId());
+        LambdaQueryWrapper<Arguments> argumentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        argumentsLambdaQueryWrapper.eq(Arguments::getReportId, argumentsQueryDTO.getReportId());
+        if (argumentsQueryDTO.getReportId() != null) {
+            argumentsLambdaQueryWrapper.eq(Arguments::getRightId, argumentsQueryDTO.getRightId());
         }
     }
 
@@ -156,22 +158,22 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      */
     public void updateArgumentsBatch(ArgumentsDTO argumentsDTO) {
         // 检验参数
-        if (argumentsDTO == null||argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null||argumentsDTO.getProofId()==null) {
+        if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null) {
             return;
         }
-        Integer  loginId=loginUtils.getId();
+        Integer loginId = loginUtils.getId();
         //装载陈述意见实体类
         Arguments arguments = new Arguments();
         BeanUtils.copyProperties(argumentsDTO, arguments);
         arguments.setCreateId(loginId);
         arguments.insert();
         //若划词不为空
-        if(argumentsDTO.getContent()!=null){
-            Scratch scratch =new Scratch();
-            BeanUtils.copyProperties(argumentsDTO,scratch);
+        if (argumentsDTO.getContent() != null) {
+            Scratch scratch = new Scratch();
+            BeanUtils.copyProperties(argumentsDTO, scratch);
             //根据证据类型获得证据的专利号
             Proof proof = proofService.getById(arguments.getProofId());
-            String patenNo =proof.getPatentNo();
+            String patenNo = proof.getPatentNo();
             scratch.setPatentNo(patenNo);
             scratch.setCreateId(loginId);
             scratch.insert();
@@ -179,12 +181,26 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
 
     }
 
+
     /**
-     * 根据文件id和权要id查询列表
+     * 根据文件id和权要sort查询列表
      *
      * @param
      */
-    public void queryPoofArguments(Integer fileId) {
+    public void queryPoofArguments(Integer fileId, Integer rightSort, Integer reportId) {
+        // 根据报告id和权要id获得所有特征
+        LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Features::getReportId, reportId)
+                .eq(Features::getRightId, rightSort);
+        List<Features> features = featureService.list(wrapper);
+        List<Integer> featureIds =features.stream().map(Features::getId).collect(Collectors.toList());
+        //根据特征和文件id获得证据
+        LambdaQueryWrapper<AssoFeatureProof> featureProofWrapper =new LambdaQueryWrapper<>();
+        featureProofWrapper.in(AssoFeatureProof::getFeature_ID,featureIds)
+                .eq(AssoFeatureProof::getCompareFileId,fileId);
+        List<AssoFeatureProof> assoFeatureProofs =assoFeatureProofService.list();
+        List<Integer> assoFeatureProofIds =assoFeatureProofs.stream().map(AssoFeatureProof::getID).collect(Collectors.toList());
+        //根据特征和证据id获得陈述意见
 
     }