pengcheng 3 viikkoa sitten
vanhempi
commit
c154b32fe0

+ 1 - 1
modules/report/src/main/java/com/jeesite/modules/report/dto/ResearchReportDto.java

@@ -7,7 +7,7 @@ import java.io.Serializable;
 public class ResearchReportDto implements Serializable {
     @ExcelFields({
         @ExcelField(title = "TITLE",attrName = "title",align = ExcelField.Align.AUTO,sort = 10),
-        @ExcelField(title = "SUBJECT",attrName = "marketType",align = ExcelField.Align.AUTO,dictType = "reports_category_en",sort = 20),
+        @ExcelField(title = "SUBJECT",attrName = "marketType",align = ExcelField.Align.AUTO,dictType = "reports_category",sort = 20),
         @ExcelField(title = "ABSTRACT",attrName = "reportScopeHtml",align = ExcelField.Align.AUTO,sort = 30),
         @ExcelField(title = "TABLE OF CONTENTS",attrName = "directoryHtml",align = ExcelField.Align.AUTO,sort = 40),
     })

+ 7 - 2
modules/report/src/main/java/com/jeesite/modules/report/web/ResearchReportController.java

@@ -39,6 +39,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.zip.ZipEntry;
@@ -415,8 +416,12 @@ public class ResearchReportController extends BaseController {
 
 			//response.reset();
 			response.setCharacterEncoding("utf-8");
-			response.setContentType("application/octet-stream");
-			response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("gb2312"), "ISO8859-1") + ".zip");
+			//response.setContentType("application/octet-stream");
+			response.setContentType("application/zip");
+			String encodedFileName = URLEncoder.encode(fileName, "UTF-8");
+
+			//response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("gb2312"), "ISO8859-1") + ".zip");
+			response.addHeader("Content-Disposition", "attachment;filename=" + encodedFileName + ".zip");
 
 			zos.close();
 			bos.close();

+ 2 - 2
web/src/main/resources/config/application.yml

@@ -54,7 +54,7 @@ jdbc:
   # Mysql 数据库配置
   type: mysql
   driver: com.mysql.cj.jdbc.Driver
-  url: jdbc:mysql://192.168.0.132:3306/bjfl_config?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+  url: jdbc:mysql://192.168.0.119:3308/bjfl_config?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
   username: root
   password: songlanyun
   testSql: SELECT 1
@@ -159,7 +159,7 @@ jdbc:
   ds02:
     type: mysql
     driver: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://192.168.0.132:3306/bjfl_portal?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
+    url: jdbc:mysql://192.168.0.119:3308/bjfl_portal?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
     username: root
     password: songlanyun
     testSql: SELECT 1