cjl
2023-08-26 c38942417e15141f9a03d11bb518195ecca44b42
screen-api/src/main/java/com/moral/api/controller/SysTestController.java
@@ -56,18 +56,21 @@
    @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);
            if(CollectionUtils.isEmpty(listAll)){
                return;
            }
          /*  Date endTime =listAll.get(0).getTime();
            String endTimeStr = DateUtils.dateToDateString(endTime,DateUtils.yyyyMMdd_EN);
        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;
        }
        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");*/
          //  time = DateUtils.dateToDateString(DateUtils.addDays(endTime,1),DateUtils.yyyy_MM_dd_EN);
     //   }
            downloadWord(fileName, map, response,"空气质量日报"+endTimeStr+".docx");
            //time = DateUtils.dateToDateString(DateUtils.addDays(endTime,1),DateUtils.yyyy_MM_dd_EN);
        }
    }
    @GetMapping("excelM")
@@ -136,9 +139,9 @@
    @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);
@@ -161,7 +164,7 @@
        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);