|
@@ -77,6 +77,38 @@ public class UserController {
|
|
|
return success(id);
|
|
|
}
|
|
|
|
|
|
+// @PostMapping("/createStudent")
|
|
|
+// @Operation(summary = "新增学生")
|
|
|
+// @PreAuthorize("@ss.hasPermission('system:user:createStudent')")
|
|
|
+// public CommonResult<Long> createStudent(@Valid @RequestBody UserSaveReqVO reqVO) {
|
|
|
+// reqVO.setUserType("1");
|
|
|
+// Long id = userService.createUser(reqVO);
|
|
|
+// Set<Long> roleId = new HashSet<>();
|
|
|
+// if (reqVO.getUserType()!=null){//添加权限
|
|
|
+// if (reqVO.getUserType().equals("1") ||reqVO.getUserType().equals("2")) {
|
|
|
+// roleId.add(112L);//学生
|
|
|
+// }
|
|
|
+// }
|
|
|
+// permissionService.assignUserRole(id,roleId);
|
|
|
+// return success(id);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @PostMapping("/createTeacher")
|
|
|
+// @Operation(summary = "新增导师")
|
|
|
+// @PreAuthorize("@ss.hasPermission('system:user:createTeacher')")
|
|
|
+// public CommonResult<Long> createTeacher(@Valid @RequestBody UserSaveReqVO reqVO) {
|
|
|
+// reqVO.setUserType("2");
|
|
|
+// Long id = userService.createUser(reqVO);
|
|
|
+// Set<Long> roleId = new HashSet<>();
|
|
|
+// if (reqVO.getUserType()!=null){//添加权限
|
|
|
+// if (reqVO.getUserType().equals("3")) {
|
|
|
+// roleId.add(113L);//学生
|
|
|
+// }
|
|
|
+// }
|
|
|
+// permissionService.assignUserRole(id,roleId);
|
|
|
+// return success(id);
|
|
|
+// }
|
|
|
+
|
|
|
|
|
|
@PutMapping("update")
|
|
|
@Operation(summary = "修改用户")
|
|
@@ -173,22 +205,22 @@ public class UserController {
|
|
|
pageResult.getTotal()));
|
|
|
}
|
|
|
|
|
|
-// @GetMapping("/SchoolStudentPage")
|
|
|
-// @Operation(summary = "获得在校学生分页列表")
|
|
|
-// @PreAuthorize("@ss.hasPermission('system:user:SchoolStudentList')")
|
|
|
-// public CommonResult<PageResult<UserRespVO>> getSchoolStudentPage(@Valid UserPageReqVO pageReqVO) {
|
|
|
-// // 获得用户分页列表
|
|
|
-// pageReqVO.setUserType("1");
|
|
|
-// PageResult<AdminUserDO> pageResult = userService.getUserPage1(pageReqVO);
|
|
|
-// if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
-// return success(new PageResult<>(pageResult.getTotal()));
|
|
|
-// }
|
|
|
-// // 拼接数据
|
|
|
-// Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
|
|
-// convertList(pageResult.getList(), AdminUserDO::getDeptId));
|
|
|
-// return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
|
|
|
-// pageResult.getTotal()));
|
|
|
-// }
|
|
|
+ @GetMapping("/SchoolStudentPage")
|
|
|
+ @Operation(summary = "获得在校学生分页列表")
|
|
|
+ @PreAuthorize("@ss.hasPermission('system:user:SchoolStudentList')")
|
|
|
+ public CommonResult<PageResult<UserRespVO>> getSchoolStudentPage(@Valid UserPageReqVO pageReqVO) {
|
|
|
+ // 获得用户分页列表
|
|
|
+ pageReqVO.setUserType("1");
|
|
|
+ PageResult<AdminUserDO> pageResult = userService.getUserPage1(pageReqVO);
|
|
|
+ if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
+ return success(new PageResult<>(pageResult.getTotal()));
|
|
|
+ }
|
|
|
+ // 拼接数据
|
|
|
+ Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
|
|
+ convertList(pageResult.getList(), AdminUserDO::getDeptId));
|
|
|
+ return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
|
|
|
+ pageResult.getTotal()));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@GetMapping("/DeptTeacherPage")
|
|
@@ -322,7 +354,7 @@ public class UserController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get-import-template")
|
|
|
- @Operation(summary = "获得导入用户模板")
|
|
|
+ @Operation(summary = "获得在校生模板")
|
|
|
public void importTemplate(HttpServletResponse response) throws IOException {
|
|
|
// 手动创建导出 demo
|
|
|
List<UserImportExcelVO> list = Arrays.asList(
|
|
@@ -334,6 +366,30 @@ public class UserController {
|
|
|
ExcelUtils.write(response, "用户导入模板.xls", "用户列表", UserImportExcelVO.class, list);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/get-import-graduateTemplate")
|
|
|
+ @Operation(summary = "获得毕业生模板")
|
|
|
+ public void importGraduateTemplate(HttpServletResponse response) throws IOException {
|
|
|
+ List<graduateStudentImportExcelVO> list = Arrays.asList(
|
|
|
+ graduateStudentImportExcelVO.builder().username("graduateStudent").password("123456").email("2456125438@qq.com").mobile("15601691300")
|
|
|
+ .nickname("测试000").userType("毕业生").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex())
|
|
|
+ .build()
|
|
|
+ );
|
|
|
+ ExcelUtils.write(response, "用户导入模板.xls", "用户列表", graduateStudentImportExcelVO.class, list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/get-import-teacherTemplate")
|
|
|
+ @Operation(summary = "获得导师模板")
|
|
|
+ public void importTeacherTemplate(HttpServletResponse response) throws IOException {
|
|
|
+ List<teacherImportExcelVO> list = Arrays.asList(
|
|
|
+ teacherImportExcelVO.builder().username("teacher").password("123456").email("2456125438@qq.com").mobile("15601691300").deptName("2#601")
|
|
|
+ .nickname("测试000") .userType("导师").status(CommonStatusEnum.ENABLE.getStatus()).sex(SexEnum.MALE.getSex())
|
|
|
+ .build()
|
|
|
+ );
|
|
|
+ ExcelUtils.write(response, "用户导入模板.xls", "用户列表", teacherImportExcelVO.class, list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@PostMapping("/import")
|
|
|
@Operation(summary = "导入用户")
|
|
|
@Parameters({
|