Browse Source

导出时的文件格式

wangzaijun 7 tháng trước cách đây
mục cha
commit
a1b493d600

+ 3 - 3
service-manage/src/main/java/com/simuwang/manage/api/deletion/DeletionController.java

@@ -90,7 +90,7 @@ public class DeletionController {
      * @return
      */
     @PostMapping("/download-fund-deletion")
-    public void downloadFundDeletion(@RequestBody FundDeletionListVO fundDeletionListVO, HttpServletResponse response, HttpServletRequest request){
+    public void downloadFundDeletion(@RequestBody FundDeletionListVO fundDeletionListVO, HttpServletResponse response){
         List<ExcelDeletionInfoDTO> fundDeletionInfoVOList = deletionService.selectFundDeletionInfoVOList(fundDeletionListVO);
         Map<String,List<List<String>>> values = new HashMap<>();
         List<String> head = new ArrayList<>();
@@ -115,8 +115,8 @@ public class DeletionController {
         values.put(sheetName,dataList);
         HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook(sheetName,head,values,null);
         try {
-            response.setContentType("application/octet-stream; charset=utf-8");
-            response.setCharacterEncoding("utf-8");
+            response.setContentType("application/x-xls");
+            response.setCharacterEncoding("gbk");
             response.addHeader("Content-Disposition", "attachment;filename=" + EncodeUtil.encodeUTF8("缺失明细.xls"));
             ServletOutputStream outputStream = response.getOutputStream();
             wb.write(outputStream);