| | |
| | | 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; |
| | |
| | | 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.*; |
| | |
| | | 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) { |