|
@@ -3,12 +3,16 @@ package com.huaxu.controller;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.huaxu.dto.*;
|
|
|
+import com.huaxu.entity.MonitorDataValueEntity;
|
|
|
import com.huaxu.entity.MonitorInfoEntity;
|
|
|
+import com.huaxu.entity.ReportDimensionSettingEntity;
|
|
|
import com.huaxu.entity.SceneEntity;
|
|
|
import com.huaxu.model.AjaxMessage;
|
|
|
import com.huaxu.model.Pagination;
|
|
|
import com.huaxu.model.ResultStatus;
|
|
|
+import com.huaxu.service.ReportDimensionSettingService;
|
|
|
import com.huaxu.service.ReportService;
|
|
|
+import com.huaxu.util.UserUtil;
|
|
|
import com.sun.org.apache.bcel.internal.generic.NEWARRAY;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -18,8 +22,11 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.function.Function;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 标签信息页面控制器
|
|
@@ -34,6 +41,9 @@ public class DayMonthYearReportController {
|
|
|
@Autowired
|
|
|
private ReportService reportService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ReportDimensionSettingService reportDimensionSettingService;
|
|
|
+
|
|
|
@ApiOperation(value = "按年月日统计报表")
|
|
|
@RequestMapping(value = "/getReportBySceneIds", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@@ -52,10 +62,28 @@ public class DayMonthYearReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,pages);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "按年月日统计报表")
|
|
|
+ @RequestMapping(value = "/getReportBySceneIdsNews", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxMessage<Pagination<ReportDto>> getReportBySceneIdsNews(
|
|
|
+ @RequestParam Integer pageNum,
|
|
|
+ @RequestParam Integer pageSize,
|
|
|
+ @ApiParam(value = "场景IDS", required = true) @RequestParam(required = true) Long[] ids,
|
|
|
+ @ApiParam(value = "查询年", required = false) @RequestParam(required = false) Integer year ,
|
|
|
+ @ApiParam(value = "查询月", required = false) @RequestParam(required = false) Integer month ,
|
|
|
+ @ApiParam(value = "查询日", required = false) @RequestParam(required = false) Integer day ,
|
|
|
+ @ApiParam(value = "报表类型(0日 1月 2年)", required = true) @RequestParam(required = true) Integer reportType
|
|
|
+ ) {
|
|
|
+ IPage<ReportDto> iPage = new Page<>(pageNum, pageSize);
|
|
|
+ iPage = reportService.getReportBySceneIdsNew(iPage,ids,year,month,day,reportType);
|
|
|
+ Pagination<ReportDto> pages = new Pagination<>(iPage);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,pages);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "按设备统计压力及流量年月日统计报表")
|
|
|
- @RequestMapping(value = "/getDevicePressReportByDeviceIds", method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "/getDevicePressReportByDeviceIdsNew", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public AjaxMessage<Pagination<ReportDto>> getDevicePressReportByDeviceIds(
|
|
|
+ public AjaxMessage<Pagination<ReportDto>> getDevicePressReportByDeviceIdsNew(
|
|
|
@RequestParam Integer pageNum,
|
|
|
@RequestParam Integer pageSize,
|
|
|
@ApiParam(value = "设备IDS", required = true) @RequestParam(required = true) Long[] ids,
|
|
@@ -71,7 +99,7 @@ public class DayMonthYearReportController {
|
|
|
return new AjaxMessage<>(ResultStatus.OK,pages);
|
|
|
}
|
|
|
|
|
|
- /*@ApiOperation(value = "按设备统计压力及流量年月日统计报表")
|
|
|
+ @ApiOperation(value = "按设备统计压力及流量年月日统计报表")
|
|
|
@RequestMapping(value = "/getDevicePressReportByDeviceIds", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public AjaxMessage<Pagination<DevicePressReportAttributeDto>> getDevicePressReportByDeviceIds(
|
|
@@ -97,7 +125,25 @@ public class DayMonthYearReportController {
|
|
|
}
|
|
|
|
|
|
return new AjaxMessage<>(ResultStatus.OK,pages);
|
|
|
- }*/
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "按设备统计水质年月日统计报表")
|
|
|
+ @RequestMapping(value = "/getDevicWaterReportByDeviceIdsNew", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxMessage<Pagination<ReportDto>> getDevicWaterReportByDeviceIdsNew(
|
|
|
+ @RequestParam Integer pageNum,
|
|
|
+ @RequestParam Integer pageSize,
|
|
|
+ @ApiParam(value = "设备IDS", required = true) @RequestParam(required = true) Long[] ids,
|
|
|
+ @ApiParam(value = "查询年", required = false) @RequestParam(required = false) Integer year ,
|
|
|
+ @ApiParam(value = "查询月", required = false) @RequestParam(required = false) Integer month ,
|
|
|
+ @ApiParam(value = "查询日", required = false) @RequestParam(required = false) Integer day ,
|
|
|
+ @ApiParam(value = "报表类型(0日 1月 2年)", required = true) @RequestParam(required = true) Integer reportType
|
|
|
+ ) {
|
|
|
+ IPage<ReportDto> iPage = new Page<>(pageNum, pageSize);
|
|
|
+ iPage = reportService.getPipeDevicePressReportByDeviceIds(iPage,ids,year,month,day,reportType,3);
|
|
|
+ Pagination<ReportDto> pages = new Pagination<>(iPage);
|
|
|
+ return new AjaxMessage<>(ResultStatus.OK,pages);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "按设备统计水质年月日统计报表")
|
|
|
@RequestMapping(value = "/getDevicWaterReportByDeviceIds", method = RequestMethod.POST)
|
|
@@ -114,8 +160,8 @@ public class DayMonthYearReportController {
|
|
|
IPage<DeviceWaterReportAttributeDto> iPage = new Page<>(pageNum, pageSize);
|
|
|
iPage = reportService.getDevicWaterReportByDeviceIds(iPage,ids,year,month,day,reportType);
|
|
|
Pagination<DeviceWaterReportAttributeDto> pages = new Pagination<>(iPage);
|
|
|
- for(DeviceWaterReportAttributeDto item : pages.getList())
|
|
|
- {
|
|
|
+ for(DeviceWaterReportAttributeDto item : pages.getList()) {
|
|
|
+
|
|
|
item.setAvgCLValue((double)Math.round(item.getAvgCLValue()==null?0:item.getAvgCLValue()*1000)/1000);
|
|
|
item.setAvgPHValue((double)Math.round(item.getAvgPHValue()==null?0:item.getAvgPHValue()*1000)/1000);
|
|
|
item.setAvgQuValue((double)Math.round(item.getAvgQuValue()==null?0:item.getAvgQuValue()*1000)/1000);
|
|
@@ -160,7 +206,7 @@ public class DayMonthYearReportController {
|
|
|
@RequestMapping(value = "/updateCustomDimension", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public AjaxMessage<List<ReportAttributeDto>> updateCustomDimension(@RequestBody @Valid List<ReportStatisticalDimensionDto> dataList) {
|
|
|
- reportService.updateStatisticalDimension(dataList);
|
|
|
+ reportDimensionSettingService.batchUpdateStatisticalDimension(dataList);
|
|
|
return new AjaxMessage<>(ResultStatus.OK);
|
|
|
}
|
|
|
}
|