OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2021-12-15 de2abff4377c9ee83161c954a51de4c9390fff76
src/main/java/kr/wisestone/owl/service/impl/UserServiceImpl.java
@@ -18,7 +18,6 @@
import kr.wisestone.owl.util.*;
import kr.wisestone.owl.vo.*;
import kr.wisestone.owl.web.condition.UserCondition;
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;
@@ -91,6 +90,9 @@
    @Autowired
    private ProjectService projectService;
    @Autowired
    private IssueTypeService issueTypeService;
    @Autowired
    private UserSecurityService userSecurityService;
@@ -258,7 +260,10 @@
                this.userWorkspaceService.addUserWorkspace(user, workspace, true, true);
                //  기본으로 제공되는 프로젝트를 생성한다.
//                this.projectService.addDefaultProject(user, workspace);
                this.projectService.addDefaultProject(user, workspace);
                // 기본으로 제공되는 프로젝트를 이슈 유형의 사용 프로젝트로 설정
                this.issueTypeService.addDefaultUsedProject(workspace);
                user.setLastWorkspaceId(workspace.getId());
@@ -541,8 +546,12 @@
            User user = this.getUser(userCondition.getId());
            userVo = ConvertUtil.copyProperties(user, UserVo.class, "password");
            userVo.setAccount(CommonUtil.decryptAES128(userVo.getAccount()));
        }
            Map<String, Object> projectManagerYN = this.projectRoleUserService.findProjectManager((userCondition.getId()));
            if(projectManagerYN != null){
                userVo.setProjectManagerYN(true);
            }
        }
        resJsonData.put(Constants.RES_KEY_CONTENTS, userVo);
    }
@@ -949,6 +958,15 @@
        return this.convertUserVoToMap(results, totalUsersCount, pageable, resJsonData);
    }
    //  사용자 정보를 가져온다.
    @Override
    @Transactional(readOnly = true)
    public void findMyLevelAndDepartment(Map<String, Object> resJsonData) {
        Long loginId = this.webAppUtil.getLoginId();
        Map<String, Object> result = this.userMapper.findByMyLevelAndDepartment(loginId);
        resJsonData.put(Constants.RES_KEY_CONTENTS, result);
    }
    //  사용자 아이디로 사용자를 조회한다.
    @Override
    @Transactional(readOnly = true)
@@ -1064,6 +1082,30 @@
        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)
@@ -1237,6 +1279,22 @@
        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)