|
@@ -1,16 +1,12 @@
|
|
|
package cn.cslg.report.service.business;
|
|
|
-
|
|
|
-import cn.cslg.report.common.core.base.Constants;
|
|
|
import cn.cslg.report.common.model.dto.CustomFieldLabelDTO;
|
|
|
-import cn.cslg.report.common.model.dto.PatentQueryFieldSourceDTO;
|
|
|
+
|
|
|
import cn.cslg.report.common.model.vo.CompareFilesVO;
|
|
|
import cn.cslg.report.common.model.vo.PatentIndexSettingVO;
|
|
|
-import cn.cslg.report.common.model.vo.PatentQueryFieldSourceVO;
|
|
|
-import cn.cslg.report.common.model.vo.PatentVO;
|
|
|
|
|
|
+import cn.cslg.report.common.model.vo.PatentVO;
|
|
|
import cn.cslg.report.common.utils.JsonUtils;
|
|
|
import cn.cslg.report.common.utils.Response;
|
|
|
-import cn.cslg.report.common.utils.StringUtils;
|
|
|
import cn.cslg.report.entity.*;
|
|
|
import cn.cslg.report.entity.asso.AssoTaskPersonel;
|
|
|
import cn.cslg.report.mapper.CompareFilesMapper;
|
|
@@ -18,20 +14,14 @@ import cn.cslg.report.service.OutInterfaceService;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
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.extern.slf4j.Slf4j;
|
|
|
-
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import java.io.IOException;
|
|
|
-
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
@SuppressWarnings({"all"})
|
|
@@ -56,6 +46,7 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
Report report = reportService.getById(compareFilesVO.getReportId());
|
|
|
//根据标的专利号获得专利信息
|
|
|
String res1 = outInterfaceService.getPatentFromPAS( report.getSignPatentNo());
|
|
|
+
|
|
|
JSONObject res1Object = JSONObject.parseObject(res1);
|
|
|
JSONObject patentNoJSON = JSONObject.parseObject(res1Object.get("data").toString());
|
|
|
//获得引用专利号
|
|
@@ -68,8 +59,10 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
familyPatentNos = JsonUtils.jsonToList(JsonUtils.objectToJson(familyJson), String.class);
|
|
|
}
|
|
|
LambdaQueryWrapper<CompareFiles> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //根据报告id 获取文件对比表的详情
|
|
|
queryWrapper.eq(CompareFiles::getReportId, compareFilesVO.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();
|
|
@@ -77,48 +70,63 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
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);
|
|
|
+ //删除原有的
|
|
|
patentNos.removeAll(compareFilesVO.getIsDelete());
|
|
|
+ //添加新的
|
|
|
patentNos.addAll(compareFilesVO.getIsAdd());
|
|
|
+ //获取对比文件对比表的专利号
|
|
|
patentNos.removeAll(patentNoList);
|
|
|
for(int i=0;i<patentNos.size();i++){
|
|
|
CompareFiles compareFiles1 = new CompareFiles();
|
|
|
+ //根据专利号和报告id造对象
|
|
|
compareFiles1.setPatentNo(patentNos.get(i));
|
|
|
compareFiles1.setReportId(compareFilesVO.getReportId());
|
|
|
+ //区分对比文件的类型
|
|
|
if (familyPatentNos != null&"es.size() != 0 && quotes.contains(patentNos.get(i))) {
|
|
|
compareFiles1.setRemark("引");
|
|
|
}
|
|
|
if (familyPatentNos != null&&familyPatentNos.size() != 0 && familyPatentNos.contains(patentNos.get(i))) {
|
|
|
compareFiles1.setRemark("同");
|
|
|
}
|
|
|
+
|
|
|
compareFiles.add(compareFiles1);
|
|
|
}
|
|
|
-
|
|
|
+ // 批量添加
|
|
|
this.saveBatch(compareFiles);
|
|
|
return Response.success();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public String getCompareFile(PatentVO patentVO) throws IOException {
|
|
|
LambdaQueryWrapper<CompareFiles> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(CompareFiles::getReportId, patentVO.getReportId());
|
|
|
-
|
|
|
+ //根据报告id 获取文件对比表的详情
|
|
|
List<CompareFiles> compareFiles = this.list(queryWrapper);
|
|
|
+ //获取文件对比表的详情的专利号
|
|
|
List<String> patentNos = compareFiles.stream().map(CompareFiles::getPatentNo).collect(Collectors.toList());
|
|
|
String res;
|
|
|
+ //1 代表已读
|
|
|
if (patentVO.getState() == 1) {
|
|
|
patentVO.setPatentNos(patentNos);
|
|
|
+ //详情见outInterfaceService.getPatentFromPAS
|
|
|
res = outInterfaceService.getPatentFromPAS(patentVO, 1);
|
|
|
|
|
|
} else {
|
|
|
+ //根据标的专利号和报告id找到报告
|
|
|
LambdaQueryWrapper<Report> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
wrapper1.select(Report::getSignPatentNo);
|
|
|
wrapper1.eq(Report::getId, patentVO.getReportId());
|
|
|
+ //获取标的专利号
|
|
|
+ if(reportService.list(wrapper1).size()==0){
|
|
|
+ return "";
|
|
|
+ }
|
|
|
String signPatentNO = reportService.list(wrapper1).get(0).getSignPatentNo();
|
|
|
patentNos.add(signPatentNO);
|
|
|
patentVO.setNotInPatentNos(patentNos);
|
|
|
+ //详情见outInterfaceService.getPatentFromPAS
|
|
|
res = outInterfaceService.getPatentFromPAS(patentVO, 0);
|
|
|
|
|
|
}
|
|
@@ -127,11 +135,13 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
List<JSONObject> list = JSONArray.parseArray(resData.getString("records"), JSONObject.class);
|
|
|
List<String> temNos = new ArrayList<>();
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
+ //查到专利的专利号在标的内拿到
|
|
|
if (patentNos.contains(list.get(i).get("patentNo").toString())) {
|
|
|
temNos.add(list.get(i).get("patentNo").toString());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ //根据报告id获取对比文件的数量
|
|
|
int i = compareFilesMapper.selectedTotal(patentVO.getReportId());
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("datas", resData);
|
|
@@ -198,17 +208,22 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
LambdaQueryWrapper<CompareFiles> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.select(CompareFiles::getPatentNo)
|
|
|
.eq(CompareFiles::getReportId, compareFilesVO.getReportId())
|
|
|
+ //分页查询 传的起始条数和结束条数
|
|
|
.last("limit" + (compareFilesVO.getStartNumber() - 1) + "," + compareFilesVO.getEndNumber());
|
|
|
patentNos = this.list(wrapper).stream().map(CompareFiles::getPatentNo).collect(Collectors.toList());
|
|
|
}
|
|
|
+ //减少的专利号
|
|
|
if (compareFilesVO.getIsDelete() != null) {
|
|
|
patentNos.removeAll(compareFilesVO.getIsDelete());
|
|
|
}
|
|
|
+ //增加的专利号
|
|
|
if (compareFilesVO.getIsAdd() != null) {
|
|
|
patentNos.addAll(compareFilesVO.getIsAdd());
|
|
|
}
|
|
|
+ //根据专利号删除
|
|
|
if (patentNos.size() != 0) {
|
|
|
LambdaQueryWrapper<CompareFiles> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+
|
|
|
lambdaQueryWrapper.in(CompareFiles::getPatentNo, patentNos);
|
|
|
this.remove(lambdaQueryWrapper);
|
|
|
}
|
|
@@ -223,9 +238,8 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
|
|
|
public List<CustomFieldLabelDTO> setAll(Integer reportId, String patentNos) throws IOException{
|
|
|
List<CustomFieldLabelDTO> dataList = new ArrayList<>();
|
|
|
+ //根据报告id找到对比文件
|
|
|
List<ReportField> reportFields = reportFieldService.selectAll(reportId);
|
|
|
-
|
|
|
-
|
|
|
for(ReportField reportField:reportFields) {
|
|
|
PatentIndexSettingVO params = new PatentIndexSettingVO();
|
|
|
CustomFieldLabelDTO data = new CustomFieldLabelDTO();
|
|
@@ -236,9 +250,9 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
data.setName(reportField.getName());
|
|
|
data.setId(reportField.getId());
|
|
|
data.setType(reportField.getType());
|
|
|
+ //详细见reportFieldPatentLinkService getPatentIndexSetting方法
|
|
|
data.setSelected(reportFieldPatentLinkService.getPatentIndexSetting(params));
|
|
|
dataList.add(data);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
return dataList;
|
|
@@ -249,24 +263,21 @@ public class CompareFilesService extends ServiceImpl<CompareFilesMapper, Compare
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void getPatentIndexSetting(PatentIndexSettingVO params)throws IOException {
|
|
|
+ //详情见reportFieldPatentLinkService updatePatentIndexSetting方法
|
|
|
reportFieldPatentLinkService.updatePatentIndexSetting(params);
|
|
|
|
|
|
}
|
|
|
- public IPage<PatentQueryFieldSourceDTO> getPatentQuerySourcePageList(PatentQueryFieldSourceVO params) {
|
|
|
- return this.getPatentAttributeSourcePageList(params);
|
|
|
- }
|
|
|
|
|
|
- public IPage<PatentQueryFieldSourceDTO> getPatentAttributeSourcePageList(PatentQueryFieldSourceVO params) {
|
|
|
|
|
|
- return null;
|
|
|
- }
|
|
|
|
|
|
public Map<String, Object> reTaskStateCount(Integer reportId) {
|
|
|
- //根据任务Id和类型获得任务的清单
|
|
|
+ //根据报告id查询对比方案与对比记录关联表的详细
|
|
|
LambdaQueryWrapper<AssoTaskPersonel> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(AssoTaskPersonel::getReportId, reportId);
|
|
|
+
|
|
|
List<AssoTaskPersonel> assoTaskPersonels = assoTaskPersonelService.list(queryWrapper);
|
|
|
LambdaQueryWrapper<CompareFiles> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ //根据报告id查询对比文件的详情
|
|
|
queryWrapper1.eq(CompareFiles::getReportId,reportId);
|
|
|
List<CompareFiles> compareFiles = this.list(queryWrapper1);
|
|
|
Map<String, Object> reMap = new HashMap<>();
|