Commit df1357bf authored by Ryan Loong's avatar Ryan Loong

add 清除单个学生成绩的接口

parent 3a4bf0e2
package cn.exploring.engine.server.db.domain.vo;
public class IdVo {
private Integer id;
public IdVo() {
}
public IdVo(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
...@@ -115,6 +115,17 @@ public class StudentPointService { ...@@ -115,6 +115,17 @@ public class StudentPointService {
.example()); .example());
} }
@Transactional(rollbackFor = Exception.class)
public void removeByStudentId(Integer studentId) {
studentPointInfoMapper.updateByExampleSelective(new StudentPointInfo(){{
setUpdateTime(LocalDateTime.now());
setDeleted(StudentPointInfo.IS_DELETED);
}}, new StudentPointInfoExample().createCriteria()
.andDeletedEqualTo(StudentPointInfo.NOT_DELETED)
.andStudentIdEqualTo(studentId)
.example());
}
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true) @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public List<StudentPointInfo> listByClassId(Integer classId) { public List<StudentPointInfo> listByClassId(Integer classId) {
return studentPointInfoMapper.selectByExample(new StudentPointInfoExample().createCriteria() return studentPointInfoMapper.selectByExample(new StudentPointInfoExample().createCriteria()
......
...@@ -3,6 +3,7 @@ package cn.exploring.engine.server.wx.web; ...@@ -3,6 +3,7 @@ package cn.exploring.engine.server.wx.web;
import cn.exploring.engine.server.core.storage.StorageService; import cn.exploring.engine.server.core.storage.StorageService;
import cn.exploring.engine.server.core.util.ResponseUtil; import cn.exploring.engine.server.core.util.ResponseUtil;
import cn.exploring.engine.server.db.domain.StudentPointInfo; import cn.exploring.engine.server.db.domain.StudentPointInfo;
import cn.exploring.engine.server.db.domain.vo.IdVo;
import cn.exploring.engine.server.db.service.StudentInfoService; import cn.exploring.engine.server.db.service.StudentInfoService;
import cn.exploring.engine.server.db.service.StudentPointService; import cn.exploring.engine.server.db.service.StudentPointService;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -68,6 +69,12 @@ public class PointController { ...@@ -68,6 +69,12 @@ public class PointController {
return ResponseUtil.ok(); return ResponseUtil.ok();
} }
@PostMapping("remove")
public Object remove(@RequestBody IdVo req) {
pointService.removeByStudentId(req.getId());
return ResponseUtil.ok();
}
@GetMapping("export") @GetMapping("export")
public Object export(Integer classId) { public Object export(Integer classId) {
......
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