|
@@ -124,7 +124,7 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
|
|
|
if (featureFromDb != null && featureFromDb.size() != 0) {
|
|
if (featureFromDb != null && featureFromDb.size() != 0) {
|
|
int rightId = patentRights.get(i).getId();
|
|
int rightId = patentRights.get(i).getId();
|
|
- featuresList = featureFromDb.stream().filter(item -> item.getRightId() == rightId && item.getSplitBy() == splitBy).collect(Collectors.toList());
|
|
|
|
|
|
+ featuresList = featureFromDb.stream().filter(item -> item.getRightId() == rightId && item.getSplitBy() == splitBy &&item.getPartnerId()==personnelVO.getId()).collect(Collectors.toList());
|
|
}
|
|
}
|
|
//如果数据库里无拆解记录则手动插入一条
|
|
//如果数据库里无拆解记录则手动插入一条
|
|
if (featuresList == null || featuresList.size() == 0 || flag == 1) {
|
|
if (featuresList == null || featuresList.size() == 0 || flag == 1) {
|
|
@@ -178,6 +178,54 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String getFeatures(String patentNo, Integer reportId) throws IOException {
|
|
|
|
+ LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper();
|
|
|
|
+ queryWrapper.eq(Report::getId, reportId);
|
|
|
|
+ Report report = reportService.list(queryWrapper).get(0);
|
|
|
|
+ //权要(带拆分的特征)列表
|
|
|
|
+ List<PatentRightVo> patentRightVos = new ArrayList<>();
|
|
|
|
+ //从pas获得权要信息
|
|
|
|
+ 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);
|
|
|
|
+ Features featureTO = new Features();
|
|
|
|
+ featureTO.setReportId(reportId);
|
|
|
|
+ featureTO.setSignPatentNo(patentNo);
|
|
|
|
+ //查询数据库里是否有查询记录
|
|
|
|
+ List<Features> featureFromDb = this.queryFeatures(featureTO);
|
|
|
|
+ //将拆解的权要和特征装载到对象PatentRightVo
|
|
|
|
+ for (int i = 0; i < patentRights.size(); i++) {
|
|
|
|
+ List<Features> featuresList = new ArrayList<>();
|
|
|
|
+ //对需要拆解的权要进行拆解
|
|
|
|
+ if (featureFromDb != null && featureFromDb.size() != 0) {
|
|
|
|
+ int rightId = patentRights.get(i).getId();
|
|
|
|
+ featuresList = featureFromDb.stream().filter(item -> item.getRightId() == rightId &&item.getPartnerId()==report.getPersonId()).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //装载到对象PatentRightVo
|
|
|
|
+ PatentRightVo patentRightVo = new PatentRightVo();
|
|
|
|
+ String name = "权要" + (i + 1);
|
|
|
|
+ patentRightVo.setPatentId(patentRights.get(i).getPatentId());
|
|
|
|
+ patentRightVo.setFeatures(featuresList);
|
|
|
|
+ patentRightVo.setContent(patentRights.get(i).getContent());
|
|
|
|
+ patentRightVo.setSort(patentRights.get(i).getSort());
|
|
|
|
+ patentRightVo.setType(patentRights.get(i).getType());
|
|
|
|
+ patentRightVo.setContentOut(patentRights.get(i).getContentOut());
|
|
|
|
+ patentRightVo.setReportId(reportId);
|
|
|
|
+ patentRightVo.setRightName(name);
|
|
|
|
+ patentRightVo.setSignPatentNo(patentNo);
|
|
|
|
+ patentRightVos.add(patentRightVo);
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
+ map.put("patentRightVos", patentRightVos);
|
|
|
|
+ map.put("splitBy", report.getSplitBy());
|
|
|
|
+ map.put("splitType", report.getSplitType());
|
|
|
|
+ return Response.success(map);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
//根据符号拆分字符串
|
|
//根据符号拆分字符串
|
|
public List<String> splitStringByFlags(String sentence, List<String> flags) {
|
|
public List<String> splitStringByFlags(String sentence, List<String> flags) {
|
|
List<String> sectences = new ArrayList<>();
|
|
List<String> sectences = new ArrayList<>();
|