|
|
|
@ -43,6 +43,7 @@ import java.math.BigDecimal; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -148,13 +149,26 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
|
// throw new BusinessException(ErrorCode.USERNAME_NOT_EXIT);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// UmsUser umsUser = umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>()
|
|
|
|
|
// .eq(UmsUser::getUsername, username));
|
|
|
|
|
// UmsAdminRoleRelation umsAdminRoleRelation = umsAdminRoleRelationMapper.selectOne(new LambdaQueryWrapper<UmsAdminRoleRelation>()
|
|
|
|
|
// .eq(UmsAdminRoleRelation::getAdminId, umsUser.getId()));
|
|
|
|
|
int roleId = Integer.parseInt(umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>() |
|
|
|
|
.eq(UmsUser::getUsername, username)).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; |
|
|
|
|
|
|
|
|
|
switch (roleId) { |
|
|
|
@ -183,6 +197,9 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
|
Page<Courses> p = lambdaQuery() |
|
|
|
|
.like(courseQuery.getName() != null, Courses::getName, courseQuery.getName()) |
|
|
|
|
.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); |
|
|
|
|
return PageDTO.of(p, CoursesVO.class); |
|
|
|
|
} |
|
|
|
|