chendayu vor 2 Jahren
Ursprung
Commit
7c046c4fac
20 geänderte Dateien mit 166 neuen und 65 gelöschten Zeilen
  1. 0 4
      RMS/src/main/java/cn/cslg/report/common/model/dto/AvoidFeatures.java
  2. 68 2
      RMS/src/main/java/cn/cslg/report/common/model/vo/AvoidDesignDirectionVO.java
  3. 7 4
      RMS/src/main/java/cn/cslg/report/controller/AvoidDesignDirectionController.java
  4. 1 1
      RMS/src/main/java/cn/cslg/report/mapper/AvoidDesignLittleDirectionMapper.java
  5. 4 1
      RMS/src/main/java/cn/cslg/report/service/IAvoidDesignDirectionService.java
  6. 19 4
      RMS/src/main/java/cn/cslg/report/service/impl/AvoidDesignDirectionServiceImpl.java
  7. 22 24
      RMS/src/main/resources/mapper/AvoidDesignLittleDirectionMapper.xml
  8. 1 1
      RMS/src/test/java/cn/cslg/report/mapper/AssoAvoidDesignWholeLittleDirectionMapperTests.java
  9. 10 1
      RMS/src/test/java/cn/cslg/report/mapper/AvoidDesignLittleDirectionMapperTests.java
  10. 1 1
      RMS/src/test/java/cn/cslg/report/mapper/AvoidDesignWholeDirectionMapperTests.java
  11. BIN
      RMS/target/classes/cn/cslg/report/common/model/vo/AvoidDesignDirectionVO.class
  12. BIN
      RMS/target/classes/cn/cslg/report/controller/AvoidDesignDirectionController.class
  13. BIN
      RMS/target/classes/cn/cslg/report/service/IAvoidDesignDirectionService.class
  14. BIN
      RMS/target/classes/cn/cslg/report/service/business/ReportService.class
  15. BIN
      RMS/target/classes/cn/cslg/report/service/impl/AvoidDesignDirectionServiceImpl.class
  16. 13 0
      RMS/target/classes/mapper/AssoTaskPersonelMapper.xml
  17. 20 22
      RMS/target/classes/mapper/AvoidDesignLittleDirectionMapper.xml
  18. BIN
      RMS/target/test-classes/cn/cslg/report/mapper/AssoAvoidDesignWholeLittleDirectionMapperTests.class
  19. BIN
      RMS/target/test-classes/cn/cslg/report/mapper/AvoidDesignLittleDirectionMapperTests.class
  20. BIN
      RMS/target/test-classes/cn/cslg/report/mapper/AvoidDesignWholeDirectionMapperTests.class

+ 0 - 4
RMS/src/main/java/cn/cslg/report/common/model/dto/AvoidFeatures.java

@@ -1,10 +1,6 @@
 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;

+ 68 - 2
RMS/src/main/java/cn/cslg/report/common/model/vo/AvoidDesignDirectionVO.java

