|
@@ -66,6 +66,25 @@ public class MatrixPushByWpService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static <T> List<List<T>> splitList(List<T> list, int len) {
|
|
|
+
|
|
|
+ if (list == null || list.isEmpty() || len < 1) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<List<T>> result = new ArrayList<>();
|
|
|
+
|
|
|
+ int size = list.size();
|
|
|
+ int count = (size + len - 1) / len;
|
|
|
+
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
+ List<T> subList = list.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1)));
|
|
|
+ result.add(subList);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 风场矩阵
|
|
|
*
|
|
@@ -131,9 +150,43 @@ public class MatrixPushByWpService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
|
|
|
- List<PointData> zlptlist = realApiUtil.getRealData(zlpointcodes);
|
|
|
-
|
|
|
+// List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
|
|
|
+// List<PointData> ptlist = new ArrayList<>();
|
|
|
+// List<List<String>> list = splitList(pointcodes, 500);
|
|
|
+// list.stream().forEach(i->{
|
|
|
+// try {
|
|
|
+// ptlist.addAll(realApiUtil.getRealData(i));
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// });
|
|
|
+ List<PointData> ptlist = new ArrayList<>();
|
|
|
+//
|
|
|
+ pointcodes.stream().forEach(point->{
|
|
|
+ try {
|
|
|
+ ptlist.add(realApiUtil.getRealData(point));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+// List<PointData> zlptlist = realApiUtil.getRealData(zlpointcodes);
|
|
|
+ List<PointData> zlptlist = new ArrayList<>();
|
|
|
+// List<List<String>> list1 = splitList(zlpointcodes, 500);
|
|
|
+// list1.stream().forEach(i->{
|
|
|
+// try {
|
|
|
+// zlptlist.addAll(realApiUtil.getRealData(i));
|
|
|
+// } catch (Exception e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// });
|
|
|
+ zlpointcodes.stream().forEach(point->{
|
|
|
+ try {
|
|
|
+ zlptlist.add(realApiUtil.getRealData(point));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
int zlnumber=0;
|
|
|
if (!ptlist.isEmpty() && ptlist.size() == pointcodes.size()) {
|