浏览代码

Merge remote-tracking branch 'origin/master'

chenyi 2 年之前
父节点
当前提交
d308ae3751

+ 14 - 3
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -416,21 +416,32 @@ List<Map<String,Object>> mapList =new ArrayList<Map<String,Object>>();
             Map<String,Object> map =new HashMap<>();
             List<Map<String,Object>> temMapList =new ArrayList<>();
             Features features1 =featuresList.get(0);
+            Map<String, Object> Map = new HashMap<>();
+            List<Integer> recordIds = assoRecordsFeatures.stream().filter(item -> item.getFeatureId().equals(featuresList.get(0).getId())).map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
+            List<CompareRecords> PartRecords = compareRecords.stream().filter(item -> recordIds.contains(item.getId())).collect(Collectors.toList());
+            if(PartRecords!=null&&PartRecords.size()>0){
+                Map.put("feature", featuresList.get(0));
+                Map.put("CompareRecords", PartRecords);
+                temMapList.add(Map);
+            }
             featuresList.remove(features1);
             map.put("signPatentNo",features1.getSignPatentNo());
             for (Features tem : featuresList) {
                 if(tem.getSignPatentNo().equals(features1.getSignPatentNo())){
                     Map<String, Object> temMap = new HashMap<>();
-                    List<Integer> recordIds = assoRecordsFeatures.stream().filter(item -> item.getFeatureId().equals(tem.getId())).map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
-                    List<CompareRecords> PartRecords = compareRecords.stream().filter(item -> recordIds.contains(item)).collect(Collectors.toList());
+                    List<Integer> recordId = assoRecordsFeatures.stream().filter(item -> item.getFeatureId().equals(tem.getId())).map(AssoRecordsFeature::getRecordsId).collect(Collectors.toList());
+                    List<CompareRecords> PartRecord = compareRecords.stream().filter(item -> recordIds.contains(item.getId())).collect(Collectors.toList());
+                    if(PartRecords!=null&&PartRecords.size()>0){
                     temMap.put("feature", tem);
                     temMap.put("CompareRecords", PartRecords);
                     temMapList.add(temMap);
+                    }
                     features.remove(tem);
                 }
             }
+            if(temMapList.size()!=0){
             map.put("features",temMapList);
-            mapList.add(map);
+            mapList.add(map);}
         }
 
 

+ 19 - 12
RMS/src/main/resources/mapper/ReportFieldMapper.xml

@@ -100,20 +100,27 @@
     </select>
 
     <select id="getFieldPatentNos" parameterType="java.util.List" resultType="java.lang.String">
-        select distinct a.PATENT_NO from COMPARE_FILES a left join  OS_PATENT_FIELD_PATENT_LINK b on a.PATENT_NO =b.PATENT_NO
-        <where>
-            a.REPORT_ID=#{reportId}  and
-            <foreach collection="params" item="item" separator=" and " open="(" close=")">
-                b.CID=#{item.field} and b.FID in
+
+        select distinct c.PATENT_NO from COMPARE_FILES c <where>
+        <foreach collection="params" item="item" separator=" and ">
+            c.PATENT_NO in (
+            select distinct a.PATENT_NO from COMPARE_FILES a left join  OS_PATENT_FIELD_PATENT_LINK b on a.PATENT_NO =b.PATENT_NO
+            and b.CID=#{item.field}
+            <where>
+                a.REPORT_ID=#{reportId}
+                and (
+                b.FID in
                 <foreach collection="item.optionList" item="item1" separator="," open="(" close=")">
-                   #{item1.key}
+                    #{item1.key}
                 </foreach>
                 <if test="item.haveNull == 1">
-                    or b.CID !=#{item.field} or b.CID is null
+                    or b.CID is null
                 </if>
-            </foreach>
-        </where>
-
+                )
+            </where>
+            )
+        </foreach>
+    </where>
     </select>
 
     <select id="getFieldTaskPNos" parameterType="java.util.List" resultType="java.lang.String">
@@ -121,14 +128,14 @@
         <foreach collection="params" item="item" separator=" and ">
             c.PATENT_NO in (
             select  distinct a.PATENT_NO from ASSO_TASK_PERSONEL a left join  OS_PATENT_FIELD_PATENT_LINK b on a.PATENT_NO =b.PATENT_NO
-            and a.REPORT_ID=b.REPORT_ID
+            and a.REPORT_ID=b.REPORT_ID and b.CID=#{item.field}
             <where>
                 a.TASK_ID=#{taskId}
                 <if test="readState!=3">
                     and  a.STATE =#{readState}
                 </if>
                 and (
-                b.CID=#{item.field} and b.FID in
+                b.FID in
                 <foreach collection="item.optionList" item="item1" separator="," open="(" close=")">
                 #{item1.key}
                 </foreach>