@@ -15,9 +15,75 @@ import java.util.List;
 @Data
 public class AvoidDesignDirectionVO implements Serializable {
     /**
-     * 权要特征和回避设计方案
+     * 特征id
      */
-    List<AvoidFeatures> features;
+    private Integer id;
+    /**
+     * 专利号
+     */
+    private String signPatentNo;
+    /**
+     * 特征翻译
+     */
+    private String contentOut;
+    /**
+     * 特征
+     */
+    private String content;
+    /**
+     * 权要ID
+     */
+    private Integer rightId;
+
+    /**
+     * 特征拆分人ID
+     */
+    private Integer partnerId;
+    /**
+     * 是否最终
+     */
+    private Integer isFinal;
+    /**
+     * 所属报告
+     */
+    private Integer reportId;
+    /**
+     * 解释
+     */
+    private String explainText;
+    /**
+     * 拆分类型
+     */
+    private Integer splitBy;
+
+    /**
+     * 拆分方式
+     */
+    private Integer splitType;
+    /**
+     * 权要名
+     */
+    private String rightName;
+    /**
+     * 权要类型 1主权要 0附属权要
+     */
+    private Integer rightType;
+    /**
+     * 特征排序
+     */
+    private Integer featuresOrder;
+    /**
+     * 任务id
+     */
+    private Integer taskId;
+    /**
+     * 特征拆分人IDs
+     */
+    private List<Integer> partnerIds;
+    /**
+     * 回避设计方向
+     */
+    private String littleDirection;
     /**
      * 回避设计总体方向
      */

+ 7 - 4
RMS/src/main/java/cn/cslg/report/controller/AvoidDesignDirectionController.java

@@ -12,6 +12,9 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 
+import java.io.IOException;
+import java.util.List;
+
 /**
  * 回避设计方案的Controller层
  *
@@ -35,15 +38,15 @@ public class AvoidDesignDirectionController {
         } catch (XiaoShiException e) {
             return Response.error(e.getMessage());
         }
-        return Response.success("新增回避设计方案完成");
+        return Response.success(1);
     }
 
     @Operation(summary = "查询回避设计方案")
     @GetMapping("/getAvoidDesignDirection")
-    public String getAvoidDesignDirection(Integer reportId) {
+    public String getAvoidDesignDirection(Integer reportId) throws IOException {
         log.info("开始处理【查询回避设计方案】的请求,参数为:{}", reportId);
-        AvoidDesignDirectionVO avoidDesignDirection = avoidDesignDirectionService.getAvoidDesignDirection(reportId);
-        return Response.success(avoidDesignDirection);
+        List<AvoidDesignDirectionVO> queryResults = avoidDesignDirectionService.getAvoidDesignDirection(reportId);
+        return Response.success(queryResults);
     }
 
 }

+ 1 - 1
RMS/src/main/java/cn/cslg/report/mapper/AvoidDesignLittleDirectionMapper.java

@@ -36,6 +36,6 @@ public interface AvoidDesignLittleDirectionMapper {
      * @param reportId 报告id
      * @return 返回查询到的数据
      */
-    AvoidDesignDirectionVO selectWholeByReportId(Integer reportId);
+    List<AvoidDesignDirectionVO> selectWholeByReportId(Integer reportId);
 
 }

+ 4 - 1
RMS/src/main/java/cn/cslg/report/service/IAvoidDesignDirectionService.java

@@ -4,6 +4,9 @@ import cn.cslg.report.common.model.dto.AvoidDesignDirectionDTO;
 import cn.cslg.report.common.model.vo.AvoidDesignDirectionVO;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.IOException;
+import java.util.List;
+
 /**
  * 回避设计方向的Service层接口
  *
@@ -25,7 +28,7 @@ public interface IAvoidDesignDirectionService {
      * @param reportId 报告id
      * @return 返回查询到的数据
      */
