|
@@ -35,16 +35,14 @@ public class TeacherController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysRoleService roleService;
|
|
private ISysRoleService roleService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ISysDeptService deptService;
|
|
private ISysDeptService deptService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private ISysPostService postService;
|
|
|
|
-
|
|
|
|
|
|
+ private SysDeptMapper deptMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AddOnDeptService addOnDeptService;
|
|
@Autowired
|
|
@Autowired
|
|
private TeacherService teacherService;
|
|
private TeacherService teacherService;
|
|
|
|
|
|
@@ -55,10 +53,19 @@ public class TeacherController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 新增教师
|
|
|
|
|
|
+ * copy
|
|
|
|
+ * 根据用户编号获取详细信息
|
|
*/
|
|
*/
|
|
- // @PreAuthorize("@ss.hasPermi('sim:teacher:add')")
|
|
|
|
- // @Log(title = "用户管理", businessType = BusinessType.INSERT)
|
|
|
|
|
|
+ @GetMapping(value = "/{userId}")
|
|
|
|
+ @ApiOperation("根据userId获取教师详细信息")
|
|
|
|
+ public AjaxResult getInfo(@PathVariable(value = "userId") Long userId) {
|
|
|
|
+ // -------------------------------- tom add --------------------------------
|
|
|
|
+ // 覆盖data
|
|
|
|
+ // ajax.put(AjaxResult.DATA_TAG, student);
|
|
|
|
+ // -------------------------------- tom add --------------------------------
|
|
|
|
+ return success(teacherService.selectTeacherByUserId(userId));
|
|
|
|
+ }
|
|
|
|
+
|
|
@PostMapping
|
|
@PostMapping
|
|
@ApiOperation("新增教师")
|
|
@ApiOperation("新增教师")
|
|
public AjaxResult add(@Validated @RequestBody SysUser user) {
|
|
public AjaxResult add(@Validated @RequestBody SysUser user) {
|
|
@@ -76,21 +83,16 @@ public class TeacherController extends BaseController {
|
|
AjaxResult tempAjax = toAjax(userService.insertUser(user));
|
|
AjaxResult tempAjax = toAjax(userService.insertUser(user));
|
|
// -------------------------------- --------------------------------
|
|
// -------------------------------- --------------------------------
|
|
|
|
|
|
- // 自动添加学生权限
|
|
|
|
- SysUser find = userService.selectUserByUserName(user.getUserName());
|
|
|
|
- logger.info(String.valueOf(find));
|
|
|
|
- if (find != null) {
|
|
|
|
|
|
+ // 自动添加权限
|
|
|
|
+ SysUser suF = userService.selectUserByUserName(user.getUserName());
|
|
|
|
+ logger.info(String.valueOf(suF));
|
|
|
|
+ if (suF != null) {
|
|
// roleService.insertAuthUsers(Consts.ROLE_ID_STUDENT, new Long[]{userId});
|
|
// roleService.insertAuthUsers(Consts.ROLE_ID_STUDENT, new Long[]{userId});
|
|
- userService.insertUserAuth(find.getUserId(), new Long[]{Consts.ROLE_ID_TEACHER});
|
|
|
|
|
|
+ userService.insertUserAuth(suF.getUserId(), new Long[]{Consts.ROLE_ID_TEACHER});
|
|
}
|
|
}
|
|
return tempAjax;
|
|
return tempAjax;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 修改教师
|
|
|
|
- */
|
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:teacher:edit')")
|
|
|
|
- // @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
|
|
|
@PutMapping
|
|
@PutMapping
|
|
@ApiOperation("修改教师")
|
|
@ApiOperation("修改教师")
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user) {
|
|
public AjaxResult edit(@Validated @RequestBody SysUser user) {
|
|
@@ -115,8 +117,6 @@ public class TeacherController extends BaseController {
|
|
/**
|
|
/**
|
|
* 删除教师
|
|
* 删除教师
|
|
*/
|
|
*/
|
|
- // @PreAuthorize("@ss.hasPermi('sim:teacher:remove')")
|
|
|
|
- // @Log(title = "用户管理", businessType = BusinessType.DELETE)
|
|
|
|
@DeleteMapping("/{userIds}")
|
|
@DeleteMapping("/{userIds}")
|
|
@ApiOperation("删除教师")
|
|
@ApiOperation("删除教师")
|
|
public AjaxResult remove(@PathVariable Long[] userIds) {
|
|
public AjaxResult remove(@PathVariable Long[] userIds) {
|
|
@@ -126,19 +126,11 @@ public class TeacherController extends BaseController {
|
|
return toAjax(userService.deleteUserByIds(userIds));
|
|
return toAjax(userService.deleteUserByIds(userIds));
|
|
}
|
|
}
|
|
|
|
|
|
- // @PreAuthorize("@ss.hasPermi('sim:teacher:resetPwd')")
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private SysDeptMapper deptMapper;
|
|
|
|
- @Autowired
|
|
|
|
- private AddOnDeptService addOnDeptService;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 获取班级/部门列表
|
|
* 获取班级/部门列表
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- //@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
|
|
|
@GetMapping("/class-major/list")
|
|
@GetMapping("/class-major/list")
|
|
@ApiOperation("获取班级/部门列表")
|
|
@ApiOperation("获取班级/部门列表")
|
|
/**
|
|
/**
|