|
@@ -465,55 +465,6 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
|
|
|
return Response.success();
|
|
|
}
|
|
|
|
|
|
- //返回任务专利清单
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public String reTaskPatents(PatentVO patentVO) throws ParseException, IOException {
|
|
|
- List<String> taskPatentNos = new ArrayList<>();
|
|
|
- //根据报告Id和类型获得任务的清单
|
|
|
- LambdaQueryWrapper<AssoTaskPersonel> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(AssoTaskPersonel::getReportId, patentVO.getReportId());
|
|
|
- //当taskID存在时
|
|
|
- if (patentVO.getTaskId() != null) {
|
|
|
- queryWrapper.eq(AssoTaskPersonel::getTaskId, patentVO.getTaskId());
|
|
|
- if (patentVO.getTaskStatus() != 3) {
|
|
|
- queryWrapper.eq(AssoTaskPersonel::getState, patentVO.getTaskStatus());
|
|
|
- }
|
|
|
- List<AssoTaskPersonel> assoTaskPersonels = assoTaskPersonelService.list(queryWrapper);
|
|
|
- if (patentVO.getTaskStatus() != 3) {
|
|
|
- taskPatentNos = assoTaskPersonels.stream().filter(item -> item.getState() == patentVO.getTaskStatus()).map(AssoTaskPersonel::getPatentNo).collect(Collectors.toList());
|
|
|
- } else {
|
|
|
- taskPatentNos = assoTaskPersonels.stream().map(AssoTaskPersonel::getPatentNo).collect(Collectors.toList());
|
|
|
- }
|
|
|
- }
|
|
|
- //当taskId不存在时
|
|
|
- else {
|
|
|
- List<AssoTaskPersonel> assoTaskPersonels = assoTaskPersonelService.list(queryWrapper);
|
|
|
- taskPatentNos = assoTaskPersonels.stream().map(AssoTaskPersonel::getPatentNo).collect(Collectors.toList());
|
|
|
- }
|
|
|
- //无查询条件
|
|
|
- if (patentVO.getFiledOptions().size() == 0 || patentVO.getFiledOptions() == null) {
|
|
|
- patentVO.setPatentNos(taskPatentNos);
|
|
|
- }
|
|
|
- //有查询条件时,自定义字段的专利号和任务的专利号取交集
|
|
|
- else {
|
|
|
- List<String> patentNos = reportFieldService.getPatentNo(patentVO.getFiledOptions(), taskPatentNos);
|
|
|
- List<String> jiaoList = new ArrayList<>(taskPatentNos);
|
|
|
- jiaoList.retainAll(patentNos);
|
|
|
- patentVO.setPatentNos(jiaoList);
|
|
|
- }
|
|
|
- String res = outInterfaceService.getPatentFromPAS(patentVO, 1);
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
- JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
|
|
|
- List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
|
|
|
- for (int i = 0; i < jsonObjects.size(); i++) {
|
|
|
- jsonObjects.get(i).put("field", reportFieldService.getPatentFieldByPatentIdAndProjectId(patentVO.getReportId(), jsonObjects.get(i).getString("patentNo")));
|
|
|
- }
|
|
|
- jsonObject1.put("records", jsonObjects);
|
|
|
- jsonObject.put("data", jsonObject1);
|
|
|
-
|
|
|
-
|
|
|
- return jsonObject.toString();
|
|
|
- }
|
|
|
|
|
|
//返回任务专利清单
|
|
|
@Transactional(rollbackFor = Exception.class)
|