|
@@ -581,7 +581,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
Set<Long> attachmentIds = new HashSet<>();
|
|
Set<Long> attachmentIds = new HashSet<>();
|
|
// Set<File> ftlList = new HashSet<>();
|
|
// Set<File> ftlList = new HashSet<>();
|
|
for (ExamDetail examDetail : examDetailList) {
|
|
for (ExamDetail examDetail : examDetailList) {
|
|
- tbTask.setObjName(examDetail.getExamRoom() + "-" + examDetail.getExamPlace());
|
|
|
|
|
|
+ tbTask.setObjName(examDetail.getExamRoom() + SystemConstant.HYPHEN + examDetail.getExamPlace());
|
|
//查询examDetailCourse
|
|
//查询examDetailCourse
|
|
QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
|
|
if (Objects.nonNull(examDetailCourseIds) && examDetailCourseIds.size() > 0) {
|
|
if (Objects.nonNull(examDetailCourseIds) && examDetailCourseIds.size() > 0) {
|
|
@@ -679,7 +679,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
stringJoiner.add(SystemConstant.getNanoId()).add(".").add(SystemConstant.XLSX);
|
|
stringJoiner.add(SystemConstant.getNanoId()).add(".").add(SystemConstant.XLSX);
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
- String dirName = stringJoiner.toString().replaceAll("\\\\", "/");
|
|
|
|
|
|
+ String dirName = stringJoiner.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
if (oss) {//上传至oss
|
|
if (oss) {//上传至oss
|
|
fileStoreUtil.ossUpload(dirName, in, DigestUtils.md5Hex(new ByteArrayInputStream(outputStream.toByteArray())), fileStoreUtil.getUploadEnumByPath(dirName).getFssType());
|
|
fileStoreUtil.ossUpload(dirName, in, DigestUtils.md5Hex(new ByteArrayInputStream(outputStream.toByteArray())), fileStoreUtil.getUploadEnumByPath(dirName).getFssType());
|
|
@@ -687,7 +687,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
jsonObject.put(SystemConstant.PATH, dirName);
|
|
jsonObject.put(SystemConstant.PATH, dirName);
|
|
} else {
|
|
} else {
|
|
if (Objects.nonNull(dictionaryConfig.fssLocalFileDomain()) && !StringUtils.isBlank(dictionaryConfig.fssLocalFileDomain().getConfig())) {
|
|
if (Objects.nonNull(dictionaryConfig.fssLocalFileDomain()) && !StringUtils.isBlank(dictionaryConfig.fssLocalFileDomain().getConfig())) {
|
|
- dirName = (dictionaryConfig.fssLocalFileDomain().getConfig() + File.separator + dirName).replaceAll("\\\\", "/");
|
|
|
|
|
|
+ dirName = (dictionaryConfig.fssLocalFileDomain().getConfig() + File.separator + dirName).replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
fileStoreUtil.copyInputStreamToFile(in, new File(stringJoiner.toString()), DigestUtils.md5Hex(new ByteArrayInputStream(outputStream.toByteArray())), LocalCatalogEnum.LOCAL_FILE);
|
|
fileStoreUtil.copyInputStreamToFile(in, new File(stringJoiner.toString()), DigestUtils.md5Hex(new ByteArrayInputStream(outputStream.toByteArray())), LocalCatalogEnum.LOCAL_FILE);
|
|
} else {
|
|
} else {
|
|
fileStoreUtil.ossUpload(dirName, in, DigestUtils.md5Hex(new ByteArrayInputStream(outputStream.toByteArray())), UploadFileEnum.FILE.getFssType());
|
|
fileStoreUtil.ossUpload(dirName, in, DigestUtils.md5Hex(new ByteArrayInputStream(outputStream.toByteArray())), UploadFileEnum.FILE.getFssType());
|
|
@@ -952,8 +952,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
.add(e.getExamName()).add(File.separator)
|
|
.add(e.getExamName()).add(File.separator)
|
|
.add(e.getCourseNameCode()).add(File.separator)
|
|
.add(e.getCourseNameCode()).add(File.separator)
|
|
.add(e.getPackageCode()).add(File.separator)
|
|
.add(e.getPackageCode()).add(File.separator)
|
|
- .add(e.getCourseNameCode()).add("-")
|
|
|
|
- .add(e.getPaperNumber()).add("-");
|
|
|
|
|
|
+ .add(e.getCourseNameCode()).add(SystemConstant.HYPHEN)
|
|
|
|
+ .add(e.getPaperNumber()).add(SystemConstant.HYPHEN);
|
|
//试卷合并文件
|
|
//试卷合并文件
|
|
if (Objects.nonNull(e.getAttachmentId())) {
|
|
if (Objects.nonNull(e.getAttachmentId())) {
|
|
BasicAttachment attachment = basicAttachmentService.getById(e.getAttachmentId());
|
|
BasicAttachment attachment = basicAttachmentService.getById(e.getAttachmentId());
|
|
@@ -996,7 +996,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
if (!CollectionUtils.isEmpty(sourceFileList)) {
|
|
if (!CollectionUtils.isEmpty(sourceFileList)) {
|
|
Zip4jUtil.zipEncryptFile(zipFile.getPath(), zipLocalRootPath, SystemConstant.ZIP_ENCRYPT_PWD);
|
|
Zip4jUtil.zipEncryptFile(zipFile.getPath(), zipLocalRootPath, SystemConstant.ZIP_ENCRYPT_PWD);
|
|
- String ossDirName = dirName.toString().replaceAll("\\\\", "/");
|
|
|
|
|
|
+ String ossDirName = dirName.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
if (oss) {//上传至oss
|
|
if (oss) {//上传至oss
|
|
@@ -1112,7 +1112,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
StringJoiner stringJoine = SystemConstant.getDirName(UploadFileEnum.FILE, true);
|
|
StringJoiner stringJoine = SystemConstant.getDirName(UploadFileEnum.FILE, true);
|
|
stringJoine.add(SystemConstant.getNanoId()).add(SystemConstant.ZIP_PREFIX);
|
|
stringJoine.add(SystemConstant.getNanoId()).add(SystemConstant.ZIP_PREFIX);
|
|
- String dirNameTmp = stringJoine.toString().replaceAll("\\\\", "/");
|
|
|
|
|
|
+ String dirNameTmp = stringJoine.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
File zipFile = new File(zipJoiner + dirNameTmp);
|
|
File zipFile = new File(zipJoiner + dirNameTmp);
|
|
if (!zipFile.getParentFile().exists()) {
|
|
if (!zipFile.getParentFile().exists()) {
|
|
zipFile.getParentFile().mkdirs();
|
|
zipFile.getParentFile().mkdirs();
|
|
@@ -1128,7 +1128,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (Objects.isNull(examTask)) {
|
|
if (Objects.isNull(examTask)) {
|
|
throw ExceptionResultEnum.ERROR.exception("未找到命题任务");
|
|
throw ExceptionResultEnum.ERROR.exception("未找到命题任务");
|
|
}
|
|
}
|
|
- String examTaskSign = examTask.getCourseName() + "-" + examTask.getPaperNumber();
|
|
|
|
|
|
+ String examTaskSign = examTask.getCourseName() + SystemConstant.HYPHEN + examTask.getPaperNumber();
|
|
String firstPath = zipLocalRootPath + File.separator + examTaskSign;
|
|
String firstPath = zipLocalRootPath + File.separator + examTaskSign;
|
|
ReviewSampleDto reviewSampleDto = examTaskService.findReviewSampleInfoByExamTaskId(id);
|
|
ReviewSampleDto reviewSampleDto = examTaskService.findReviewSampleInfoByExamTaskId(id);
|
|
|
|
|
|
@@ -1249,7 +1249,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
- zipLocalRootPath = zipLocalRootPath.replaceAll("\\\\", "/");
|
|
|
|
|
|
+ zipLocalRootPath = zipLocalRootPath.replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
Zip4jUtil.zipEncryptFile(zipFile.getPath(), zipLocalRootPath, SystemConstant.ZIP_ENCRYPT_PWD);
|
|
Zip4jUtil.zipEncryptFile(zipFile.getPath(), zipLocalRootPath, SystemConstant.ZIP_ENCRYPT_PWD);
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
if (oss) {//上传至oss
|
|
if (oss) {//上传至oss
|
|
@@ -1260,7 +1260,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
zipFile.delete();
|
|
zipFile.delete();
|
|
} else {
|
|
} else {
|
|
jsonObject.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
jsonObject.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
- jsonObject.put(SystemConstant.PATH, (zipJoiner + dirNameTmp).replaceAll("\\\\", "/"));
|
|
|
|
|
|
+ jsonObject.put(SystemConstant.PATH, (zipJoiner + dirNameTmp).replaceAll("\\\\", SystemConstant.ORG_SPLIT));
|
|
}
|
|
}
|
|
jsonObject.put(SystemConstant.UPLOAD_TYPE, UploadFileEnum.FILE);
|
|
jsonObject.put(SystemConstant.UPLOAD_TYPE, UploadFileEnum.FILE);
|
|
tbTask.setResultFilePath(jsonObject.toJSONString());
|
|
tbTask.setResultFilePath(jsonObject.toJSONString());
|
|
@@ -1287,7 +1287,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
StringJoiner dirName = SystemConstant.getDirName(UploadFileEnum.FILE, true);
|
|
StringJoiner dirName = SystemConstant.getDirName(UploadFileEnum.FILE, true);
|
|
dirName.add(yyyyMMddHH24mmss).add("_").add(basicSchool.getName()).add("_").add("试卷导出文件").add(SystemConstant.ZIP_PREFIX);
|
|
dirName.add(yyyyMMddHH24mmss).add("_").add(basicSchool.getName()).add("_").add("试卷导出文件").add(SystemConstant.ZIP_PREFIX);
|
|
- String dirNameTmp = dirName.toString().replaceAll("\\\\", "/");
|
|
|
|
|
|
+ String dirNameTmp = dirName.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
|
|
|
|
// 根文件路径
|
|
// 根文件路径
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
@@ -1307,8 +1307,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
.add(examTaskDetailPdfDownloadDto.getExamName()).add(File.separator)
|
|
.add(examTaskDetailPdfDownloadDto.getExamName()).add(File.separator)
|
|
.add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add(File.separator)
|
|
.add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add(File.separator)
|
|
.add(examTaskDetailPdfDownloadDto.getPaperNumber()).add(File.separator)
|
|
.add(examTaskDetailPdfDownloadDto.getPaperNumber()).add(File.separator)
|
|
- .add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add("-")
|
|
|
|
- .add(examTaskDetailPdfDownloadDto.getPaperNumber()).add("-");
|
|
|
|
|
|
+ .add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add(SystemConstant.HYPHEN)
|
|
|
|
+ .add(examTaskDetailPdfDownloadDto.getPaperNumber()).add(SystemConstant.HYPHEN);
|
|
// 试卷
|
|
// 试卷
|
|
String paperAttachmentIds = examTaskDetailPdfDownloadDto.getPaperAttachmentIds();
|
|
String paperAttachmentIds = examTaskDetailPdfDownloadDto.getPaperAttachmentIds();
|
|
if (StringUtils.isNotBlank(paperAttachmentIds)) {
|
|
if (StringUtils.isNotBlank(paperAttachmentIds)) {
|
|
@@ -1323,7 +1323,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
BasicAttachment attachment = basicAttachmentService.getById(attachmentId);
|
|
BasicAttachment attachment = basicAttachmentService.getById(attachmentId);
|
|
if (Objects.nonNull(attachment)) {
|
|
if (Objects.nonNull(attachment)) {
|
|
JSONObject jsonObject = JSONObject.parseObject(attachment.getPath());
|
|
JSONObject jsonObject = JSONObject.parseObject(attachment.getPath());
|
|
- String paperPath = dirPath.toString() + "试卷" + "-" + name + attachment.getType();
|
|
|
|
|
|
+ String paperPath = dirPath.toString() + "试卷" + SystemConstant.HYPHEN + name + attachment.getType();
|
|
UploadFileEnum uploadFileEnum = UploadFileEnum.valueOf((String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
|
|
UploadFileEnum uploadFileEnum = UploadFileEnum.valueOf((String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
|
|
File file = null;
|
|
File file = null;
|
|
file = new File(paperPath);
|
|
file = new File(paperPath);
|
|
@@ -1344,8 +1344,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
MakeMethodEnum makeMethodEnum = examCard.getMakeMethod();
|
|
MakeMethodEnum makeMethodEnum = examCard.getMakeMethod();
|
|
|
|
|
|
- String cardHtmlPath = dirPath.toString() + "题卡" + "-" + paperMap.get("name") + SystemConstant.HTML_PREFIX;
|
|
|
|
- String cardPdfPath = dirPath.toString() + "题卡" + "-" + paperMap.get("name") + SystemConstant.PDF_PREFIX;
|
|
|
|
|
|
+ String cardHtmlPath = dirPath.toString() + "题卡" + SystemConstant.HYPHEN + paperMap.get("name") + SystemConstant.HTML_PREFIX;
|
|
|
|
+ String cardPdfPath = dirPath.toString() + "题卡" + SystemConstant.HYPHEN + paperMap.get("name") + SystemConstant.PDF_PREFIX;
|
|
// 通用题卡
|
|
// 通用题卡
|
|
ExamCardDetail examCardDetail = examCardDetailService.getByCardId(examCard.getId());
|
|
ExamCardDetail examCardDetail = examCardDetailService.getByCardId(examCard.getId());
|
|
String htmlContent;
|
|
String htmlContent;
|
|
@@ -1945,7 +1945,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
StringJoiner stringJoiner = SystemConstant.getDirName(UploadFileEnum.FILE, true);
|
|
StringJoiner stringJoiner = SystemConstant.getDirName(UploadFileEnum.FILE, true);
|
|
stringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.ZIP_PREFIX);
|
|
stringJoiner.add(SystemConstant.getNanoId()).add(SystemConstant.ZIP_PREFIX);
|
|
- String dirNameTmp = stringJoiner.toString().replaceAll("\\\\", "/");
|
|
|
|
|
|
+ String dirNameTmp = stringJoiner.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
|
|
File zipFile = new File(zipJoiner + dirNameTmp);
|
|
File zipFile = new File(zipJoiner + dirNameTmp);
|
|
if (!zipFile.getParentFile().exists()) {
|
|
if (!zipFile.getParentFile().exists()) {
|
|
zipFile.getParentFile().mkdirs();
|
|
zipFile.getParentFile().mkdirs();
|
|
@@ -1973,7 +1973,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
throw ExceptionResultEnum.ERROR.exception("没有找到任何试卷信息");
|
|
throw ExceptionResultEnum.ERROR.exception("没有找到任何试卷信息");
|
|
}
|
|
}
|
|
// 二级路径 课程
|
|
// 二级路径 课程
|
|
- Set<String> courseSet = examTaskPaperFileDtoList.stream().map(e -> e.getCourseName() + "-" + e.getCourseCode()).collect(Collectors.toSet());
|
|
|
|
|
|
+ Set<String> courseSet = examTaskPaperFileDtoList.stream().map(e -> e.getCourseName() + SystemConstant.HYPHEN + e.getCourseCode()).collect(Collectors.toSet());
|
|
// 文件数以一级目录文件为准(初始1是excel)
|
|
// 文件数以一级目录文件为准(初始1是excel)
|
|
int count = 1;
|
|
int count = 1;
|
|
for (String course : courseSet) {
|
|
for (String course : courseSet) {
|
|
@@ -1981,7 +1981,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
int courseCount = 0;
|
|
int courseCount = 0;
|
|
Set<String> paperNumberSet = examTaskPaperFileDtoList
|
|
Set<String> paperNumberSet = examTaskPaperFileDtoList
|
|
.stream()
|
|
.stream()
|
|
- .filter(e -> course.equals(e.getCourseName() + "-" + e.getCourseCode()))
|
|
|
|
|
|
+ .filter(e -> course.equals(e.getCourseName() + SystemConstant.HYPHEN + e.getCourseCode()))
|
|
.map(ExamTaskPaperFileDto::getPaperNumber)
|
|
.map(ExamTaskPaperFileDto::getPaperNumber)
|
|
.collect(Collectors.toSet());
|
|
.collect(Collectors.toSet());
|
|
for (String paperNumber : paperNumberSet) {
|
|
for (String paperNumber : paperNumberSet) {
|
|
@@ -2047,7 +2047,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (namedByOriginalFile) {
|
|
if (namedByOriginalFile) {
|
|
cardName = cardName + examCardService.getById(examCardId).getTitle();
|
|
cardName = cardName + examCardService.getById(examCardId).getTitle();
|
|
}
|
|
}
|
|
- cardName = cardName + "-" + examTaskPaperFileDto.getPaperType();
|
|
|
|
|
|
+ cardName = cardName + SystemConstant.HYPHEN + examTaskPaperFileDto.getPaperType();
|
|
String cardLocalHtmlPath = filePath + cardName + SystemConstant.HTML_PREFIX;
|
|
String cardLocalHtmlPath = filePath + cardName + SystemConstant.HTML_PREFIX;
|
|
String cardLocalPdfPath = filePath + cardName + SystemConstant.PDF_PREFIX;
|
|
String cardLocalPdfPath = filePath + cardName + SystemConstant.PDF_PREFIX;
|
|
|
|
|
|
@@ -2078,7 +2078,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (namedByOriginalFile) {
|
|
if (namedByOriginalFile) {
|
|
paperName = paperName + examTaskPaperFileDto.getPaperName();
|
|
paperName = paperName + examTaskPaperFileDto.getPaperName();
|
|
}
|
|
}
|
|
- paperName = paperName + "-" + examTaskPaperFileDto.getPaperType();
|
|
|
|
|
|
+ paperName = paperName + SystemConstant.HYPHEN + examTaskPaperFileDto.getPaperType();
|
|
String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
|
|
String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
|
|
String paperPath = examTaskPaperFileDto.getPaperPath();
|
|
String paperPath = examTaskPaperFileDto.getPaperPath();
|
|
if (oss) {
|
|
if (oss) {
|
|
@@ -2115,7 +2115,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (namedByOriginalFile) {
|
|
if (namedByOriginalFile) {
|
|
cardName = cardName + examCardService.getById(examCardId).getTitle();
|
|
cardName = cardName + examCardService.getById(examCardId).getTitle();
|
|
}
|
|
}
|
|
- cardName = cardName + "-" + examTaskPaperFileDto.getPaperType();
|
|
|
|
|
|
+ cardName = cardName + SystemConstant.HYPHEN + examTaskPaperFileDto.getPaperType();
|
|
String cardLocalHtmlPath = filePath + cardName + SystemConstant.HTML_PREFIX;
|
|
String cardLocalHtmlPath = filePath + cardName + SystemConstant.HTML_PREFIX;
|
|
String cardLocalPdfPath = filePath + cardName + SystemConstant.PDF_PREFIX;
|
|
String cardLocalPdfPath = filePath + cardName + SystemConstant.PDF_PREFIX;
|
|
File localCardFile = new File(cardLocalHtmlPath);
|
|
File localCardFile = new File(cardLocalHtmlPath);
|
|
@@ -2141,7 +2141,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
if (namedByOriginalFile) {
|
|
if (namedByOriginalFile) {
|
|
paperName = paperName + examTaskPaperFileDto.getPaperName();
|
|
paperName = paperName + examTaskPaperFileDto.getPaperName();
|
|
}
|
|
}
|
|
- paperName = paperName + "-" + examTaskPaperFileDto.getPaperType();
|
|
|
|
|
|
+ paperName = paperName + SystemConstant.HYPHEN + examTaskPaperFileDto.getPaperType();
|
|
String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
|
|
String paperLocalPath = filePath + paperName + examTaskPaperFileDto.getPaperSuffix();
|
|
String paperPath = examTaskPaperFileDto.getPaperPath();
|
|
String paperPath = examTaskPaperFileDto.getPaperPath();
|
|
|
|
|