|
@@ -1,11 +1,13 @@
|
|
|
package com.qmth.distributed.print.api;
|
|
|
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
+import com.qmth.distributed.print.business.bean.params.TeachStudentBatchParam;
|
|
|
import com.qmth.distributed.print.business.bean.params.TeachStudentParams;
|
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
|
import com.qmth.distributed.print.business.service.TeachStudentService;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
@@ -21,6 +23,7 @@ import javax.validation.constraints.Max;
|
|
|
import javax.validation.constraints.Min;
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* @Description: 教学学生 前端控制器
|
|
@@ -58,6 +61,25 @@ public class TeachStudentController {
|
|
|
return ResultUtil.ok(teachStudentService.createTeachStudent(teachStudentParams.getStudentName(), teachStudentParams.getStudentCode(), teachStudentParams.getTeachClazzId(), requestUser));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "教学学生-从课程班级批量添加学生")
|
|
|
+ @RequestMapping(value = "/create_batch", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "创建成功", response = EditResult.class)})
|
|
|
+ public Result createTeachStudentBatchByDictionary(@Valid @RequestBody TeachStudentBatchParam teachStudentBatchParam, BindingResult bindingResult) {
|
|
|
+ SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
+ }
|
|
|
+ Set<Long> basicStudentIdSet = teachStudentBatchParam.getBasicStudentIdSet();
|
|
|
+ if (basicStudentIdSet == null || basicStudentIdSet.size() == 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("请选择要删除的对象");
|
|
|
+ }
|
|
|
+ Long teachClazzId = teachStudentBatchParam.getTeachClazzId();
|
|
|
+ Long schoolId = (Long) ServletUtil.getRequestHeaderSchoolId();
|
|
|
+ teachStudentService.createTeachStudentBatch(basicStudentIdSet, teachClazzId, schoolId, requestUser);
|
|
|
+ return ResultUtil.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@ApiOperation(value = "教学学生-批量导入")
|
|
|
@RequestMapping(value = "/import", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
|