代码调整
This commit is contained in:
@@ -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<>();
|
||||
|
||||
Reference in New Issue
Block a user