代码调整

This commit is contained in:
2023-04-18 10:54:37 +08:00
parent e2691ba8f3
commit ed3eb2e312
17 changed files with 38 additions and 905 deletions

View File

@@ -39,7 +39,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.IOUtils;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.influxdb.dto.QueryResult;
import org.springframework.beans.BeanUtils;
@@ -236,8 +236,8 @@ public class CustomReportServiceImpl implements CustomReportService {
.eq(ExcelRpt::getType, reportSearchParam.getType())
//报表日期
.eq(ExcelRpt::getDataDate, reportSearchParam.getStartTime());
ExcelRpt excelRpts = excelRptMapper.selectOne(lambdaQuery);
try {
ExcelRpt excelRpts = excelRptMapper.selectOne(lambdaQuery);
if (Objects.nonNull(excelRpts)) {
fileStorageUtil.downloadStream(response, excelRpts.getContent());
} else {
@@ -360,12 +360,12 @@ public class CustomReportServiceImpl implements CustomReportService {
/**
* 解析报表数据
* 解析报表模板赋值数据
*/
private String analyzeReport(ReportSearchParam reportSearchParam, ExcelRptTemp excelRptTemp) {
//根据content获取v值并进行处理
List<ReportTemplateDTO> reportTemplateDTOList = new ArrayList<>();
JSONArray jsonArray ;
JSONArray jsonArray;
InputStream fileStream = null;
try {
//通过文件服务器获取
@@ -412,12 +412,8 @@ public class CustomReportServiceImpl implements CustomReportService {
});
} catch (Exception e) {
throw new BusinessException(HarmonicResponseEnum.CUSTOM_REPORT_JSON);
}finally {
try {
fileStream.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
} finally {
IOUtils.closeQuietly(fileStream);
}
List<ReportTemplateDTO> endList = new ArrayList<>();