修复评测数据丢失问题
This commit is contained in:
parent
85ef0e2af3
commit
e3c18922e7
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,16 +1280,19 @@ export default {
|
|||
}
|
||||
|
||||
let problemDto = {}; // 上传给后台的数据
|
||||
if (!this.problem.spj) {
|
||||
this.problem.spjCode = '';
|
||||
this.problem.spjLanguage = '';
|
||||
}
|
||||
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(
|
||||
this.problem.examples
|
||||
|
|
Loading…
Reference in New Issue