From 6cba427b1f1dd37c811e2cc3f9ad43147570b07d Mon Sep 17 00:00:00 2001 From: Himit_ZH <372347736@qq.com> Date: Sat, 31 Jul 2021 12:12:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=A2=98=E7=9B=AE=E6=B5=8B=E8=AF=95=E7=82=B9=E5=88=86?= =?UTF-8?q?=E6=95=B0=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/top/hcode/hoj/dao/xml/UserRecordMapper.xml | 6 +++--- .../java/top/hcode/hoj/service/impl/ProblemServiceImpl.java | 6 +++--- .../api/src/main/java/top/hcode/hoj/pojo/entity/Judge.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserRecordMapper.xml b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserRecordMapper.xml index 23d0f1f3..936c1078 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserRecordMapper.xml +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/dao/xml/UserRecordMapper.xml @@ -3,7 +3,7 @@ SELECT u.uuid as uid,u.nickname,u.username,u.signature,u.avatar, (SELECT COUNT( DISTINCT pid ) FROM user_acproblem WHERE uid =u.uuid - and DATE(gmt_create) >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) ) AS ac, + and DATE(gmt_create) >= DATE_SUB(CURDATE(),INTERVAL 7 DAY)) AS ac, (SELECT COUNT(uid) FROM judge WHERE uid=u.uuid AND cid=0 - and DATE(gmt_create) >= DATE_SUB(CURDATE(),INTERVAL 7 DAY) )AS total + and DATE(submit_time) >= DATE_SUB(CURDATE(),INTERVAL 7 DAY)) AS total FROM user_info u WHERE u.status = 0 ORDER BY ac DESC,total ASC LIMIT 10 diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java index e3ac3680..c90b2235 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/service/impl/ProblemServiceImpl.java @@ -293,8 +293,8 @@ public class ProblemServiceImpl extends ServiceImpl impl if (needDeleteProblemCases.size() > 0 || newProblemCaseList.size() > 0 || needUpdateProblemCaseList.size() > 0 || !StringUtils.isEmpty(testcaseDir)) { problem.setCaseVersion(caseVersion); - // 如果是选择上传测试文件的,临时文件路径不为空,则需要遍历对应文件夹,读取数据,写入数据库,先前的题目数据一并清空。 - if (problemDto.getIsUploadTestCase() && !StringUtils.isEmpty(testcaseDir)) { + // 如果是选择上传测试文件的,则需要遍历对应文件夹,读取数据,写入数据库,先前的题目数据一并清空。 + if (problemDto.getIsUploadTestCase()) { // 获取代理bean对象执行异步方法===》根据测试文件初始info applicationContext.getBean(ProblemServiceImpl.class).initUploadTestCase(problemDto.getIsSpj(), caseVersion, pid, testcaseDir, problemDto.getSamples()); } else { @@ -428,7 +428,7 @@ public class ProblemServiceImpl extends ServiceImpl impl String testCasesDir = Constants.File.TESTCASE_BASE_FOLDER.getPath() + File.separator + "problem_" + problemId; // 将之前的临时文件夹里面的评测文件全部复制到指定文件夹(覆盖) - if (tmpTestcaseDir != null) { + if (!StringUtils.isEmpty(tmpTestcaseDir)) { FileUtil.copyFilesFromDir(new File(tmpTestcaseDir), new File(testCasesDir), true); } diff --git a/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/Judge.java b/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/Judge.java index 88f8edf2..de7ce881 100644 --- a/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/Judge.java +++ b/hoj-springboot/api/src/main/java/top/hcode/hoj/pojo/entity/Judge.java @@ -41,7 +41,7 @@ public class Judge implements Serializable { @ApiModelProperty(value = "用户名") private String username; - @ApiModelProperty(value = "结果码具体参考文档") + @ApiModelProperty(value = "提交的时间") private Date submitTime; @ApiModelProperty(value = "结果码具体参考文档")