zero 1 ano atrás
pai
commit
a37220225b

+ 6 - 2
src/main/java/cn/cslg/pas/controller/FTOController.java

@@ -127,9 +127,13 @@ public class FTOController {
     @Operation(summary = "获得对比过的专利")
     @PostMapping("/getComparedPatent")
     public Response getComparedPatent(@RequestBody ComparedPatentDTO comparedPatentDTO) {
-        List<ComparedPatentVO> comparedPatentVOS = ftoCompareRecordService.getComparedPatent(comparedPatentDTO);
         Records records = new Records();
-        records.setData(comparedPatentVOS);
+        try {
+            List<ComparedPatentVO> comparedPatentVOS = ftoCompareRecordService.getComparedPatent(comparedPatentDTO);
+            records.setData(comparedPatentVOS);
+        } catch (Exception e) {
+            return Response.error(e.getMessage());
+        }
         return Response.success(records);
     }
 }

+ 1 - 0
src/main/java/cn/cslg/pas/service/SearchRecordService.java

@@ -104,6 +104,7 @@ public class SearchRecordService extends ServiceImpl<SearchRecordMapper, SearchR
 
         LambdaQueryWrapper<SearchRecord> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SearchRecord::getProjectId, projectId);
+        queryWrapper.orderByDesc(SearchRecord::getCreateTime);
         Page<SearchRecord> searchRecordPage = this.page(new Page<>(current, size), queryWrapper);
         Long total = searchRecordPage.getTotal();
         List<SearchRecord> searchRecords = searchRecordPage.getRecords();

+ 10 - 6
src/main/java/cn/cslg/pas/service/business/FollowUpService.java

@@ -32,6 +32,7 @@ import com.github.pagehelper.PageHelper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
@@ -92,11 +93,11 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
             }
         }
         //DTO赋值给后续事项表实体类
