燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-08-10 1b2ce0a15e0d441042817feceaa16184a885165f
src/main/java/com/yssh/service/XlsReportService.java
@@ -3,6 +3,7 @@
import com.yssh.entity.xls.DayExcel;
import com.yssh.entity.xls.MonthExcel;
import com.yssh.entity.xls.WeekExcel;
import com.yssh.mapper.XlsReportMapper;
import com.yssh.utils.DateUtils;
import com.yssh.utils.ExcelUtils;
import org.slf4j.Logger;
@@ -11,6 +12,7 @@
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.*;
@@ -24,10 +26,37 @@
public class XlsReportService {
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Resource
    XlsReportMapper mapper;
    /**
     * 报告路径
     */
    @Value("${report.path}")
    private String reportPath;
    /**
     * 预警值
     */
    @Value("${report.yjz}")
    private double yjz;
    /**
     * 报警值
     */
    @Value("${report.bjz}")
    private double bjz;
    /**
     * Excel是否已存在
     */
    private boolean xlsExists(String type, String name) {
        int rows = mapper.xlsExists(type, name);
        return rows > 0;
    }
    /**
     * 获取导出路径
     */
    private String getExpPath(String type) {