|
@@ -58,9 +58,9 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
* @function 添加对比文件
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String addCompareFile(CompareFilesVO compareFilesVO) throws IOException {
|
|
|
+ public String addCompareFile(PatentVO patentVO) throws IOException {
|
|
|
//查询标的专利信息
|
|
|
- Report report = reportService.getById(compareFilesVO.getReportId());
|
|
|
+ Report report = reportService.getById(patentVO.getReportId());
|
|
|
//根据标的专利号获得专利信息
|
|
|
String res1 = outInterfaceService.getPatentFromPAS(report.getSignPatentNo());
|
|
|
JSONObject res1Object = JSONObject.parseObject(res1);
|
|
@@ -72,28 +72,32 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
List<String> familyPatentNos = new ArrayList<>();
|
|
|
if (patentNoJSON.containsKey("family")) {
|
|
|
String familyJson = patentNoJSON.get("family").toString();
|
|
|
- familyPatentNos = JsonUtils.jsonToList(JsonUtils.objectToJson(familyJson), String.class);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(familyJson);
|
|
|
+ String simpleJson = jsonObject.get("simple").toString();
|
|
|
+ familyPatentNos = JSONArray.parseArray(simpleJson,String.class);
|
|
|
}
|
|
|
LambdaQueryWrapper<CompareFiles> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
//根据报告id 获取文件对比表的详情
|
|
|
- queryWrapper.eq(CompareFiles::getReportId, compareFilesVO.getReportId());
|
|
|
+ queryWrapper.eq(CompareFiles::getReportId, patentVO.getReportId());
|
|
|
List<CompareFiles> compareFile1 = this.list(queryWrapper);
|
|
|
//获取对比文件对比表的专利号
|
|
|
List<String> patentNoList = compareFile1.stream().map(CompareFiles::getPatentNo).collect(Collectors.toList());
|
|
|
List<CompareFiles> compareFiles = new ArrayList<>();
|
|
|
- PatentVO patentVO = new PatentVO();
|
|
|
- patentVO.setStartNumber(compareFilesVO.getStartNumber() - 1);
|
|
|
- patentVO.setEndNumber(compareFilesVO.getEndNumber());
|
|
|
- patentVO.setReportId(compareFilesVO.getReportId());
|
|
|
- patentVO.setPatentNos(patentNoList);
|
|
|
- // 见outInterfaceService getComPatentNos接口
|
|
|
- String res = outInterfaceService.getComPatentNos(patentVO);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
- List<String> patentNos = JSONArray.parseArray(jsonObject.get("data").toString(), String.class);
|
|
|
+ patentVO.setNotInPatentNos(patentNoList);
|
|
|
+
|
|
|
+ List<String> patentNos =new ArrayList<>();
|
|
|
+ if(patentVO.getStartNumber()<=patentVO.getEndNumber()){
|
|
|
+ // 见outInterfaceService getComPatentNos接口
|
|
|
+ patentVO.setStartNumber(patentVO.getStartNumber()-1);
|
|
|
+ patentVO.setEndNumber(patentVO.getEndNumber()-patentVO.getStartNumber());
|
|
|
+ String res = outInterfaceService.getComPatentNos(patentVO);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
+ patentNos = JSONArray.parseArray(jsonObject.get("data").toString(), String.class);
|
|
|
+ }
|
|
|
//删除原有的
|
|
|
- patentNos.removeAll(compareFilesVO.getIsDelete());
|
|
|
+ patentNos.removeAll(patentVO.getIsDelete());
|
|
|
//添加新的
|
|
|
- patentNos.addAll(compareFilesVO.getIsAdd());
|
|
|
+ patentNos.addAll(patentVO.getIsAdd());
|
|
|
//获取对比文件对比表的专利号
|
|
|
patentNos.removeAll(patentNoList);
|
|
|
List<String> flags =new ArrayList<>();
|
|
@@ -102,7 +106,7 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
if(!flags.contains(patentNos.get(i))){
|
|
|
//根据专利号和报告id造对象
|
|
|
compareFiles1.setPatentNo(patentNos.get(i));
|
|
|
- compareFiles1.setReportId(compareFilesVO.getReportId());
|
|
|
+ compareFiles1.setReportId(patentVO.getReportId());
|
|
|
//区分对比文件的类型
|
|
|
if (familyPatentNos != null && quotes.size() != 0 && quotes.contains(patentNos.get(i))) {
|
|
|
compareFiles1.setRemark("引");
|
|
@@ -315,9 +319,9 @@ else if(patentVO.getOrderItem()!=null&&patentVO.getOrderItem().equals("SysOrder"
|
|
|
if (compareFilesVO.getStartNumber() != null && compareFilesVO.getEndNumber() != null && compareFilesVO.getEndNumber() > compareFilesVO.getStartNumber()) {
|
|
|
LambdaQueryWrapper<CompareFiles> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.select(CompareFiles::getPatentNo)
|
|
|
- .eq(CompareFiles::getReportId, compareFilesVO.getReportId())
|
|
|
+ .eq(CompareFiles::getReportId, compareFilesVO.getReportId()).orderByAsc(CompareFiles::getPatentNo)
|
|
|
//分页查询 传的起始条数和结束条数
|
|
|
- .last("limit " + (compareFilesVO.getStartNumber() - 1) + "," + compareFilesVO.getEndNumber());
|
|
|
+ .last("limit " + (compareFilesVO.getStartNumber() - 1) + "," + (compareFilesVO.getEndNumber()-compareFilesVO.getStartNumber()+1));
|
|
|
patentNos = this.list(wrapper).stream().map(CompareFiles::getPatentNo).collect(Collectors.toList());
|
|
|
}
|
|
|
//减少的专利号
|