Skip to content

Commit

Permalink
fix: 修复bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
GLaxky committed Dec 22, 2024
1 parent f350298 commit f2f6c30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/softeng/dingtalk/component/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void updateUserPosition() {
.filter((user -> user.getStuNum() != null))
.forEach((user -> {
// 排除教师用户
if(user.getPosition() == Position.TEACHER) return;
if(user.getPosition() == Position.TEACHER || user.getPosition() == Position.DOCTOR) return;
StuNumParser parser= StuNumParserFactory.generateParser(user.getStuNum().trim().length());
assert parser != null;
user.setPosition(parser.parse(user.getStuNum()));
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/com/softeng/dingtalk/service/PaperService.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void calculateInternalPaperAc(InternalPaper internalPaper) {
// voteService.computeVoteAc(vote, InternalPaper.ACCEPT, LocalDateTime.of(internalPaper.getUpdateDate(), LocalTime.of(8, 0)));
// }
// log.info("论文文件不完整,无法生成ac, 但已生成投票ac");
throw new ResponseStatusException(HttpStatus.OK, "但是由于论文文件不完整,论文ac未成功生成");
throw new ResponseStatusException(HttpStatus.OK, "由于论文文件不完整,论文ac未生成,请补充所有文件");
}
// 1. 获取 paperDetails
log.info("获取 paperDetails");
Expand Down Expand Up @@ -352,9 +352,14 @@ public void updateInternalPaperResult(int id, int result, LocalDate updateDate)
internalPaper.setResult(this.getPaperResult(true,result));
internalPaper.setUpdateDate(updateDate);
internalPaperRepository.save(internalPaper);
// 4. 更新论文 ac
// log.info("更新论文 ac");
// paperService.calculateInternalPaperAc(internalPaper);

log.info("更新论文 ac");
paperService.calculateInternalPaperAc(internalPaper);
// if(internalPaper.getResult() != InternalPaper.ACCEPT) {
// log.info("更新被拒绝或者中止的论文的相关 ac");
// paperService.calculateInternalPaperAc(internalPaper);
// }


// 5. 插入相关消息
notifyService.paperAcMessage(internalPaper);
Expand Down

0 comments on commit f2f6c30

Please sign in to comment.