wangliang 1 rok pred
rodič
commit
2da51cda1d

+ 3 - 3
server/src/main/java/com/qmth/jkserver/common/UnZipUtils.java

@@ -51,9 +51,9 @@ public class UnZipUtils {
             destDir.mkdirs();
 //            throw new JkServerException("指定目录不存在," + destDir.getAbsolutePath());
         }
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        ZipFile zip = new ZipFile(zipFile, Charset.forName(sysConfig.getConfigValue()));
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        ZipFile zip = new ZipFile(zipFile, Charset.forName(SystemConstant.CHARSET_NAME));
         Enumeration entries = zip.entries();
         while (entries.hasMoreElements()) {
             ZipEntry entry = (ZipEntry) entries.nextElement();

+ 2 - 2
server/src/main/java/com/qmth/jkserver/controller/system/ExamKwHZController.java

@@ -279,8 +279,8 @@ public class ExamKwHZController {
             mycell8.setCellValue(examStudenDetailDto.getExamCheat().getIntroduce());
             indexe++;
         }
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        response.setCharacterEncoding(sysConfig.getConfigValue());
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        response.setCharacterEncoding(SystemConstant.CHARSET_NAME);
         response.setContentType("multipart/form-data");
         String fileName = "考务汇总_" + new SimpleDateFormat("yyyy_MM_ddHHmmss").format(new Date()) + ".xlsx";
         fileName = URLEncoder.encode(fileName, SystemConstant.CHARSET_NAME);

+ 6 - 6
server/src/main/java/com/qmth/jkserver/core/ow/Normal2OWExport.java

@@ -93,9 +93,9 @@ public class Normal2OWExport implements IOW2Export {
         File file = new File(dir, "ow_omr.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {
@@ -361,9 +361,9 @@ public class Normal2OWExport implements IOW2Export {
         File file = new File(dir, "student-paper.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {

+ 9 - 9
server/src/main/java/com/qmth/jkserver/core/ow/Solfege2OWExport.java

@@ -95,9 +95,9 @@ public class Solfege2OWExport implements IOW2Export {
         File file = new File(dir, "答案路径.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {
@@ -161,9 +161,9 @@ public class Solfege2OWExport implements IOW2Export {
         File file = new File(dir, "科目数据.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {
@@ -224,9 +224,9 @@ public class Solfege2OWExport implements IOW2Export {
         File file = new File(dir, "student-paper.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {

+ 6 - 6
server/src/main/java/com/qmth/jkserver/core/ow/Utest2OWExport.java

@@ -304,9 +304,9 @@ public class Utest2OWExport implements IOW2Export {
         File file = new File(dir, "ow_omr.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {
@@ -371,9 +371,9 @@ public class Utest2OWExport implements IOW2Export {
         File file = new File(dir, "student-paper.txt");
         file.createNewFile();
         FileOutputStream fileOutputStream = new FileOutputStream(file);
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
         BufferedWriter bufferedWriter = new BufferedWriter(outBatch);
         try {
             while (!over) {

+ 3 - 3
server/src/main/java/com/qmth/jkserver/core/ow/Utest2OWExportBackUp.java

@@ -355,9 +355,9 @@ public class Utest2OWExportBackUp implements IOW2Export {
         BufferedWriter bufferedWriter = null;
         try {
             FileOutputStream fileOutputStream = new FileOutputStream(file);
-            CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-            OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, sysConfig.getConfigValue());
+//            CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//            SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+            OutputStreamWriter outBatch = new OutputStreamWriter(fileOutputStream, SystemConstant.CHARSET_NAME);
             bufferedWriter = new BufferedWriter(outBatch);
             for (ExamStudentAnswer answer : examStudentAnswers) {
                 if (answer == null || StringUtils.isEmpty(answer.getObjectiveAnswer())) {

+ 6 - 6
server/src/main/java/com/qmth/jkserver/service/impl/KWServiceImpl.java

@@ -526,9 +526,9 @@ public class KWServiceImpl extends ServiceImpl<KwFileDao, KwFile> implements KWS
      */
     protected void unZipCommon(File file, String password, String destPath) throws ZipException {
         ZipFile zFile = new ZipFile(file);  //首先创建ZipFile指向磁盘上的.zip文件
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        zFile.setFileNameCharset(sysConfig.getConfigValue());       //设置文件名编码,在GBK系统中需要设置
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        zFile.setFileNameCharset(SystemConstant.CHARSET_NAME);       //设置文件名编码,在GBK系统中需要设置
         if (!zFile.isValidZipFile()) {   // 验证.zip文件是否合法,包括文件是否存在、是否为zip文件、是否被损坏等
             throw JkServerException.withMessage("压缩文件可能已被损坏.");
         }
@@ -551,9 +551,9 @@ public class KWServiceImpl extends ServiceImpl<KwFileDao, KwFile> implements KWS
     @Override
     public List<File> unZipByPasswordByDest(File file, String password) throws Exception {
         ZipFile zFile = new ZipFile(file);  //首先创建ZipFile指向磁盘上的.zip文件
-        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
-        zFile.setFileNameCharset(sysConfig.getConfigValue());       //设置文件名编码,在GBK系统中需要设置
+//        CommonCacheService commonCacheService = SpringContextHolder.getBean(CommonCacheService.class);
+//        SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.SYS_CONFIG_KEY_CHARSETS);
+        zFile.setFileNameCharset(SystemConstant.CHARSET_NAME);       //设置文件名编码,在GBK系统中需要设置
         if (!zFile.isValidZipFile()) {   // 验证.zip文件是否合法,包括文件是否存在、是否为zip文件、是否被损坏等
             throw JkServerException.withMessage("压缩文件可能已被损坏.");
         }