Bläddra i källkod

权要拆分,创建报告 2022/11/9

lwhhszx 2 år sedan
förälder
incheckning
e4fa3d06b3

+ 16 - 1
RMS/src/main/java/cn/cslg/report/common/model/vo/PatentRightVo.java

@@ -1,6 +1,7 @@
 package cn.cslg.report.common.model.vo;
 
 import cn.cslg.report.entity.Features;
+import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
@@ -16,6 +17,14 @@ import java.util.List;
 @Accessors(chain = true)
 public class PatentRightVo {
     /**
+     * 专利号
+     */
+    private String signPatentNo;
+    /**
+     * 特征拆分人ID
+     */
+    private String partnerId;
+    /**
      * 专利ID
      */
     private Integer patentId;
@@ -29,7 +38,6 @@ public class PatentRightVo {
      * 内容
      */
     private String content;
-
     /**
      * 类型
      */
@@ -37,5 +45,12 @@ public class PatentRightVo {
 
     private Integer sort;
 
+    /**
+     * 所属报告
+     */
+    private Integer reportId;
+    /**
+     * 特征集合
+     */
     private List<Features> features;
 }

+ 2 - 1
RMS/src/main/java/cn/cslg/report/common/model/vo/PersonnelVO.java

@@ -1,5 +1,6 @@
 package cn.cslg.report.common.model.vo;
 
+import cn.cslg.report.common.model.BaseVO;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
@@ -13,7 +14,7 @@ import java.util.List;
 
 @Data
 @Accessors(chain = true)
-public class PersonnelVO {
+public class PersonnelVO extends BaseVO {
     /**
      * ID
      */

+ 123 - 0
RMS/src/main/java/cn/cslg/report/common/model/vo/ReportVO.java

@@ -0,0 +1,123 @@
+package cn.cslg.report.common.model.vo;
+
+import cn.cslg.report.common.model.BaseVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+
+/**
+ * @author lrj
+ * @date 2022-11-9
+ * @description 报告VO类
+ */
+@Data
+@Accessors(chain = true)
+public class ReportVO extends BaseVO {
+    /**
+     * 标的专利/产品号
+     */
+    @Schema(description="标的专利号")
+    private String signPatentNo;
+
+    /**
+     * 报告名称
+     */
+    @Schema(description="报告名称")
+    private String name;
+
+    /**
+     * 产品/技术
+     */
+    @Schema(description="产品/技术")
+    private String proTec;
+
+    /**
+     * 报告类别
+     */
+    @Schema(description="报告类别(0无效分析1第三方意见2稳定性分析3FTO调查4侵权分析5回避设计6图表分析)")
+    private String type;
+
+    /**
+     * 报告状态
+     */
+    @Schema(description="报告状态")
+    private String status;
+
+    /**
+     * 报告生成时间
+     */
+    @Schema(description="报告生成时间")
+    private String createTime;
+
+    /**
+     * 报告生成文件ID
+     */
+    @Schema(description="报告生成文件ID")
+    private String reportFileId;
+
+    /**
+     * 负责人ID
+     */
+    @Schema(description="负责人ID")
+    private String personId;
+
+    /**
+     * 委托人ID
+     */
+    @Schema(description="委托人ID")
+    private String clientId;
+
+    /**
+     * 承担部门ID
+     */
+    @Schema(description="承担部门ID")
+    private String departmentId;
+
+    /**
+     * 承担部门名称
+     */
+    @Schema(description="承担部门名称")
+    private String departmentName;
+
+    /**
+     * 关联报告ID
+     */
+    @Schema(description="关联报告ID")
+    private String associateReportId;
+
+    /**
+     * 关联报告名称
+     */
+    @Schema(description="关联报告名称")
+    private String associateReportName;
+
+    /**
+     * 应用场景
+     */
+    @Schema(description="应用场景")
+    private String easFlag;
+
+    /**
+     * 调查类型
+     */
+    @Schema(description="调查类型")
+    private String itFlag;
+
+    /**
+     * 专题库ID
+     */
+    @Schema(description="专题库ID")
+    private String thematicId;
+
+    /**
+     * 卷号
+     */
+    @Schema(description="卷号")
+    private String volumeNumber;
+
+    @Schema(description = "选中人员")
+    private List<Integer> PersonnelIds;
+}

+ 50 - 0
RMS/src/main/java/cn/cslg/report/common/model/vo/TaskVO.java

@@ -0,0 +1,50 @@
+package cn.cslg.report.common.model.vo;
+
+
+import cn.cslg.report.entity.Report;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author lrj
+ * @date 2022-11-9
+ * @description 任务VO类
+ */
+@Data
+@Accessors(chain = true)
+@Schema(description="任务VO",required = true)
+public class TaskVO {
+
+    @Schema(description = "报告信息")
+    private Report report;
+
+    @Schema(description = "参与人Id列表")
+    private List<Integer> personIds;
+
+    @Schema(description = "任务名称")
+    private String taskName;
+
+
+    @Schema(description = "任务类型 0开卷审核任务")
+    private Integer type;
+
+    /**
+     * 任务开始时间
+     */
+    @Schema(description = "任务开始时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
+    private Date beginTime;
+
+    /**
+     * 结束时间
+     */
+    @Schema(description = "任务结束时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
+    private Date endTime;
+}

+ 8 - 7
RMS/src/main/java/cn/cslg/report/controller/BaseController.java

@@ -2,6 +2,7 @@ package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
 import cn.cslg.report.common.model.vo.LoginVO;
+import cn.cslg.report.common.model.vo.PersonnelVO;
 import cn.cslg.report.common.utils.Response;
 import cn.cslg.report.service.BaseService;
 import cn.cslg.report.service.OutInterfaceService;
@@ -87,10 +88,10 @@ public class BaseController {
         return baseService.getAllPersonnel();
     }
 
-    @GetMapping("/getPartPersonnel")
-    @Operation(summary = "获取部分人员")
-    public String getPartPersonnel() {
-        return baseService.getPartPersonnel();
+    @PostMapping("/getPartPersonnel")
+    @Operation(summary = "分页查询人员")
+    public String getPartPersonnel(@RequestBody PersonnelVO personnelVO) {
+        return baseService.getPartPersonnel(personnelVO);
     }
 
     @GetMapping("/getAllClient")
@@ -104,21 +105,21 @@ public class BaseController {
     public String getPartClient() {
         return baseService.getPartClient();
     }
-    @PostMapping("/getSystemDicItem")
+    @GetMapping("/getSystemDicItem")
     @Operation(summary = "获取本系统字典项")
     public String getSystemDicItem() {
         return  systemDictItemService.getSystemKey();
     }
 
 
-    @PostMapping("/getPatentByPatentNo")
+    @GetMapping("/getPatentByPatentNo")
     @Operation(summary = "根据专利号获得专利")
     @Parameters(value = {
             @Parameter(name = "patentNo",description = "专利号",required = true),
 
     })
 
-    public String getSystemDicItem( String patentNo) throws IOException {
+    public String getPatentByPatentNo(String patentNo) throws IOException {
         return  outInterfaceService.getPatentFromPAS(patentNo);
     }
 

+ 21 - 3
RMS/src/main/java/cn/cslg/report/controller/FeatureController.java

@@ -1,10 +1,14 @@
 package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.model.vo.PatentRightVo;
 import cn.cslg.report.common.utils.Response;
+import cn.cslg.report.entity.Features;
 import cn.cslg.report.entity.Report;
 import cn.cslg.report.service.business.FeatureService;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
@@ -14,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.io.IOException;
+import java.util.List;
 
 @Tag(name = "特征管理")
 @RestController
@@ -22,10 +27,23 @@ import java.io.IOException;
 public class FeatureController {
     private final FeatureService featureService;
 
-    @RequestMapping(value = "/splitPatentRight", method = RequestMethod.POST)
+    @RequestMapping(value = "/splitPatentRight", method = RequestMethod.GET)
     @Operation(summary = "拆分权要")
-    public String addReport(String patentNo,Integer splitType ,Integer splitBy,Integer ReportId) throws IOException {
+    @Parameters(value = {
+            @Parameter(name = "patentNo",description = "专利号",required = true),
+            @Parameter(name = "splitType",description = "拆分类型(0仅拆主权要,1全部拆分)",required = true),
+            @Parameter(name = "splitBy",description = "拆分符号(0  ',',1';',2','和';')",required = true),
+            @Parameter(name = "ReportId",description = "报告Id",required = true),
+    })
+    public String splitPatentRight(String patentNo,Integer splitType ,Integer splitBy,Integer ReportId) throws IOException {
      String res =   featureService.splitPatentRight(patentNo,splitType,splitBy,ReportId);
-        return Response.success(res);
+        return res;
+    }
+
+    @RequestMapping(value = "/splitPatentRight", method = RequestMethod.POST)
+    @Operation(summary = "保存权要")
+    public String addFeatures(@RequestBody PatentRightVo patentRightVo) throws IOException {
+        String res =  featureService.addFeatures(patentRightVo);
+        return res;
     }
 }

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

@@ -1,6 +1,7 @@
 package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.model.vo.ReportVO;
 import cn.cslg.report.common.utils.Response;
 import cn.cslg.report.entity.Report;
 import cn.cslg.report.service.business.ReportService;
@@ -59,14 +60,20 @@ public class ReportController {
     @Operation(summary = "修改报告")
     public String updateReport(@RequestBody Report report) {
         if (report != null) {
-            boolean flag = reportService.updateById(report);
-            if (flag) {
+            Boolean flag = reportService.updateById(report);
+            if(flag){
                 return Response.success("添加成功");
-            } else {
-                return Response.error("添加失败");
             }
+         else{ return Response.error("添加失败");}
+
         } else {
             return Response.error("未检测到报告信息");
         }
     }
+
+    @RequestMapping(value = "/queryReport", method = RequestMethod.POST)
+    @Operation(summary = "查找报告")
+    public String queryReport(@RequestBody ReportVO reportVO) {
+     return reportService.queryReport(reportVO);
+    }
 }

+ 18 - 2
RMS/src/main/java/cn/cslg/report/controller/TaskController.java

@@ -3,15 +3,19 @@ package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
 import cn.cslg.report.common.model.BaseVO;
+import cn.cslg.report.common.model.vo.TaskVO;
 import cn.cslg.report.entity.Task;
 import cn.cslg.report.service.business.TaskService;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.text.ParseException;
+
 @RestController
 @RequestMapping(Constants.REPORT_API + "/task")
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
@@ -21,7 +25,10 @@ public class TaskController {
 
     @RequestMapping(value = "/addTask", method = RequestMethod.POST)
     @Operation(summary = "新增任务")
-    public String addTask(Task task) {
+    public String addTask(@RequestBody TaskVO taskVO) {
+
+         Task task =new Task();
+
         return taskService.addTask(task);
     }
 
@@ -43,9 +50,18 @@ public class TaskController {
         return taskService.queryPageList(task, baseVO);
     }
 
-    @RequestMapping(value = "/getAllTask", method = RequestMethod.GET)
+    @RequestMapping(value = "/add", method = RequestMethod.GET)
     @Operation(summary = "获取所有任务")
     public String getAllTask() {
         return taskService.getAllTask();
     }
+
+    @RequestMapping(value = "/addAuditTask", method = RequestMethod.POST)
+    @Operation(summary = "新增审核任务")
+    public String addAuditTask(@RequestBody TaskVO taskVO) throws ParseException {
+
+
+        return taskService.addAuditTask(taskVO);
+    }
+
 }

+ 6 - 5
RMS/src/main/java/cn/cslg/report/entity/Features.java

@@ -32,11 +32,6 @@ public class Features extends BaseEntity<Features> {
     @TableField(value = "CONTENT")
     private String content;
 
-    /**
-     * 权要
-     */
-    @TableField(value = "RIGHT")
-    private String right;
 
     /**
      * 权要ID
@@ -61,4 +56,10 @@ public class Features extends BaseEntity<Features> {
      */
     @TableField(value = "REPORT_ID")
     private Integer reportId;
+    /**
+     *  解释
+     */
+    @TableField(value = "EXPLAIN_TEXT")
+    private Integer explainText;
+
 }

+ 35 - 0
RMS/src/main/java/cn/cslg/report/entity/asso/AssoTaskPersonel.java

@@ -0,0 +1,35 @@
+package cn.cslg.report.entity.asso;
+
+import cn.cslg.report.common.model.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * 对比方案与对比记录关联表
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = true)
+@TableName(value = "ASSO_TASK_PERSONEL")
+public class AssoTaskPersonel extends BaseEntity<AssoTaskPersonel> {
+    @Schema(description = "任务ID")
+    @TableField(value = "TASK_ID")
+    private String taskId;
+
+
+    @Schema(description = "任务类型")
+    @TableField(value = "TASK_TYPE")
+    private String taskType;
+
+    @Schema(description = "人员ID")
+    @TableField(value = "PERSONEL_ID")
+    private String personelId;
+
+    @Schema(description = "人员类型")
+    @TableField(value = "PERSONEL_TYPE")
+    private String personelType;
+}

+ 10 - 0
RMS/src/main/java/cn/cslg/report/mapper/AssoTaskPersonelMapper.java

@@ -0,0 +1,10 @@
+package cn.cslg.report.mapper;
+
+import cn.cslg.report.entity.Report;
+import cn.cslg.report.entity.asso.AssoTaskPersonel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AssoTaskPersonelMapper extends BaseMapper<AssoTaskPersonel> {
+}

+ 3 - 4
RMS/src/main/java/cn/cslg/report/service/BaseService.java

@@ -166,11 +166,10 @@ public class BaseService {
      * @title 获取部分人员
      * @author 沈永艺
      */
-    public String getPartPersonnel() {
+    public String getPartPersonnel(PersonnelVO personnelVO) {
         try {
-            String resBody = outInterfaceService.getPartPersonnelFromPCS();
-            JSONObject jsonObject = JSONObject.parseObject(resBody);
-            return Response.success(jsonObject.get("data"));
+            String resBody = outInterfaceService.getPartPersonnelFromPCS(personnelVO);
+            return resBody;
         } catch (Exception ex) {
             ex.printStackTrace();
             log.error("权限系统获取人员列表失败,错误信息:" + LogExceptionUtil.getMessage(ex));

+ 17 - 5
RMS/src/main/java/cn/cslg/report/service/OutInterfaceService.java

@@ -1,6 +1,7 @@
 package cn.cslg.report.service;
 
 import cn.cslg.report.common.model.vo.LoginVO;
+import cn.cslg.report.common.model.vo.PersonnelVO;
 import cn.cslg.report.common.utils.CacheUtils;
 import cn.cslg.report.common.utils.JsonUtils;
 import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
@@ -165,16 +166,26 @@ public class OutInterfaceService {
     }
 
     /**
-     * @title 获取部分人员(有权限控制)
+     * @title 分页查询人员
      * @description 接口来源:PCS
      */
-    // TODO: 2022/11/2 未开发
-    public String getPartPersonnelFromPCS() throws IOException {
+    public String getPartPersonnelFromPCS(PersonnelVO personnelVO) throws IOException {
+        Map<String, Object> map = new HashMap<>();
+if(personnelVO.getName()==null)
+{
+    personnelVO.setName("");
+}
+        map.put("name", personnelVO.getName());
+        map.put("tenant", personnelVO.getTenant());
+        map.put("size", personnelVO.getSize());
+        map.put("current", personnelVO.getCurrent());
+        JSONObject json = new JSONObject(map);
+        RequestBody requestBody = RequestBody.create(JSON, String.valueOf(json));
         OkHttpClient okHttpClient = new OkHttpClient();
         Request request = new Request.Builder()
-                .url(PCSUrl + "/permission/api/system/getPartPersonnel")
+                .url(PCSUrl + "/permission/api/system/queryPageList")
                 .addHeader("Cookie", LoginUtils.getToken())
-                .get()
+                .post(requestBody)
                 .build();
         return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
     }
@@ -217,6 +228,7 @@ public class OutInterfaceService {
 //                .addHeader("Cookie", LoginUtils.getToken())
                 .get()
                 .build();
+        String a=Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
         return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
     }
     /**

+ 26 - 0
RMS/src/main/java/cn/cslg/report/service/business/AssoTaskPersonelService.java

@@ -0,0 +1,26 @@
+package cn.cslg.report.service.business;
+
+import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.utils.LogExceptionUtil;
+import cn.cslg.report.common.utils.Response;
+import cn.cslg.report.entity.SysDictItem;
+import cn.cslg.report.entity.asso.AssoTaskPersonel;
+import cn.cslg.report.mapper.AssoTaskPersonelMapper;
+import cn.cslg.report.mapper.SystemDictItemMapper;
+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.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper, AssoTaskPersonel> {
+
+}

+ 165 - 78
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -1,18 +1,22 @@
 package cn.cslg.report.service.business;
 
 import cn.cslg.report.common.model.vo.PatentRightVo;
+import cn.cslg.report.common.model.vo.PersonnelVO;
 import cn.cslg.report.common.utils.Response;
+import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.report.entity.Features;
 import cn.cslg.report.entity.PatentRight;
 import cn.cslg.report.mapper.FeatureMapper;
 import cn.cslg.report.service.OutInterfaceService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+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.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -25,94 +29,177 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
 
-    private final OutInterfaceService outInterfaceService;
-
+    private  final OutInterfaceService outInterfaceService;
     //从PAS系统上获得权要并拆分
-    public String splitPatentRight(String patentNo, Integer splitType, Integer splitBy, Integer reportId) throws IOException {
-        //权要(带拆分的特征)列表
-        List<PatentRightVo> patentRightVos = new ArrayList<>();
-        String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
-        JSONObject jsonObject = JSONObject.parseObject(resBody);
-        List<PatentRight> patentRights = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
-        List<String> flags = new ArrayList<>();
-        List<PatentRight> mainRights = new ArrayList<>();
-        if (splitType == 0) {
-            mainRights = patentRights.stream().filter(item -> item.getType() == 1).collect(Collectors.toList());
-            // TODO: 2022/11/9 这个地方的判断条件应该是 mainRights.size() == 0 吧 如果是为null的话 这个地方一直都是 false的
-            if (mainRights == null) {
-                mainRights = new ArrayList<>();
-            }
-        } else if (splitType == 1) {
-            mainRights = patentRights;
-        }
-        if (splitBy == 0) {
-            flags.add(",");
-        } else if (splitBy == 1) {
-            flags.add(";");
-        } else if (splitBy == 2) {
-            flags.add(",");
-            flags.add(";");
-        }
-        List<Features> featuresListToDb = new ArrayList<>();
-        for (PatentRight mainRight : mainRights) {
-            List<String> contentOuts = this.splitStringByFlags(mainRight.getContentOut(), flags);
-            List<String> contents = this.splitStringByFlags(mainRight.getContent(), flags);
-            List<Features> featuresList = new ArrayList<>();
-            for (int t = 0; t < contentOuts.size(); t++) {
-                Features features = new Features();
-                features.setRight(mainRight.getContentOut());
-                features.setRightId(mainRight.getId());
-                features.setIsFinal(0);
-                features.setSignPatentNo(patentNo);
-                features.setReportId(reportId);
-                features.setContentOut(contentOuts.get(t));
-                String content = contents.size() - 1 >= t ? contents.get(t) : "";
-                features.setContent(content);
-//              features.setPartnerId(LoginUtils.getToken());
-                featuresList.add(features);
-                // TODO: 2022/11/9 这段添加代码是做什么的? featuresListToDb 这个List在装填完数据后没有调用啊
-                featuresListToDb.add(features);
-            }
-            PatentRightVo patentRightVo = new PatentRightVo();
-            patentRightVo.setPatentId(mainRight.getPatentId());
-            patentRightVo.setFeatures(featuresList);
-            patentRightVo.setContent(mainRight.getContent());
-            patentRightVo.setSort(mainRight.getSort());
-            patentRightVo.setType(mainRight.getType());
-            patentRightVo.setContentOut(mainRight.getContentOut());
-            patentRightVos.add(patentRightVo);
+public String splitPatentRight(String patentNo,Integer splitType ,Integer splitBy,Integer reportId) throws IOException {
+    //权要(带拆分的特征)列表
+    List<PatentRightVo> patentRightVos =new ArrayList<>();
+    //从pas获得权要信息
+  String resBody=  outInterfaceService.getPatentRightFromPAS(patentNo);
+    JSONObject jsonObject = JSONObject.parseObject(resBody);
+    //解析jason获得标的专利的权要
+    List<PatentRight> patentRights = JSON.parseArray(jsonObject.getString("data"),PatentRight.class);
+    List<Integer> partRightIds=new ArrayList<>();
+    List<String> flags =new ArrayList<>();
+    // 当splitType=0仅拆解主权要
+    if(splitType==0)
+    { partRightIds = patentRights.stream().filter(item->item.getType()==1).map(PatentRight::getId).collect(Collectors.toList());
+    }// 当splitType=1拆解全部权要
+    else if(splitType==1)
+    {
+         partRightIds = patentRights.stream().map(PatentRight::getId).collect(Collectors.toList());
+    }
+    //当splitBy=0时仅仅根据“,”拆解
+    if(splitBy==0)
+    {   flags.add(",");
+
+    }
+    //当splitBy=1时仅仅根据“;“拆解
+    else if(splitBy==1)
+    {
+        flags.add(";");
+    }//当splitBy=2时根据“;“和”,”拆解
+    else if(splitBy==2){
+
+        flags.add(",");
+        flags.add(";");
+    }
+    Features featureTO=new Features();
+    featureTO.setReportId(reportId);
+    featureTO.setSignPatentNo(patentNo);
+    //featureTO.setPartnerId();
+    //查询数据库里是否有查询记录
+    List<Features> featureFromDb =this.queryFeatures(featureTO);
+    //将拆解的权要和特征装载到对象PatentRightVo
+    for(int i=0;i<patentRights.size();i++) {
+        List<Features> featuresList = new ArrayList<>();
+        //对需要拆解的权要进行拆解
+        if(partRightIds.contains(patentRights.get(i).getId()))
+        {
+
+            if(featureFromDb!=null&&featureFromDb.size()!=0)
+        { int  rightId =patentRights.get(i).getId();
+           featuresList = featureFromDb.stream().filter(item->item.getRightId()==rightId).collect(Collectors.toList());
+
         }
-        if (splitType == 0) {
-            List<PatentRight> rights = patentRights.stream().filter(item -> item.getType() == 0).collect(Collectors.toList());
-            for (PatentRight right : rights) {
-                PatentRightVo patentRightVo = new PatentRightVo();
-                patentRightVo.setPatentId(right.getPatentId());
-                patentRightVo.setFeatures(null);
-                patentRightVo.setContent(right.getContent());
-                patentRightVo.setSort(right.getSort());
-                patentRightVo.setType(right.getType());
-                patentRightVo.setContentOut(right.getContentOut());
-                patentRightVos.add(patentRightVo);
+          //如果数据库里无拆解记录则手动插入一条
+            if(featuresList==null||featuresList.size()==0)
+            { featuresList=new ArrayList<>();
+                //获得权要的译文并且拆解
+                List<String> contentOuts = this.splitStringByFlags(patentRights.get(i).getContentOut(), flags);
+                //获得权要的原文并且拆解
+                List<String> contents  =this.splitStringByFlags(patentRights.get(i).getContent(),flags);
+                //遍历拆解出来的内容并装载到features最后存入列表
+                for (int t = 0; t < contentOuts.size(); t++)
+                { Features features =new Features();
+                    features.setRightId(patentRights.get(i).getId());
+                    features.setIsFinal(0);
+                    features.setSignPatentNo(patentNo);
+                    features.setReportId(reportId);
+                    features.setContentOut(contentOuts.get(t));
+                    String  content=  contents.size()-1>=t ? contents.get(t):"";
+                    features.setContent(content);
+//            features.setPartnerId(LoginUtils.getToken());
+                    featuresList.add(features);
+                }
+
             }
         }
 
-        return Response.success(patentRightVos);
+        //装载到对象PatentRightVo
+     PatentRightVo patentRightVo =new PatentRightVo();
+        patentRightVo.setPatentId(patentRights.get(i).getPatentId());
+        patentRightVo.setFeatures(featuresList);
+        patentRightVo.setContent(patentRights.get(i).getContent());
+        patentRightVo.setSort(patentRights.get(i).getSort());
+        patentRightVo.setType(patentRights.get(i).getType());
+        patentRightVo.setContentOut(patentRights.get(i).getContentOut());
+        patentRightVo.setReportId(reportId);
+//        patentRightVo.setPatentId();
+        patentRightVo.setSignPatentNo(patentNo);
+        patentRightVos.add(patentRightVo);
     }
 
 
-    public List<String> splitStringByFlags(String sentence, List<String> flags) {
-        List<String> sentenceList = new ArrayList<>();
-        sentenceList.add(sentence);
-        for (String flag : flags) {
-            List<String> tem = new ArrayList<>();
-            for (int t = 0; t < sentenceList.size(); t++) {
-                tem.addAll(Arrays.asList(sentence.split(flag)));
-            }
-            sentenceList = tem;
+    return Response.success(patentRightVos);
 
-        }
+}
+
+//根据符号拆分字符串
+public List<String> splitStringByFlags(String sentence,List<String> flags){
+List<String> sectences =new ArrayList<>();
+//如果字符串为空则返回一个包含空字符串的list
+if(sentence==null){
+    sectences.add("");
+    return  sectences;
+}
+sectences.add(sentence);
+for(int i=0;i<flags.size();i++)
+{  List<String> tem =new ArrayList<>();
+  for(int t=0;t<sectences.size();t++)
+  {
+    tem.addAll(Arrays.asList(sentence.split(flags.get(i))));
+  }
+sectences=tem;
+
+}
+return sectences;
+
+}
 
-        return sentenceList;
+    /**
+     * @author lrj
+     * @deprecated 查询特征
+     */
+public List<Features>  queryFeatures(Features features){
+    List<Features> featureList =new ArrayList<>();
+    LambdaQueryWrapper<Features> lambdaQueryWrapper= new LambdaQueryWrapper();
+    if(features.getRightId()!=null)
+    {lambdaQueryWrapper.eq(Features::getRightId,features.getRightId());
+    }
+    if(features.getIsFinal()!=null)
+    {
+        lambdaQueryWrapper.eq(Features::getIsFinal,features.getIsFinal());
+    }
+    if(features.getPartnerId()!=null)
+    {
+        lambdaQueryWrapper.eq(Features::getPartnerId,features.getPartnerId());
+    }
+    if(features.getSignPatentNo()!=null)
+    {
+        lambdaQueryWrapper.eq(Features::getSignPatentNo,features.getSignPatentNo());
+    }
+    if(features.getReportId()!=null)
+    {
+        lambdaQueryWrapper.eq(Features::getReportId,features.getReportId());
     }
+    featureList =this.list(lambdaQueryWrapper);
+    return featureList;
+}
+
+    /**
+     * @author 沈永艺
+     * @deprecated 保存特征
+     */
+    @Transactional(rollbackFor = Exception.class)
+public String addFeatures(PatentRightVo patentRightVo){
+    if(patentRightVo.getReportId()!=null&&patentRightVo.getSignPatentNo()!=null&&patentRightVo.getPartnerId()!=null)
+    {LambdaQueryWrapper<Features> wrapper =new LambdaQueryWrapper<>();
+     wrapper.eq(Features::getReportId,patentRightVo.getReportId())
+             .eq(Features::getSignPatentNo,patentRightVo.getSignPatentNo())
+             .eq(Features::getPartnerId,patentRightVo.getPartnerId());
+     
+     this.remove(wrapper);
+     if(patentRightVo.getFeatures()!=null&&patentRightVo.getFeatures().size()!=0)
+     {
+         this.saveBatch(patentRightVo.getFeatures());
+     }
+
+    }
+
+    return  Response.success();
+}
+
+
 
 }

+ 24 - 2
RMS/src/main/java/cn/cslg/report/service/business/ReportService.java

@@ -1,31 +1,39 @@
 package cn.cslg.report.service.business;
 
+import cn.cslg.report.common.model.vo.ReportVO;
+import cn.cslg.report.common.utils.DataUtils;
 import cn.cslg.report.common.utils.LogExceptionUtil;
+import cn.cslg.report.common.utils.Response;
 import cn.cslg.report.entity.Report;
 import cn.cslg.report.mapper.ReportMapper;
+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.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 
 @Service
 @Slf4j
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class ReportService extends ServiceImpl<ReportMapper, Report> {
 
     /**
-     * @param report 报告类
      * @author 沈永艺
+     * @param report 报告类
      */
     @Transactional(rollbackFor = Exception.class)
     public Integer addReport(Report report) {
         try {
             boolean addFlag = this.save(report);
             if (addFlag) {
-                return 1;
+                return report.getId();
             } else {
                 return 0;
             }
@@ -42,4 +50,18 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         }
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    //查询报告
+    public String queryReport(ReportVO reportVO) {
+        LambdaQueryWrapper<Report> queryWrapper =new LambdaQueryWrapper<>();
+        if(reportVO.getName()!=null){
+        queryWrapper.like(Report::getName,reportVO.getName());
+        }
+        List<Report> reports = this.list(queryWrapper);
+        long count = this.count(queryWrapper);
+        return Response.success(reports, DataUtils.setPageColumn(reportVO.getSize(), reportVO.getCurrent(), Math.toIntExact(count)));
+    }
+
+
+
 }

+ 24 - 1
RMS/src/main/java/cn/cslg/report/service/business/TaskService.java

@@ -1,27 +1,33 @@
 package cn.cslg.report.service.business;
 
 import cn.cslg.report.common.model.BaseVO;
+import cn.cslg.report.common.model.vo.TaskVO;
 import cn.cslg.report.common.utils.DataUtils;
 import cn.cslg.report.common.utils.LogExceptionUtil;
 import cn.cslg.report.common.utils.Response;
 import cn.cslg.report.entity.Task;
+import cn.cslg.report.entity.asso.AssoTaskPersonel;
 import cn.cslg.report.mapper.TaskMapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
 @Service
 @Slf4j
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class TaskService extends ServiceImpl<TaskMapper, Task> {
-
+    private final ReportService reportService;
     @Transactional(rollbackFor = Exception.class)
     public String addTask(Task task) {
         try {
@@ -85,4 +91,21 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
         List<Task> taskList = this.list();
         return Response.success(taskList);
     }
+
+    public String addAuditTask(TaskVO taskVO) throws ParseException {
+      Integer reportId =  reportService.addReport(taskVO.getReport());
+Task task =new Task();
+task.setReportId(reportId);
+task.setTaskName(taskVO.getTaskName());
+task.setBeginTime(taskVO.getBeginTime());
+task.setEndTime(taskVO.getEndTime());
+task.setType(0);
+this.save(task);
+        AssoTaskPersonel assoTaskPersonel =new AssoTaskPersonel();
+//        assoTaskPersonel.setTaskId(task.getId())
+//TODO
+//task.setPersonId();
+
+        return Response.success();
+    }
 }