|
@@ -1,6 +1,7 @@
|
|
|
package cn.cslg.report.service.business;
|
|
|
|
|
|
|
|
|
+import cn.cslg.report.common.model.delete.Patents;
|
|
|
import cn.cslg.report.common.model.vo.PatentVO;
|
|
|
import cn.cslg.report.common.utils.Response;
|
|
|
|
|
@@ -17,9 +18,6 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import okhttp3.MediaType;
|
|
|
-import okhttp3.OkHttpClient;
|
|
|
-import okhttp3.Request;
|
|
|
-import okhttp3.RequestBody;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
@@ -43,6 +41,9 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
private String PCSUrl;
|
|
|
@Value("${PASUrl}")
|
|
|
private String PASUrl;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public void test(){}
|
|
|
|
|
|
/**
|
|
@@ -64,13 +65,12 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
* @param state 状态 1已读 0 未读 3 全部
|
|
|
* @param taskId 任务id
|
|
|
* @param location 该条专利位置
|
|
|
- * @return 专利号
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public String pagination(PatentVO patentVO)throws IOException {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
List<String> patentNumber = new ArrayList<>();
|
|
|
- if (patentVO.getState() == 3) {
|
|
|
+ if (patentVO.getTaskStatus().equals(3)) {
|
|
|
//3类型包括1和2
|
|
|
LambdaQueryWrapper<AssoTaskPersonel> wrappers = new LambdaQueryWrapper();
|
|
|
wrappers.eq(AssoTaskPersonel::getTaskId, patentVO.getTaskId());
|
|
@@ -88,6 +88,7 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
|
|
|
patentVO.setPatentNos(patentNumber);
|
|
|
|
|
|
+
|
|
|
if (patentVO.getLocPosition() <= 1) {
|
|
|
patentVO.setStartNumber(0);
|
|
|
patentVO.setEndNumber(1);
|
|
@@ -95,7 +96,39 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
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());
|
|
|
+ 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);
|
|
|
} else {
|
|
|
patentVO.setStartNumber(patentVO.getLocPosition() - 2);
|
|
|
patentVO.setEndNumber(patentVO.getLocPosition());
|
|
@@ -103,15 +136,54 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
|
|
|
List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
|
|
|
- if (jsonObjects.size() < 3) {
|
|
|
+ List<Patents> list= new ArrayList<>();
|
|
|
+ for(JSONObject obj:jsonObjects){
|
|
|
+ Patents patent = obj.toJavaObject(obj, Patents.class);
|
|
|
+ list.add(patent);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- jsonObject1.put("type", "end");
|
|
|
+ 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);
|
|
|
|
|
|
- } else {
|
|
|
- jsonObject1.put("type", "normal");
|
|
|
}
|
|
|
- return "11";
|
|
|
+ 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());
|
|
|
+ return Response.success(map);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- return "11"; }
|
|
|
+
|
|
|
+ }
|
|
|
}
|