|
@@ -37,6 +37,7 @@ import java.util.stream.Collectors;
|
|
|
public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper, AssoTaskPersonel> {
|
|
|
private final AssoTaskPersonelMapper assoTaskPersonelMapper;
|
|
|
private final OutInterfaceService outInterfaceService;
|
|
|
+ private final ReportFieldService reportFieldService;
|
|
|
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
|
|
@Value("${PCSUrl}")
|
|
|
private String PCSUrl;
|
|
@@ -89,110 +90,67 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
//专利号
|
|
|
patentNumber = list.stream().map(AssoTaskPersonel::getPatentNo).collect(Collectors.toList());
|
|
|
}
|
|
|
+ if(patentVO.getFiledOptions()!=null&&patentVO.getFiledOptions().size()>0) {
|
|
|
+ patentNumber = reportFieldService.getPatentNo1(patentVO.getFiledOptions(), patentVO.getReportId(), patentVO.getTaskId(), patentVO.getTaskStatus());
|
|
|
+ }
|
|
|
|
|
|
patentVO.setPatentNos(patentNumber);
|
|
|
-
|
|
|
-
|
|
|
+ String resNum = outInterfaceService.getConPantents(patentVO, 1);
|
|
|
+ JSONObject jsonObjectNum = JSONObject.parseObject(resNum);
|
|
|
+ List<JSONObject> jsonObjectNums = JSONArray.parseArray(jsonObjectNum.get("data").toString(), JSONObject.class);
|
|
|
+ Integer totalNumber = jsonObjectNums.size();
|
|
|
if (patentVO.getLocPosition() == 1) {
|
|
|
- patentVO.setStartNumber(0);
|
|
|
- patentVO.setEndNumber(1);
|
|
|
- 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);
|
|
|
- List<Patents> list = new ArrayList<>();
|
|
|
-
|
|
|
- for (JSONObject obj : jsonObjects) {
|
|
|
-
|
|
|
- Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
- list.add(patent);
|
|
|
-
|
|
|
- }
|
|
|
- if (list.size() == 0) {
|
|
|
-
|
|
|
- return Response.success();
|
|
|
- }
|
|
|
-
|
|
|
- if (list.size() == 1) {
|
|
|
- map.put("currentID", list.get(0).getId());
|
|
|
- map.put("behindID", null);
|
|
|
- map.put("frontID", null);
|
|
|
- map.put("totalNumber", list.size());
|
|
|
- map.put("frontPatentNo", null);
|
|
|
- map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
- map.put("behindPatentNo", null);
|
|
|
- map.put("frontNumber", 0);
|
|
|
- map.put("behindNumber", 0);
|
|
|
- return Response.success(map);
|
|
|
-
|
|
|
- }
|
|
|
- jsonObject1.put("type", "first");
|
|
|
- map.put("currentID", list.get(0).getId());
|
|
|
- map.put("behindID", list.get(1).getId());
|
|
|
- map.put("frontID", null);
|
|
|
- map.put("totalNumber", list.size());
|
|
|
- map.put("frontNumber", 0);
|
|
|
- map.put("behindNumber", list.size() - 1);
|
|
|
- map.put("location", 1);
|
|
|
- map.put("frontPatentNo", null);
|
|
|
- map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
- map.put("behindPatentNo", list.get(1).getPatentNo());
|
|
|
- return Response.success(map);
|
|
|
+ patentVO.setStartNumber(patentVO.getLocPosition() - 1);
|
|
|
+ patentVO.setEndNumber(patentVO.getLocPosition());
|
|
|
+ } else if (patentVO.getLocPosition() >= totalNumber) {
|
|
|
+ patentVO.setStartNumber(patentVO.getLocPosition() - 2);
|
|
|
+ patentVO.setEndNumber(patentVO.getLocPosition() - 1);
|
|
|
} else {
|
|
|
patentVO.setStartNumber(patentVO.getLocPosition() - 2);
|
|
|
patentVO.setEndNumber(patentVO.getLocPosition());
|
|
|
- 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);
|
|
|
- List<Patents> list = new ArrayList<>();
|
|
|
- for (JSONObject obj : jsonObjects) {
|
|
|
- Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
- list.add(patent);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (list.size() == 1) {
|
|
|
- map.put("currentID", list.get(0).getId());
|
|
|
- map.put("behindID", null);
|
|
|
- map.put("frontID", null);
|
|
|
- map.put("totalNumber", list.size());
|
|
|
- map.put("frontPatentNo", null);
|
|
|
- map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
+ }
|
|
|
+ String res = outInterfaceService.getConPantents(patentVO, 1);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
+ List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject.get("data").toString(), JSONObject.class);
|
|
|
+ List<Patents> list = new ArrayList<>();
|
|
|
+ for (JSONObject obj : jsonObjects) {
|
|
|
+ Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
+ list.add(patent);
|
|
|
+ }
|
|
|
+ map.put("totalNumber", totalNumber);
|
|
|
+ map.put("frontNumber", patentVO.getLocPosition()-1);
|
|
|
+ map.put("behindNumber", totalNumber-patentVO.getLocPosition());
|
|
|
+ if (patentVO.getLocPosition() == 1) {
|
|
|
+ map.put("currentID", list.get(0).getId());
|
|
|
+ map.put("currentPatentNo", list.get(0).getPatentNo());
|
|
|
+ map.put("frontPatentNo", null);
|
|
|
+ map.put("frontID", null);
|
|
|
+ if(list.size()==1) {
|
|
|
map.put("behindPatentNo", null);
|
|
|
- map.put("frontNumber", 0);
|
|
|
- map.put("behindNumber", 0);
|
|
|
- return Response.success(map);
|
|
|
-
|
|
|
- }
|
|
|
- if (patentVO.getLocPosition() >= list.size()) {
|
|
|
- map.put("currentID", list.get(list.size() - 1).getId());
|
|
|
map.put("behindID", null);
|
|
|
- map.put("frontID", list.get(list.size() - 2).getId());
|
|
|
- map.put("totalNumber", list.size());
|
|
|
- map.put("frontNumber", list.size() - 1);
|
|
|
- map.put("behindNumber", 0);
|
|
|
- map.put("location", list.size());
|
|
|
- map.put("frontPatentNo", list.get(list.size() - 2).getPatentNo());
|
|
|
- map.put("currentPatentNo", list.get(list.size() - 1).getPatentNo());
|
|
|
- map.put("behindPatentNo", null);
|
|
|
- return Response.success(map);
|
|
|
}
|
|
|
- map.put("currentID", list.get(patentVO.getLocPosition() - 1).getId());
|
|
|
- map.put("behindID", list.get(patentVO.getLocPosition()).getId());
|
|
|
- map.put("frontID", list.get(patentVO.getLocPosition() - 2).getId());
|
|
|
- map.put("totalNumber", list.size());
|
|
|
- map.put("frontNumber", patentVO.getLocPosition() - 1);
|
|
|
- map.put("behindNumber", list.size() - patentVO.getLocPosition());
|
|
|
- map.put("location", patentVO.getLocPosition());
|
|
|
- map.put("frontPatentNo", list.get(patentVO.getLocPosition() - 2).getPatentNo());
|
|
|
- map.put("currentPatentNo", list.get(patentVO.getLocPosition() - 1).getPatentNo());
|
|
|
- map.put("behindPatentNo", list.get(patentVO.getLocPosition()).getPatentNo());
|
|
|
+ else {
|
|
|
+ map.put("behindPatentNo", list.get(1).getPatentNo());
|
|
|
+ map.put("behindID", list.get(1).getId());
|
|
|
+ }
|
|
|
return Response.success(map);
|
|
|
-
|
|
|
-
|
|
|
+ } else if (patentVO.getLocPosition() >= totalNumber) {
|
|
|
+ map.put("currentID", list.get(1).getId());
|
|
|
+ map.put("currentPatentNo", list.get(1).getPatentNo());
|
|
|
+ map.put("frontPatentNo", list.get(0).getPatentNo());
|
|
|
+ map.put("frontID", list.get(0).getId());
|
|
|
+ map.put("behindPatentNo", null);
|
|
|
+ map.put("behindID", null);
|
|
|
+ return Response.success(map);
|
|
|
+ } else {
|
|
|
+ map.put("currentID", list.get(1).getId());
|
|
|
+ map.put("currentPatentNo", list.get(1).getPatentNo());
|
|
|
+ map.put("frontPatentNo", list.get(0).getPatentNo());
|
|
|
+ map.put("frontID", list.get(0).getId());
|
|
|
+ map.put("behindPatentNo", list.get(2).getPatentNo());
|
|
|
+ map.put("behindID", list.get(2).getId());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ return Response.success(map);
|
|
|
}
|
|
|
+
|
|
|
}
|