区域报告修改,添加间谐波电压含有率

This commit is contained in:
cdf
2026-06-07 15:55:50 +08:00
parent 748fd62afb
commit 50181459bf
5 changed files with 86 additions and 22 deletions

View File

@@ -581,16 +581,19 @@ public class CustomReportTableServiceImpl implements CustomReportTableService {
} catch (Exception e) {
// 自定义报表防止没有默认模板从resource目录加载默认模板
String defaultTemplatePath = "file/default_excel_report.json";
InputStream defaultStream = getClass().getClassLoader().getResourceAsStream(defaultTemplatePath);
if (defaultStream == null) {
if (e instanceof BusinessException) {
throw new BusinessException(e.getMessage());
try (InputStream defaultStream = getClass().getClassLoader().getResourceAsStream(defaultTemplatePath)) {
if (defaultStream == null) {
if (e instanceof BusinessException) {
throw new BusinessException(e.getMessage());
} else {
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
}
} else {
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
jsonArray = new JSONArray(new JSONTokener(defaultStream, new JSONConfig()));
parseTemplate(jsonArray, reportTemplateDTOList, reportLimitList, terminalList);
}
}else {
jsonArray = new JSONArray(new JSONTokener(defaultStream, new JSONConfig()));
parseTemplate(jsonArray, reportTemplateDTOList, reportLimitList, terminalList);
}catch (Exception e1){
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
}
}
//查询不分相别的指标