|
@@ -69,22 +69,16 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
* @function 对权要进行合并操作
|
|
|
*/
|
|
|
public List<PatentRight> FormatPatentRights(List<PatentRight> patentRights, String patentNo) {
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
- patentRights.forEach(item -> {
|
|
|
- stringBuilder.append(item.getContent());
|
|
|
- });
|
|
|
-
|
|
|
- StringBuilder stringBuilder2 = new StringBuilder();
|
|
|
- patentRights.forEach(item -> {
|
|
|
- stringBuilder2.append(item.getContentOut());
|
|
|
- });
|
|
|
-
|
|
|
- PatentRightParams params = new PatentRightParams();
|
|
|
- params.setPatentNo(patentNo);
|
|
|
- params.setPatentId(-1);
|
|
|
- params.setContent(stringBuilder.toString());
|
|
|
- params.setContentOut(stringBuilder2.toString());
|
|
|
- patentRights = patentRightUtils.formatPatentRight(params);
|
|
|
+ //从pas获得拆分后的权要
|
|
|
+ String resBody = null;
|
|
|
+ try {
|
|
|
+ resBody = outInterfaceService.formatPatentRights(patentNo);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
|
+ patentRights = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return patentRights;
|
|
|
+ }
|
|
|
return patentRights;
|
|
|
}
|
|
|
|
|
@@ -167,35 +161,34 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
//权要(带拆分的特征)列表
|
|
|
List<PatentRightVo> patentRightVos = new ArrayList<>();
|
|
|
//从pas获得权要信息
|
|
|
- String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
|
|
|
+// String resBody = outInterfaceService.getPatentRightFromPAS(patentNo);
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
|
+// //解析jason获得标的专利的权要
|
|
|
+// List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
|
|
|
+// //给权要进行格式更改
|
|
|
+// List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin, patentNo);
|
|
|
+ //从pas获得拆分后的权要
|
|
|
+ String resBody = outInterfaceService.formatPatentRights(patentNo);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
|
- //解析jason获得标的专利的权要
|
|
|
- List<PatentRight> patentRightsOrgin = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
|
|
|
- //给权要进行格式更改
|
|
|
- List<PatentRight> patentRights = FormatPatentRights(patentRightsOrgin, patentNo);
|
|
|
+ List<PatentRight> patentRights = JSON.parseArray(jsonObject.getString("data"), PatentRight.class);
|
|
|
+
|
|
|
//List<Integer> partRightIds = new ArrayList<>(); //权要ids
|
|
|
List<Integer> partRightSorts = new ArrayList<>(); //权要sorts
|
|
|
List<String> flags = new ArrayList<>();
|
|
|
- // 当splitType=0仅拆解主权要
|
|
|
- if (splitType.equals(0)) {
|
|
|
- //partRightIds = patentRights.stream().filter(item -> item.getType().equals(1)).map(PatentRight::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (splitType.equals(0)) { //当splitType=0仅拆解主权要
|
|
|
partRightSorts = patentRights.stream().filter(item -> item.getType().equals(1)).map(PatentRight::getSort).collect(Collectors.toList());
|
|
|
- }// 当splitType=1拆解全部权要
|
|
|
- else if (splitType.equals(1)) {
|
|
|
- //partRightIds = patentRights.stream().map(PatentRight::getId).collect(Collectors.toList());
|
|
|
+ } else if (splitType.equals(1)) { //当splitType=1拆解全部权要
|
|
|
partRightSorts = patentRights.stream().map(PatentRight::getSort).collect(Collectors.toList());
|
|
|
}
|
|
|
- //当splitBy=0时仅仅根据“,”拆解
|
|
|
- if (splitBy == 0) {
|
|
|
+
|
|
|
+ if (splitBy == 0) { //当splitBy=0时仅仅根据“,”拆解
|
|
|
flags.add(",");
|
|
|
flags.add(",");
|
|
|
- }
|
|
|
- //当splitBy=1时仅仅根据“;“拆解
|
|
|
- else if (splitBy == 1) {
|
|
|
+ } else if (splitBy == 1) { //当splitBy=1时仅仅根据“;“拆解
|
|
|
flags.add(";");
|
|
|
flags.add(";");
|
|
|
- }//当splitBy=2时根据“;“和”,”拆解
|
|
|
- else if (splitBy == 2) {
|
|
|
+ } else if (splitBy == 2) { //当splitBy=2时根据“;“和”,”拆解
|
|
|
flags.add(";");
|
|
|
flags.add(";");
|
|
|
flags.add(",");
|
|
@@ -543,7 +536,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
reMap.put("current", queryRecordsDTO.getCurrent());
|
|
|
reMap.put("size", queryRecordsDTO.getSize());
|
|
|
reMap.put("total", 0);
|
|
|
- reMap.put("records",new ArrayList());
|
|
|
+ reMap.put("records", new ArrayList());
|
|
|
//根据专利号获得权要
|
|
|
String patentNo = queryRecordsDTO.getPatentNo();
|
|
|
SplitVO splitVO = new SplitVO();
|
|
@@ -574,20 +567,20 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
patentNos.forEach(item -> {
|
|
|
Map<String, Object> patentMap = new HashMap<>();
|
|
|
//根据专利号查询对比记录
|
|
|
- List<CompareRecordDTO> compareRecords = compareRecordsService.getBaseMapper().getCompareRecordsByNo(featureIds,item);
|
|
|
+ List<CompareRecordDTO> compareRecords = compareRecordsService.getBaseMapper().getCompareRecordsByNo(featureIds, item);
|
|
|
JSONObject jsonObject1 = patentDTOS.stream().filter(tem -> item.equals(tem.get("patentNo"))).findFirst().orElse(null);
|
|
|
|
|
|
- patentMap.put("patentNo",item);
|
|
|
- if(jsonObject1!=null){
|
|
|
- patentMap.put("publicNo",jsonObject1.get("publicNo"));
|
|
|
- patentMap.put("title",jsonObject1.get("name"));
|
|
|
+ patentMap.put("patentNo", item);
|
|
|
+ if (jsonObject1 != null) {
|
|
|
+ patentMap.put("publicNo", jsonObject1.get("publicNo"));
|
|
|
+ patentMap.put("title", jsonObject1.get("name"));
|
|
|
}
|
|
|
- patentMap.put("compareRecords",compareRecords);
|
|
|
- patentMaps.add(patentMap);
|
|
|
+ patentMap.put("compareRecords", compareRecords);
|
|
|
+ patentMaps.add(patentMap);
|
|
|
|
|
|
});
|
|
|
|
|
|
- reMap.put("records",patentMaps);
|
|
|
+ reMap.put("records", patentMaps);
|
|
|
return reMap;
|
|
|
}
|
|
|
|