燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-08-29 5d6e29cd47762c4dacad7708cbef232414f5b95e
1
已修改3个文件
14 ■■■■ 文件已修改
src/main/java/com/yssh/controller/XlsReportController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/XlsReportService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-file.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/controller/XlsReportController.java
@@ -29,7 +29,7 @@
    @Resource
    XlsReportService xlsReportService;
    private static List<String> TYPES = new ArrayList<>(Arrays.asList("day", "week", "month"));
    private static final List<String> TYPES = new ArrayList<>(Arrays.asList("day", "week", "month"));
    @ApiOperationSupport(order = 1)
    @GetMapping("/selectByPage")
src/main/java/com/yssh/service/XlsReportService.java
@@ -57,6 +57,12 @@
    private double bjz;
    /**
     * 报警值
     */
    @Value("${report.templates}")
    private String templates;
    /**
     * 获取导出路径
     */
    private String getExpPath(String type) {
@@ -74,9 +80,10 @@
     * 获取Excel模板
     */
    private String getXslTemplate(String type) throws IOException {
        ClassPathResource resource = new ClassPathResource(String.format("templates/%s.xlsx", type));
        //ClassPathResource resource = new ClassPathResource(String.format("templates/%s.xlsx", type));
        //return resource.exists() ? resource.getFile().getPath() : null;
        return resource.exists() ? resource.getFile().getPath() : null;
        return String.format(templates + File.separator + type + ".xlsx");
    }
    /**
src/main/resources/application-file.yml
@@ -8,6 +8,7 @@
  vocPath: 'E:\yssh_data\VOC_ALL'
#日/周/月报路径
report:
  templates: E:\terrait\TianJin\YanShan\src\main\resources\templates
  path: E:\yssh_data\XlsReport
  yjz: 1.6
  bjz: 2