|
@@ -2,11 +2,9 @@ package cn.cslg.report.service.business;
|
|
|
|
|
|
import cn.cslg.report.common.model.PatentRightParams;
|
|
import cn.cslg.report.common.model.PatentRightParams;
|
|
import cn.cslg.report.common.model.dto.FeaturesDTO;
|
|
import cn.cslg.report.common.model.dto.FeaturesDTO;
|
|
|
|
+import cn.cslg.report.common.model.dto.QueryRecordsDTO;
|
|
import cn.cslg.report.common.model.dto.invalidReReport.CheckReFeaturesDTO;
|
|
import cn.cslg.report.common.model.dto.invalidReReport.CheckReFeaturesDTO;
|
|
-import cn.cslg.report.common.model.vo.PatentRightVo;
|
|
|
|
-import cn.cslg.report.common.model.vo.PatentVO;
|
|
|
|
-import cn.cslg.report.common.model.vo.PersonnelVO;
|
|
|
|
-import cn.cslg.report.common.model.vo.SplitVO;
|
|
|
|
|
|
+import cn.cslg.report.common.model.vo.*;
|
|
import cn.cslg.report.common.model.vo.invalidReReport.QueryAllFeaturesVO;
|
|
import cn.cslg.report.common.model.vo.invalidReReport.QueryAllFeaturesVO;
|
|
import cn.cslg.report.common.utils.CacheUtils;
|
|
import cn.cslg.report.common.utils.CacheUtils;
|
|
import cn.cslg.report.common.utils.PatentRightUtils;
|
|
import cn.cslg.report.common.utils.PatentRightUtils;
|
|
@@ -29,6 +27,8 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -68,7 +68,6 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
* @return List<PatentRight>
|
|
* @return List<PatentRight>
|
|
* @function 对权要进行合并操作
|
|
* @function 对权要进行合并操作
|
|
*/
|
|
*/
|
|
-
|
|
|
|
public List<PatentRight> FormatPatentRights(List<PatentRight> patentRights, String patentNo) {
|
|
public List<PatentRight> FormatPatentRights(List<PatentRight> patentRights, String patentNo) {
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
patentRights.forEach(item -> {
|
|
patentRights.forEach(item -> {
|
|
@@ -539,6 +538,60 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
return mapList;
|
|
return mapList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public Map<String, Object> querySimFeaturePatentByPatentNo(QueryRecordsDTO queryRecordsDTO) throws IOException {
|
|
|
|
+ Map<String, Object> reMap = new HashMap<>();
|
|
|
|
+ reMap.put("current", queryRecordsDTO.getCurrent());
|
|
|
|
+ reMap.put("size", queryRecordsDTO.getSize());
|
|
|
|
+ reMap.put("total", 0);
|
|
|
|
+ reMap.put("records",new ArrayList());
|
|
|
|
+ //根据专利号获得权要
|
|
|
|
+ String patentNo = queryRecordsDTO.getPatentNo();
|
|
|
|
+ SplitVO splitVO = new SplitVO();
|
|
|
|
+ splitVO.setPatentNo(patentNo);
|
|
|
|
+ splitVO.setSplitBy(2);
|
|
|
|
+ List<Features> features = this.splitFeatures(splitVO);
|
|
|
|
+ //获得特征内容
|
|
|
|
+ List<String> contents = features.stream().map(Features::getContent).collect(Collectors.toList());
|
|
|
|
+ List<Features> featuresList = featureMapper.getSignPatentNo(contents, patentNo);
|
|
|
|
+ if (featuresList.size() == 0) {
|
|
|
|
+ return reMap;
|
|
|
|
+ }
|
|
|
|
+ //根据特征Id 查询 对比记录特征关联信息
|
|
|
|
+ List<Integer> featureIds = featuresList.stream().map(Features::getId).collect(Collectors.toList());
|
|
|
|
+ //分页查询专利
|
|
|
|
+ List<String> patentNos = compareRecordsService.getBaseMapper().getCompareNos(featureIds, queryRecordsDTO.getCurrent(), queryRecordsDTO.getSize());
|
|
|
|
+ // 获得总数
|
|
|
|
+ Integer total = compareRecordsService.getBaseMapper().getCompareNosCount(featureIds);
|
|
|
|
+ reMap.put("total", total);
|
|
|
|
+ //根据专利号查询专利详情
|
|
|
|
+ PatentVO patentVO = new PatentVO();
|
|
|
|
+ patentVO.setPatentNos(patentNos);
|
|
|
|
+ String resBody = outInterfaceService.getPatentList(patentVO);
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
|
|
+ List<JSONObject> patentDTOS = JSON.parseArray(jsonObject.get("data").toString(), JSONObject.class);
|
|
|
|
+ //装载专利信息
|
|
|
|
+ List<Map<String, Object>> patentMaps = new ArrayList<>();
|
|
|
|
+ patentNos.forEach(item -> {
|
|
|
|
+ Map<String, Object> patentMap = new HashMap<>();
|
|
|
|
+ //根据专利号查询对比记录
|
|
|
|
+ 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("compareRecords",compareRecords);
|
|
|
|
+ patentMaps.add(patentMap);
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ reMap.put("records",patentMaps);
|
|
|
|
+ return reMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
public Features select(int id) {
|
|
public Features select(int id) {
|
|
LambdaQueryWrapper<Features> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Features> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.eq(Features::getId, id);
|
|
queryWrapper.eq(Features::getId, id);
|
|
@@ -749,4 +802,73 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
|
|
|
return Response.success(mapList);
|
|
return Response.success(mapList);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //拆分特征
|
|
|
|
+ List<Features> splitFeatures(SplitVO splitVO) throws IOException {
|
|
|
|
+ List<String> flags = new ArrayList<>();
|
|
|
|
+ String patentNo = splitVO.getPatentNo();
|
|
|
|
+ Integer splitBy = splitVO.getSplitBy();
|
|
|
|
+ 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);
|
|
|
|
+
|
|
|
|
+ if (splitBy == 0) {
|
|
|
|
+ flags.add(",");
|
|
|
|
+ flags.add(",");
|
|
|
|
+ }
|
|
|
|
+ //当splitBy=1时仅仅根据“;“拆解
|
|
|
|
+ else if (splitBy == 1) {
|
|
|
|
+ flags.add(";");
|
|
|
|
+ flags.add(";");
|
|
|
|
+ }//当splitBy=2时根据“;“和”,”拆解
|
|
|
|
+ else if (splitBy == 2) {
|
|
|
|
+ flags.add(";");
|
|
|
|
+ flags.add(";");
|
|
|
|
+ flags.add(",");
|
|
|
|
+ flags.add(",");
|
|
|
|
+ }
|
|
|
|
+ List<Features> featuresList = new ArrayList<>();
|
|
|
|
+ //将拆解的权要和特征装载到对象PatentRightVo
|
|
|
|
+ for (int i = 0; i < patentRights.size(); i++) {
|
|
|
|
+ //特征序号
|
|
|
|
+ Integer order = 1;
|
|
|
|
+
|
|
|
|
+ int rightId = patentRights.get(i).getSort();
|
|
|
|
+ String name = "权要" + (patentRights.get(i).getSort() + 1);
|
|
|
|
+ //对需要拆解的权要进行拆解
|
|
|
|
+ //如果数据库里无拆解记录则手动插入一条
|
|
|
|
+ List<String> contentOuts = Arrays.asList(patentRights.get(i).getContentOut());
|
|
|
|
+ List<String> contents = Arrays.asList(patentRights.get(i).getContent());
|
|
|
|
+ //如果是需要拆解的权要
|
|
|
|
+
|
|
|
|
+ //获得权要的译文并且拆解
|
|
|
|
+ contentOuts = this.splitStringByFlags(patentRights.get(i).getContentOut(), flags);
|
|
|
|
+ //获得权要的原文并且拆解
|
|
|
|
+ contents = this.splitStringByFlags(patentRights.get(i).getContent(), flags);
|
|
|
|
+
|
|
|
|
+ //遍历拆解出来的内容并装载到features最后存入列表
|
|
|
|
+ for (int t = 0; t < contents.size(); t++) {
|
|
|
|
+ Features features = new Features();
|
|
|
|
+ features.setRightId(patentRights.get(i).getSort());
|
|
|
|
+ features.setIsFinal(0);
|
|
|
|
+ features.setSignPatentNo(patentNo);
|
|
|
|
+ String countOut = contentOuts.size() - 1 >= t ? contentOuts.get(t) : "";
|
|
|
|
+ features.setContentOut(countOut);
|
|
|
|
+ features.setContent(contents.get(t));
|
|
|
|
+ features.setSplitBy(splitBy);
|
|
|
|
+ features.setRightName(name);
|
|
|
|
+ features.setFeaturesOrder(order);
|
|
|
|
+ features.setRightType(patentRights.get(i).getType());
|
|
|
|
+
|
|
|
|
+ featuresList.add(features);
|
|
|
|
+ order += 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return featuresList;
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|