|
|
@ -43,6 +43,7 @@ import java.math.BigDecimal; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
@ -148,13 +149,26 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
// throw new BusinessException(ErrorCode.USERNAME_NOT_EXIT);
|
|
|
|
// throw new BusinessException(ErrorCode.USERNAME_NOT_EXIT);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// UmsUser umsUser = umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>()
|
|
|
|
int roleId = Integer.parseInt(umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>() |
|
|
|
// .eq(UmsUser::getUsername, username));
|
|
|
|
.eq(UmsUser::getUsername, username)).getRoleId()); |
|
|
|
// UmsAdminRoleRelation umsAdminRoleRelation = umsAdminRoleRelationMapper.selectOne(new LambdaQueryWrapper<UmsAdminRoleRelation>()
|
|
|
|
|
|
|
|
// .eq(UmsAdminRoleRelation::getAdminId, umsUser.getId()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// int roleId = Math.toIntExact(umsAdminRoleRelation.getRoleId());
|
|
|
|
// int roleId = Math.toIntExact(umsAdminRoleRelation.getRoleId());
|
|
|
|
int roleId = Math.toIntExact(courseQuery.getRoleId()); |
|
|
|
// int roleId = 0;
|
|
|
|
|
|
|
|
// List<String> roleIdList = courseQuery.getRoleId();
|
|
|
|
|
|
|
|
// System.out.println(roleIdList);
|
|
|
|
|
|
|
|
// if (roleIdList != null && !roleIdList.isEmpty()) {
|
|
|
|
|
|
|
|
// Object firstElement = roleIdList.get(0);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (firstElement instanceof List) {
|
|
|
|
|
|
|
|
// List<?> innerList = (List<?>) firstElement;
|
|
|
|
|
|
|
|
// if (!innerList.isEmpty()) {
|
|
|
|
|
|
|
|
// roleId = Integer.parseInt((String) innerList.get(0));
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else if (firstElement instanceof String) {
|
|
|
|
|
|
|
|
// roleId = Integer.parseInt((String) firstElement);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
System.out.println(roleId); |
|
|
|
PageDTO<CoursesVO> coursesVOPageDTO; |
|
|
|
PageDTO<CoursesVO> coursesVOPageDTO; |
|
|
|
|
|
|
|
|
|
|
|
switch (roleId) { |
|
|
|
switch (roleId) { |
|
|
@ -183,6 +197,9 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
Page<Courses> p = lambdaQuery() |
|
|
|
Page<Courses> p = lambdaQuery() |
|
|
|
.like(courseQuery.getName() != null, Courses::getName, courseQuery.getName()) |
|
|
|
.like(courseQuery.getName() != null, Courses::getName, courseQuery.getName()) |
|
|
|
.apply("FIND_IN_SET({0}, teacher)", username) |
|
|
|
.apply("FIND_IN_SET({0}, teacher)", username) |
|
|
|
|
|
|
|
.eq(courseQuery.getCategory() != null && !courseQuery.getCategory().isEmpty(), Courses::getCategory, courseQuery.getCategory()) |
|
|
|
|
|
|
|
.eq(courseQuery.getNature() != null && !courseQuery.getNature().isEmpty(), Courses::getNature, courseQuery.getNature()) |
|
|
|
|
|
|
|
.eq(courseQuery.getAssessmenttype() != null &&!courseQuery.getAssessmenttype().isEmpty(), Courses::getAssessmenttype, courseQuery.getAssessmenttype()) |
|
|
|
.page(page); |
|
|
|
.page(page); |
|
|
|
return PageDTO.of(p, CoursesVO.class); |
|
|
|
return PageDTO.of(p, CoursesVO.class); |
|
|
|
} |
|
|
|
} |
|
|
|