Переглянути джерело

Merge remote-tracking branch 'origin/dev' into dev

chenyi 2 роки тому
батько
коміт
55aa326a9d

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

@@ -65,6 +65,7 @@ public class TaskVO extends BaseVO {
 
     private List<Integer> taskStatuses;
 
+    private List<Integer> ids;
     @Schema(description = "人员专题号对象")
     @Data
     public static class personPatents{

+ 10 - 0
RMS/src/main/java/cn/cslg/report/service/OutInterfaceService.java

@@ -535,4 +535,14 @@ public class OutInterfaceService {
                 .build();
         return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
     }
+
+    public String getPersonIdByNamePCS(String personName) throws IOException {
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .url(PCSUrl + "/permission/api/system/getPersonIdByName?personName="+personName)
+                .get()
+                .build();
+
+        return  Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    }
 }

+ 51 - 41
RMS/src/main/java/cn/cslg/report/service/business/ReportDocumentService.java

@@ -63,7 +63,8 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
     private final ReportFieldPatentLinkService reportFieldPatentLinkService;
     private final CompareMessageService compareMessageService;
     @Value("${fileURL}")
-    private  String fileURL;
+    private String fileURL;
+
     public String reportDocument(ReportDocument reportDocument) {
 
         return Response.success();
@@ -220,8 +221,10 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
                 //填充对比记录文字
                 disclosures.append(tem.getContent());
                 disclosures.append("\r");
+                disclosures.append("(");
                 disclosures.append(tem.getFields());
                 disclosures.append("[" + (tem.getPosition()) + "]");
+                disclosures.append(")");
                 List<Integer> featuresIds = assoRecordsFeatures.stream().filter(te -> te.getRecordsId().equals(tem.getId())).map(AssoRecordsFeature::getFeatureId).collect(Collectors.toList());
                 //根据特征Id获得特征内容
                 List<String> feaListContent = sFeatures.stream().filter(te -> featuresIds.contains(te.getId())).map(Features::getContent).collect(Collectors.toList());
@@ -266,10 +269,11 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
             List<Features> allRightFeatures = allFeatures.stream().filter(item -> item.getRightId().equals(item1.getRightId())).collect(Collectors.toList());
             //存放单条对比结果的map
             Map<String, Object> temMap = new HashMap<>();
+            String a = partFeatures.get(0).getRightName().replace("\r", "");
             if (partFeatures.size() != 0 && partFeatures.get(0).getRightType().equals(1)) {
-                temMap.put("rightName", "独立" + partFeatures.get(0).getRightName());
+                temMap.put("rightName", "独立" + a);
             } else {
-                temMap.put("rightName", "附属" + partFeatures.get(0).getRightName());
+                temMap.put("rightName", "附属" + a);
             }
             temMap.put("rightId", item1.getRightId());
 
@@ -284,7 +288,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
                 Map<String, Object> map = new HashMap<>();
                 map.put("featureContent", tem.getContent());
                 AssoRecordsFeature assoRecordsFeature = finalAsso.stream().filter(item -> item.getFeatureId().equals(tem.getId())).findFirst().orElse(new AssoRecordsFeature());
-                map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "");
+                map.put("compareResult", assoRecordsFeature.getComResult() != null ? assoRecordsFeature.getComResult() : "公识");
                 CompareRecords record = records.stream().filter(item -> item.getId().equals(assoRecordsFeature.getRecordsId())).findFirst().orElse(new CompareRecords());
                 String compareContent = "";
                 //获取对比内容
@@ -292,15 +296,23 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
                 //获得对比专利号
                 String patentNo = record.getPatentNo() != null ? record.getPatentNo() : "";
                 if (OtherName.containsKey(patentNo)) {
-                    patentNo = OtherName.get(patentNo).toString();
+                    patentNo = OtherName.get(patentNo).toString()+":";
+                }
+                else if(!patentNo.equals("")){
+                    patentNo+=":";
                 }
+
                 //获得解析过程
                 String paresingProcess = record.getParesingProcess() != null ? "(" + record.getParesingProcess() + ")" : "";
-                compareContent = patentNo + ":" + content + paresingProcess;
+                compareContent = patentNo + content + paresingProcess;
                 //获取对比专利号
                 map.put("compareContent", compareContent);
                 map.put("figure", fileUtils.getSystemPath() + record.getFilePath());
-                map.put("position", record.getFields() + "[" + record.getPosition() + "]");
+                if (record.getFields() == null && record.getPosition() == null) {
+                    map.put("position", "");
+                } else {
+                    map.put("position", "\r" + "(" + record.getFields() + "[" + record.getPosition() + "]" + ")");
+                }
                 maps.add(map);
             });
             //方案内容
@@ -439,7 +451,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
             }
         }
         //
-        List<Map<String,Object>> classifyMaps=new ArrayList<>();
+        List<Map<String, Object>> classifyMaps = new ArrayList<>();
         //装载信息
         for (Map<String, Object> map : loadMaps) {
             Map<String, Object> classifyMap = new HashMap<>();
@@ -464,74 +476,72 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
                 StringBuilder applicants = new StringBuilder();
                 StringBuilder rightPerson = new StringBuilder();
                 applicantJSONs.forEach(tem -> {
-                    if(Integer.parseInt(tem.get("dataType").toString())==1) {
+                    if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
                         applicants.append(tem.get("name") + "\r");
-                    }
-                    else{
+                    } else {
                         rightPerson.append(tem.get("name") + "\r");
                     }
                 });
-              //装载同族信息
-                JSONObject familys =JSONObject.parseObject(patent.get("family").toString());
-            List<String> patSnaps =  JSON.parseArray(familys.get("patSnap").toString(), String.class);
-                List<String> simples =  JSON.parseArray(familys.get("simple").toString(), String.class);
-                List<String>  inpadocs =JSON.parseArray(familys.get("inpadoc").toString(), String.class);
+                //装载同族信息
+                JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
+                List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
+                List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
+                List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
                 patSnaps.addAll(simples);
                 patSnaps.addAll(inpadocs);
-                String familyStr=StringUtils.join(patSnaps,",");
+                String familyStr = StringUtils.join(patSnaps, ",");
                 //装载法律状态
                 StringBuilder affair = new StringBuilder();
-               List<JSONObject>  affaires =JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
-               affaires.forEach(item->{
-                   affair.append(item.get("status")+ "\r");}
+                List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
+                affaires.forEach(item -> {
+                            affair.append(item.get("status") + "\r");
+                        }
 
-               );
+                );
                 //装载单个专利的信息
                 Map<String, Object> patentMap = new HashMap<>();
                 //同族专利
-                patentMap.put("simpleFamilys",familyStr);
+                patentMap.put("simpleFamilys", familyStr);
                 //引用专利
-                patentMap.put("quotePatents",patent.get("quote"));
+                patentMap.put("quotePatents", patent.get("quote"));
                 //申请日
-                patentMap.put("applicationDate",patent.get("applicationDate"));
+                patentMap.put("applicationDate", patent.get("applicationDate"));
                 //公开日
-                patentMap.put("publicDate",patent.get("publicDate"));
+                patentMap.put("publicDate", patent.get("publicDate"));
                 //专利号
                 patentMap.put("publicNo", patent.get("publicNo"));
-                patentMap.put("firstPublicDate",patent.get("firstPublicDate"));
+                patentMap.put("firstPublicDate", patent.get("firstPublicDate"));
                 patentMap.put("applicant", applicants);
                 patentMap.put("rightPerson", rightPerson);
-                patentMap.put("affair",affair);
+                patentMap.put("affair", affair);
                 //图示
                 patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
                 //获得专利对比记录的信息
                 Map<String, Object> temMap = compareMessageService.queryforTemplate(patent.get("patentNo").toString(), reportId);
                 List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
                 //装载对比记录的信息
-                patentMap.put("compareMessage",compareMessageVOS);
-                patentMap.put("rightNum",temMap.get("right"));
-                patentMap.put("mainRightNum",temMap.get("mainRight"));
-             Integer status =   Integer.parseInt(patent.get("simpleStatusInt").toString());
-                if(status==1||status==5||status==6){
+                patentMap.put("compareMessage", compareMessageVOS);
+                patentMap.put("rightNum", temMap.get("right"));
+                patentMap.put("mainRightNum", temMap.get("mainRight"));
+                Integer status = Integer.parseInt(patent.get("simpleStatusInt").toString());
+                if (status == 1 || status == 5 || status == 6) {
                     announcePatents.add(patentMap);
-                }
-                else if(status==2){
+                } else if (status == 2) {
                     lapsePatents.add(patentMap);
-                }
-                else if(status==3){
+                } else if (status == 3) {
                     publicPatents.add(patentMap);
                 }
-                classifyMap.put("publicPatents",publicPatents);
-                classifyMap.put("lapsePatents",lapsePatents);
-                classifyMap.put("announcePatents",announcePatents);
-                }
+                classifyMap.put("publicPatents", publicPatents);
+                classifyMap.put("lapsePatents", lapsePatents);
+                classifyMap.put("announcePatents", announcePatents);
+            }
             classifyMaps.add(classifyMap);
         }
         Map<String, Object> map = new HashMap<>();
         String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
         String[] ds = date.split("-");
         map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
-       map.put("classifys", classifyMaps);
+        map.put("classifys", classifyMaps);
         // 为表格的显示绑定行循环
         LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
         HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();

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

@@ -162,7 +162,18 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
         {
             taskVO.setTaskStatuses(Arrays.asList(1,2));
         }
-        IPage<TaskReportVO> dataPage = baseMapper.queryTasks(new Page<>(taskVO.getCurrent(), taskVO.getSize()), taskVO);
+        IPage<TaskReportVO> dataPage = new Page<>();
+        //当查询未使用发起人名称时
+        if(taskVO.getCreateName()!=null&&taskVO.getCreateName()!=""){
+        String res =outInterfaceService.getPersonIdByNamePCS(taskVO.getCreateName());
+      List<Integer> createIds =  JSONArray.parseArray(res,Integer.class);
+            taskVO.setIds(createIds);
+            //当未查询到时直接返回空页
+            if(createIds==null||createIds.size()==0){
+           taskVO.setIds(Arrays.asList(-1));
+            }
+        }
+        dataPage = baseMapper.queryTasks(new Page<>(taskVO.getCurrent(), taskVO.getSize()), taskVO);
    List<TaskReportVO>  taskReportVOS =   dataPage.getRecords();
    taskReportVOS =this.reTaskReportVOs(taskReportVOS);
    dataPage.setRecords(taskReportVOS);

+ 5 - 3
RMS/src/main/resources/mapper/TaskMapper.xml

@@ -13,9 +13,11 @@ and a.TASK_STATUS in
                 #{item}
             </foreach>
         </if>
-        <if test="param.createName !=null and param.createName !='' ">
-and a.CREATE_NAME like concat('%', #{param.createName}, '%')
-
+        <if test="param.ids !=null and param.ids.size()!=0 ">
+            and a.CREATE_ID in
+            <foreach collection="param.ids" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
         </if>
         <if test="param.taskName !=null and param.taskName !=''">
 and a.TASK_NAME  like concat('%', #{param.taskName}, '%')

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