Browse Source

增删 2022/11/22

lwhhszx 2 years ago
parent
commit
973b2d2038

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

@@ -46,8 +46,8 @@ public class FeatureController {
             @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)

+ 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;
 
     /**
      * 事件

+ 13 - 0
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -155,6 +155,19 @@ 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();