| | |
| | | /** |
| | | * å建Excel |
| | | */ |
| | | private <T> void createExcel(String type, Date date, List<T> list) throws Exception { |
| | | private <T> String createExcel(String type, Date date, List<T> list) throws Exception { |
| | | String source = getXslTemplate(type); |
| | | String strData = DateUtils.parseDateToStr("month".equals(type) ? DateUtils.YYYYMM : DateUtils.YYYYMMDD, date); |
| | | String target = String.format("%s\\%s.xlsx", getExpPath(type), strData); |
| | | |
| | | createExcel(source, target, list); |
| | | |
| | | return String.format("%s\\%s.xlsx", type, strData); |
| | | } |
| | | |
| | | /** |
| | |
| | | list.add(day); |
| | | } |
| | | |
| | | createExcel("day", yesterday, list); |
| | | String filePath = createExcel("day", yesterday, list); |
| | | } catch (Exception ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | } |
| | |
| | | list.add(day); |
| | | } |
| | | |
| | | createExcel("week", end, list); |
| | | String filePath = createExcel("week", end, list); |
| | | } catch (Exception ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | } |
| | |
| | | list.add(day); |
| | | } |
| | | |
| | | createExcel("month", end, list); |
| | | String filePath = createExcel("month", end, list); |
| | | } catch (Exception ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | } |