|
@@ -27,6 +27,7 @@ import com.qmth.paper.library.common.util.ServletUtil;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -343,7 +344,14 @@ public class PaperLibraryCommonServiceImpl implements PaperLibraryCommonService
|
|
|
BasicExam basicExam = basicExamService.getById(paperScanTask.getExamId());
|
|
|
BasicSemester basicSemester = basicSemesterService.getById(basicExam.getSemesterId());
|
|
|
String courseNameCode = String.format("%s(%s)", paperScanTask.getCourseName(), paperScanTask.getCourseCode());
|
|
|
- String rootPath = fileStoreUtil.buildPath(UploadFileEnum.IMAGE, false, basicSchool.getName(), basicSemester.getName(), basicExam.getName(), courseNameCode, classRoomName, "other");
|
|
|
+
|
|
|
+ String rootPath;
|
|
|
+ if(StringUtils.isEmpty(classRoomName)) {
|
|
|
+ rootPath = fileStoreUtil.buildPath(UploadFileEnum.IMAGE, false, basicSchool.getName(), basicSemester.getName(), basicExam.getName(), courseNameCode, "other");
|
|
|
+ } else {
|
|
|
+ rootPath = fileStoreUtil.buildPath(UploadFileEnum.IMAGE, false, basicSchool.getName(), basicSemester.getName(), basicExam.getName(), courseNameCode, classRoomName, "other");
|
|
|
+ }
|
|
|
+
|
|
|
// 根目录
|
|
|
List<FilePathVo> objects = new ArrayList<>();
|
|
|
try {
|