|
@@ -22,85 +22,19 @@ public class MeterInfoController {
|
|
|
@Resource
|
|
|
GetMeterInfo getMeterInfo;
|
|
|
|
|
|
- @GetMapping("/meterinfo/bottom1")
|
|
|
- public Result<Object> getBottomInfo1(
|
|
|
- @RequestParam(required = false) String windId,
|
|
|
- @RequestParam(required = false) String meterType,
|
|
|
- @RequestParam(required = false) String meterClass,
|
|
|
- @RequestParam(required = false) String name,
|
|
|
- @RequestParam(required = false) long startTime,
|
|
|
- @RequestParam(required = false) long endTime,
|
|
|
- @RequestParam(defaultValue = "1") int page,
|
|
|
- @RequestParam(defaultValue = "25") int perPage
|
|
|
- ) {
|
|
|
- if (windId != null && meterType != null && meterClass != null && name != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null && meterClass != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoByWindId(windId, meterType, meterClass, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoByWindId(windId, meterType, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoByWindId(windId, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- }
|
|
|
- return new Result<>(201, "参数错误", null);
|
|
|
- }
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取根据传入不同参数获取每日底码信息
|
|
|
+ *
|
|
|
+ * @param windId 风场ID
|
|
|
+ * @param meterType 测点一级类型
|
|
|
+ * @param meterClass 测点二级分类
|
|
|
+ * @param name 测点名称
|
|
|
+ * @param startTime 开始时间(时间戳)
|
|
|
+ * @param endTime 结束时间(时间戳)
|
|
|
+ * @param page 第几页
|
|
|
+ * @param perPage 每页几条数据
|
|
|
+ * @return 时间段内的每日底码数据
|
|
|
+ */
|
|
|
@GetMapping("/meterinfo/bottom")
|
|
|
public Result<Object> getBottomInfo(
|
|
|
@RequestParam(required = false) String windId,
|
|
@@ -112,15 +46,12 @@ public class MeterInfoController {
|
|
|
@RequestParam(defaultValue = "1") int page,
|
|
|
@RequestParam(defaultValue = "25") int perPage
|
|
|
) {
|
|
|
-
|
|
|
ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
// 进行分页处理
|
|
|
int totalItems = meterInfoByWindIdList.size();
|
|
|
int startIndex = (page - 1) * perPage;
|
|
|
int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
// 构建响应
|
|
|
Map<String, Object> response = new HashMap<>();
|
|
|
response.put("bottom", paginatedList);
|
|
@@ -128,11 +59,20 @@ public class MeterInfoController {
|
|
|
response.put("page", page);
|
|
|
response.put("perPage", perPage);
|
|
|
return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取风机日发电量
|
|
|
+ *
|
|
|
+ * @param windId 风场ID
|
|
|
+ * @param id 风机ID
|
|
|
+ * @param startTime 开始时间(时间戳)
|
|
|
+ * @param endTime 结束时间(时间戳)
|
|
|
+ * @param page 第几页
|
|
|
+ * @param perPage 每页几条数
|
|
|
+ * @return 时间段内的风机发电量
|
|
|
+ */
|
|
|
@GetMapping("/meterinfo/equipment")
|
|
|
public Result<Object> getEquipmentInfo(
|
|
|
@RequestParam(required = false) String windId,
|
|
@@ -142,52 +82,37 @@ public class MeterInfoController {
|
|
|
@RequestParam(defaultValue = "1") int page,
|
|
|
@RequestParam(defaultValue = "25") int perPage
|
|
|
) {
|
|
|
-
|
|
|
- if (windId != null && id != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getEquipmentInfoByEquipmentId(id, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("equipment", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
- } else if (windId != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getEquipmentInfoByWindId(windId, startTime, endTime);
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("equipment", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- }
|
|
|
-
|
|
|
- return new Result<>(201, "参数错误", null);
|
|
|
+ ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getEquipmentInfoById(windId, id, startTime, endTime);
|
|
|
+ // 进行排序
|
|
|
+ meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
+ // 进行分页处理
|
|
|
+ int totalItems = meterInfoByWindIdList.size();
|
|
|
+ int startIndex = (page - 1) * perPage;
|
|
|
+ int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
+ List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
+ // 构建响应
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+ response.put("equipment", paginatedList);
|
|
|
+ response.put("totalItems", totalItems);
|
|
|
+ response.put("page", page);
|
|
|
+ response.put("perPage", perPage);
|
|
|
+ return new Result<>(200, "成功", response);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取根据传入不同参数获取每日场站指标数据(计算点)
|
|
|
+ *
|
|
|
+ * @param windId 风场ID
|
|
|
+ * @param meterType 测点一级类型
|
|
|
+ * @param meterClass 测点二级分类
|
|
|
+ * @param name 测点名称
|
|
|
+ * @param startTime 开始时间(时间戳)
|
|
|
+ * @param endTime 结束时间(时间戳)
|
|
|
+ * @param page 第几页
|
|
|
+ * @param perPage 每页几条数据
|
|
|
+ * @return 时间段内的每日场站指标数据(计算点)
|
|
|
+ */
|
|
|
@GetMapping("/meterinfo/calculating")
|
|
|
public Result<Object> getCalculatingInfo(
|
|
|
@RequestParam(required = false) String windId,
|
|
@@ -199,90 +124,36 @@ public class MeterInfoController {
|
|
|
@RequestParam(defaultValue = "1") int page,
|
|
|
@RequestParam(defaultValue = "25") int perPage
|
|
|
) {
|
|
|
- if (windId != null && meterType != null && meterClass != null && name != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null && meterClass != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoByWindId(windId, meterType, meterClass, startTime, endTime);
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoByWindId(windId, meterType, startTime, endTime);
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
-
|
|
|
- } else if (windId != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoByWindId(windId, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- }
|
|
|
- return new Result<>(201, "参数错误", null);
|
|
|
+ ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
+ // 进行排序
|
|
|
+ meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
+ // 进行分页处理
|
|
|
+ int totalItems = meterInfoByWindIdList.size();
|
|
|
+ int startIndex = (page - 1) * perPage;
|
|
|
+ int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
+ List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
+ // 构建响应
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+ response.put("calculating", paginatedList);
|
|
|
+ response.put("totalItems", totalItems);
|
|
|
+ response.put("page", page);
|
|
|
+ response.put("perPage", perPage);
|
|
|
+ return new Result<>(200, "成功", response);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取根据传入不同参数获取每月场站指标数据(计算点)
|
|
|
+ *
|
|
|
+ * @param windId 风场ID
|
|
|
+ * @param meterType 测点一级类型
|
|
|
+ * @param meterClass 测点二级分类
|
|
|
+ * @param name 测点名称
|
|
|
+ * @param startTime 开始时间(时间戳)
|
|
|
+ * @param endTime 结束时间(时间戳)
|
|
|
+ * @param page 第几页
|
|
|
+ * @param perPage 每页几条数据
|
|
|
+ * @return 时间段内的每月场站指标数据(计算点)
|
|
|
+ */
|
|
|
@GetMapping("/meterinfo/calculatingMonth")
|
|
|
public Result<Object> getCalculatingInfoMonth(
|
|
|
@RequestParam(required = false) String windId,
|
|
@@ -294,93 +165,34 @@ public class MeterInfoController {
|
|
|
@RequestParam(defaultValue = "1") int page,
|
|
|
@RequestParam(defaultValue = "25") int perPage
|
|
|
) {
|
|
|
- if (windId != null && meterType != null && meterClass != null && name != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoMonthByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null && meterClass != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoMonthByWindId(windId, meterType, meterClass, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoMonthByWindId(windId, meterType, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoMonthByWindId(windId, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return new Result<>(201, "参数错误", null);
|
|
|
+ ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getCalculatingInfoMonthByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
+ // 进行排序
|
|
|
+ meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
+ // 进行分页处理
|
|
|
+ int totalItems = meterInfoByWindIdList.size();
|
|
|
+ int startIndex = (page - 1) * perPage;
|
|
|
+ int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
+ List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
+ // 构建响应
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+ response.put("calculating", paginatedList);
|
|
|
+ response.put("totalItems", totalItems);
|
|
|
+ response.put("page", page);
|
|
|
+ response.put("perPage", perPage);
|
|
|
+ return new Result<>(200, "成功", response);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取风机月发电量
|
|
|
+ *
|
|
|
+ * @param windId 风场ID
|
|
|
+ * @param id 风机ID
|
|
|
+ * @param startTime 开始时间(时间戳)
|
|
|
+ * @param endTime 结束时间(时间戳)
|
|
|
+ * @param page 第几页
|
|
|
+ * @param perPage 每页几条数
|
|
|
+ * @return 时间段内的月风机发电量
|
|
|
+ */
|
|
|
@GetMapping("/meterinfo/equipmentMonth")
|
|
|
public Result<Object> getEquipmentInfoMonth(
|
|
|
@RequestParam(required = false) String windId,
|
|
@@ -390,55 +202,37 @@ public class MeterInfoController {
|
|
|
@RequestParam(defaultValue = "1") int page,
|
|
|
@RequestParam(defaultValue = "25") int perPage
|
|
|
) {
|
|
|
-
|
|
|
- if (windId != null && id != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getEquipmentInfoMonthByWindId(windId, id, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null) {
|
|
|
-
|
|
|
-
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getEquipmentInfoMonthByWindId(windId, startTime, endTime);
|
|
|
-
|
|
|
- // 进行排序
|
|
|
- meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
-
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("calculating", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- }
|
|
|
- return new Result<>(201, "参数错误", null);
|
|
|
-
|
|
|
+ ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getEquipmentInfoMonthByWindId(windId, id, startTime, endTime);
|
|
|
+ // 进行排序
|
|
|
+ meterInfoByWindIdList.sort(Comparator.comparing(MeterInfoVo::getName));
|
|
|
+ // 进行分页处理
|
|
|
+ int totalItems = meterInfoByWindIdList.size();
|
|
|
+ int startIndex = (page - 1) * perPage;
|
|
|
+ int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
+ List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
+ // 构建响应
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+ response.put("calculating", paginatedList);
|
|
|
+ response.put("totalItems", totalItems);
|
|
|
+ response.put("page", page);
|
|
|
+ response.put("perPage", perPage);
|
|
|
+ return new Result<>(200, "成功", response);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取根据传入不同参数获取每月底码信息
|
|
|
+ *
|
|
|
+ * @param windId 风场ID
|
|
|
+ * @param meterType 测点一级类型
|
|
|
+ * @param meterClass 测点二级分类
|
|
|
+ * @param name 测点名称
|
|
|
+ * @param startTime 开始时间(时间戳)
|
|
|
+ * @param endTime 结束时间(时间戳)
|
|
|
+ * @param page 第几页
|
|
|
+ * @param perPage 每页几条数据
|
|
|
+ * @return 时间段内的每月底码数据
|
|
|
+ */
|
|
|
@GetMapping("/meterinfo/bottomMonth")
|
|
|
public Result<Object> getBottomInfoMonth(
|
|
|
@RequestParam(required = false) String windId,
|
|
@@ -450,75 +244,19 @@ public class MeterInfoController {
|
|
|
@RequestParam(defaultValue = "1") int page,
|
|
|
@RequestParam(defaultValue = "25") int perPage
|
|
|
) {
|
|
|
- if (windId != null && meterType != null && meterClass != null && name != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoMonthByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
- } else if (windId != null && meterType != null && meterClass != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoMonthByWindId(windId, meterType, meterClass, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
- } else if (windId != null && meterType != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoMonthByWindId(windId, meterType, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
- } else if (windId != null) {
|
|
|
- ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoMonthByWindId(windId, startTime, endTime);
|
|
|
- // 进行分页处理
|
|
|
- int totalItems = meterInfoByWindIdList.size();
|
|
|
- int startIndex = (page - 1) * perPage;
|
|
|
- int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
-
|
|
|
- List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
-
|
|
|
- // 构建响应
|
|
|
- Map<String, Object> response = new HashMap<>();
|
|
|
- response.put("bottom", paginatedList);
|
|
|
- response.put("totalItems", totalItems);
|
|
|
- response.put("page", page);
|
|
|
- response.put("perPage", perPage);
|
|
|
- return new Result<>(200, "成功", response);
|
|
|
-
|
|
|
- }
|
|
|
- return new Result<>(201, "参数错误", null);
|
|
|
+ ArrayList<MeterInfoVo> meterInfoByWindIdList = getMeterInfo.getBottomInfoMonthByWindId(windId, meterType, meterClass, name, startTime, endTime);
|
|
|
+ // 进行分页处理
|
|
|
+ int totalItems = meterInfoByWindIdList.size();
|
|
|
+ int startIndex = (page - 1) * perPage;
|
|
|
+ int endIndex = Math.min(startIndex + perPage, totalItems);
|
|
|
+ List<MeterInfoVo> paginatedList = meterInfoByWindIdList.subList(startIndex, endIndex);
|
|
|
+ // 构建响应
|
|
|
+ Map<String, Object> response = new HashMap<>();
|
|
|
+ response.put("bottom", paginatedList);
|
|
|
+ response.put("totalItems", totalItems);
|
|
|
+ response.put("page", page);
|
|
|
+ response.put("perPage", perPage);
|
|
|
+ return new Result<>(200, "成功", response);
|
|
|
}
|
|
|
|
|
|
|