Bläddra i källkod

3/8 专利挖掘分组修改

lwhhszx 1 år sedan
förälder
incheckning
df34eb70dc

+ 23 - 17
src/main/java/cn/cslg/pas/service/business/FeatureService.java

@@ -59,6 +59,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
 
     @Autowired
     private PatentStarApiService patentStarApiService;
+
     @Transactional(rollbackFor = Exception.class)
     public List<PatentRightVo> splitPatentFeature(SplitVO splitVO) throws IOException {
         String patentNo = splitVO.getPatentNo();
@@ -81,7 +82,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
 
         //查询拆分下的权要
         List<RePatentClaim> patentRights = this.getRightListByNo(patentNo);
-        if(patentRights.size()==0){
+        if (patentRights.size() == 0) {
             return new ArrayList<>();
         }
         LambdaQueryWrapper<PatentSplitMessage> splitWrapper = new LambdaQueryWrapper<>();
@@ -198,21 +199,21 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public List<RePatentClaim> getRightListByNo(String patentNo,String appNo) throws IOException {
+    public List<RePatentClaim> getRightListByNo(String patentNo, String appNo) throws IOException {
         //从pas获得拆分后的权要
         SelectClaimDTO selectClaimDTO = null;
-        String patentRight ="";
-        try {if(appNo!=null) {
-            selectClaimDTO = patentStarApiService.getOrginCalim(appNo);
-            if(selectClaimDTO!=null&&selectClaimDTO.getClaimContent()!=null&&selectClaimDTO.getClaimContent().size()!=0){
-              patentRight=selectClaimDTO.getClaimContent().get(0).getTextContent();
+        String patentRight = "";
+        try {
+            if (appNo != null) {
+                selectClaimDTO = patentStarApiService.getOrginCalim(appNo);
+                if (selectClaimDTO != null && selectClaimDTO.getClaimContent() != null && selectClaimDTO.getClaimContent().size() != 0) {
+                    patentRight = selectClaimDTO.getClaimContent().get(0).getTextContent();
 
+                }
+            } else if (patentNo != null) {
+                selectClaimDTO = esService.selectClaim(patentNo);
+                patentRight = selectClaimDTO.getClaim();
             }
-        }
-        else if(patentNo!=null){
-            selectClaimDTO = esService.selectClaim(patentNo);
-            patentRight =selectClaimDTO.getClaim();
-        }
 
         } catch (Exception e) {
             throw new XiaoShiException("未查询到权要");
@@ -265,9 +266,9 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
         }
     }
 
-    public List<PatentRightTree> getPatentRightTree(String patentNo,String appNo) {
+    public List<PatentRightTree> getPatentRightTree(String patentNo, String appNo) {
         try {
-            List<RePatentClaim> patentRights = this.getRightListByNo(patentNo,appNo);
+            List<RePatentClaim> patentRights = this.getRightListByNo(patentNo, appNo);
 
             List<PatentRightTree> treeNodeList = new ArrayList<>();
             //装载权要原文
@@ -490,17 +491,21 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
         splitWrapper.eq(PatentSplitMessage::getProjectId, projectId);
 
         PatentSplitMessage patentSplitMessage = patentSplitMessageService.getOne(splitWrapper, false);
-
+        List<Feature> allFeatures = new ArrayList<>();
+        if (patentSplitMessage == null) {
+            return allFeatures;
+        }
         LambdaQueryWrapper<Feature> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Feature::getProjectId, projectId)
                 .eq(Feature::getPatentNo, patentNo)
                 .eq(Feature::getSplitMessageId, patentSplitMessage.getId());
-        List<Feature> allFeatures = this.list(wrapper);
+        allFeatures = this.list(wrapper);
         return allFeatures;
     }
 
     /**
      * 保存特征
+     *
      * @param updateFeatureDTO
      * @return
      */
@@ -529,13 +534,14 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Feature> {
         if (patentSplitMessage == null) {
             throw new XiaoShiException("未进行拆分过");
         }
-        List<Integer> ids =   this.saveFeatures(features, patentSplitMessage.getId(), projectId);
+        List<Integer> ids = this.saveFeatures(features, patentSplitMessage.getId(), projectId);
         return ids;
     }
 
 
     /**
      * 批量添加特征
+     *
      * @param features
      * @param splitMessageId
      * @param projectId

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

@@ -147,6 +147,7 @@ public class PatentDigProjectService extends ServiceImpl<PatentDigProjectMapper,
         StringRequest stringRequest = new StringRequest();
         BeanUtils.copyProperties(groupRequest, stringRequest);
         List<String> sqls = formatQueryService.reSqls(stringRequest, tableName);
+        sqls = this.loadSearchSql(sqls);
         //格式化 分组
         GroupConfig groupConfig = null;
         if (groupRequest.getGroupBy() != null) {

+ 2 - 2
src/main/resources/mapper/Event.xml

@@ -67,10 +67,10 @@
         select count(*) from (select ${selectField} from ${tableName}
         <if test="sqls.get(0)!=''">
             where ${sqls.get(0)}
-            and p.entrust_type is not null
+
         </if>
         <if test="sqls.get(0)==''">
-            where p.entrust_type is not null
+
         </if>
         group by ${groupField}
         ) as c