-    AvoidDesignDirectionVO getAvoidDesignDirection(Integer reportId);
+    List<AvoidDesignDirectionVO> getAvoidDesignDirection(Integer reportId);
 
     /**
      * 删除回避设计方案

+ 19 - 4
RMS/src/main/java/cn/cslg/report/service/impl/AvoidDesignDirectionServiceImpl.java

@@ -4,19 +4,26 @@ import cn.cslg.report.common.model.dto.AvoidDesignDirectionDTO;
 import cn.cslg.report.common.model.dto.AvoidDesignLittleDirectionDTO;
 import cn.cslg.report.common.model.dto.AvoidFeatures;
 import cn.cslg.report.common.model.vo.AvoidDesignDirectionVO;
+import cn.cslg.report.common.utils.CacheUtils;
+import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.report.entity.AssoAvoidDesignWholeLittleDirection;
 import cn.cslg.report.entity.AvoidDesignLittleDirection;
 import cn.cslg.report.entity.AvoidDesignWholeDirection;
+import cn.cslg.report.entity.PatentRight;
 import cn.cslg.report.exception.XiaoShiException;
 import cn.cslg.report.mapper.AssoAvoidDesignWholeLittleDirectionMapper;
 import cn.cslg.report.mapper.AvoidDesignLittleDirectionMapper;
 import cn.cslg.report.mapper.AvoidDesignWholeDirectionMapper;
 import cn.cslg.report.mapper.AvoidFeatureMapper;
 import cn.cslg.report.service.IAvoidDesignDirectionService;
+import cn.cslg.report.service.OutInterfaceService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -34,6 +41,7 @@ public class AvoidDesignDirectionServiceImpl implements IAvoidDesignDirectionSer
     private final AvoidDesignLittleDirectionMapper avoidDesignLittleDirectionMapper;  //回避设计方向表的Mapper层接口装配
     private final AssoAvoidDesignWholeLittleDirectionMapper assoAvoidDesignWholeLittleDirectionMapper;  //回避设计总体方向和方向关联表的Mapper层接口装配
     private final AvoidFeatureMapper avoidFeatureMapper;  //特征标的Mapper层接口装配
+    private final OutInterfaceService outInterfaceService;
     //private final CacheUtils cacheUtils;
     //private final LoginUtils loginUtils;
 
@@ -68,7 +76,6 @@ public class AvoidDesignDirectionServiceImpl implements IAvoidDesignDirectionSer
         //2.从回避设计方案中取出权要特征解释等和回避设计方向littleDirection等数据的对象的集合avoidDesignLittleDirectionDTOs,处理后把数据分别插入各自表中
         List<AvoidDesignLittleDirectionDTO> avoidDesignLittleDirectionDTOs = avoidDesignDirectionDTO.getAvoidDesignLittleDirectionDTOs();
         //遍历集合取出每个权要的特征数据插入特征表,插入后取出每个特征的特征featureId和回避设计方向littleDirection存入回避设计方向表
-        List<AvoidDesignLittleDirection> avoidDesignLittleDirections = new ArrayList<>();
         List<AvoidFeatures> avoidFeatures = new ArrayList<>();
         for (AvoidDesignLittleDirectionDTO avoidDesignLittleDirectionDTO : avoidDesignLittleDirectionDTOs) {
             avoidFeatures.addAll(avoidDesignLittleDirectionDTO.getFeatures());
@@ -92,6 +99,8 @@ public class AvoidDesignDirectionServiceImpl implements IAvoidDesignDirectionSer
             log.info("{}", message);
             throw new XiaoShiException(message);
         }
+
+        List<AvoidDesignLittleDirection> avoidDesignLittleDirections = new ArrayList<>();
         for (AvoidFeatures avoidFeature : avoidFeatures) {
             Integer featureId = avoidFeature.getId();
             String littleDirection = avoidFeature.getLittleDirection();
@@ -146,10 +155,16 @@ public class AvoidDesignDirectionServiceImpl implements IAvoidDesignDirectionSer
     }
 
     @Override
-    public AvoidDesignDirectionVO getAvoidDesignDirection(Integer reportId) {
+    public List<AvoidDesignDirectionVO> getAvoidDesignDirection(Integer reportId) {
         log.info("开始处理【查询回避设计方案】的业务,参数为:{}", reportId);
-        AvoidDesignDirectionVO queryResult = avoidDesignLittleDirectionMapper.selectWholeByReportId(reportId);
-        return queryResult;
+        List<AvoidDesignDirectionVO> queryResults = avoidDesignLittleDirectionMapper.selectWholeByReportId(reportId);
+//        从pas获得权要信息
+//        String resBody = null;
+//        resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
+//        JSONObject jsonObject = JSONObject.parseObject(resBody);
+//        解析jason获得标的专利的权要
+//        List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
+        return queryResults;
     }
 
     @Override

+ 22 - 24
RMS/src/main/resources/mapper/AvoidDesignLittleDirectionMapper.xml

@@ -22,15 +22,15 @@
     </delete>
 
     <!--根据报告id关联查询回避设计方案数据-->
-    <!--AvoidDesignDirectionVO selectWholeByReportId(Integer reportId);-->
+    <!--List<AvoidDesignDirectionVO> selectWholeByReportId(Integer reportId);-->
     <select id="selectWholeByReportId" resultMap="AllResultMap">
-        select f.ID f_ID,
+        select f.ID,
                SIGN_PATENT_NO,
                CONTENT_OUT,
                RIGHT_ID,
                PARTNER_ID,
                IS_FINAL,
-               f.REPORT_ID f_REPORT_ID,
+               f.REPORT_ID,
                CONTENT,
                EXPLAIN_TEXT,
                SPLIT_BY,
@@ -42,33 +42,31 @@
                LITTLE_DIRECTION,
                WHOLE_DIRECTION
         from FEATURES f
-                 join AVOIDDESIGN_LITTLE_DIRECTION l on f.ID = l.FEATURE_ID
-                 join ASSO_AVOIDDESIGN_WHOLE_LITTLE_DIRECTION wl on l.ID = wl.AVOIDDESIGN_LITTLE_DIRECTION_ID
-                 join AVOIDDESIGN_WHOLE_DIRECTION w on wl.AVOIDDESIGN_WHOLE_DIRECTION_ID = w.ID
+                 left join AVOIDDESIGN_LITTLE_DIRECTION l on f.ID = l.FEATURE_ID
+                 left join ASSO_AVOIDDESIGN_WHOLE_LITTLE_DIRECTION wl on l.ID = wl.AVOIDDESIGN_LITTLE_DIRECTION_ID
+                 left join AVOIDDESIGN_WHOLE_DIRECTION w on wl.AVOIDDESIGN_WHOLE_DIRECTION_ID = w.ID
         where f.REPORT_ID = #{reportId}
         order by f.ID
     </select>
 
     <resultMap id="AllResultMap" type="cn.cslg.report.common.model.vo.AvoidDesignDirectionVO">
+        <id column="ID" property="id"/>
+        <result column="SIGN_PATENT_NO" property="signPatentNo"/>
+        <result column="CONTENT_OUT" property="contentOut"/>
+        <result column="RIGHT_ID" property="rightId"/>
+        <result column="PARTNER_ID" property="partnerId"/>
+        <result column="IS_FINAL" property="isFinal"/>
+        <result column="REPORT_ID" property="reportId"/>
+        <result column="CONTENT" property="content"/>
+        <result column="EXPLAIN_TEXT" property="explainText"/>
+        <result column="SPLIT_BY" property="splitBy"/>
+        <result column="RIGHT_NAME" property="rightName"/>
+        <result column="RIGHT_TYPE" property="rightType"/>
+        <result column="FEATURES_ORDER" property="featuresOrder"/>
+        <result column="SPLIT_TYPE" property="splitType"/>
+        <result column="TASK_ID" property="taskId"/>
+        <result column="LITTLE_DIRECTION" property="littleDirection"/>
         <result column="WHOLE_DIRECTION" property="wholeDirection"/>
-        <collection property="features" ofType="cn.cslg.report.common.model.dto.AvoidFeatures">
-            <result column="f_ID" property="id"/>
-            <result column="SIGN_PATENT_NO" property="signPatentNo"/>
-            <result column="CONTENT_OUT" property="contentOut"/>
-            <result column="RIGHT_ID" property="rightId"/>
-            <result column="PARTNER_ID" property="partnerId"/>
-            <result column="IS_FINAL" property="isFinal"/>
-            <result column="f_REPORT_ID" property="reportId"/>
-            <result column="CONTENT" property="content"/>
-            <result column="EXPLAIN_TEXT" property="explainText"/>
-            <result column="SPLIT_BY" property="splitBy"/>
-            <result column="RIGHT_NAME" property="rightName"/>
-            <result column="RIGHT_TYPE" property="rightType"/>
-            <result column="FEATURES_ORDER" property="featuresOrder"/>
-            <result column="SPLIT_TYPE" property="splitType"/>
-            <result column="TASK_ID" property="taskId"/>
-            <result column="LITTLE_DIRECTION" property="littleDirection"/>
-        </collection>
     </resultMap>
 
 </mapper>

+ 1 - 1
RMS/src/test/java/cn/cslg/report/mapper/AssoAvoidDesignWholeLittleDirectionMapperTests.java

@@ -43,7 +43,7 @@ public class AssoAvoidDesignWholeLittleDirectionMapperTests {
 
     @Test
     void deleteByReportId() {
-        Integer reportId = 330;
+        Integer reportId = 517;
         int rows = assoAvoidDesignWholeLittleDirectionMapper.deleteByReportId(reportId);
         log.info("根据报告id删除数据完成,受影响的行数为:{}", rows);
     }

+ 10 - 1
RMS/src/test/java/cn/cslg/report/mapper/AvoidDesignLittleDirectionMapperTests.java

@@ -1,5 +1,6 @@
 package cn.cslg.report.mapper;
 
+import cn.cslg.report.common.model.vo.AvoidDesignDirectionVO;
 import cn.cslg.report.entity.AvoidDesignLittleDirection;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
@@ -7,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 回避设计方向表的Mapper层接口测试类
@@ -43,9 +45,16 @@ public class AvoidDesignLittleDirectionMapperTests {
 
     @Test
     void deleteByReportId() {
-        Integer reportId = 330;
+        Integer reportId = 517;
         int rows = avoidDesignLittleDirectionMapper.deleteByReportId(reportId);
         log.info("根据报告id删除数据完成,受影响的行数为:{}", rows);
     }
 
+    @Test
+    void selectWholeByReportId() {
+        Integer reportId = 543;
+        List<AvoidDesignDirectionVO> queryResults = avoidDesignLittleDirectionMapper.selectWholeByReportId(reportId);
+        log.info("查询数据完成,数据信息为:{}", queryResults);
+    }
+
 }

+ 1 - 1
RMS/src/test/java/cn/cslg/report/mapper/AvoidDesignWholeDirectionMapperTests.java

@@ -32,7 +32,7 @@ public class AvoidDesignWholeDirectionMapperTests {
 
     @Test
     void deleteByReportId() {
-        Integer reportId = 410;
+        Integer reportId = 517;
         int rows = avoidDesignWholeDirectionMapper.deleteByReportId(reportId);
         log.info("根据报告id删除数据完成,受影响的行数为:{}", rows);
     }

BIN
RMS/target/classes/cn/cslg/report/common/model/vo/AvoidDesignDirectionVO.class


BIN
RMS/target/classes/cn/cslg/report/controller/AvoidDesignDirectionController.class


BIN
RMS/target/classes/cn/cslg/report/service/IAvoidDesignDirectionService.class


BIN
RMS/target/classes/cn/cslg/report/service/business/ReportService.class


BIN
RMS/target/classes/cn/cslg/report/service/impl/AvoidDesignDirectionServiceImpl.class


+ 13 - 0
RMS/target/classes/mapper/AssoTaskPersonelMapper.xml

@@ -10,5 +10,18 @@
         select b.* from ASSO_TASK_PATENT a left join ASSO_TASK_PATENT_SPLIT as b on a.id=b.TASK_PATENT_ID
         where a.PATENT_NO=#{patentNo} and a.TASK_ID=#{taskId} limit 1;
     </select>
+    <select id="getPatents" resultType="java.lang.String">
+        select distinct  PATENT_NO  from ASSO_TASK_PERSONEL
+      <where>
+            <foreach collection="params" index="index" item="item" open="(" separator=" or " close=")">
+          PERSON_ID=#{item.personId} and STATE=#{item.state} and TASK_ID in
+                <foreach collection="item.taskIds" index="index" item="item1" open="(" separator="," close=")">
+                    #{item1}
+                </foreach>
+            </foreach>
+      </where>
+
+    </select>
+
 
 </mapper>

+ 20 - 22
RMS/target/classes/mapper/AvoidDesignLittleDirectionMapper.xml

@@ -22,15 +22,15 @@
     </delete>
 
     <!--根据报告id关联查询回避设计方案数据-->
-    <!--AvoidDesignDirectionVO selectWholeByReportId(Integer reportId);-->
+    <!--List<AvoidDesignDirectionVO> selectWholeByReportId(Integer reportId);-->
     <select id="selectWholeByReportId" resultMap="AllResultMap">
-        select f.ID f_ID,
+        select f.ID,
                SIGN_PATENT_NO,
                CONTENT_OUT,
                RIGHT_ID,
                PARTNER_ID,
                IS_FINAL,
-               f.REPORT_ID f_REPORT_ID,
+               f.REPORT_ID,
                CONTENT,
                EXPLAIN_TEXT,
                SPLIT_BY,
@@ -46,29 +46,27 @@
                  left join ASSO_AVOIDDESIGN_WHOLE_LITTLE_DIRECTION wl on l.ID = wl.AVOIDDESIGN_LITTLE_DIRECTION_ID
                  left join AVOIDDESIGN_WHOLE_DIRECTION w on wl.AVOIDDESIGN_WHOLE_DIRECTION_ID = w.ID
         where f.REPORT_ID = #{reportId}
-        order by f_ID
+        order by f.ID
     </select>
 
     <resultMap id="AllResultMap" type="cn.cslg.report.common.model.vo.AvoidDesignDirectionVO">
+        <id column="ID" property="id"/>
+        <result column="SIGN_PATENT_NO" property="signPatentNo"/>
+        <result column="CONTENT_OUT" property="contentOut"/>
+        <result column="RIGHT_ID" property="rightId"/>
+        <result column="PARTNER_ID" property="partnerId"/>
+        <result column="IS_FINAL" property="isFinal"/>
+        <result column="REPORT_ID" property="reportId"/>
+        <result column="CONTENT" property="content"/>
+        <result column="EXPLAIN_TEXT" property="explainText"/>
+        <result column="SPLIT_BY" property="splitBy"/>
+        <result column="RIGHT_NAME" property="rightName"/>
+        <result column="RIGHT_TYPE" property="rightType"/>
+        <result column="FEATURES_ORDER" property="featuresOrder"/>
+        <result column="SPLIT_TYPE" property="splitType"/>
+        <result column="TASK_ID" property="taskId"/>
+        <result column="LITTLE_DIRECTION" property="littleDirection"/>
         <result column="WHOLE_DIRECTION" property="wholeDirection"/>
-        <collection property="features" ofType="cn.cslg.report.common.model.dto.AvoidFeatures">
-            <result column="f_ID" property="id"/>
-            <result column="SIGN_PATENT_NO" property="signPatentNo"/>
-            <result column="CONTENT_OUT" property="contentOut"/>
-            <result column="RIGHT_ID" property="rightId"/>
-            <result column="PARTNER_ID" property="partnerId"/>
-            <result column="IS_FINAL" property="isFinal"/>
-            <result column="f_REPORT_ID" property="reportId"/>
-            <result column="CONTENT" property="content"/>
-            <result column="EXPLAIN_TEXT" property="explainText"/>
-            <result column="SPLIT_BY" property="splitBy"/>
-            <result column="RIGHT_NAME" property="rightName"/>
-            <result column="RIGHT_TYPE" property="rightType"/>
-            <result column="FEATURES_ORDER" property="featuresOrder"/>
-            <result column="SPLIT_TYPE" property="splitType"/>
-            <result column="TASK_ID" property="taskId"/>
-            <result column="LITTLE_DIRECTION" property="littleDirection"/>
-        </collection>
     </resultMap>
 
 </mapper>

BIN
RMS/target/test-classes/cn/cslg/report/mapper/AssoAvoidDesignWholeLittleDirectionMapperTests.class


BIN
RMS/target/test-classes/cn/cslg/report/mapper/AvoidDesignLittleDirectionMapperTests.class


BIN
RMS/target/test-classes/cn/cslg/report/mapper/AvoidDesignWholeDirectionMapperTests.class