|
@@ -1326,28 +1326,81 @@ public String getComPantentNos(PatentVO params){
|
|
|
return Response.success(patentNos);
|
|
|
}
|
|
|
public String getPagination(List<String> list,int location){
|
|
|
-
|
|
|
- int totalNumber=patentMapper.getPatentNumber(list);
|
|
|
- if(location>totalNumber){
|
|
|
+ Map map=new HashMap();
|
|
|
+ LambdaQueryWrapper<Patent> wrapper =new LambdaQueryWrapper<>();
|
|
|
+ wrapper.in(Patent::getPatentNo,list);
|
|
|
+ Integer totalNumber = Math.toIntExact(this.count(wrapper));
|
|
|
+ if(location>=totalNumber){
|
|
|
location=totalNumber;
|
|
|
+ int a=location-2;
|
|
|
+ int b=2;
|
|
|
+ List<Patent> patent = patentMapper.getPatent(list, a, b);
|
|
|
+ int front=location-1;
|
|
|
+ String str1 =patent.get(0).getPatentNo();
|
|
|
+ String srr2= patent.get(1).getPatentNo();
|
|
|
+ int i=patent.get(0).getId();
|
|
|
+ int j=patent.get(1).getId();
|
|
|
+ map.put("frontID",i);
|
|
|
+ map.put("currentID",j);
|
|
|
+ map.put("behindPatentNo",null);
|
|
|
+ map.put("frontNumber",front);
|
|
|
+ map.put("behindNumber",0);
|
|
|
+ map.put("frontPatentNo",str1);
|
|
|
+ map.put("currentPatentNo",srr2);
|
|
|
+ map.put("totalNumber",totalNumber);
|
|
|
+ return Response.success(map);
|
|
|
+
|
|
|
}
|
|
|
- int n=location-2;
|
|
|
- if(n<0){
|
|
|
- n=0;
|
|
|
+ if(location==1){
|
|
|
+ int a=0;
|
|
|
+ int p=2;
|
|
|
+ List<Patent> patent = patentMapper.getPatent(list, a, p);
|
|
|
+ String str1 =patent.get(0).getPatentNo();
|
|
|
+ String srr2= patent.get(1).getPatentNo();
|
|
|
+ int i=patent.get(0).getId();
|
|
|
+ int j=patent.get(1).getId();
|
|
|
+ map.put("currentID",i);
|
|
|
+ map.put("behindID",j);
|
|
|
+ map.put("currentPatentNo",str1);
|
|
|
+ map.put("behindPatentNo",srr2);
|
|
|
+ map.put("frontPatentNo",null);
|
|
|
+
|
|
|
+ map.put("frontNumber",0);
|
|
|
+ int behindNumber=totalNumber-location;
|
|
|
+ map.put("behindNumber",behindNumber);
|
|
|
+ map.put("totalNumber",totalNumber);
|
|
|
+ return Response.success(map);
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ int a=location-2;
|
|
|
int p=3;
|
|
|
- List<Patent> patent = patentMapper.getPatent(list, n, p);
|
|
|
+ List<Patent> patent = patentMapper.getPatent(list, a, p);
|
|
|
+ String str1 =patent.get(0).getPatentNo();
|
|
|
+ String str2 =patent.get(1).getPatentNo();
|
|
|
+ String str3 =patent.get(2).getPatentNo();
|
|
|
+ int i=patent.get(0).getId();
|
|
|
+ int j=patent.get(1).getId();
|
|
|
+ int k=patent.get(2).getId();
|
|
|
+ map.put("frontID",i);
|
|
|
+ map.put("currentID",j);
|
|
|
+ map.put("behindID",k);
|
|
|
+
|
|
|
+// List next=new ArrayList();
|
|
|
+// Map map1=new HashMap();
|
|
|
+// map1.put("total",totalNumber);
|
|
|
+// map1.put("behindPatentNo",str3);
|
|
|
+// next.add(map1);
|
|
|
+// map.put("next",next);
|
|
|
+ map.put("frontPatentNo",str1);
|
|
|
+ map.put("totalNumber",totalNumber);
|
|
|
+ map.put("currentPatentNo",str2);
|
|
|
+ map.put("behindPatentNo",str3);
|
|
|
+ int behindNumber=totalNumber-location;
|
|
|
int front=location-1;
|
|
|
- int behind=totalNumber-location;
|
|
|
- Map map=new HashMap();
|
|
|
+ map.put("behindNumber",behindNumber);
|
|
|
map.put("frontNumber",front);
|
|
|
- map.put("behindNumber",behind);
|
|
|
- map.put("totalNumber",totalNumber);
|
|
|
- map.put("Patent",patent);
|
|
|
- return Response.success(map);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ return Response.success(map);
|
|
|
|
|
|
}
|
|
|
|