|
@@ -297,7 +297,6 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
* @return
|
|
|
* @function 查询自定义字段,统计与之相关的专利的数量
|
|
|
*/
|
|
|
-
|
|
|
public List<PatentQueryFieldSourceVO> getPatentQuerySourcePageList(PatentQueryFieldSourceVO params) {
|
|
|
List<PatentQueryFieldSourceVO> list = new ArrayList<>();
|
|
|
//根据fieldId 从patent_field中获得 自定义字段对象
|
|
@@ -387,10 +386,9 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
allNos = compareFiles.stream().map(CompareFiles::getPatentNo).collect(Collectors.toList());
|
|
|
|
|
|
}
|
|
|
-
|
|
|
//记录已被选择的数量
|
|
|
- Integer choosed=0;
|
|
|
- for (PatentQueryFieldSourceVO tem:list) {
|
|
|
+ Integer choosed = 0;
|
|
|
+ for (PatentQueryFieldSourceVO tem : list) {
|
|
|
List<ReportFieldPatentLink> part = reportFieldPatentLinks.stream().filter(tm -> tm.getFieldId().equals(params.getFieldId()) && tm.getOptionId().equals(tem.getKey()
|
|
|
)).collect(Collectors.toList());
|
|
|
//如果是任务清单列表
|
|
@@ -402,7 +400,7 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
choosed += jiaoList.size();
|
|
|
} else {
|
|
|
tem.setCount(part.size());
|
|
|
- choosed+=part.size();
|
|
|
+ choosed += part.size();
|
|
|
}
|
|
|
tem.setType(type1);
|
|
|
}
|
|
@@ -411,7 +409,8 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
patentQueryFieldSourceVO.setFieldId(params.getFieldId());
|
|
|
patentQueryFieldSourceVO.setKey(null);
|
|
|
patentQueryFieldSourceVO.setLabel("未选择");
|
|
|
- patentQueryFieldSourceVO.setCount(allNos.size()-choosed);
|
|
|
+ patentQueryFieldSourceVO.setCount(allNos.size() - choosed);
|
|
|
+ list.add(patentQueryFieldSourceVO);
|
|
|
//获得所有未选择的数量
|
|
|
//根据值id从ReportFieldPatentLink表中获得信息
|
|
|
return list;
|
|
@@ -424,13 +423,21 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
* @throws IOException
|
|
|
* @funtion 查询标引内容关联专利
|
|
|
*/
|
|
|
- public List<String> getString(SourceVO params) throws IOException {
|
|
|
+ public List<String> getString(SourceVO params,List<String> allPatentNos) throws IOException {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
+ List<ReportFieldPatentLink> reportFieldPatentLinks =new ArrayList<>();
|
|
|
LambdaQueryWrapper<ReportFieldPatentLink> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(ReportFieldPatentLink::getFieldId, params.getFieldId()).eq(ReportFieldPatentLink::getOptionId, params.getKey());
|
|
|
- List<ReportFieldPatentLink> reportFieldPatentLinks = reportFieldPatentLinkService.list(lambdaQueryWrapper);
|
|
|
- for (ReportFieldPatentLink reportFieldPatentLink : reportFieldPatentLinks) {
|
|
|
- list.add(reportFieldPatentLink.getPatentNo());
|
|
|
+ lambdaQueryWrapper.eq(ReportFieldPatentLink::getFieldId, params.getFieldId());
|
|
|
+ if (params.getKey() != null) {
|
|
|
+ lambdaQueryWrapper.eq(ReportFieldPatentLink::getOptionId, params.getKey());
|
|
|
+ reportFieldPatentLinks = reportFieldPatentLinkService.list(lambdaQueryWrapper);
|
|
|
+ list= reportFieldPatentLinks.stream().map(ReportFieldPatentLink::getPatentNo).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ reportFieldPatentLinks = reportFieldPatentLinkService.list(lambdaQueryWrapper);
|
|
|
+ List<String> patentNos =reportFieldPatentLinks.stream().map(ReportFieldPatentLink::getPatentNo).collect(Collectors.toList());
|
|
|
+ allPatentNos.removeAll(patentNos);
|
|
|
+ list=allPatentNos;
|
|
|
}
|
|
|
|
|
|
return list;
|
|
@@ -480,25 +487,25 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
|
|
|
- public List<String> getPatentNo(List<SourceVO> params) throws IOException {
|
|
|
+ public List<String> getPatentNo(List<SourceVO> params,List<String> allPatentNos) throws IOException {
|
|
|
|
|
|
if (params.size() == 0) {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
return list;
|
|
|
} else {
|
|
|
- return this.getPatentNos(params);
|
|
|
+ return this.getPatentNos(params,allPatentNos);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- public List<String> getPatentNos(List<SourceVO> params) throws IOException {
|
|
|
+ public List<String> getPatentNos(List<SourceVO> params,List<String> allPatentNos) throws IOException {
|
|
|
if (params.size() == 1) {
|
|
|
- return this.getString(params.get(0));
|
|
|
+ return this.getString(params.get(0),allPatentNos);
|
|
|
}
|
|
|
- return this.gather1(params);
|
|
|
+ return this.gather1(params,allPatentNos);
|
|
|
}
|
|
|
|
|
|
- public List<String> gather1(List<SourceVO> params) throws IOException {
|
|
|
+ public List<String> gather1(List<SourceVO> params,List<String> allPatentNos) throws IOException {
|
|
|
//为了求并集
|
|
|
List<List<String>> str = new ArrayList<>();
|
|
|
//定义新集合保留老集合
|
|
@@ -510,32 +517,30 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
|
|
|
if (params.get(i).getFieldId().equals(list.get(j).getFieldId())) {
|
|
|
sourceVO.add(list.get(j));
|
|
|
list.remove(list.get(j));
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
if (sourceVO.size() != 0) {
|
|
|
map.put(i, sourceVO);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
if (map.size() != 0) {
|
|
|
for (List<SourceVO> sourceVOS : map.values()) {
|
|
|
List<String> str1 = new ArrayList<>();
|
|
|
for (SourceVO sourceVO : sourceVOS) {
|
|
|
- List<String> string = this.getString(sourceVO);
|
|
|
+ List<String> string = this.getString(sourceVO,allPatentNos);
|
|
|
str1.addAll(string);
|
|
|
}
|
|
|
str1.stream().distinct().collect(Collectors.toList());
|
|
|
str.add(str1);
|
|
|
}
|
|
|
for (SourceVO sourceVO : list) {
|
|
|
- List<String> string = this.getString(sourceVO);
|
|
|
+ List<String> string = this.getString(sourceVO,allPatentNos);
|
|
|
str.add(string);
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
for (SourceVO sourceVO : list) {
|
|
|
- List<String> string = this.getString(sourceVO);
|
|
|
+ List<String> string = this.getString(sourceVO,allPatentNos);
|
|
|
str.add(string);
|
|
|
}
|
|
|
}
|