OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2022-01-07 6e2f9c845610bc1d6a1e3b458b560ab2462995de
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;
@@ -93,6 +92,9 @@
    private ProjectService projectService;
    @Autowired
    private IssueTypeService issueTypeService;
    @Autowired
    private UserSecurityService userSecurityService;
    @Autowired
@@ -103,6 +105,9 @@
    @Autowired
    private AttachedFileService attachedFileService;
    @Autowired
    private UserDepartmentService userDepartmentService;
    @Autowired
    private IssueService issueService;
@@ -258,7 +263,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 +549,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 +961,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)
@@ -1223,10 +1244,19 @@
    @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");
        UserVo userVo = ConvertUtil.copyProperties(user, UserVo.class, "password");
        // user에서 Permission 값을 가져와서 userVo 에 setPermission 함
        userVo.setPermission(user.getPermission());
        userVo.setAccount(CommonUtil.decryptAES128(userVo.getAccount()));
        UserLevel userLevel = user.getUserLevel();
        if (userLevel != null) {
            userVo.setLevelName(userLevel.getLevelName());
        }
        List<Department> departments = this.userDepartmentService.findDepartment(user.getId());
        if (departments != null) {
            userVo.setDepartmentVos(ConvertUtil.convertObjectsToClasses(departments, DepartmentVo.class));
        }
        resJsonData.put(Constants.RES_KEY_CONTENTS, userVo);
        //  사용자 세션 정보를 분석해서 로그에 남긴다.
        log.info(ElasticSearchUtil.makeUserSessionHistoryMessage(httpServletRequest, userVo));