|
@@ -78,7 +78,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
|
if (StringUtils.isBlank(domain.getLoginName())) {
|
|
|
throw new StatusException("登录名不能为空");
|
|
|
}
|
|
|
- if (domain.getId()== null&&StringUtils.isBlank(domain.getPasswd())) {
|
|
|
+ if (domain.getId() == null && StringUtils.isBlank(domain.getPasswd())) {
|
|
|
throw new StatusException("密码不能为空");
|
|
|
}
|
|
|
if (domain.getRole() == null) {
|
|
@@ -243,6 +243,14 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
|
throw new StatusException("没有权限");
|
|
|
}
|
|
|
IPage<UserVo> iPage = this.baseMapper.page(new Page<UserVo>(query.getPageNumber(), query.getPageSize()), query);
|
|
|
+ if (CollectionUtils.isNotEmpty(iPage.getRecords())) {
|
|
|
+ for (UserVo vo : iPage.getRecords()) {
|
|
|
+ if (vo.getRoleId().equals(Role.SECTION_LEADER.getId())) {
|
|
|
+ List<CourseInfo> cs = userCourseRelationService.getCourses(vo.getId());
|
|
|
+ vo.setCourseCodes(cs.stream().map(m -> m.getCode()).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return PageUtil.of(iPage);
|
|
|
}
|
|
|
|
|
@@ -261,8 +269,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
|
vo.setSchoolId(ue.getSchoolId());
|
|
|
vo.setSchoolName(schoolService.getById(ue.getSchoolId()).getName());
|
|
|
if (vo.getRoleId().equals(Role.SECTION_LEADER.getId())) {
|
|
|
- List<CourseInfo> cs=userCourseRelationService.getCourses(vo.getId());
|
|
|
- vo.setCourseCodes(cs.stream().map(m->m.getCode()).collect(Collectors.toList()));
|
|
|
+ List<CourseInfo> cs = userCourseRelationService.getCourses(vo.getId());
|
|
|
+ vo.setCourseCodes(cs.stream().map(m -> m.getCode()).collect(Collectors.toList()));
|
|
|
}
|
|
|
return vo;
|
|
|
}
|
|
@@ -334,13 +342,13 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
|
vo.setSchoolId(ue.getSchoolId());
|
|
|
vo.setSchoolName(schoolService.getById(ue.getSchoolId()).getName());
|
|
|
if (vo.getRoleId().equals(Role.SECTION_LEADER.getId())) {
|
|
|
- List<CourseInfo> cs=userCourseRelationService.getCourses(vo.getId());
|
|
|
- if(CollectionUtils.isNotEmpty(cs)) {
|
|
|
- vo.setCourseCodes(cs.stream().map(m->m.getCode()).collect(Collectors.toList()));
|
|
|
- vo.setCourseNames(cs.stream().map(m->m.getCode()+"-"+m.getName()).collect(Collectors.toList()));
|
|
|
+ List<CourseInfo> cs = userCourseRelationService.getCourses(vo.getId());
|
|
|
+ if (CollectionUtils.isNotEmpty(cs)) {
|
|
|
+ vo.setCourseCodes(cs.stream().map(m -> m.getCode()).collect(Collectors.toList()));
|
|
|
+ vo.setCourseNames(cs.stream().map(m -> m.getCode() + "-" + m.getName()).collect(Collectors.toList()));
|
|
|
}
|
|
|
}
|
|
|
return vo;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|