|
@@ -1208,7 +1208,22 @@ public class WindturbinegoodnessService {
|
|
|
}
|
|
|
lpds.add(ia);
|
|
|
}
|
|
|
- List<InverterAnalysis2> lias2 = lpds.stream().sorted(Comparator.comparing(InverterAnalysis2::getTime)).collect(Collectors.toList());
|
|
|
+ // List<InverterAnalysis2> lias2 = lpds.stream().sorted(Comparator.comparing(InverterAnalysis2::getTime)).collect(Collectors.toList());
|
|
|
+ List<InverterAnalysis2> lias2 = lpds.stream().sorted(Comparator.comparing(ia -> {
|
|
|
+ try {
|
|
|
+ Long pointTime = ia.getTime();
|
|
|
+ Date date = new Date(pointTime * 1000);
|
|
|
+ //将id转换成Long类型
|
|
|
+ Long sortValue = Long.parseLong(wtid);
|
|
|
+ //将sortValue和时间戳拼接成一个Long类型的值
|
|
|
+ String sortKey = sortValue.toString() + String.format("%13d", date.getTime());
|
|
|
+ return Long.parseLong(sortKey);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ })).collect(Collectors.toList());
|
|
|
+
|
|
|
int total = lias2.size();
|
|
|
long offset = (pageNum - 1) * pageSize;
|
|
|
lias2 = lias2.stream().skip(offset).limit(pageSize).collect(Collectors.toList());
|