|
|
@@ -409,18 +409,22 @@ public class BaseNewStudentController {
|
|
|
@PostMapping("/change-banding-status")
|
|
|
@ApiOperation(value = "修改分班状态")
|
|
|
@SaCheckPermission("basenewstudent:add")
|
|
|
- public RT<Boolean> changeBandingStatus(@Valid @RequestBody ChangeBandingStatusDto dto){
|
|
|
- BaseNewStudent newStudent = baseNewStudentService.getById(dto.getId());
|
|
|
-
|
|
|
- UpdateWrapper<BaseNewStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.eq("id", newStudent.getId());
|
|
|
- updateWrapper.setSql("is_can_banding = " + dto.getIsCanBanding());
|
|
|
- if(StrUtil.isNotEmpty(dto.getRemarks())){
|
|
|
- updateWrapper.setSql("remarks = '" + dto.getRemarks() + "'");
|
|
|
- }else{
|
|
|
- updateWrapper.setSql("remarks = null");
|
|
|
+ public RT<Boolean> changeBandingStatus(@Valid @RequestBody List<ChangeBandingStatusDto> dto){
|
|
|
+ for (ChangeBandingStatusDto el : dto) {
|
|
|
+ BaseNewStudent newStudent = baseNewStudentService.getById(el.getId());
|
|
|
+
|
|
|
+ UpdateWrapper<BaseNewStudent> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("id", newStudent.getId());
|
|
|
+ updateWrapper.setSql("is_can_banding = " + el.getIsCanBanding());
|
|
|
+ if(StrUtil.isNotEmpty(el.getRemarks())){
|
|
|
+ updateWrapper.setSql("remarks = '" + el.getRemarks() + "'");
|
|
|
+ }else{
|
|
|
+ updateWrapper.setSql("remarks = null");
|
|
|
+ }
|
|
|
+ baseNewStudentService.update(newStudent, updateWrapper);
|
|
|
}
|
|
|
- return RT.ok(baseNewStudentService.update(newStudent, updateWrapper));
|
|
|
+
|
|
|
+ return RT.ok(true);
|
|
|
}
|
|
|
|
|
|
}
|