|
@@ -10,19 +10,16 @@ import cn.cslg.pas.common.model.cronModel.Records;
|
|
import cn.cslg.pas.common.model.importTaskModel.PatentApplicant;
|
|
import cn.cslg.pas.common.model.importTaskModel.PatentApplicant;
|
|
import cn.cslg.pas.common.utils.*;
|
|
import cn.cslg.pas.common.utils.*;
|
|
import cn.cslg.pas.common.vo.ContentVO;
|
|
import cn.cslg.pas.common.vo.ContentVO;
|
|
-import cn.cslg.pas.common.vo.NoCacheVO;
|
|
|
|
import cn.cslg.pas.common.vo.QueryExternalFamilyVO;
|
|
import cn.cslg.pas.common.vo.QueryExternalFamilyVO;
|
|
import cn.cslg.pas.common.vo.StarPatentVO;
|
|
import cn.cslg.pas.common.vo.StarPatentVO;
|
|
import cn.cslg.pas.common.vo.business.PatentNoVO;
|
|
import cn.cslg.pas.common.vo.business.PatentNoVO;
|
|
import cn.cslg.pas.domain.WebLoginConfig;
|
|
import cn.cslg.pas.domain.WebLoginConfig;
|
|
import cn.cslg.pas.domain.business.RetrieveRecord;
|
|
import cn.cslg.pas.domain.business.RetrieveRecord;
|
|
import cn.cslg.pas.domain.es.*;
|
|
import cn.cslg.pas.domain.es.*;
|
|
-import cn.cslg.pas.exception.XiaoShiException;
|
|
|
|
import cn.cslg.pas.service.WebLoginConfigService;
|
|
import cn.cslg.pas.service.WebLoginConfigService;
|
|
|
|
|
|
|
|
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
-import cn.hutool.core.util.IdUtil;
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -67,7 +64,10 @@ import java.util.stream.Collectors;
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
|
|
+
|
|
public class PatentStarApiService {
|
|
public class PatentStarApiService {
|
|
|
|
+ private ApplicationContext applicationContext;
|
|
|
|
+ private PatentStarApiService patentStarApiService;
|
|
@Autowired
|
|
@Autowired
|
|
private RetrieveRecordService retrieveRecordService;
|
|
private RetrieveRecordService retrieveRecordService;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -78,48 +78,29 @@ public class PatentStarApiService {
|
|
private WebLoginConfigService webLoginConfigService;
|
|
private WebLoginConfigService webLoginConfigService;
|
|
@Autowired
|
|
@Autowired
|
|
private FormatQueryService formatQueryService;
|
|
private FormatQueryService formatQueryService;
|
|
- @Autowired
|
|
|
|
- private NOSCacheService cacheService;
|
|
|
|
|
|
|
|
public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
|
|
public Records patentStarSearchLocal(PatentStarListDTO patentStarListDTO) throws IOException {
|
|
RetrieveRecord retrieveRecord = new RetrieveRecord();
|
|
RetrieveRecord retrieveRecord = new RetrieveRecord();
|
|
retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery());
|
|
retrieveRecord.setConditions(patentStarListDTO.getCurrentQuery());
|
|
- retrieveRecord.setSearchType(0);
|
|
|
|
|
|
+
|
|
if (patentStarListDTO.getRetrieveRecordId() != null) {
|
|
if (patentStarListDTO.getRetrieveRecordId() != null) {
|
|
retrieveRecord = retrieveRecordService.getById(patentStarListDTO.getRetrieveRecordId());
|
|
retrieveRecord = retrieveRecordService.getById(patentStarListDTO.getRetrieveRecordId());
|
|
patentStarListDTO.setCurrentQuery(retrieveRecord.getConditions());
|
|
patentStarListDTO.setCurrentQuery(retrieveRecord.getConditions());
|
|
patentStarListDTO.setDBType(retrieveRecord.getDbType());
|
|
patentStarListDTO.setDBType(retrieveRecord.getDbType());
|
|
}
|
|
}
|
|
-
|
|
|
|
- String redisKey = patentStarListDTO.getRedisKey();
|
|
|
|
- List<String> nos = new ArrayList<>();
|
|
|
|
- Long total = 0L;
|
|
|
|
- if (StringUtils.isNotEmpty(patentStarListDTO.getNumberQuery())) {
|
|
|
|
- NoCacheVO cacheVO = cacheService.savaByList(patentStarListDTO);
|
|
|
|
- retrieveRecord.setConditions(patentStarListDTO.getNumberQuery());
|
|
|
|
- retrieveRecord.setSearchType(1);
|
|
|
|
- redisKey = cacheVO.getKey();
|
|
|
|
- total = cacheVO.getTotal();
|
|
|
|
- nos.addAll(cacheVO.getList());
|
|
|
|
- }
|
|
|
|
- if (Boolean.TRUE.equals(StringUtils.isEmpty(patentStarListDTO.getNumberQuery())) && StringUtils.isNotEmpty(redisKey)) {
|
|
|
|
- NoCacheVO cacheVO = cacheService.getByList(patentStarListDTO);
|
|
|
|
- retrieveRecord.setConditions(patentStarListDTO.getNumberQuery());
|
|
|
|
- retrieveRecord.setSearchType(1);
|
|
|
|
- nos.addAll(cacheVO.getList());
|
|
|
|
- total = cacheVO.getTotal();
|
|
|
|
- redisKey = cacheVO.getKey();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
Map<String, Object> map = this.patentStarSearchApi(patentStarListDTO);
|
|
Map<String, Object> map = this.patentStarSearchApi(patentStarListDTO);
|
|
|
|
+long end =System.currentTimeMillis();
|
|
|
|
+System.out.println("search time:"+(end-start));
|
|
if (map == null) {
|
|
if (map == null) {
|
|
- throw new XiaoShiException("检索失败,请检查检索式");
|
|
|
|
|
|
+ ThrowException.throwXiaoShiException("检索失败,请检查检索式");
|
|
}
|
|
}
|
|
|
|
|
|
//记录检索历史
|
|
//记录检索历史
|
|
retrieveRecord.setRetrieveTime(new Date());
|
|
retrieveRecord.setRetrieveTime(new Date());
|
|
retrieveRecord.setTotalNum(Integer.parseInt(map.get("total").toString()));
|
|
retrieveRecord.setTotalNum(Integer.parseInt(map.get("total").toString()));
|
|
retrieveRecord.setDbType(patentStarListDTO.getDBType());
|
|
retrieveRecord.setDbType(patentStarListDTO.getDBType());
|
|
|
|
+
|
|
if (patentStarListDTO.getRetrieveRecordId() == null) {
|
|
if (patentStarListDTO.getRetrieveRecordId() == null) {
|
|
//获取创建人信息
|
|
//获取创建人信息
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
@@ -137,23 +118,12 @@ public class PatentStarApiService {
|
|
records.setRetrieveRecordId(retrieveRecord.getId());
|
|
records.setRetrieveRecordId(retrieveRecord.getId());
|
|
records.setCurrent(Long.parseLong(map.get("current").toString()));
|
|
records.setCurrent(Long.parseLong(map.get("current").toString()));
|
|
records.setSize(Long.parseLong(map.get("size").toString()));
|
|
records.setSize(Long.parseLong(map.get("size").toString()));
|
|
- List<PatentColumnDTO> columnDTOS = this.loadPatent(starPatentVOS);
|
|
|
|
- records.setData(this.loadPatentList(columnDTOS, nos, patentStarListDTO.getDBType()));
|
|
|
|
- if (total != 0) {
|
|
|
|
- records.setTotal(total);
|
|
|
|
- } else {
|
|
|
|
- records.setTotal(Long.parseLong(map.get("total").toString()));
|
|
|
|
- }
|
|
|
|
- records.setRedisKey(redisKey);
|
|
|
|
|
|
+ records.setData(this.loadPatent(starPatentVOS));
|
|
|
|
+ records.setTotal(Long.parseLong(map.get("total").toString()));
|
|
return records;
|
|
return records;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 格式化条件后并请求外部接口
|
|
|
|
- * @param PatentStarListDTO
|
|
|
|
- * @return
|
|
|
|
- * @throws IOException
|
|
|
|
- */
|
|
|
|
|
|
+
|
|
public Map<String, Object> patentStarSearchApi(PatentStarListDTO PatentStarListDTO) throws IOException {
|
|
public Map<String, Object> patentStarSearchApi(PatentStarListDTO PatentStarListDTO) throws IOException {
|
|
try {
|
|
try {
|
|
if (PatentStarListDTO.getFormed() == null || PatentStarListDTO.getFormed() == false) {
|
|
if (PatentStarListDTO.getFormed() == null || PatentStarListDTO.getFormed() == false) {
|
|
@@ -163,7 +133,6 @@ public class PatentStarApiService {
|
|
StringBuilder stringBuilder = new StringBuilder(PatentStarListDTO.getCurrentQuery());
|
|
StringBuilder stringBuilder = new StringBuilder(PatentStarListDTO.getCurrentQuery());
|
|
stringBuilder.insert(PatentStarListDTO.getCurrentQuery().length() - 1, "-CN/GJ");
|
|
stringBuilder.insert(PatentStarListDTO.getCurrentQuery().length() - 1, "-CN/GJ");
|
|
PatentStarListDTO.setCurrentQuery(stringBuilder.toString());
|
|
PatentStarListDTO.setCurrentQuery(stringBuilder.toString());
|
|
-
|
|
|
|
}
|
|
}
|
|
PatentStarListDTO.setFormed(true);
|
|
PatentStarListDTO.setFormed(true);
|
|
}
|
|
}
|
|
@@ -176,6 +145,12 @@ public class PatentStarApiService {
|
|
String appKey = configObject.getString("appKey");
|
|
String appKey = configObject.getString("appKey");
|
|
PatentStarDTO patentStarDto = new PatentStarDTO();
|
|
PatentStarDTO patentStarDto = new PatentStarDTO();
|
|
BeanUtils.copyProperties(PatentStarListDTO, patentStarDto);
|
|
BeanUtils.copyProperties(PatentStarListDTO, patentStarDto);
|
|
|
|
+
|
|
|
|
+ if(patentStarDto.getOrderBy()==null){
|
|
|
|
+ patentStarDto.setOrderBy("AD");
|
|
|
|
+ patentStarDto.setOrderByType("DESC");
|
|
|
|
+ }
|
|
|
|
+
|
|
String json = JSONObject.toJSONString(patentStarDto);
|
|
String json = JSONObject.toJSONString(patentStarDto);
|
|
String url = "http://s.patentstar.com.cn/SearchAPI/PatentSearch/ResultGet";
|
|
String url = "http://s.patentstar.com.cn/SearchAPI/PatentSearch/ResultGet";
|
|
Long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
Long currentTimeMillis = System.currentTimeMillis() / 1000;
|
|
@@ -199,7 +174,12 @@ public class PatentStarApiService {
|
|
Request request = new Request.Builder().url(url).post(requestBody).build();
|
|
Request request = new Request.Builder().url(url).post(requestBody).build();
|
|
// 发送请求获取响应
|
|
// 发送请求获取响应
|
|
try {
|
|
try {
|
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
|
+
|
|
Response response = okHttpClient.newCall(request).execute();
|
|
Response response = okHttpClient.newCall(request).execute();
|
|
|
|
+
|
|
|
|
+ long end =System.currentTimeMillis();
|
|
|
|
+ System.out.println("search11time:"+(end-start));
|
|
// 判断请求是否成功
|
|
// 判断请求是否成功
|
|
if (response.isSuccessful()) {
|
|
if (response.isSuccessful()) {
|
|
JSONObject jsonObject = JSONObject.parseObject(Objects.requireNonNull(response.body()).string());
|
|
JSONObject jsonObject = JSONObject.parseObject(Objects.requireNonNull(response.body()).string());
|
|
@@ -216,70 +196,26 @@ public class PatentStarApiService {
|
|
return reMap;
|
|
return reMap;
|
|
}
|
|
}
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
-// e.printStackTrace();
|
|
|
|
-// return null;
|
|
|
|
- throw new XiaoShiException("外部接口检索超时");
|
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- //封装patent column数据返回
|
|
|
|
- private List<PatentColumnDTO> loadPatentList(List<PatentColumnDTO> columnDTOS, List<String> list, String dbType) {
|
|
|
|
- if (CollectionUtils.isEmpty(list) || CollectionUtils.isEmpty(columnDTOS)) {
|
|
|
|
- return list.isEmpty() ? columnDTOS : createNewDTOs(list);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<PatentColumnDTO> result = new ArrayList<>(columnDTOS.size());
|
|
|
|
- Set<String> searchedNumbers = new HashSet<>(); // 用于跟踪已搜索的专利号
|
|
|
|
-
|
|
|
|
- for (String patentNo : list) {
|
|
|
|
- boolean found = false;
|
|
|
|
- String formattedNo = dbType.equals("CN") ? PatentNoUtil.formatApNo(patentNo) : patentNo;
|
|
|
|
-
|
|
|
|
- for (PatentColumnDTO columnDTO : columnDTOS) {
|
|
|
|
- if (containsNumber(columnDTO, formattedNo)) {
|
|
|
|
- PatentColumnDTO dto = new PatentColumnDTO();
|
|
|
|
- BeanUtils.copyProperties(columnDTO,dto);
|
|
|
|
- dto.setSearchNo(patentNo);
|
|
|
|
- result.add(dto);
|
|
|
|
- searchedNumbers.add(patentNo); // 标记为已搜索
|
|
|
|
- found = true;
|
|
|
|
- break; // 找到匹配项后跳出内层循环
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!found) {
|
|
|
|
- // 如果没有在columnDTOS中找到匹配项,则创建一个新的DTO
|
|
|
|
- PatentColumnDTO newDTO = new PatentColumnDTO();
|
|
|
|
- newDTO.setPatentNo(patentNo);
|
|
|
|
- newDTO.setSearchNo(patentNo);
|
|
|
|
- newDTO.setIfSearch(false);
|
|
|
|
- result.add(newDTO);
|
|
|
|
|
|
+ public String getFormatCondition(String condition) {
|
|
|
|
+ String s = condition.substring(condition.indexOf("=") + 1);
|
|
|
|
+ String s1 = s.replaceAll("[()]", "");
|
|
|
|
+ String[] valueStrs = s1.split("[,,]|(\\r\\n)+|\\r+|\\n+");
|
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
+ for (int i = 0; i < valueStrs.length; i++) {
|
|
|
|
+ final String value = valueStrs[i];
|
|
|
|
+ if (i != valueStrs.length - 1) {
|
|
|
|
+ stringBuilder.append(value).append(",");
|
|
|
|
+ } else {
|
|
|
|
+ stringBuilder.append(value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private boolean containsNumber(PatentColumnDTO dto, String number) {
|
|
|
|
- String appNo = StringUtils.isNotEmpty(dto.getAppNo()) ? dto.getAppNo() : "";
|
|
|
|
- String publicNo = StringUtils.isNotEmpty(dto.getPublicNo()) ? dto.getPublicNo() : "";
|
|
|
|
- String grantNo = StringUtils.isNotEmpty(dto.getGrantNo()) ? dto.getGrantNo() : "";
|
|
|
|
- String rowAppNo = StringUtils.isNotEmpty(dto.getRowApplicationNo()) ? dto.getRowApplicationNo() : "";
|
|
|
|
- return appNo.contains(number) || publicNo.contains(number)
|
|
|
|
- || grantNo.contains(number) || rowAppNo.contains(number);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private List<PatentColumnDTO> createNewDTOs(List<String> list) {
|
|
|
|
- List<PatentColumnDTO> newDTOs = new ArrayList<>();
|
|
|
|
- for (String s : list) {
|
|
|
|
- PatentColumnDTO dto = new PatentColumnDTO();
|
|
|
|
- dto.setPatentNo(s);
|
|
|
|
- dto.setSearchNo(s);
|
|
|
|
- dto.setIfSearch(false);
|
|
|
|
- newDTOs.add(dto);
|
|
|
|
- }
|
|
|
|
- return newDTOs;
|
|
|
|
|
|
+ return stringBuilder.toString();
|
|
}
|
|
}
|
|
|
|
|
|
public List<PatentStarListDTO> getSplitedConditions(PatentStarListDTO patentStarListDTO, int patentNum) throws IOException {
|
|
public List<PatentStarListDTO> getSplitedConditions(PatentStarListDTO patentStarListDTO, int patentNum) throws IOException {
|
|
@@ -392,6 +328,7 @@ public class PatentStarApiService {
|
|
* 从专利之星获取中国专利摘要附图
|
|
* 从专利之星获取中国专利摘要附图
|
|
*/
|
|
*/
|
|
public String getPictureApi(String appNo) {
|
|
public String getPictureApi(String appNo) {
|
|
|
|
+
|
|
String url = "https://api.patentstar.com.cn/api/Patent/CnMainImage/" + appNo;
|
|
String url = "https://api.patentstar.com.cn/api/Patent/CnMainImage/" + appNo;
|
|
JSONObject configObject = this.getConfigObject(4, 2);
|
|
JSONObject configObject = this.getConfigObject(4, 2);
|
|
String appId = configObject.getString("appId");
|
|
String appId = configObject.getString("appId");
|
|
@@ -435,7 +372,6 @@ public class PatentStarApiService {
|
|
* 从专利之星获取中国专利外观图
|
|
* 从专利之星获取中国专利外观图
|
|
*/
|
|
*/
|
|
public String getWGPictureApi(String appNo) throws IOException {
|
|
public String getWGPictureApi(String appNo) throws IOException {
|
|
-
|
|
|
|
String url = "https://api.patentstar.com.cn/api/Patent/CnWGImage/" + appNo;
|
|
String url = "https://api.patentstar.com.cn/api/Patent/CnWGImage/" + appNo;
|
|
JSONObject configObject = this.getConfigObject(4, 2);
|
|
JSONObject configObject = this.getConfigObject(4, 2);
|
|
String appId = configObject.getString("appId");
|
|
String appId = configObject.getString("appId");
|
|
@@ -463,7 +399,8 @@ public class PatentStarApiService {
|
|
if (response.isSuccessful()) {
|
|
if (response.isSuccessful()) {
|
|
// 打印服务端返回结果
|
|
// 打印服务端返回结果
|
|
return Objects.requireNonNull(response.body()).string();
|
|
return Objects.requireNonNull(response.body()).string();
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
response.close();
|
|
response.close();
|
|
}
|
|
}
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
@@ -549,7 +486,8 @@ public class PatentStarApiService {
|
|
if (response.isSuccessful()) {
|
|
if (response.isSuccessful()) {
|
|
// 打印服务端返回结果
|
|
// 打印服务端返回结果
|
|
return Objects.requireNonNull(response.body()).string();
|
|
return Objects.requireNonNull(response.body()).string();
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
response.close();
|
|
response.close();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -642,8 +580,11 @@ public class PatentStarApiService {
|
|
}
|
|
}
|
|
List<String> reStrs = new ArrayList<>();
|
|
List<String> reStrs = new ArrayList<>();
|
|
Integer count = 1;
|
|
Integer count = 1;
|
|
|
|
+
|
|
for (Element item : elements) {
|
|
for (Element item : elements) {
|
|
String claim = item.getText().replaceAll("<br/>", "");
|
|
String claim = item.getText().replaceAll("<br/>", "");
|
|
|
|
+
|
|
|
|
+
|
|
if (!claim.trim().equals("技术领域")
|
|
if (!claim.trim().equals("技术领域")
|
|
&& !claim.trim().equals("发明内容")
|
|
&& !claim.trim().equals("发明内容")
|
|
&& !claim.trim().equals("附图说明")
|
|
&& !claim.trim().equals("附图说明")
|
|
@@ -699,7 +640,8 @@ public class PatentStarApiService {
|
|
if (response.isSuccessful()) {
|
|
if (response.isSuccessful()) {
|
|
// 打印服务端返回结果
|
|
// 打印服务端返回结果
|
|
return Objects.requireNonNull(response.body()).string();
|
|
return Objects.requireNonNull(response.body()).string();
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
response.close();
|
|
response.close();
|
|
}
|
|
}
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
@@ -758,6 +700,7 @@ public class PatentStarApiService {
|
|
* 从专利之星获取同族专利
|
|
* 从专利之星获取同族专利
|
|
*/
|
|
*/
|
|
public String getFamilyByPubNoApi(String patentNo) {
|
|
public String getFamilyByPubNoApi(String patentNo) {
|
|
|
|
+ patentNo="CN217038881U";
|
|
String url = "https://api.patentstar.com.cn/api/Patent/FamilyByPubNo/" + patentNo;
|
|
String url = "https://api.patentstar.com.cn/api/Patent/FamilyByPubNo/" + patentNo;
|
|
JSONObject configObject = this.getConfigObject(4, 2);
|
|
JSONObject configObject = this.getConfigObject(4, 2);
|
|
String appId = configObject.getString("appId");
|
|
String appId = configObject.getString("appId");
|
|
@@ -936,30 +879,30 @@ public class PatentStarApiService {
|
|
starPatentVOS.forEach(item -> {
|
|
starPatentVOS.forEach(item -> {
|
|
PatentColumnDTO patentColumnDTO = new PatentColumnDTO();
|
|
PatentColumnDTO patentColumnDTO = new PatentColumnDTO();
|
|
//申请号
|
|
//申请号
|
|
- patentColumnDTO.setAppNo(item.getApplicationNo());
|
|
|
|
|
|
+ patentColumnDTO.setAppNo(item.getAN());
|
|
//装载公开号
|
|
//装载公开号
|
|
- patentColumnDTO.setPublicNo(item.getPublicNo());
|
|
|
|
|
|
+ patentColumnDTO.setPublicNo(item.getPN());
|
|
//装载公告号
|
|
//装载公告号
|
|
- patentColumnDTO.setGrantNo(item.getPublicAccreditNo());
|
|
|
|
|
|
+ patentColumnDTO.setGrantNo(item.getGN());
|
|
//装载专利状态
|
|
//装载专利状态
|
|
if (item.getLG() != null) {
|
|
if (item.getLG() != null) {
|
|
patentColumnDTO.setSimpleStatus(item.getLG().toString());
|
|
patentColumnDTO.setSimpleStatus(item.getLG().toString());
|
|
}
|
|
}
|
|
//装载专利类型
|
|
//装载专利类型
|
|
- if (item.getPatentType() != null) {
|
|
|
|
- patentColumnDTO.setPatentType(item.getPatentType().toString());
|
|
|
|
|
|
+ if (item.getPT() != null) {
|
|
|
|
+ patentColumnDTO.setPatentType(item.getPT().toString());
|
|
}
|
|
}
|
|
//装载摘要
|
|
//装载摘要
|
|
List<Text> abstractList = new ArrayList<>();
|
|
List<Text> abstractList = new ArrayList<>();
|
|
Text text = new Text();
|
|
Text text = new Text();
|
|
- text.setTextContent(item.getAbstractStr());
|
|
|
|
|
|
+ text.setTextContent(item.getAB());
|
|
text.setIfOrigin(true);
|
|
text.setIfOrigin(true);
|
|
abstractList.add(text);
|
|
abstractList.add(text);
|
|
patentColumnDTO.setAbstractStr(abstractList);
|
|
patentColumnDTO.setAbstractStr(abstractList);
|
|
//装载标题
|
|
//装载标题
|
|
List<Text> titleList = new ArrayList<>();
|
|
List<Text> titleList = new ArrayList<>();
|
|
Text title = new Text();
|
|
Text title = new Text();
|
|
- title.setTextContent(item.getName());
|
|
|
|
|
|
+ title.setTextContent(item.getTI());
|
|
title.setIfOrigin(true);
|
|
title.setIfOrigin(true);
|
|
titleList.add(title);
|
|
titleList.add(title);
|
|
// text.setLanguage(patent.getAppCountry());
|
|
// text.setLanguage(patent.getAppCountry());
|
|
@@ -967,7 +910,7 @@ public class PatentStarApiService {
|
|
//装载权利要求
|
|
//装载权利要求
|
|
List<Text> claimList = new ArrayList<>();
|
|
List<Text> claimList = new ArrayList<>();
|
|
Text claim = new Text();
|
|
Text claim = new Text();
|
|
- claim.setTextContent(item.getClaimStr());
|
|
|
|
|
|
+ claim.setTextContent(item.getCL());
|
|
claim.setIfOrigin(true);
|
|
claim.setIfOrigin(true);
|
|
claimList.add(claim);
|
|
claimList.add(claim);
|
|
patentColumnDTO.setClaim(claimList);
|
|
patentColumnDTO.setClaim(claimList);
|
|
@@ -986,90 +929,94 @@ public class PatentStarApiService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //装载申请日
|
|
|
|
- if (item.getApplicationDate() != null && !item.getApplicationDate().trim().equals("")) {
|
|
|
|
- patentColumnDTO.setAppDate(DateUtils.strToDate(item.getApplicationDate()));
|
|
|
|
- }
|
|
|
|
|
|
+// //装载申请日
|
|
|
|
+// if (item.getAD() != null && !item.getAD().trim().equals("")) {
|
|
|
|
+// patentColumnDTO.setAppDate(DateUtils.strToDate(item.getAD()));
|
|
|
|
+// }
|
|
|
|
+//// patentColumnDTO.setAppCountry(item.getBureau());
|
|
|
|
+// //装载申请人地址
|
|
|
|
+// PersonAddress appAddress = new PersonAddress();
|
|
|
|
+// appAddress.setAddress(item.getApplicationAddress());
|
|
|
|
+// appAddress.setProvince(item.getProvinceStr());
|
|
|
|
+// patentColumnDTO.setApplicantAddr(appAddress);
|
|
|
|
+// patentColumnDTO.setAppAddress(item.getApplicationAddress());
|
|
|
|
+//// patentColumnDTO.setApplicantCountry(item.getProvinceStr());
|
|
|
|
+// String provinceStr = item.getProvinceStr();
|
|
|
|
+// if (provinceStr.contains("(") && provinceStr.contains(")")) {
|
|
|
|
+// String substring = provinceStr.substring(provinceStr.indexOf("(") + 1, provinceStr.indexOf(")"));
|
|
|
|
+// patentColumnDTO.setAppProvince(substring);
|
|
|
|
+// }
|
|
|
|
+// //装载ipc(主)分类号
|
|
|
|
+// PatentClassify mipcClassify = new PatentClassify();
|
|
|
|
+// mipcClassify.setLevel5(item.getMainIpc());
|
|
|
|
+// patentColumnDTO.setMipc(mipcClassify);
|
|
|
|
+// //装载ipc分类号
|
|
|
|
+// List<PatentClassify> classifies = new ArrayList<>();
|
|
|
|
+// String[] split = item.getIpcListStr().split(";");
|
|
|
|
+// for (String ipc : split) {
|
|
|
|
+// PatentClassify ipcClassify = new PatentClassify();
|
|
|
|
+// ipcClassify.setLevel5(ipc);
|
|
|
|
+// }
|
|
|
|
+// patentColumnDTO.setIpc(classifies);
|
|
|
|
+// //获取摘要附图
|
|
|
|
+//// String pictureApi = this.getPictureApi(item.getRowApplicationNo());
|
|
|
|
+//// patentColumnDTO.setPictureGuid(pictureApi);
|
|
|
|
+// //获取外部专利原始申请号
|
|
|
|
+// patentColumnDTO.setRowApplicationNo(item.getRowApplicationNo());
|
|
|
|
+// //获取法律状态
|
|
|
|
+//// String cnLegalApi = this.getCnLegalApi(item.getRowApplicationNo());
|
|
|
|
+//// patentColumnDTO.setLegalStatus(Arrays.asList(cnLegalApi));
|
|
|
|
+// //获取被引用次数
|
|
|
|
+// //装载公开日
|
|
|
|
+// if (item.getPublicDate() != null && !item.getPublicDate().trim().equals("")) {
|
|
|
|
+// patentColumnDTO.setPublicDate(DateUtils.strToDate(item.getPublicDate()));
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //装载公开日
|
|
|
|
+// if (item.getPublicAccreditDate() != null && !item.getPublicAccreditDate().trim().equals("")) {
|
|
|
|
+// patentColumnDTO.setGrantDate(DateUtils.strToDate(item.getPublicAccreditDate()));
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //装载申请人
|
|
|
|
+// if (item.getApplicantStr() != null && !item.getApplicantStr().trim().equals("")) {
|
|
|
|
+// List<String> names = Arrays.asList(item.getApplicantStr().split(";"));
|
|
|
|
+// patentColumnDTO.setApplicant(names);
|
|
|
|
+// } else {
|
|
|
|
+// patentColumnDTO.setApplicant(new ArrayList<>());
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //装载发明人
|
|
|
|
+// if (item.getInventorStr() != null && !item.getInventorStr().trim().equals("")) {
|
|
|
|
+// List<String> names = Arrays.asList(item.getInventorStr().split(";"));
|
|
|
|
+// patentColumnDTO.setInventor(names);
|
|
|
|
+// } else {
|
|
|
|
+// patentColumnDTO.setInventor(new ArrayList<>());
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //装载权利人
|
|
|
|
+// if (item.getCurrentApplicantStr() != null && !item.getCurrentApplicantStr().trim().equals("")) {
|
|
|
|
+// List<String> names = Arrays.asList(item.getCurrentApplicantStr().split(";"));
|
|
|
|
+// patentColumnDTO.setRightHolder(names);
|
|
|
|
+// } else {
|
|
|
|
+// patentColumnDTO.setRightHolder(new ArrayList<>());
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //装载代理人
|
|
|
|
+// if (item.getAgentStr() != null && !item.getAgentStr().trim().equals("")) {
|
|
|
|
+// List<String> names = Arrays.asList(item.getAgentStr().split(";"));
|
|
|
|
+// patentColumnDTO.setAgent(names);
|
|
|
|
+// } else {
|
|
|
|
+// patentColumnDTO.setAgent(new ArrayList<>());
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //装载代理机构
|
|
|
|
+// if (item.getAgencyStr() != null && !item.getAgencyStr().trim().equals("")) {
|
|
|
|
+// patentColumnDTO.setAgency(item.getAgencyStr());
|
|
|
|
+// }
|
|
|
|
+// //装载优先权
|
|
|
|
+// patentColumnDTO.setPriorityNo(item.getPriorityNo());
|
|
|
|
+// patentColumnDTO.setPriorityDate(item.getPriorityDate());
|
|
// patentColumnDTO.setAppCountry(item.getBureau());
|
|
// patentColumnDTO.setAppCountry(item.getBureau());
|
|
- //装载申请人地址
|
|
|
|
- patentColumnDTO.setAppAddress(item.getApplicationAddress());
|
|
|
|
-// patentColumnDTO.setApplicantCountry(item.getProvinceStr());
|
|
|
|
- String provinceStr = item.getProvinceStr();
|
|
|
|
- if (provinceStr.contains("(") && provinceStr.contains(")")) {
|
|
|
|
- String substring = provinceStr.substring(provinceStr.indexOf("(") + 1, provinceStr.indexOf(")"));
|
|
|
|
- patentColumnDTO.setAppProvince(substring);
|
|
|
|
- }
|
|
|
|
- //装载ipc(主)分类号
|
|
|
|
- PatentClassify mipcClassify = new PatentClassify();
|
|
|
|
- mipcClassify.setLevel5(item.getMainIpc());
|
|
|
|
- patentColumnDTO.setMipc(mipcClassify);
|
|
|
|
- //装载ipc分类号
|
|
|
|
- List<PatentClassify> classifies = new ArrayList<>();
|
|
|
|
- String[] split = item.getIpcListStr().split(";");
|
|
|
|
- for (String ipc : split) {
|
|
|
|
- PatentClassify ipcClassify = new PatentClassify();
|
|
|
|
- ipcClassify.setLevel5(ipc);
|
|
|
|
- }
|
|
|
|
- patentColumnDTO.setIpc(classifies);
|
|
|
|
- //获取摘要附图
|
|
|
|
-// String pictureApi = this.getPictureApi(item.getRowApplicationNo());
|
|
|
|
-// patentColumnDTO.setPictureGuid(pictureApi);
|
|
|
|
- //获取外部专利原始申请号
|
|
|
|
- patentColumnDTO.setRowApplicationNo(item.getRowApplicationNo());
|
|
|
|
- //获取法律状态
|
|
|
|
-// String cnLegalApi = this.getCnLegalApi(item.getRowApplicationNo());
|
|
|
|
-// patentColumnDTO.setLegalStatus(Arrays.asList(cnLegalApi));
|
|
|
|
- //获取被引用次数
|
|
|
|
- //装载公开日
|
|
|
|
- if (item.getPublicDate() != null && !item.getPublicDate().trim().equals("")) {
|
|
|
|
- patentColumnDTO.setPublicDate(DateUtils.strToDate(item.getPublicDate()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //装载公开日
|
|
|
|
- if (item.getPublicAccreditDate() != null && !item.getPublicAccreditDate().trim().equals("")) {
|
|
|
|
- patentColumnDTO.setGrantDate(DateUtils.strToDate(item.getPublicAccreditDate()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //装载申请人
|
|
|
|
- if (item.getApplicantStr() != null && !item.getApplicantStr().trim().equals("")) {
|
|
|
|
- List<String> names = Arrays.asList(item.getApplicantStr().split(";"));
|
|
|
|
- patentColumnDTO.setApplicant(names);
|
|
|
|
- } else {
|
|
|
|
- patentColumnDTO.setApplicant(new ArrayList<>());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //装载发明人
|
|
|
|
- if (item.getInventorStr() != null && !item.getInventorStr().trim().equals("")) {
|
|
|
|
- List<String> names = Arrays.asList(item.getInventorStr().split(";"));
|
|
|
|
- patentColumnDTO.setInventor(names);
|
|
|
|
- } else {
|
|
|
|
- patentColumnDTO.setInventor(new ArrayList<>());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //装载权利人
|
|
|
|
- if (item.getCurrentApplicantStr() != null && !item.getCurrentApplicantStr().trim().equals("")) {
|
|
|
|
- List<String> names = Arrays.asList(item.getCurrentApplicantStr().split(";"));
|
|
|
|
- patentColumnDTO.setRightHolder(names);
|
|
|
|
- } else {
|
|
|
|
- patentColumnDTO.setRightHolder(new ArrayList<>());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //装载代理人
|
|
|
|
- if (item.getAgentStr() != null && !item.getAgentStr().trim().equals("")) {
|
|
|
|
- List<String> names = Arrays.asList(item.getAgentStr().split(";"));
|
|
|
|
- patentColumnDTO.setAgent(names);
|
|
|
|
- } else {
|
|
|
|
- patentColumnDTO.setAgent(new ArrayList<>());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //装载代理机构
|
|
|
|
- if (item.getAgencyStr() != null && !item.getAgencyStr().trim().equals("")) {
|
|
|
|
- patentColumnDTO.setAgency(item.getAgencyStr());
|
|
|
|
- }
|
|
|
|
- //装载优先权
|
|
|
|
- patentColumnDTO.setPriorityNo(item.getPriorityNo());
|
|
|
|
- patentColumnDTO.setPriorityDate(item.getPriorityDate());
|
|
|
|
- patentColumnDTO.setAppCountry(item.getBureau());
|
|
|
|
patentColumnDTOS.add(patentColumnDTO);
|
|
patentColumnDTOS.add(patentColumnDTO);
|
|
});
|
|
});
|
|
|
|
|
|
@@ -1199,6 +1146,7 @@ public class PatentStarApiService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public List<Text> getCnFullText(String appNo) {
|
|
public List<Text> getCnFullText(String appNo) {
|
|
|
|
+ appNo="202410796708";
|
|
List<Text> pubTextList = new ArrayList<>();
|
|
List<Text> pubTextList = new ArrayList<>();
|
|
//获取公开说明书
|
|
//获取公开说明书
|
|
String cnFullXmlApi = null;
|
|
String cnFullXmlApi = null;
|
|
@@ -1262,20 +1210,21 @@ public class PatentStarApiService {
|
|
dto.setType(0);
|
|
dto.setType(0);
|
|
list.add(dto);
|
|
list.add(dto);
|
|
}
|
|
}
|
|
- } else { //若只有一个
|
|
|
|
|
|
+ }
|
|
|
|
+ else { //若只有一个
|
|
pdfUrl1 = pdfUrlStr.substring(pdfUrlStr.indexOf("http"));
|
|
pdfUrl1 = pdfUrlStr.substring(pdfUrlStr.indexOf("http"));
|
|
if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
|
|
|
|
- InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
|
- dto.setPdfGuid(pdfUrl1);
|
|
|
|
- dto.setType(0);
|
|
|
|
- list.add(dto);
|
|
|
|
|
|
+ InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
|
+ dto.setPdfGuid(pdfUrl1);
|
|
|
|
+ dto.setType(0);
|
|
|
|
+ list.add(dto);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
|
- dto.setPdfGuid(pdfUrl1);
|
|
|
|
- dto.setType(1);
|
|
|
|
- list.add(dto);
|
|
|
|
|
|
+ InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
|
|
+ dto.setPdfGuid(pdfUrl1);
|
|
|
|
+ dto.setType(1);
|
|
|
|
+ list.add(dto);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1283,11 +1232,11 @@ public class PatentStarApiService {
|
|
} else {
|
|
} else {
|
|
String usedPatentNo;
|
|
String usedPatentNo;
|
|
if (publicNo != null && !publicNo.equals("")) {
|
|
if (publicNo != null && !publicNo.equals("")) {
|
|
- usedPatentNo = publicNo;
|
|
|
|
|
|
+ usedPatentNo =publicNo;
|
|
} else {
|
|
} else {
|
|
usedPatentNo = grantNo;
|
|
usedPatentNo = grantNo;
|
|
}
|
|
}
|
|
- if (usedPatentNo != null) {
|
|
|
|
|
|
+ if(usedPatentNo!=null){
|
|
pdfUrl = this.getEnPdfApi(usedPatentNo);
|
|
pdfUrl = this.getEnPdfApi(usedPatentNo);
|
|
if (!pdfUrl.equals("")) {
|
|
if (!pdfUrl.equals("")) {
|
|
InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
InnerPatentPdfDTO dto = new InnerPatentPdfDTO();
|
|
@@ -1394,4 +1343,6 @@ public class PatentStarApiService {
|
|
}
|
|
}
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|