| | |
| | | import kr.wisestone.owl.domain.enumType.SocialType; |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.UserMapper; |
| | | import kr.wisestone.owl.repository.DepartmentRepository; |
| | | import kr.wisestone.owl.repository.UserRepository; |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.*; |
| | | import kr.wisestone.owl.vo.*; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentManageForm; |
| | | import kr.wisestone.owl.web.form.DepartmentForm; |
| | | import kr.wisestone.owl.web.form.UserForm; |
| | | import kr.wisestone.owl.web.view.ExcelView; |
| | | import org.apache.commons.validator.routines.EmailValidator; |
| | |
| | | private UserRepository userRepository; |
| | | |
| | | @Autowired |
| | | private DepartmentRepository departmentRepository; |
| | | |
| | | @Autowired |
| | | private UserLevelService userLevelService; |
| | | |
| | | @Autowired |
| | | private DepartmentManageService departmentManageService; |
| | | private DepartmentService departmentService; |
| | | |
| | | @Autowired |
| | | private SystemRoleService systemRoleService; |
| | |
| | | /*user.setPermission(MngPermission.USER_PERMISSION_MNG_NONE);*/ |
| | | |
| | | } else if(validAdmin == 1) { // 라이센스 입력 관리자 |
| | | |
| | | /*DepartmentForm departmentForm = new DepartmentForm(); |
| | | |
| | | departmentForm.setDepartmentName("부서 없음"); |
| | | Department department = this.departmentService.add(departmentForm); |
| | | this.departmentRepository.saveAndFlush(department);*/ |
| | | |
| | | Workspace primaryWorkspace = this.workspaceService.getPrimaryWorkspace(); |
| | | |
| | | UserLevel userLevel = this.userLevelService.addSuperUserLevel(); |
| | |
| | | /*user.setPermission(MngPermission.makeSubAllPermission());*/ |
| | | } |
| | | } |
| | | DepartmentManageForm departmentManageForm = new DepartmentManageForm(); |
| | | |
| | | departmentManageForm.setDepartmentName("부서 없음"); |
| | | DepartmentManage departmentManage = this.departmentManageService.addDepartmentManage(departmentManageForm); |
| | | user.setDepartmentManage(departmentManage); |
| | | this.userRepository.saveAndFlush(user); |
| | | |
| | | // 이메일 알림 예정 시간이 공백이면 디폴트 이메일 알림 예정 시간으로 설정한다. |
| | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, userVo); |
| | | } |
| | | |
| | | // 마지막으로 선택한 이슈 타입 정보를 저장한다. |
| | | @Override |
| | | @Transactional |
| | | public void updateLastIssueType(Map<String, Object> resJsonData, UserForm userForm) { |
| | | User user = this.getUser(this.webAppUtil.getLoginId()); |
| | | |
| | | if (userForm.getLastIssueTypeId() != null) { |
| | | user.setLastIssueTypeId(userForm.getLastIssueTypeId()); |
| | | } |
| | | |
| | | this.userRepository.saveAndFlush(user); |
| | | // 세션 업데이트 |
| | | SecurityUtils.setUserToSession(user); |
| | | // 클라이언트의 사용자 정보 업데이트 |
| | | UserVo userVo = ConvertUtil.copyProperties(user, UserVo.class, "password"); |
| | | |
| | | if (user.getSocialType() != null) { |
| | | userVo.setSocialType(user.getSocialType().toString()); |
| | | } |
| | | |
| | | userVo.setAccount(CommonUtil.decryptAES128(userVo.getAccount())); |
| | | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, userVo); |
| | | } |
| | | // 특정 아이디에 해당하는 사용자 목록을 가져온다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | |
| | | @Transactional(readOnly = true) |
| | | public User getUserSession(Map<String, Object> resJsonData, HttpServletRequest httpServletRequest) { |
| | | User user = this.getUser(this.webAppUtil.getLoginId()); |
| | | UserVo userVo = ConvertUtil.copyProperties(user, UserVo.class, "password","permission"); // wyu - ignores permission ?? |
| | | UserVo userVo = ConvertUtil.copyProperties(user, UserVo.class, "password","permission"); |
| | | // user에서 Permission 값을 가져와서 userVo 에 setPermission 함 |
| | | userVo.setPermission(user.getPermission()); |
| | | userVo.setAccount(CommonUtil.decryptAES128(userVo.getAccount())); |
| | |
| | | return results; |
| | | } |
| | | |
| | | // 이메일 알림 예정 시간을 실시간으로 설정한 사용자를 조회한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public List<String> findByRealTimeNotifyTime() { |
| | | Map<String, Object> conditions = new HashMap<>(); |
| | | |
| | | List<Map<String, Object>> users = this.userMapper.findByRealTimeNotifyTime(conditions); |
| | | List<String> results = Lists.newArrayList(); |
| | | |
| | | for (Map<String, Object> user : users) { |
| | | results.add(MapUtil.getString(user, "account")); |
| | | } |
| | | |
| | | return results; |
| | | } |
| | | |
| | | // 프로젝트에 참여하는 사용자 정보를 조회한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |