|
|
|
@ -7,31 +7,24 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.google.gson.Gson; |
|
|
|
|
import com.teaching.backend.exception.Asserts; |
|
|
|
|
import com.teaching.backend.exception.BusinessException; |
|
|
|
|
import com.teaching.backend.exception.LyException; |
|
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsAdminMapper; |
|
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsAdminRoleRelationMapper; |
|
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsStudentMapper; |
|
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsTeacherMapper; |
|
|
|
|
import com.teaching.backend.model.dto.UmsAdminParam; |
|
|
|
|
import com.teaching.backend.model.dto.UpdateAdminPasswordParam; |
|
|
|
|
import com.teaching.backend.mapper.umsAdmin.*; |
|
|
|
|
import com.teaching.backend.model.dto.umsAdmin.UmsUserParam; |
|
|
|
|
import com.teaching.backend.model.dto.umsAdmin.UpdateUserPasswordParam; |
|
|
|
|
import com.teaching.backend.model.dto.umsAdmin.UmsStudentAndTeacherDTO; |
|
|
|
|
import com.teaching.backend.model.entity.umsAdmin.*; |
|
|
|
|
import com.teaching.backend.model.vo.courses.TeacherInfVO; |
|
|
|
|
import com.teaching.backend.model.vo.umsAdmin.UmsStudentVO; |
|
|
|
|
import com.teaching.backend.model.vo.umsAdmin.UmsTeacherVO; |
|
|
|
|
import com.teaching.backend.service.umsAdmin.UmsAdminService; |
|
|
|
|
import com.teaching.backend.service.umsAdmin.UmsUserService; |
|
|
|
|
import com.teaching.backend.utils.JwtTokenUtil; |
|
|
|
|
import com.teaching.backend.utils.RegexUtils; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.RandomStringUtils; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.amqp.core.AmqpTemplate; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate; |
|
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
|
|
|
|
import org.springframework.security.core.AuthenticationException; |
|
|
|
|
import org.springframework.security.core.context.SecurityContextHolder; |
|
|
|
@ -51,9 +44,9 @@ import java.util.UUID; |
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> implements UmsAdminService { |
|
|
|
|
public class UmsUserServiceImpl extends ServiceImpl<UmsUserMapper, UmsUser> implements UmsUserService { |
|
|
|
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(UmsAdminServiceImpl.class); |
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(UmsUserServiceImpl.class); |
|
|
|
|
@Autowired |
|
|
|
|
private JwtTokenUtil jwtTokenUtil; |
|
|
|
|
@Autowired |
|
|
|
@ -65,37 +58,40 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
@Autowired |
|
|
|
|
UmsTeacherMapper umsTeacherMapper; |
|
|
|
|
@Autowired |
|
|
|
|
UmsAdminMapper umsAdminMapper; |
|
|
|
|
UmsUserMapper umsUserMapper; |
|
|
|
|
@Autowired |
|
|
|
|
UmsRoleMapper umsRoleMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UmsAdmin register(UmsAdminParam umsAdminParam) { |
|
|
|
|
UmsAdmin umsAdmin = new UmsAdmin(); |
|
|
|
|
BeanUtils.copyProperties(umsAdminParam, umsAdmin); |
|
|
|
|
umsAdmin.setCreateTime(LocalDateTime.now()); |
|
|
|
|
umsAdmin.setStatus(1); |
|
|
|
|
public UmsUser register(UmsUserParam umsAdminParam) { |
|
|
|
|
UmsUser umsUser = new UmsUser(); |
|
|
|
|
BeanUtils.copyProperties(umsAdminParam, umsUser); |
|
|
|
|
umsUser.setCreateTime(LocalDateTime.now()); |
|
|
|
|
umsUser.setStatus(1); |
|
|
|
|
//查询是否有相同用户名的用户
|
|
|
|
|
List<UmsAdmin> umsAdminList = lambdaQuery() |
|
|
|
|
.eq(UmsAdmin::getUsername, umsAdmin.getUsername()) |
|
|
|
|
List<UmsUser> umsAdminList = lambdaQuery() |
|
|
|
|
.eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
|
.list(); |
|
|
|
|
if (umsAdminList.size() > 0) { |
|
|
|
|
throw new BusinessException(500,"用户已存在"); |
|
|
|
|
} |
|
|
|
|
//将密码进行加密操作
|
|
|
|
|
String encodePassword = passwordEncoder.encode(umsAdmin.getPassword()); |
|
|
|
|
umsAdmin.setPassword(encodePassword); |
|
|
|
|
save(umsAdmin); |
|
|
|
|
String encodePassword = passwordEncoder.encode(umsUser.getPassword()); |
|
|
|
|
umsUser.setPassword(encodePassword); |
|
|
|
|
|
|
|
|
|
//分配角色(学生)
|
|
|
|
|
umsUser.setRoleId("2"); |
|
|
|
|
save(umsUser); |
|
|
|
|
|
|
|
|
|
//创建学生信息(默认是学生)
|
|
|
|
|
UmsAdmin byUsername = lambdaQuery().eq(UmsAdmin::getUsername, umsAdmin.getUsername()) |
|
|
|
|
UmsUser byUsername = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
|
.one(); |
|
|
|
|
UmsStudent umsStudent = new UmsStudent(); |
|
|
|
|
umsStudent.setUserId(Math.toIntExact(byUsername.getId())); |
|
|
|
|
umsStudentMapper.insert(umsStudent); |
|
|
|
|
|
|
|
|
|
//分配角色(学生)
|
|
|
|
|
adminRoleRelation.insert(byUsername.getId(), 2L); |
|
|
|
|
return umsAdmin; |
|
|
|
|
return umsUser; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -127,7 +123,7 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
String token = null; |
|
|
|
|
//密码需要客户端加密后传递
|
|
|
|
|
try { |
|
|
|
|
UmsAdmin phoneAdmin = lambdaQuery().eq(UmsAdmin::getPhone, phone) |
|
|
|
|
UmsUser phoneAdmin = lambdaQuery().eq(UmsUser::getPhone, phone) |
|
|
|
|
.one(); |
|
|
|
|
if (phoneAdmin == null){ |
|
|
|
|
throw new BusinessException(400,"手机号未注册"); |
|
|
|
@ -148,24 +144,39 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Object getByIdPersonalInfo(String id) { |
|
|
|
|
UmsRole umsRole = umsAdminMapper.getByIdRoleInfo(id); |
|
|
|
|
if (umsRole == null){ |
|
|
|
|
UmsUser umsUser = lambdaQuery().eq(UmsUser::getId, id).one(); |
|
|
|
|
if (umsUser.getRoleId() == null){ |
|
|
|
|
throw new BusinessException(500,"用户未分配角色"); |
|
|
|
|
} |
|
|
|
|
if(umsRole.getStatus()==0){ |
|
|
|
|
String[] roles = umsUser.getRoleId().split(","); |
|
|
|
|
List<String> roleList = new ArrayList<>(); |
|
|
|
|
for (String role : roles) { |
|
|
|
|
UmsRole umsRole = umsRoleMapper.selectById(role); |
|
|
|
|
if(umsRole.getStatus() == 1){ |
|
|
|
|
roleList.add(role); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (roleList == null){ |
|
|
|
|
throw new BusinessException(500,"角色被禁用"); |
|
|
|
|
} |
|
|
|
|
if (umsRole.getId() == 1){ |
|
|
|
|
UmsTeacher teacher = umsAdminMapper.getByIdTeacher(id); |
|
|
|
|
UmsTeacherVO umsTeacherVO = new UmsTeacherVO(); |
|
|
|
|
|
|
|
|
|
//查询个人信息
|
|
|
|
|
UmsTeacher teacher = umsUserMapper.getByIdTeacher(id); |
|
|
|
|
UmsTeacherVO umsTeacherVO = new UmsTeacherVO(); |
|
|
|
|
if (teacher != null){ |
|
|
|
|
BeanUtils.copyProperties(teacher,umsTeacherVO); |
|
|
|
|
umsTeacherVO.setRoleId(Math.toIntExact(umsRole.getId())); |
|
|
|
|
} |
|
|
|
|
umsTeacherVO.setRoleId(roleList); |
|
|
|
|
if (teacher != null){ |
|
|
|
|
return umsTeacherVO; |
|
|
|
|
}else if (umsRole.getId() == 2){ |
|
|
|
|
UmsStudentVO student = umsAdminMapper.getByIdStudent(id); |
|
|
|
|
UmsStudentVO umsStudentVO = new UmsStudentVO(); |
|
|
|
|
} |
|
|
|
|
UmsStudentVO student = umsUserMapper.getByIdStudent(id); |
|
|
|
|
UmsStudentVO umsStudentVO = new UmsStudentVO(); |
|
|
|
|
if (student != null){ |
|
|
|
|
BeanUtils.copyProperties(student,umsStudentVO); |
|
|
|
|
umsStudentVO.setRoleId(Math.toIntExact(umsRole.getId())); |
|
|
|
|
} |
|
|
|
|
umsStudentVO.setRoleId(roleList); |
|
|
|
|
if (student != null){ |
|
|
|
|
return umsStudentVO; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
@ -174,54 +185,59 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
@Override |
|
|
|
|
public boolean updatePersonalInfo(UmsStudentAndTeacherDTO umsStudentAndTeacherDTO) { |
|
|
|
|
|
|
|
|
|
if (umsStudentAndTeacherDTO.getRoleId() == 1){ |
|
|
|
|
UmsTeacher umsTeacher = new UmsTeacher(); |
|
|
|
|
BeanUtils.copyProperties(umsStudentAndTeacherDTO,umsTeacher); |
|
|
|
|
System.out.println(umsTeacher); |
|
|
|
|
UmsTeacher umsTeacher = new UmsTeacher(); |
|
|
|
|
BeanUtils.copyProperties(umsStudentAndTeacherDTO,umsTeacher); |
|
|
|
|
UmsTeacher teacher = umsTeacherMapper.selectByUserId(umsTeacher.getUserId()); |
|
|
|
|
|
|
|
|
|
if (teacher != null){ |
|
|
|
|
return umsTeacherMapper.updateTeacherInfo(umsTeacher); |
|
|
|
|
} else if (umsStudentAndTeacherDTO.getRoleId() == 2) { |
|
|
|
|
UmsStudent umsStudent = new UmsStudent(); |
|
|
|
|
BeanUtils.copyProperties(umsStudentAndTeacherDTO,umsStudent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
UmsStudent umsStudent = new UmsStudent(); |
|
|
|
|
BeanUtils.copyProperties(umsStudentAndTeacherDTO,umsStudent); |
|
|
|
|
UmsStudent student = umsStudentMapper.selectByUserId(umsStudent.getUserId()); |
|
|
|
|
|
|
|
|
|
if (student != null){ |
|
|
|
|
return umsStudentMapper.updateStudentInfo(umsStudent); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean updateUms(UmsAdmin umsadmin) { |
|
|
|
|
List<UmsAdmin> adminList = lambdaQuery().eq(UmsAdmin::getUsername, umsadmin.getUsername()) |
|
|
|
|
public boolean updateUms(UmsUser umsUser) { |
|
|
|
|
List<UmsUser> adminList = lambdaQuery().eq(UmsUser::getUsername, umsUser.getUsername()) |
|
|
|
|
.list(); |
|
|
|
|
if (adminList.size() > 0){ |
|
|
|
|
throw new BusinessException(400,"用户名已存在"); |
|
|
|
|
} |
|
|
|
|
if (!StrUtil.isEmpty(umsadmin.getPassword())){ |
|
|
|
|
if (!StrUtil.isEmpty(umsUser.getPassword())){ |
|
|
|
|
throw new BusinessException(400,"修改操作错误1"); |
|
|
|
|
} |
|
|
|
|
if (umsadmin.getCreateTime() != null){ |
|
|
|
|
if (umsUser.getCreateTime() != null){ |
|
|
|
|
throw new BusinessException(400,"修改操作错误2"); |
|
|
|
|
} |
|
|
|
|
return umsAdminMapper.updateUserInformation(umsadmin); |
|
|
|
|
return umsUserMapper.updateUserInformation(umsUser); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int updatePassword(UpdateAdminPasswordParam param) { |
|
|
|
|
public int updatePassword(UpdateUserPasswordParam param) { |
|
|
|
|
if(StrUtil.isEmpty(param.getUsername()) |
|
|
|
|
||StrUtil.isEmpty(param.getOldPassword()) |
|
|
|
|
||StrUtil.isEmpty(param.getNewPassword())){ |
|
|
|
|
throw new BusinessException(400,"修改密码操作错误"); |
|
|
|
|
} |
|
|
|
|
List<UmsAdmin> adminList = lambdaQuery() |
|
|
|
|
.eq(UmsAdmin::getUsername, param.getUsername()) |
|
|
|
|
List<UmsUser> userList = lambdaQuery() |
|
|
|
|
.eq(UmsUser::getUsername, param.getUsername()) |
|
|
|
|
.list(); |
|
|
|
|
if(CollUtil.isEmpty(adminList)){ |
|
|
|
|
if(CollUtil.isEmpty(userList)){ |
|
|
|
|
throw new BusinessException(400,"用户名不存在"); |
|
|
|
|
} |
|
|
|
|
UmsAdmin umsAdmin = adminList.get(0); |
|
|
|
|
if(!passwordEncoder.matches(param.getOldPassword(),umsAdmin.getPassword())){ |
|
|
|
|
UmsUser umsUser = userList.get(0); |
|
|
|
|
if(!passwordEncoder.matches(param.getOldPassword(),umsUser.getPassword())){ |
|
|
|
|
throw new BusinessException(400,"密码重复"); |
|
|
|
|
} |
|
|
|
|
umsAdmin.setPassword(passwordEncoder.encode(param.getNewPassword())); |
|
|
|
|
updateById(umsAdmin); |
|
|
|
|
umsUser.setPassword(passwordEncoder.encode(param.getNewPassword())); |
|
|
|
|
updateById(umsUser); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -231,14 +247,6 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
throw new BusinessException(400, "手机号格式错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UmsAdmin admin = lambdaQuery()
|
|
|
|
|
// .eq(UmsAdmin::getPhone, phone)
|
|
|
|
|
// .one();
|
|
|
|
|
// if (admin != null){
|
|
|
|
|
//// throw new ;
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
String code = RandomStringUtils.randomNumeric(5); |
|
|
|
|
|
|
|
|
|
String ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI5tF7fcDC5VTj1cVWKDU6"; |
|
|
|
@ -267,34 +275,34 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UmsAdmin phoneRegister(UmsAdminParam umsAdminParam) { |
|
|
|
|
UmsAdmin umsAdmin = new UmsAdmin(); |
|
|
|
|
BeanUtils.copyProperties(umsAdminParam, umsAdmin); |
|
|
|
|
umsAdmin.setCreateTime(LocalDateTime.now()); |
|
|
|
|
umsAdmin.setStatus(1); |
|
|
|
|
public UmsUser phoneRegister(UmsUserParam umsUserParam) { |
|
|
|
|
UmsUser umsUser = new UmsUser(); |
|
|
|
|
BeanUtils.copyProperties(umsUserParam, umsUser); |
|
|
|
|
umsUser.setCreateTime(LocalDateTime.now()); |
|
|
|
|
umsUser.setStatus(1); |
|
|
|
|
//查询是否有相同手机号的用户
|
|
|
|
|
List<UmsAdmin> umsAdminList = lambdaQuery() |
|
|
|
|
.eq(UmsAdmin::getPhone,umsAdminParam.getPhone()) |
|
|
|
|
List<UmsUser> umsUserList = lambdaQuery() |
|
|
|
|
.eq(UmsUser::getPhone,umsUserParam.getPhone()) |
|
|
|
|
.list(); |
|
|
|
|
if (umsAdminList.size() > 0 ) { |
|
|
|
|
if (umsUserList.size() > 0 ) { |
|
|
|
|
throw new BusinessException(400,"手机号已存在"); |
|
|
|
|
} |
|
|
|
|
//将密码进行加密操作
|
|
|
|
|
String encodePassword = passwordEncoder.encode(umsAdmin.getPassword()); |
|
|
|
|
umsAdmin.setUsername(randomUsername()); |
|
|
|
|
umsAdmin.setPassword(encodePassword); |
|
|
|
|
save(umsAdmin); |
|
|
|
|
String encodePassword = passwordEncoder.encode(umsUser.getPassword()); |
|
|
|
|
umsUser.setUsername(randomUsername()); |
|
|
|
|
umsUser.setPassword(encodePassword); |
|
|
|
|
//分配角色(学生)
|
|
|
|
|
umsUser.setRoleId("2"); |
|
|
|
|
save(umsUser); |
|
|
|
|
|
|
|
|
|
//创建学生信息(默认是学生)
|
|
|
|
|
UmsAdmin byUsername = lambdaQuery().eq(UmsAdmin::getPhone, umsAdmin.getPhone()) |
|
|
|
|
UmsUser byUsername = lambdaQuery().eq(UmsUser::getPhone, umsUser.getPhone()) |
|
|
|
|
.one(); |
|
|
|
|
UmsStudent umsStudent = new UmsStudent(); |
|
|
|
|
umsStudent.setUserId(Math.toIntExact(byUsername.getId())); |
|
|
|
|
umsStudentMapper.insert(umsStudent); |
|
|
|
|
|
|
|
|
|
//分配角色(学生)
|
|
|
|
|
adminRoleRelation.insert(byUsername.getId(), 2L); |
|
|
|
|
return umsAdmin; |
|
|
|
|
return umsUser; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
@ -302,12 +310,12 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
*/ |
|
|
|
|
private String randomUsername(){ |
|
|
|
|
String username; |
|
|
|
|
UmsAdmin newUsername = new UmsAdmin(); |
|
|
|
|
UmsUser newUsername = new UmsUser(); |
|
|
|
|
do { |
|
|
|
|
UUID uuid = UUID.randomUUID(); |
|
|
|
|
// 这里只是简单地截取UUID的一部分作为用户名,但你可以根据需要进行更复杂的处理
|
|
|
|
|
username = uuid.toString().substring(0, 10); // 截取前10个字符作
|
|
|
|
|
newUsername = lambdaQuery().eq(UmsAdmin::getUsername, username) |
|
|
|
|
newUsername = lambdaQuery().eq(UmsUser::getUsername, username) |
|
|
|
|
.one(); |
|
|
|
|
} while ( newUsername != null); // 如果用户名已存在,则重新生成
|
|
|
|
|
return username; |
|
|
|
@ -324,30 +332,38 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UmsAdmin getAdminByUsername(String username) { |
|
|
|
|
public UmsUser getUserByUsername(String username) { |
|
|
|
|
//从数据库中获取
|
|
|
|
|
UmsAdmin admin = lambdaQuery().eq(UmsAdmin::getUsername, username) |
|
|
|
|
UmsUser user = lambdaQuery().eq(UmsUser::getUsername, username) |
|
|
|
|
.one(); |
|
|
|
|
if (admin != null) { |
|
|
|
|
return admin; |
|
|
|
|
if (user != null) { |
|
|
|
|
return user; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<UmsResource> getResourceList(Long adminId) { |
|
|
|
|
public List<UmsResource> getResourceList(Long userId) { |
|
|
|
|
//从数据库中获取
|
|
|
|
|
List<UmsResource> resourceList = adminRoleRelation.getResourceList(adminId); |
|
|
|
|
List<UmsResource> resourceList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
UmsUser umsUser = lambdaQuery().eq(UmsUser::getId, userId).one(); |
|
|
|
|
String[] roles = umsUser.getRoleId().split(","); |
|
|
|
|
List<String> roleList = new ArrayList<>(); |
|
|
|
|
for (String role : roles) { |
|
|
|
|
UmsRole umsRole = umsRoleMapper.selectById(role); |
|
|
|
|
resourceList = adminRoleRelation.getResourceList(umsRole.getId()); |
|
|
|
|
} |
|
|
|
|
return resourceList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UserDetails loadUserByUsername(String username){ |
|
|
|
|
//获取用户信息
|
|
|
|
|
UmsAdmin admin = getAdminByUsername(username); |
|
|
|
|
if (admin != null) { |
|
|
|
|
List<UmsResource> resourceList = getResourceList(admin.getId()); |
|
|
|
|
return new AdminUserDetails(admin,resourceList); |
|
|
|
|
UmsUser user = getUserByUsername(username); |
|
|
|
|
if (user != null) { |
|
|
|
|
List<UmsResource> resourceList = getResourceList(user.getId()); |
|
|
|
|
return new AdminUserDetails(user,resourceList); |
|
|
|
|
} |
|
|
|
|
throw new UsernameNotFoundException("用户名或密码错误"); |
|
|
|
|
} |
|
|
|
@ -359,8 +375,8 @@ public class UmsAdminServiceImpl extends ServiceImpl<UmsAdminMapper, UmsAdmin> i |
|
|
|
|
List<TeacherInfVO> teacherInfList = new ArrayList<>();; |
|
|
|
|
for (UmsTeacher umsTeacher : umsTeachers) { |
|
|
|
|
teacherInfVO = new TeacherInfVO(); |
|
|
|
|
UmsAdmin umsAdmin = umsAdminMapper.selectOne(new LambdaQueryWrapper<UmsAdmin>() |
|
|
|
|
.eq(UmsAdmin::getId, umsTeacher.getUserId())); |
|
|
|
|
UmsUser umsAdmin = umsUserMapper.selectOne(new LambdaQueryWrapper<UmsUser>() |
|
|
|
|
.eq(UmsUser::getId, umsTeacher.getUserId())); |
|
|
|
|
teacherInfVO.setName(umsTeacher.getName()); |
|
|
|
|
teacherInfVO.setUsername(umsAdmin.getUsername()); |
|
|
|
|
teacherInfList.add(teacherInfVO); |