소스 검색

修改打包配置

wangliang 1 개월 전
부모
커밋
d3b17fc8ca
1개의 변경된 파일29개의 추가작업 그리고 17개의 파일을 삭제
  1. 29 17
      server/src/main/java/com/qmth/jkserver/service/impl/ExamPaperTempServiceImpl.java

+ 29 - 17
server/src/main/java/com/qmth/jkserver/service/impl/ExamPaperTempServiceImpl.java

@@ -25,7 +25,6 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.context.annotation.Scope;
 import org.springframework.context.annotation.ScopedProxyMode;
 import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
 import org.springframework.util.LinkedMultiValueMap;
 
 import javax.annotation.Resource;
@@ -116,22 +115,35 @@ public class ExamPaperTempServiceImpl extends ServiceImpl<ExamPaperTempDao, Exam
         UnZipUtils.doUnZip(paperAnswerTarget, answerDir, paperAnswerTarget.getParent());
         deletePaths.add(answerDir.getAbsolutePath());
 
-        Map<String, Object> map = new LinkedHashMap<>();
-        map = SystemConstant.getFileDirectoryCount(answerDir, map);
+//        Map<String, Object> map = new LinkedHashMap<>();
+//        map = SystemConstant.getFileDirectoryCount(answerDir, map);
 
-        File finalAnswerDir = null;
-        if (!CollectionUtils.isEmpty(map)) {
-            for (Map.Entry<String, Object> entry : map.entrySet()) {
-                if (!Objects.equals(entry.getKey(), "fileDirectoryCount")) {
-                    finalAnswerDir = new File((String) entry.getValue());
-                    if (finalAnswerDir.getAbsolutePath().endsWith("answer")) {
-                        break;
-                    }
-                }
-            }
-        } else {
-            finalAnswerDir = answerDir;
-        }
+//        File finalAnswerDir = answerDir;
+//        if (!CollectionUtils.isEmpty(map)) {
+//            for (Map.Entry<String, Object> entry : map.entrySet()) {
+//                if (!Objects.equals(entry.getKey(), "fileDirectoryCount")) {
+//                    finalAnswerDir = new File((String) entry.getValue());
+//                    if (finalAnswerDir.getAbsolutePath().endsWith("answer")) {
+//                        break;
+//                    }
+//                }
+//            }
+//        } else {
+//            finalAnswerDir = answerDir;
+//        }
+
+//        File finalAnswerDir = null;
+//        if (!CollectionUtils.isEmpty(map)) {
+//            log.info("fileDirectoryCount:{}", JacksonUtil.parseJson(map));
+//            int fileDirectoryCount = (int) map.get("fileDirectoryCount");
+//            if (fileDirectoryCount == 3) {
+//                finalAnswerDir = new File((String) map.get("1"));
+//            } else if (fileDirectoryCount == 4) {
+//                finalAnswerDir = new File((String) map.get("2"));
+//            }
+//        } else {
+//            finalAnswerDir = answerDir;
+//        }
 
         //获取开卷密码
         List<ExamPaperUncoiling> examPaperUncoilingList = kwService.queryExamPaperUncoiling(new ExamPaperUncoilingParams(examCode));
@@ -145,7 +157,7 @@ public class ExamPaperTempServiceImpl extends ServiceImpl<ExamPaperTempDao, Exam
             Map<String, File> finalMapFile = mapFile;
             paperAnswerFile = Objects.isNull(paperAnswerFile) ? new ArrayList<>() : paperAnswerFile;
             List<File> finalPaperAnswerFile = paperAnswerFile;
-            File finalAnswerDir1 = finalAnswerDir;
+            File finalAnswerDir1 = answerDir;
             paperCourseCodeTempMap.forEach((k, v) -> {
                 finalPaperAnswerFile.add(createPaperAnswerFile(k, finalMapFile, finalAnswerDir1));
             });