|
@@ -19,6 +19,7 @@ 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;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -261,24 +262,38 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
|
|
|
|
|
|
//返回任务专利清单
|
|
//返回任务专利清单
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public String reTaskPatents(TaskVO taskVo) throws ParseException, IOException {
|
|
|
|
|
|
+ public String reTaskPatents(PatentVO patentVO) throws ParseException, IOException {
|
|
|
|
+
|
|
//根据任务Id和类型获得任务的清单
|
|
//根据任务Id和类型获得任务的清单
|
|
LambdaQueryWrapper<AssoTaskPersonel> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<AssoTaskPersonel> queryWrapper = new LambdaQueryWrapper<>();
|
|
- queryWrapper.eq(AssoTaskPersonel::getTaskId, taskVo.getTaskId());
|
|
|
|
- queryWrapper.eq(AssoTaskPersonel::getState,taskVo.getTaskStatus());
|
|
|
|
|
|
+ queryWrapper.eq(AssoTaskPersonel::getTaskId, patentVO.getTaskId());
|
|
|
|
+ if(patentVO.getTaskStatus()!=3){
|
|
|
|
+ queryWrapper.eq(AssoTaskPersonel::getState, patentVO.getTaskStatus());}
|
|
List<AssoTaskPersonel> assoTaskPersonels = assoTaskPersonelService.list(queryWrapper);
|
|
List<AssoTaskPersonel> assoTaskPersonels = assoTaskPersonelService.list(queryWrapper);
|
|
- List<String> PatentNos =assoTaskPersonels.stream().filter(item->item.getState()==taskVo.getTaskStatus()).map(AssoTaskPersonel::getPatentNo).collect(Collectors.toList());
|
|
|
|
- //根据清单获得获得专利详情
|
|
|
|
- PatentVO patentVO =new PatentVO();
|
|
|
|
- patentVO.setPatentNos(PatentNos);
|
|
|
|
- patentVO.setSize(taskVo.getSize());
|
|
|
|
- patentVO.setCurrent(taskVo.getCurrent());
|
|
|
|
|
|
+ List<String> taskPatentNos =new ArrayList<>();
|
|
|
|
+ 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());
|
|
|
|
+ }
|
|
|
|
+ //无查询条件
|
|
|
|
+ if(patentVO.getFiledOptions().size()==0|| patentVO.getFiledOptions()==null) {
|
|
|
|
+ patentVO.setPatentNos(taskPatentNos);
|
|
|
|
+ }
|
|
|
|
+ //有查询条件时,自定义字段的专利号和任务的专利号取交集
|
|
|
|
+ else {
|
|
|
|
+ List<String> patentNos= reportFieldService.getPatentNo(patentVO.getFiledOptions());
|
|
|
|
+ List<String> jiaoList = new ArrayList<>(taskPatentNos);
|
|
|
|
+ jiaoList.retainAll(patentNos);
|
|
|
|
+ patentVO.setPatentNos(jiaoList);
|
|
|
|
+ }
|
|
String res = outInterfaceService.getPatentFromPAS(patentVO, 1);
|
|
String res = outInterfaceService.getPatentFromPAS(patentVO, 1);
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
JSONObject jsonObject1= JSONObject.parseObject(jsonObject.get("data").toString()) ;
|
|
JSONObject jsonObject1= JSONObject.parseObject(jsonObject.get("data").toString()) ;
|
|
List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
|
|
List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
|
|
for (int i =0;i<jsonObjects.size();i++)
|
|
for (int i =0;i<jsonObjects.size();i++)
|
|
- { jsonObjects.get(i).put("field", reportFieldService.getPatentFieldByPatentIdAndProjectId(taskVo.getReportId(), jsonObjects.get(i).getString("patentNo")));
|
|
|
|
|
|
+ { jsonObjects.get(i).put("field", reportFieldService.getPatentFieldByPatentIdAndProjectId(patentVO.getReportId(), jsonObjects.get(i).getString("patentNo")));
|
|
}
|
|
}
|
|
jsonObject1.put("records",jsonObjects);
|
|
jsonObject1.put("records",jsonObjects);
|
|
jsonObject.put("data",jsonObject1);
|
|
jsonObject.put("data",jsonObject1);
|