mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-25 11:19:40 +08:00
后台学员列表返回无条件的total
This commit is contained in:
parent
e70301bdbf
commit
599d5938a7
@ -49,7 +49,6 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author 杭州白书科技有限公司
|
* @Author 杭州白书科技有限公司
|
||||||
*
|
|
||||||
* @create 2023/2/23 09:48
|
* @create 2023/2/23 09:48
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@ -57,21 +56,29 @@ import java.util.stream.Collectors;
|
|||||||
@RequestMapping("/backend/v1/user")
|
@RequestMapping("/backend/v1/user")
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|
||||||
@Autowired private UserService userService;
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired private UserDepartmentService userDepartmentService;
|
@Autowired
|
||||||
|
private UserDepartmentService userDepartmentService;
|
||||||
|
|
||||||
@Autowired private DepartmentService departmentService;
|
@Autowired
|
||||||
|
private DepartmentService departmentService;
|
||||||
|
|
||||||
@Autowired private ApplicationContext context;
|
@Autowired
|
||||||
|
private ApplicationContext context;
|
||||||
|
|
||||||
@Autowired private UserCourseHourRecordService userCourseHourRecordService;
|
@Autowired
|
||||||
|
private UserCourseHourRecordService userCourseHourRecordService;
|
||||||
|
|
||||||
@Autowired private UserCourseRecordService userCourseRecordService;
|
@Autowired
|
||||||
|
private UserCourseRecordService userCourseRecordService;
|
||||||
|
|
||||||
@Autowired private CourseHourService courseHourService;
|
@Autowired
|
||||||
|
private CourseHourService courseHourService;
|
||||||
|
|
||||||
@Autowired private CourseService courseService;
|
@Autowired
|
||||||
|
private CourseService courseService;
|
||||||
|
|
||||||
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_INDEX)
|
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_INDEX)
|
||||||
@GetMapping("/index")
|
@GetMapping("/index")
|
||||||
@ -120,6 +127,7 @@ public class UserController {
|
|||||||
"user_dep_ids",
|
"user_dep_ids",
|
||||||
userService.getDepIdsGroup(result.getData().stream().map(User::getId).toList()));
|
userService.getDepIdsGroup(result.getData().stream().map(User::getId).toList()));
|
||||||
data.put("departments", departmentService.id2name());
|
data.put("departments", departmentService.id2name());
|
||||||
|
data.put("pure_total", userService.total());
|
||||||
|
|
||||||
return JsonResponse.data(data);
|
return JsonResponse.data(data);
|
||||||
}
|
}
|
||||||
@ -216,7 +224,7 @@ public class UserController {
|
|||||||
String defaultAvatar = BCtx.getConfig().get(CConfig.MEMBER_DEFAULT_AVATAR);
|
String defaultAvatar = BCtx.getConfig().get(CConfig.MEMBER_DEFAULT_AVATAR);
|
||||||
|
|
||||||
List<String[]> errorLines = new ArrayList<>();
|
List<String[]> errorLines = new ArrayList<>();
|
||||||
errorLines.add(new String[] {"错误行", "错误信息"}); // 错误表-表头
|
errorLines.add(new String[]{"错误行", "错误信息"}); // 错误表-表头
|
||||||
|
|
||||||
// 读取存在的部门
|
// 读取存在的部门
|
||||||
List<Department> departments = departmentService.all();
|
List<Department> departments = departmentService.all();
|
||||||
@ -256,14 +264,14 @@ public class UserController {
|
|||||||
i++; // 索引值
|
i++; // 索引值
|
||||||
|
|
||||||
if (userItem.getEmail() == null || userItem.getEmail().trim().length() == 0) {
|
if (userItem.getEmail() == null || userItem.getEmail().trim().length() == 0) {
|
||||||
errorLines.add(new String[] {"第" + (i + startLine) + "行", "未输入邮箱账号"});
|
errorLines.add(new String[]{"第" + (i + startLine) + "行", "未输入邮箱账号"});
|
||||||
} else {
|
} else {
|
||||||
// 邮箱重复判断
|
// 邮箱重复判断
|
||||||
Integer repeatLine = emailRepeat.get(userItem.getEmail());
|
Integer repeatLine = emailRepeat.get(userItem.getEmail());
|
||||||
if (repeatLine != null) {
|
if (repeatLine != null) {
|
||||||
errorLines.add(
|
errorLines.add(
|
||||||
new String[] {
|
new String[]{
|
||||||
"第" + (i + startLine) + "行", "与第" + repeatLine + "行邮箱重复"
|
"第" + (i + startLine) + "行", "与第" + repeatLine + "行邮箱重复"
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
emailRepeat.put(userItem.getEmail(), i + startLine);
|
emailRepeat.put(userItem.getEmail(), i + startLine);
|
||||||
@ -273,7 +281,7 @@ public class UserController {
|
|||||||
|
|
||||||
// 部门数据检测
|
// 部门数据检测
|
||||||
if (userItem.getDeps() == null || userItem.getDeps().trim().length() == 0) {
|
if (userItem.getDeps() == null || userItem.getDeps().trim().length() == 0) {
|
||||||
errorLines.add(new String[] {"第" + (i + startLine) + "行", "未选择部门"});
|
errorLines.add(new String[]{"第" + (i + startLine) + "行", "未选择部门"});
|
||||||
} else {
|
} else {
|
||||||
String[] tmpDepList = userItem.getDeps().trim().split("\\|");
|
String[] tmpDepList = userItem.getDeps().trim().split("\\|");
|
||||||
Integer[] tmpDepIds = new Integer[tmpDepList.length];
|
Integer[] tmpDepIds = new Integer[tmpDepList.length];
|
||||||
@ -283,8 +291,8 @@ public class UserController {
|
|||||||
// 判断部门id是否存在
|
// 判断部门id是否存在
|
||||||
if (tmpDepId == null || tmpDepId == 0) {
|
if (tmpDepId == null || tmpDepId == 0) {
|
||||||
errorLines.add(
|
errorLines.add(
|
||||||
new String[] {
|
new String[]{
|
||||||
"第" + (i + startLine) + "行", "部门『" + tmpDepList[j] + "』不存在"
|
"第" + (i + startLine) + "行", "部门『" + tmpDepList[j] + "』不存在"
|
||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -296,13 +304,13 @@ public class UserController {
|
|||||||
// 姓名为空检测
|
// 姓名为空检测
|
||||||
String tmpName = userItem.getName();
|
String tmpName = userItem.getName();
|
||||||
if (tmpName == null || tmpName.trim().length() == 0) {
|
if (tmpName == null || tmpName.trim().length() == 0) {
|
||||||
errorLines.add(new String[] {"第" + (i + startLine) + "行", "昵称为空"});
|
errorLines.add(new String[]{"第" + (i + startLine) + "行", "昵称为空"});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 密码为空检测
|
// 密码为空检测
|
||||||
String tmpPassword = userItem.getPassword();
|
String tmpPassword = userItem.getPassword();
|
||||||
if (tmpPassword == null || tmpPassword.trim().length() == 0) {
|
if (tmpPassword == null || tmpPassword.trim().length() == 0) {
|
||||||
errorLines.add(new String[] {"第" + (i + startLine) + "行", "密码为空"});
|
errorLines.add(new String[]{"第" + (i + startLine) + "行", "密码为空"});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 待插入数据
|
// 待插入数据
|
||||||
@ -330,7 +338,7 @@ public class UserController {
|
|||||||
List<String> existsEmails = userService.existsEmailsByEmails(emails);
|
List<String> existsEmails = userService.existsEmailsByEmails(emails);
|
||||||
if (existsEmails.size() > 0) {
|
if (existsEmails.size() > 0) {
|
||||||
for (String tmpEmail : existsEmails) {
|
for (String tmpEmail : existsEmails) {
|
||||||
errorLines.add(new String[] {"第" + emailRepeat.get(tmpEmail) + "行", "邮箱已注册"});
|
errorLines.add(new String[]{"第" + emailRepeat.get(tmpEmail) + "行", "邮箱已注册"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errorLines.size() > 1) {
|
if (errorLines.size() > 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user