Browse Source

Merge remote-tracking branch 'origin/master'

chenyi 2 năm trước cách đây
mục cha
commit
b23af742b1

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

@@ -32,15 +32,24 @@ public class FeatureController {
     @Operation(summary = "拆分权要")
     @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),
+            @Parameter(name = "splitType",description = "拆分类型(0仅拆主权要,1全部拆分)"),
+            @Parameter(name = "splitBy",description = "拆分符号(0  ',',1';',2','和';')"),
+            @Parameter(name = "ReportId",description = "报告Id"),
     })
     public String splitPatentRight(String patentNo,Integer splitType ,Integer splitBy,Integer ReportId) throws IOException {
      String res =   featureService.splitPatentRight(patentNo,splitType,splitBy,ReportId);
         return res;
     }
-
+    @RequestMapping(value = "/getFeatures", method = RequestMethod.GET)
+    @Operation(summary = "获得报告创建人查询的特征")
+    @Parameters(value = {
+            @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);
+        return res;
+    }
     @RequestMapping(value = "/addPatentRight", method = RequestMethod.POST)
     @Operation(summary = "保存权要")
     public String addPatentRight(@RequestBody List<PatentRightVo>  patentRightVos) throws IOException {

+ 41 - 4
RMS/src/main/java/cn/cslg/report/controller/TaskController.java

@@ -3,16 +3,17 @@ 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.AssignTaskVO;
-import cn.cslg.report.common.model.vo.AuditTaskVO;
-import cn.cslg.report.common.model.vo.TaskParams;
-import cn.cslg.report.common.model.vo.TaskVO;
+import cn.cslg.report.common.model.vo.*;
 import cn.cslg.report.common.utils.DataUtils;
 import cn.cslg.report.common.utils.Response;
 import cn.cslg.report.entity.Task;
 import cn.cslg.report.service.BaseService;
 import cn.cslg.report.service.OutInterfaceService;
 import cn.cslg.report.service.business.TaskService;
+import com.alibaba.fastjson.JSON;
+import com.deepoove.poi.XWPFTemplate;
+import com.deepoove.poi.config.Configure;
+import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
@@ -23,8 +24,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
 import java.io.IOException;
 import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -101,4 +107,35 @@ public class TaskController {
         return Response.success();
     }
 
+    @RequestMapping(value = "/temple", method = RequestMethod.GET)
+    @Operation(summary = "测试")
+    public String temple() throws ParseException, IOException {
+        String filePath= "C:\\Users\\admin\\Desktop\\1.docx";
+        // 读取模板后保存生成word的地址
+        String outPath = "C:\\Users\\admin\\Desktop\\2.docx";
+        // 为表格的显示绑定行循环
+        LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
+        // 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
+        Configure configure = Configure.builder().bind("bz", policy).build();
+      List<CompareFilesVO> aa =new ArrayList<>();
+        CompareFilesVO compareFilesVO =new CompareFilesVO();
+        compareFilesVO.setCurrent(111);
+        aa.add(compareFilesVO);
+        Map<String,Object> map =new HashMap<>();
+        map.put("bz",aa);
+        map.put("sss","saeqeq");
+
+        // 读取模板、数据并渲染
+        XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
+//         文件是否已存在,则删除map = {TaskController$1@15526}  size = 7
+        File file = new File(outPath);
+        if (file.exists()){
+            file.delete();
+        }
+//         生成word保存在指定目录
+        template.writeToFile(outPath);
+        template.close();
+
+return Response.success();
+    }
 }

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

@@ -48,7 +48,7 @@ public class LitigationHistory extends BaseEntity<LitigationHistory> {
     @Schema(description = "起诉时间")
     @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
     @TableField(value = "PROSECUTORIAL_TIME")
-    private Date prosecutorialTime;
+    private String prosecutorialTime;
 
     /**
      * 结果

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

@@ -27,7 +27,7 @@ public class ReviewHistory extends BaseEntity<ReviewHistory> {
     @TableField(value = "REVIEW_TIME")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    private Date time;
+    private String time;
 
     /**
      * 事件

+ 62 - 1
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -124,7 +124,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
 
                 if (featureFromDb != null && featureFromDb.size() != 0) {
                     int rightId = patentRights.get(i).getId();
-                    featuresList = featureFromDb.stream().filter(item -> item.getRightId() == rightId && item.getSplitBy() == splitBy).collect(Collectors.toList());
+                    featuresList = featureFromDb.stream().filter(item -> item.getRightId() == rightId && item.getSplitBy() == splitBy &&item.getPartnerId()==personnelVO.getId()).collect(Collectors.toList());
                 }
                 //如果数据库里无拆解记录则手动插入一条
                 if (featuresList == null || featuresList.size() == 0 || flag == 1) {
@@ -155,6 +155,67 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
                     this.saveBatch(featuresList);
                 }
             }
+            else{
+                Features features = new Features();
+                features.setRightId(patentRights.get(i).getId());
+                features.setIsFinal(0);
+                features.setSignPatentNo(patentNo);
+                features.setReportId(reportId);
+                features.setContentOut(patentRights.get(i).getContentOut());
+                features.setContent(patentRights.get(i).getContent());
+                features.setSplitBy(splitBy);
+                features.setPartnerId(personnelVO.getId());
+               features.insert();
+                this.saveBatch(featuresList);
+            }
+
+            //装载到对象PatentRightVo
+            PatentRightVo patentRightVo = new PatentRightVo();
+            String name = "权要" + (i + 1);
+            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.setRightName(name);
+            patentRightVo.setSignPatentNo(patentNo);
+            patentRightVos.add(patentRightVo);
+        }
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("patentRightVos", patentRightVos);
+        map.put("splitBy", report.getSplitBy());
+        map.put("splitType", report.getSplitType());
+        return Response.success(map);
+
+    }
+
+    public String getFeatures(String patentNo, Integer reportId) throws IOException {
+        LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper();
+        queryWrapper.eq(Report::getId, reportId);
+        Report report = reportService.list(queryWrapper).get(0);
+        //权要(带拆分的特征)列表
+        List<PatentRightVo> patentRightVos = new ArrayList<>();
+        //从pas获得权要信息
+        String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
+        JSONObject jsonObject = JSONObject.parseObject(resBody);
+        //解析jason获得标的专利的权要
+        List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
+        List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin);
+     Features featureTO = new Features();
+        featureTO.setReportId(reportId);
+        featureTO.setSignPatentNo(patentNo);
+        //查询数据库里是否有查询记录
+        List<Features> featureFromDb = this.queryFeatures(featureTO);
+        //将拆解的权要和特征装载到对象PatentRightVo
+        for (int i = 0; i < patentRights.size(); i++) {
+            List<Features> featuresList = new ArrayList<>();
+            //对需要拆解的权要进行拆解
+                if (featureFromDb != null && featureFromDb.size() != 0) {
+                    int rightId = patentRights.get(i).getId();
+                    featuresList = featureFromDb.stream().filter(item -> item.getRightId() == rightId &&item.getPartnerId()==report.getPersonId()).collect(Collectors.toList());
+                }
 
             //装载到对象PatentRightVo
             PatentRightVo patentRightVo = new PatentRightVo();

+ 0 - 4
RMS/src/main/java/cn/cslg/report/service/business/ReportService.java

@@ -121,10 +121,6 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
 
         return reports;
     }
-//    public String reportDele(int id) throws IOException{
-//        this.removeById(id);
-//        return Response.success();
-//    }
     public String reportDele(int id) throws IOException{
        int  dele  = reportMapper.dele(id);
         if(dele>0){