|
|
@@ -1085,6 +1085,30 @@ public class IotStaticController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @PermitAll
|
|
|
+ @GetMapping("/year/total/gases/{dept}")
|
|
|
+ public CommonResult<ImmutableMap> getYearTotalGases(@PathVariable("dept") String dept) {
|
|
|
+ Set<Long> ids = getDeptIds(dept);
|
|
|
+ //获取近一年的月份
|
|
|
+ List<String> lastYearMonthRanges = getLastYearMonthRanges().stream().map(MonthRange::getYearMonth).collect(Collectors.toList());
|
|
|
+ IotRhDailyReportPageReqVO iotRhDailyReportPageReqVO = new IotRhDailyReportPageReqVO();
|
|
|
+// iotRhDailyReportPageReqVO.setDeptIds(new ArrayList<>(ids));
|
|
|
+ iotRhDailyReportPageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<YearTotalGas> yearTotalGases = iotRhDailyReportMapper.selectYearTotalGas(iotRhDailyReportPageReqVO);
|
|
|
+ LinkedList<String> result = new LinkedList<>();
|
|
|
+ lastYearMonthRanges.forEach(lastYearMonthRange -> {
|
|
|
+ YearTotalGas yearTotalGas = yearTotalGases.stream().filter(e -> e.getMonth().equals(lastYearMonthRange)).findAny().orElse(null);
|
|
|
+ if (Objects.isNull(yearTotalGas)) {
|
|
|
+ result.add("0");
|
|
|
+ } else {
|
|
|
+ result.add(NumberUtils.formatNumber(yearTotalGas.getTotalGas()));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ImmutableMap<String, Serializable> fillResult = ImmutableMap.of("name", "累计注气量~~en**cumulative gas injection", "data", result);
|
|
|
+ return success(ImmutableMap.of("xAxis", lastYearMonthRanges, "series", ImmutableList.of(fillResult)));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/number")
|
|
|
@Operation(summary = "获取巡检计划数量")
|
|
|
@PermitAll
|