ke
2024-05-20 9de7f6c737a6370888564add8cc0e2be9f196329
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/controller/DownTemplateController.java
@@ -48,7 +48,7 @@
   @GetMapping(value = "/getBriefReport")
   public R getBriefReport() {
      //获取总览、大中库、明细数据
      List<TotalInfo> totalList = sjztmdService.getTotalInfo("0");
      List<TotalInfo> totalList = sjztmdService.getTotalInfo("");
      return R.data(BriefReportUtil.formatTotalInfo(totalList));
   }
@@ -74,8 +74,8 @@
   @GetMapping("/download/overFloodInfo")
   public ResponseEntity overFloodInfo(String isShow) throws Exception{
      String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
      String fileName =  time+ "全省水库防汛情况.docx";
      String time = new SimpleDateFormat("yyyy日MM月dd日HH时").format(new Date());
      String fileName =  time+ "报汛文件.docx";
      String fileNameURL = URLEncoder.encode(fileName, "UTF-8");
      //获取总览、大中库、明细数据
      List<TotalInfo> totalList = sjztmdService.getTotalInfo(isShow);
@@ -111,7 +111,7 @@
      // 将临时文件添加到响应中,以便用户下载
      return ResponseEntity.ok()
         .contentType(MediaType.valueOf("application/vnd.openxmlformats-officedocument.wordprocessingml.document")) // 设置响应的内容类型为二进制流(octet stream)
         .header("Content-Disposition", "attachment; filename=\"" + fileNameURL) // 设置响应的Content-Disposition头,以便浏览器提示用户下载文件
         .header("Content-Disposition", "attachment; filename=" + fileNameURL) // 设置响应的Content-Disposition头,以便浏览器提示用户下载文件
         .body(resource); // 将InputStreamResource对象作为响应体
   }