暂态报告:监测点报告和区域报告下载速度优化

This commit is contained in:
wurui
2023-02-17 11:22:50 +08:00
parent 3a602068a4
commit 3b591338a6
7 changed files with 1899 additions and 3289 deletions

View File

@@ -53,4 +53,23 @@ public class InfluxDBCommUtils {
}
return lineIdsStr;
}
/**
* 组装为influxdb监测点参数
*
* @param devIds 设备ids参数
* @param name 列明
* @return StringBuilder
*/
public static StringBuilder assToInfluxParamAndName(@NotEmpty List<String> devIds,String name){
StringBuilder lineIdsStr = new StringBuilder("(");
for (int i = 0; i < devIds.size(); i++) {
if (devIds.size() - i != 1) {
lineIdsStr.append(name+" ='").append(devIds.get(i)).append("' or ");
} else {
lineIdsStr.append(name+" ='").append(devIds.get(i)).append("') ");
}
}
return lineIdsStr;
}
}

View File

@@ -24,11 +24,9 @@ public class AreaTableParam implements Serializable {
@ApiModelProperty(name = "StringBuilder", value = "监测点拼接的字符串")
private StringBuilder stringBuilder;
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;

View File

@@ -48,80 +48,80 @@ public class ReportController extends BaseController {
@PostMapping("/getGeneralSituation")
@ApiOperation("暂态总体概况(区域)")
@ApiImplicitParam(name = "businessParam", value = "暂态总体概况区域参数", required = true)
public HttpResult<List<GeneralVO>> getGeneralSituation(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam){
public HttpResult<List<GeneralVO>> getGeneralSituation(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam) {
String methodDescribe = getMethodDescribe("getGeneralSituation");
List<GeneralVO> page = reportService.getGeneralSituation(businessParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getVoltage")
@ApiOperation("暂态总体概况(电压)")
@ApiImplicitParam(name = "businessParam", value = "暂态总体概况电压参数", required = true)
public HttpResult<List<GeneralVO>> getVoltage(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam){
public HttpResult<List<GeneralVO>> getVoltage(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam) {
String methodDescribe = getMethodDescribe("getVoltage");
List<GeneralVO> page = reportService.getVoltage(businessParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getSeverity")
@ApiOperation("暂态严重度")
@ApiImplicitParam(name = "businessParam", value = "暂态严重度参数", required = true)
public HttpResult<List<WaveTypeVO>> getSeverity(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam){
public HttpResult<List<WaveTypeVO>> getSeverity(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam) {
String methodDescribe = getMethodDescribe("getSeverity");
List<WaveTypeVO> page = reportService.getSeverity(businessParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getReason")
@ApiOperation("暂态原因统计表")
@ApiImplicitParam(name = "businessParam", value = "暂态严重度参数", required = true)
public HttpResult<List<ReasonsVO>> getReason(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam){
public HttpResult<List<ReasonsVO>> getReason(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam) {
String methodDescribe = getMethodDescribe("getSeverity");
List<ReasonsVO> page = reportService.getReason(businessParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getContinueTime")
@ApiOperation("详细事件列表")
@ApiImplicitParam(name = "businessParam", value = "详细时间列表参数", required = true)
public HttpResult<Page<DetailVO>> getContinueTime(@RequestBody @Validated WaveTypeParam businessParam){
public HttpResult<Page<DetailVO>> getContinueTime(@RequestBody @Validated WaveTypeParam businessParam) {
String methodDescribe = getMethodDescribe("getContinueTime");
Page<DetailVO> page = reportService.getContinueTime(businessParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getSagTimes")
@ApiOperation("暂降次数统计")
@ApiImplicitParam(name = "waveTypeParam", value = "暂降次数统计参数", required = true)
public HttpResult<Page<DetailVO>> getSagTimes(@RequestBody @Validated WaveTypeParam waveTypeParam){
public HttpResult<Page<DetailVO>> getSagTimes(@RequestBody @Validated WaveTypeParam waveTypeParam) {
String methodDescribe = getMethodDescribe("getSagTimes");
Page<DetailVO> page = reportService.getSagTimes(waveTypeParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getUpTimes")
@ApiOperation("暂升次数统计")
@ApiImplicitParam(name = "waveTypeParam", value = "暂升次数统计参数", required = true)
public HttpResult<Page<DetailVO>> getUpTimes(@RequestBody @Validated WaveTypeParam waveTypeParam){
public HttpResult<Page<DetailVO>> getUpTimes(@RequestBody @Validated WaveTypeParam waveTypeParam) {
String methodDescribe = getMethodDescribe("getUpTimes");
Page<DetailVO> page = reportService.getUpTimes(waveTypeParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getBreakTimes")
@ApiOperation("中断次数统计")
@ApiImplicitParam(name = "waveTypeParam", value = "中断次数统计参数", required = true)
public HttpResult<Page<DetailVO>> getBreakTimes(@RequestBody @Validated WaveTypeParam waveTypeParam){
public HttpResult<Page<DetailVO>> getBreakTimes(@RequestBody @Validated WaveTypeParam waveTypeParam) {
String methodDescribe = getMethodDescribe("getBreakTimes");
Page<DetailVO> page = reportService.getBreakTimes(waveTypeParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,page,methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@@ -129,7 +129,7 @@ public class ReportController extends BaseController {
@ApiOperation("周报导出")
@ApiImplicitParam(name = "businessParam", value = "周报导出参数", required = true)
public void getExport(@RequestBody @Validated DeviceInfoParam.BusinessParam businessParam, HttpServletResponse response) throws TemplateException, IOException {
reportService.getExport(businessParam,response);
reportService.getExport(businessParam, response);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@@ -137,7 +137,7 @@ public class ReportController extends BaseController {
@ApiOperation("监测点报告导出")
@ApiImplicitParam(name = "exportParam", value = "监测点报告导出参数", required = true)
public void getLineExport(@RequestBody @Validated ExportParam exportParam, HttpServletResponse response) throws IOException, InvalidFormatException, TemplateException, ParseException {
reportService.getLineExport(exportParam,response);
reportService.getLineExport(exportParam, response);
// @RequestParam(name = "lineIndex") String lineIndex,@RequestParam(name = "startTime") String startTime,@RequestParam(name = "endTime") String endTime,@RequestParam("flag")Integer flag
// ExportParam exportParam = new ExportParam();
@@ -175,7 +175,8 @@ public class ReportController extends BaseController {
}
/**
*获取事件报告
* 获取事件报告
*
* @author zbj
* @date 2022/7/29
*/
@@ -190,7 +191,8 @@ public class ReportController extends BaseController {
}
/**
*获取区域报告
* 获取区域报告
*
* @author zbj
* @date 2022/8/4
*/
@@ -199,10 +201,9 @@ public class ReportController extends BaseController {
@ApiOperation("获取区域报告")
@ApiImplicitParam(name = "areaReportParam", value = "参数体", required = true)
public void getAreaReport(@RequestBody @Validated AreaReportParam areaReportParam, HttpServletResponse response) throws Exception {
reportService.getAreaReport(areaReportParam,response);
reportService.getAreaReport(areaReportParam, response);
}
}

View File

@@ -0,0 +1,72 @@
package com.njcn.event.service.majornetwork;
import com.njcn.event.pojo.param.StatisticsParam;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.vo.*;
import com.njcn.system.pojo.po.DictData;
import java.text.ParseException;
import java.util.List;
/**
* <监测点报表>
*
* @author wr
* @createTime: 2023-02-10
*/
public interface EventReportService {
/**
*获取Disdip表格监测点报表专用
* @param info influxdb查询结果pqs_eventdetail表
* @return
*/
List<DISDIPVO> eventDisdip(List<EventDetail> info);
/**
* 获取IEC411数据
* @param info influxdb查询结果pqs_eventdetail表
* @return
*/
List<IEC411VO> IEC411(List<EventDetail> info);
/**
* 获取IEC28数据
* @param info influxdb查询结果pqs_eventdetail表
* @return
*/
List<IEC28VO> IEC28(List<EventDetail> info);
/**
*暂降幅值概率分布
* @param info2 influxdb查询结果pqs_eventdetail表
* @return
*/
ProbabilityVO getProbabilityDistribution(List<EventDetail> info2);
/**
* 获取时间列表(月份统计)
* @param info influxdb查询结果pqs_eventdetail表
* @return
*/
List<TimeVO> getReasonTypeTime(StatisticsParam statisticsParam,List<EventDetail> info) throws ParseException;
/**
* 获取点状表格数据2.1
* @param info 结果集
* @param reasonData 暂降原因
* @param typeData 暂降类型
* @return
*/
List<EventDetail> getPlot(List<EventDetail> info, List<DictData> reasonData, List<DictData> typeData);
/**
* 获取详细数据对象
* @param info
* @param reasonData
* @param typeData
* @return
*/
StatisticVO getStatistic(List<EventDetail> info,List<DictData> reasonData,List<DictData>typeData);
}

View File

@@ -3,14 +3,11 @@ package com.njcn.event.service.majornetwork;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.event.pojo.param.*;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.vo.*;
import freemarker.template.TemplateException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.influxdb.dto.QueryResult;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
@@ -43,19 +40,20 @@ public interface ReportService {
void getLineExport(ExportParam exportParam, HttpServletResponse response) throws InvalidFormatException, IOException, TemplateException, ParseException;
/**
*获取事件报告
* 获取事件报告
*
* @author zbj
* @date 2022/7/29
*/
Page<WaveTypeVO> getEventReport(WaveTypeParam deviceInfoParam);
/**
*获取区域报告
* 获取区域报告
*
* @author zbj
* @date 2022/8/4
*/
void getAreaReport(AreaReportParam areaReportParam, HttpServletResponse response) throws Exception;
}