修复评测数据丢失问题

This commit is contained in:
Himit_ZH 2021-07-16 21:41:29 +08:00
parent 85ef0e2af3
commit e3c18922e7
4 changed files with 19 additions and 14 deletions

View File

@ -225,7 +225,11 @@ public class AdminContestController {
QueryWrapper<Problem> problemQueryWrapper = new QueryWrapper<>();
if (problemType != null) { // 必备条件 隐藏的不可取来做比赛题目
problemQueryWrapper.eq("type", problemType).ne("auth", 2);
problemQueryWrapper
// vj题目不限制赛制
.and(wrapper->wrapper.eq("type", problemType)
.or().eq("is_remote", true))
.ne("auth", 2);
}
// 逻辑判断如果是查询已有的就应该是in如果是查询不要重复的使用not in

View File

@ -279,7 +279,6 @@ public class FileController {
}
Assert.isTrue(hasTestCase, "对不起,该题目的评测数据为空!");
workDir = Constants.File.FILE_DOWNLOAD_TMP_FOLDER.getPath() + File.separator + IdUtil.simpleUUID();
FileUtil.mkdir(workDir);
// 写入本地
for (int i = 0; i < problemCaseList.size(); i++) {
@ -340,7 +339,6 @@ public class FileController {
e.printStackTrace();
}
// 清空临时文件
FileUtil.del(workDir);
FileUtil.del(Constants.File.FILE_DOWNLOAD_TMP_FOLDER.getPath() + File.separator + fileName);
}
}

View File

@ -16,7 +16,7 @@
and c.type = #{type}
</if>
</where>
order by c.start_time DESC,c.id DESC
order by c.status ASC, c.start_time DESC
</select>
<select id="getContestInfoById" resultType="top.hcode.hoj.pojo.vo.ContestVo" useCache="true">
select c.id,c.author,c.title,c.type,c.status,c.description,c.seal_rank,c.seal_rank_time,c.source,c.auth,c.start_time,c.end_time,c.duration

View File

@ -837,9 +837,9 @@ export default {
data.spjCode = '';
data.spj = false;
}
data.spjLanguage = data.spjLanguage || 'C';
this.spjRecord.spjLanguage = data.spjLanguage;
this.spjRecord.spjCode = data.spjCode;
data.spjLanguage = data.spjLanguage || 'C';
this.problem = data;
this.problem['examples'] = utils.stringToExamples(data.examples);
this.problem['examples'][0]['isOpen'] = true;
@ -1280,15 +1280,18 @@ export default {
}
let problemDto = {}; //
if (!this.problem.spj) {
this.problem.spjCode = '';
this.problem.spjLanguage = '';
}
if (
this.spjRecord.spjLanguage != this.problem.spjLanguage ||
this.spjRecord.spjCode != this.problem.spjCode
) {
problemDto['changeSpj'] = true;
if (this.problem.spj) {
if (
this.spjRecord.spjLanguage != this.problem.spjLanguage ||
this.spjRecord.spjCode != this.problem.spjCode
) {
problemDto['changeSpj'] = true;
}
} else {
// spj
if (!this.spjRecord.spjCode) {
problemDto['changeSpj'] = true;
}
}
problemDto['problem'] = Object.assign({}, this.problem); //
problemDto.problem.examples = utils.examplesToString(