| | |
| | | public void emilTask()throws IOException { |
| | | String startTime = DateUtils.dateToDateString(DateUtils.addDays(new Date(),-1),DateUtils.yyyy_MM_dd_EN); |
| | | List<DeviceExcelDTO> list = deviceService.ListDeviceExcel(startTime,null,72); |
| | | String path = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath(); |
| | | String path = System.getProperty("user.dir")+"/"; |
| | | String fileName = String.format("%s疾控中心数据-%s.xlsx",path,startTime); |
| | | ByteArrayOutputStream out = null; |
| | | try { |
| | |
| | | out = ExcelUtil.generateExcel(list, DeviceExcelDTO.class); |
| | | // 发送邮件 |
| | | String content = startTime+"疾控中心设备统计数据"; |
| | | String toMail = "ad@7drlb.com"; |
| | | String toMail = "lili@nieh.chinacdc.cn"; |
| | | emailSpringUtil.sendEmail("设备分钟数据",content,false,"909710561@qq.com", |
| | | toMail,"909710561@qq.com",null, fileName, new ByteArrayResource(out.toByteArray())); |
| | | } catch (IOException e) { |