|
|
|
@ -12,8 +12,10 @@ import com.supervision.knowsub.domain.UserInfo;
|
|
|
|
|
import com.supervision.knowsub.dto.role.UserRoleDTO;
|
|
|
|
|
import com.supervision.knowsub.dto.user.UserPageQuery;
|
|
|
|
|
import com.supervision.knowsub.exception.BusinessException;
|
|
|
|
|
import com.supervision.knowsub.model.SystemDept;
|
|
|
|
|
import com.supervision.knowsub.model.SystemRole;
|
|
|
|
|
import com.supervision.knowsub.model.SystemUser;
|
|
|
|
|
import com.supervision.knowsub.service.SystemDeptService;
|
|
|
|
|
import com.supervision.knowsub.service.SystemRoleService;
|
|
|
|
|
import com.supervision.knowsub.service.UserManageService;
|
|
|
|
|
import com.supervision.knowsub.service.UserRoleRelationManageService;
|
|
|
|
@ -48,6 +50,8 @@ public class UserManageServiceImpl implements UserManageService {
|
|
|
|
|
|
|
|
|
|
private final SystemRoleService systemRoleService;
|
|
|
|
|
|
|
|
|
|
private final SystemDeptService systemDeptService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public LoginResVO login(LoginReqVO reqVO) {
|
|
|
|
@ -66,6 +70,9 @@ public class UserManageServiceImpl implements UserManageService {
|
|
|
|
|
loginResVO.setUsername(user.get().getUsername());
|
|
|
|
|
List<UserRoleDTO> userRoleDTOS = userRoleRelationManageService.listUserRole(user.get().getId(),null);
|
|
|
|
|
loginResVO.setUserRoleDTOList(userRoleDTOS);
|
|
|
|
|
// 获取用户的部门
|
|
|
|
|
Optional<SystemDept> optById = systemDeptService.getOptById(user.get().getDeptId());
|
|
|
|
|
loginResVO.setDeptName(optById.isPresent() ? optById.get().getDeptName() : "未知部门");
|
|
|
|
|
return loginResVO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|