|
@@ -46,10 +46,10 @@ import java.util.regex.Pattern;
|
|
|
@Service
|
|
|
|
|
|
public class PatentStarApiService {
|
|
|
- @Autowired
|
|
|
- private RetrieveRecordService retrieveRecordService;
|
|
|
@Autowired
|
|
|
- private CacheUtils cacheUtils;
|
|
|
+ private RetrieveRecordService retrieveRecordService;
|
|
|
+ @Autowired
|
|
|
+ private CacheUtils cacheUtils;
|
|
|
@Autowired
|
|
|
private LoginUtils loginUtils;
|
|
|
@Autowired
|
|
@@ -224,6 +224,8 @@ public class PatentStarApiService {
|
|
|
// retrieveRecord.updateById();
|
|
|
// }
|
|
|
map.put("retrieveRecordId", retrieveRecord.getId());
|
|
|
+ //TODO 根据map内容填充数据到Records
|
|
|
+
|
|
|
return map;
|
|
|
|
|
|
}
|
|
@@ -233,7 +235,7 @@ public class PatentStarApiService {
|
|
|
try {
|
|
|
if (PatentStarListDTO.getFormed() == null || PatentStarListDTO.getFormed() == false) {
|
|
|
String formQuery = PatentStarListDTO.getCurrentQuery();
|
|
|
- PatentStarListDTO.setCurrentQuery(formatQueryService.reQuery(formQuery,"webSearchConfig"));
|
|
|
+ PatentStarListDTO.setCurrentQuery(formatQueryService.reQuery(formQuery, "webSearchConfig"));
|
|
|
if (PatentStarListDTO.getDBType().equals("WD")) {
|
|
|
StringBuilder stringBuilder = new StringBuilder(PatentStarListDTO.getCurrentQuery());
|
|
|
stringBuilder.insert(PatentStarListDTO.getCurrentQuery().length() - 1, "-CN/GJ");
|
|
@@ -792,4 +794,58 @@ public class PatentStarApiService {
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
+ public List<PatentStarListDTO> splitPatentNoByType(List<String> originalList, PatentStarListDTO patentStarListDTO) {
|
|
|
+ List<String> cnStrings = new ArrayList<>();
|
|
|
+ List<String> wdStrings = new ArrayList<>();
|
|
|
+ List<List<String>> result = new ArrayList<>();
|
|
|
+ result.add(cnStrings);
|
|
|
+ result.add(wdStrings);
|
|
|
+ // 记录CN类型的字符串数量
|
|
|
+ int cnCount = 0;
|
|
|
+ // 记录WD类型的字符串数量
|
|
|
+ int wdCount = 0;
|
|
|
+
|
|
|
+ List<PatentStarListDTO> patentStarListDTOS = new ArrayList<>();
|
|
|
+ //遍历初始集合
|
|
|
+ for (String str : originalList) {
|
|
|
+ if (str.startsWith("CN")) {
|
|
|
+ cnStrings.add(str);
|
|
|
+ cnCount++;
|
|
|
+ if (cnCount >= 100) {
|
|
|
+ cnStrings = new ArrayList<>();
|
|
|
+ result.add(cnStrings);
|
|
|
+ cnCount = 0;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wdStrings.add(str);
|
|
|
+ wdCount++;
|
|
|
+ if (wdCount >= 100) {
|
|
|
+ wdStrings = new ArrayList<>();
|
|
|
+ result.add(wdStrings);
|
|
|
+ wdCount = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ result.forEach(item -> {
|
|
|
+ String dbType = "CN";
|
|
|
+ String patentNo = item.get(0);
|
|
|
+ if (!patentNo.startsWith("CN")) {
|
|
|
+ dbType = "WD";
|
|
|
+ }
|
|
|
+ String join = StringUtils.join(item, " OR ");
|
|
|
+ String conditions = "AN=(" + join + ") OR PN=(" + join + ") OR GN=(" + join + ")";
|
|
|
+ PatentStarListDTO patentStarListDTO1 = new PatentStarListDTO();
|
|
|
+ patentStarListDTO1.setOrderByType(patentStarListDTO.getOrderByType());
|
|
|
+ patentStarListDTO1.setCurrentQuery(conditions);
|
|
|
+ patentStarListDTO1.setPageNum(patentStarListDTO.getPageNum());
|
|
|
+ patentStarListDTO1.setDBType(dbType);
|
|
|
+ patentStarListDTO1.setCurrentQuery(conditions);
|
|
|
+ patentStarListDTO1.setRowCount(patentStarListDTO.getRowCount());
|
|
|
+ patentStarListDTO1.setTotal(item.size());
|
|
|
+ patentStarListDTOS.add(patentStarListDTO1);
|
|
|
+ });
|
|
|
+
|
|
|
+ return patentStarListDTOS;
|
|
|
+ }
|
|
|
}
|