Commit 225a8bec authored by Ryan Loong's avatar Ryan Loong

update 清空点名次数

parent f0ac346f
......@@ -356,4 +356,20 @@ public class StudentInfoService {
.andIdIn(new ArrayList<>(idList))
.example());
}
@Transactional(rollbackFor = Exception.class)
public String handleEmptyAllCall() {
String logPrefix = StrUtil.format("[sessionId:{}]【清空点名次数】", UUID.randomUUID().toString().replace("-", ""));
log.info(StrUtil.format("{} 请求"));
int update = studentInfoMapper.updateByExampleSelective(
StudentInfo.builder().callTimes(0).updateTime(LocalDateTime.now()).build(),
new StudentInfoExample().createCriteria().andDeletedEqualTo(StudentInfo.NOT_DELETED).example(),
StudentInfo.Column.callTimes, StudentInfo.Column.updateTime
);
log.info(StrUtil.format("{} 更新成功 条目数量: '{}'", logPrefix, update));
return null;
}
}
......@@ -56,6 +56,12 @@ public class StudentController {
return StringUtils.isNotBlank(err) ? ResponseUtil.fail(301, err) : ResponseUtil.ok("修改成功");
}
@PostMapping("emptyCall/all")
public Object emptyAllCall() {
String err = studentInfoService.handleEmptyAllCall();
return StringUtils.isNotBlank(err) ? ResponseUtil.fail(301, err) : ResponseUtil.ok("修改成功");
}
@PostMapping("batchDeleted")
public Object batchDeleted(@RequestBody List<Integer> idList) {
String err = studentInfoService.batchDeleted(idList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment