| | |
| | | |
| | | @GetMapping("resultWord") |
| | | public void adresultWordd(HttpServletResponse response,String time,String endTime) { |
| | | // for(int i = 495;i<1095;i++){ |
| | | List<SysTest> listAll = sysTestService.listAll(time,endTime,null); |
| | | String ks = "2023-06-22"; |
| | | endTime = "2023-08-06"; |
| | | Date ksDate = DateUtils.convertDate(ks); |
| | | List<SysTest> listAll = sysTestService.listAll(ks,endTime,null); |
| | | if(CollectionUtils.isEmpty(listAll)){ |
| | | return; |
| | | } |
| | | /* Date endTime =listAll.get(0).getTime(); |
| | | String endTimeStr = DateUtils.dateToDateString(endTime,DateUtils.yyyyMMdd_EN); |
| | | for(SysTest s : listAll){ |
| | | Date endTimes =s.getTime(); |
| | | String endTimeStr = DateUtils.dateToDateString(endTimes,DateUtils.yyyyMMdd_EN); |
| | | String fileName = "空气质量日报.docx"; |
| | | Map<String,Object> map = resultMap(listAll); |
| | | downloadWord(fileName, map, response,"空气质量日报"+endTimeStr+".docx");*/ |
| | | downloadWord(fileName, map, response,"空气质量日报"+endTimeStr+".docx"); |
| | | // time = DateUtils.dateToDateString(DateUtils.addDays(endTime,1),DateUtils.yyyy_MM_dd_EN); |
| | | // } |
| | | } |
| | | } |
| | | |
| | | @GetMapping("excelM") |
| | |
| | | @GetMapping("resultWordMonth") |
| | | public void resultWordMonth(HttpServletResponse response) { |
| | | |
| | | String ks = "2020-06-01"; |
| | | String ks = "2023-07-01"; |
| | | Date ksDate = DateUtils.convertDate(ks); |
| | | for(int i = 0;i<37;i++){ |
| | | for(int i = 0;i<1;i++){ |
| | | Date jsDate = DateUtils.getLastDayOfCurrMonth(ksDate);; |
| | | String time = DateUtils.dateToDateString(ksDate,DateUtils.yyyy_MM_dd_EN); |
| | | String endTime = DateUtils.dateToDateString(jsDate,DateUtils.yyyy_MM_dd_EN); |
| | |
| | | String path = getPath(fileName);//我这放 resources包下 |
| | | try { |
| | | //获取模板文档 |
| | | OutputStream out = new FileOutputStream("E:\\home\\mon\\" + newFileName); |
| | | OutputStream out = new FileOutputStream("E:\\home\\mon1\\" + newFileName); |
| | | File rootFile = new File(ResourceUtils.getURL("classpath:").getPath()); |
| | | File file= new File(rootFile, path); |
| | | XWPFDocument word = WordExportUtil.exportWord07(file.getPath(), params); |