-        FollowUp followUp = new FollowUp();
-        if (followUpUpdateDTOList.size() > 0 && followUpUpdateDTOList != null) {
+        if (!CollectionUtils.isEmpty(followUpUpdateDTOList)) {
             //遍历传入列表
             for (int i = 0; i < followUpUpdateDTOList.size(); i++) {
                 FollowUpUpdateDTO followUpUpdateDTO = followUpUpdateDTOList.get(i);
+                FollowUp followUp = this.getById(followUpUpdateDTO.getId());
                 BeanUtils.copyProperties(followUpUpdateDTO, followUp);
                 //根据id修改后续事项表数据
                 followUp.updateById();
@@ -216,12 +217,15 @@ public class FollowUpService extends ServiceImpl<FollowUpMapper, FollowUp> {
             }
 
             //装载状态
-            if (followUp.getStatus().equals(0)) {
-                followUpVO.setStatusStr("进行中");
-            } else if (followUp.getStatus().equals(1)) {
-                followUpVO.setStatusStr("完成");
+            if (followUp.getStatus() != null) {
+                if (followUp.getStatus().equals(0)) {
+                    followUpVO.setStatusStr("进行中");
+                } else if (followUp.getStatus().equals(1)) {
+                    followUpVO.setStatusStr("完成");
+                }
             }
 
+
             //装载文件信息
             List<AssoFollowUpFile> assoFollowUpFilesTemp = assoFollowUpFiles.stream().filter(item -> item.getFollowUpId().equals(followUp.getId())).collect(Collectors.toList());
             if (assoFollowUpFilesTemp.size() != 0) {

+ 5 - 5
src/main/resources/jsons/invalidReportProject.json

@@ -44,7 +44,7 @@
     "type":"String",
     "value":"signPatentNo",
     "field": "signPatentNo",
-    "sqlField": "sign_patent_no",
+    "sqlField": "rp.sign_patent_no",
     "sqlClass": "getLikeSql",
     "orderClass": "getComOrder",
     "ifSearch":"true",
@@ -148,7 +148,7 @@
     "type":"String",
     "value":"headName",
     "field": "headName",
-    "sqlField": "head_id",
+    "sqlField": "p.head_id",
     "sqlClass": "getCreateNameSql",
     "orderClass": "getCreateNameOrder",
     "groupClass":"getComGroup",
@@ -176,7 +176,7 @@
     "type":"String",
     "value":"entrustName",
     "field": "entrustName",
-    "sqlField": "entrust_id",
+    "sqlField": "p.entrust_id",
     "sqlClass": "getEntrustTrueNameSql",
     "orderClass": "getEntrustOrder",
     "groupClass":"getEntrustGroup",
@@ -191,7 +191,7 @@
     "type":"String",
     "value":"entrustNameTrue",
     "field": "entrustNameTrue",
-    "sqlField": "entrust_id",
+    "sqlField": "p.entrust_id",
     "sqlClass": "getEntrustTrueNameSql",
     "orderClass": "getEntrustOrder",
     "groupClass":"getEntrustGroup",
@@ -269,7 +269,7 @@
     "type": "Integer",
     "value": "cronDescription",
     "field": "cronDescription",
-    "sqlField": "report_type",
+    "sqlField": "rp.cron_description",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
     "ifSearch": "false",

+ 5 - 5
src/main/resources/jsons/reportProject.json

@@ -58,7 +58,7 @@
     "type":"String",
     "value":"headName",
     "field": "headName",
-    "sqlField": "head_id",
+    "sqlField": "p.head_id",
     "sqlClass": "getCreateNameSql",
     "orderClass": "getCreateNameOrder",
     "groupClass":"getComGroup",
@@ -86,7 +86,7 @@
     "type":"String",
     "value":"entrustName",
     "field": "entrustName",
-    "sqlField": "entrust_id",
+    "sqlField": "p.entrust_id",
     "sqlClass": "getEntrustTrueNameSql",
     "orderClass": "getEntrustOrder",
     "groupClass":"getEntrustGroup",
@@ -101,7 +101,7 @@
     "type":"String",
     "value":"entrustNameTrue",
     "field": "entrustNameTrue",
-    "sqlField": "entrust_id",
+    "sqlField": "p.entrust_id",
     "sqlClass": "getEntrustTrueNameSql",
     "orderClass": "getEntrustOrder",
     "groupClass":"getEntrustGroup",
@@ -128,7 +128,7 @@
     "type":"String",
     "value":"signPatentNo",
     "field": "signPatentNo",
-    "sqlField": "sign_patent_no",
+    "sqlField": "rp.sign_patent_no",
     "sqlClass": "getLikeSql",
     "orderClass": "getComOrder",
     "ifSearch":"true",
@@ -188,7 +188,7 @@
     "type": "Integer",
     "value": "cronDescription",
     "field": "cronDescription",
-    "sqlField": "report_type",
+    "sqlField": "rp.cron_description",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
     "ifSearch": "false",

+ 2 - 1
src/main/resources/mapper/PatentProjectMapper.xml

@@ -5,7 +5,8 @@
         select distinct p.id as id,p.name as name ,p.contract_no as contract_no,p.volume_number as
         volumeNumber,p.commission_case_day as commissionCaseDay,p.description as description,p.create_id as
         createId,p.create_time as createTime,pp.if_update as ifUpdate,pp.crons as crons,pp.status as status,
-        p.entrust_type as  entrustType,p.entrust_id as entrustId,p.head_id as headId,p.department_id as departmentId
+        p.entrust_type as  entrustType,p.entrust_id as entrustId,p.head_id as headId,p.department_id as departmentId,
+        asps.scenario_id,aspe.event_id,aspt.tree_type,aspt.field_id
         from patent_project as pp
         left join project as p on pp.project_id =p.id
         left join asso_project_tree_node as aspt on p.id =aspt.project_id

+ 8 - 8
src/main/resources/mapper/ReportProjectMapper.xml

@@ -3,17 +3,17 @@
 <mapper namespace="cn.cslg.pas.mapper.ReportProjectMapper">
     <select id="getReportProject" resultType="cn.cslg.pas.common.vo.business.ReportProjectVO">
         select distinct p.id as id,p.name as name ,rp.sign_patent_no as signPatentNo,p.contract_no as
-        contract_no,p.volume_number
-        as
-        volumeNumber,p.commission_case_day as commissionCaseDay,p.description as description,p.create_id as
-        createId,p.create_time as createTime, rp.report_type as reportType ,p.head_id as headId,p.department_id as
-        departmentId,
+        contract_no,p.volume_number as volumeNumber,p.commission_case_day as commissionCaseDay,
+        p.description as description,p.create_id as createId,p.create_time as createTime, rp.report_type as reportType ,
+        p.head_id as headId,p.department_id as departmentId,
         p.entrust_type as entrustType,p.entrust_id as entrustId,rp.product_or_tech as productOrTech,rp.cron_description
         as cronDescription ,rp.status as status,rp.if_second_invalid as ifSecondInvalid,rp.patent_type as
-        patentType,rp.case_number as
-        caseNumber ,rp.issue_number as issueNumber ,rp.invalid_application as invalidApplication ,rp.cron_description as
+        patentType,rp.case_number as caseNumber ,rp.issue_number as issueNumber ,rp.invalid_application as invalidApplication ,rp.cron_description as
         cronDescription,rp.act_type as actType ,rp.patent_type as patentType ,rp.current_application as
-        currentApplication, rp.invention_name as inventionName,p.contract_no as contractNo,rp.carding_opinion ,rp.accept_year,rp.applicant_agency,rp.right_holder_agency,rp.case_stage from report as rp left join project as p
+        currentApplication, rp.invention_name as inventionName,p.contract_no as contractNo,rp.carding_opinion,
+        rp.accept_year,rp.applicant_agency,rp.right_holder_agency,rp.case_stage,
+        aspe.event_id,arc.cron_id,aspm.matter_id,asps.scenario_id
+        from report as rp left join project as p
         on rp.project_id =p.id left join asso_report_cron arc on p.id =arc.project_id
         left join (select * from asso_project_event where scenario_id is not null ) as asps on p.id = asps.project_id
         left join (select * from asso_project_event where event_id is not null ) as aspe on p.id = aspe.project_id

+ 22 - 13
src/test/java/cn/cslg/pas/service/EventServiceTests.java

@@ -23,10 +23,7 @@ import cn.cslg.pas.mapper.AssoProjectEventMapper;
 import cn.cslg.pas.service.business.MergePersonService;
 import cn.cslg.pas.service.business.ProductMarketDataService;
 import cn.cslg.pas.service.business.ReportTempleService;
-import cn.cslg.pas.service.business.es.EsCountService;
-import cn.cslg.pas.service.business.es.EsCustomFieldService;
-import cn.cslg.pas.service.business.es.EsService;
-import cn.cslg.pas.service.business.es.EsPatentService;
+import cn.cslg.pas.service.business.es.*;
 import cn.cslg.pas.service.common.FileManagerService;
 import co.elastic.clients.elasticsearch._types.query_dsl.Query;
 import com.alibaba.fastjson.JSONObject;
@@ -43,6 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -565,15 +563,26 @@ public class EventServiceTests {
 //        System.out.println(list);
         //3. 从es中检索数据
 //        Query q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
-        List<String> list = Arrays.asList("87K5hY8BdwlBaY8vibM3","DLK3hY8BdwlBaY8vfLLP","FLK3hY8BdwlBaY8vibLp","G7K5hY8BdwlBaY8vkrR7","I7K5hY8BdwlBaY8vnbTN",
-                "K7K5hY8BdwlBaY8vqLSM","K7LEhY8BdwlBaY8vP72K","M7K5hY8BdwlBaY8vsbRD","ObK3hY8BdwlBaY8vk7Ko","TbIWhY8BdwlBaY8vhS1O",
-                "XrK2hY8BdwlBaY8v37E8","Bt6xvo8BdwlBaY8vQe2a","Y7K3hY8BdwlBaY8vwLL8","ZrK2hY8BdwlBaY8v7LEH","i7K2hY8BdwlBaY8v9bHY",
-                "k7LJhY8BdwlBaY8vq8Fi","lLK3hY8BdwlBaY8vAbFG","m7LJhY8BdwlBaY8vtcGx","nLK3hY8BdwlBaY8vGLFD","q7K5hY8BdwlBaY8vUrOz","s7K5hY8BdwlBaY8vX7MV",
-                "u7LBhY8BdwlBaY8vn7qI","wbLJhY8BdwlBaY8vvcEH","xLK3hY8BdwlBaY8vIrH6","y7LEhY8BdwlBaY8vE7wT","y7LJhY8BdwlBaY8vxsG6");
-        list.forEach(System.out::println);
-        List<String> collect = list.stream().distinct().collect(Collectors.toList());
-        System.out.println(collect.size());
-    }
+//        List<String> list = Arrays.asList("87K5hY8BdwlBaY8vibM3","DLK3hY8BdwlBaY8vfLLP","FLK3hY8BdwlBaY8vibLp","G7K5hY8BdwlBaY8vkrR7","I7K5hY8BdwlBaY8vnbTN",
+//                "K7K5hY8BdwlBaY8vqLSM","K7LEhY8BdwlBaY8vP72K","M7K5hY8BdwlBaY8vsbRD","ObK3hY8BdwlBaY8vk7Ko","TbIWhY8BdwlBaY8vhS1O",
+//                "XrK2hY8BdwlBaY8v37E8","Bt6xvo8BdwlBaY8vQe2a","Y7K3hY8BdwlBaY8vwLL8","ZrK2hY8BdwlBaY8v7LEH","i7K2hY8BdwlBaY8v9bHY",
+//                "k7LJhY8BdwlBaY8vq8Fi","lLK3hY8BdwlBaY8vAbFG","m7LJhY8BdwlBaY8vtcGx","nLK3hY8BdwlBaY8vGLFD","q7K5hY8BdwlBaY8vUrOz","s7K5hY8BdwlBaY8vX7MV",
+//                "u7LBhY8BdwlBaY8vn7qI","wbLJhY8BdwlBaY8vvcEH","xLK3hY8BdwlBaY8vIrH6","y7LEhY8BdwlBaY8vE7wT","y7LJhY8BdwlBaY8vxsG6");
+//        list.forEach(System.out::println);
+//        List<String> collect = list.stream().distinct().collect(Collectors.toList());
+//        System.out.println(collect.size());
+        List<BigDecimal> list = new ArrayList<>();
+        list.add(new BigDecimal(2.3));
+        list.add(new BigDecimal(3));
+        list.add(new BigDecimal(45));
+        list.add(new BigDecimal(13));
+        list.add(new BigDecimal(1));
+        BigDecimal init = new BigDecimal(0);
+        for (BigDecimal bigDecimal : list) {
+            init = init.compareTo(bigDecimal) >= 0 ? init : bigDecimal;
+        }
+        System.out.println(init);
 
+    }
 
 }