OWL ITS + 탐지시스템(인터넷 진흥원)
wyu
2021-11-10 9c17ea26bb894c1969ed1dd12bd538ebba7d244e
사용자 관리 백앤드 수정
5개 파일 변경됨
44 ■■■■■ 파일 변경됨
src/main/java/kr/wisestone/owl/domain/User.java 4 ●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/java/kr/wisestone/owl/domain/UserDepartment.java 12 ●●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/java/kr/wisestone/owl/service/impl/UserServiceImpl.java 16 ●●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/resources/mybatis/query-template/department-template.xml 2 ●●● 패치 | 보기 | raw | blame | 히스토리
src/main/webapp/scripts/components/userWorkspace/userWorkspace.service.js 10 ●●●● 패치 | 보기 | raw | blame | 히스토리
src/main/java/kr/wisestone/owl/domain/User.java
@@ -63,9 +63,9 @@
    @JoinColumn(name="level_id")
    private UserLevel userLevel;
//    @ManyToOne(targetEntity = UserDepartment.class, fetch = FetchType.LAZY)
//    @ManyToOne(targetEntity = Department.class, fetch = FetchType.LAZY)
//    @JoinColumn(name="department_id")
//    private UserDepartment userDepartment;
//    private Department department;
    public User() {
    }
src/main/java/kr/wisestone/owl/domain/UserDepartment.java
@@ -12,6 +12,10 @@
    private Long id;
    private String departmentId;
    @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY)
    @JoinColumn(name="user_id")
    private User user;
    public UserDepartment(){}
    public Long getId() {
@@ -29,4 +33,12 @@
    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }
    public User getUser() {
        return user;
    }
    public void setUser(User user) {
        this.user = user;
    }
}
src/main/java/kr/wisestone/owl/service/impl/UserServiceImpl.java
@@ -12,6 +12,7 @@
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.*;
@@ -54,6 +55,9 @@
    @Autowired
    private UserRepository userRepository;
    @Autowired
    private DepartmentRepository departmentRepository;
    @Autowired
    private UserLevelService userLevelService;
@@ -259,13 +263,13 @@
                /*user.setPermission(MngPermission.makeSubAllPermission());*/
            }
        }
        DepartmentForm departmentForm = new DepartmentForm();
//        DepartmentManageForm departmentManageForm = new DepartmentManageForm();
//
//        departmentManageForm.setDepartmentName("부서 없음");
//        DepartmentManage departmentManage = this.departmentManageService.addDepartmentManage(departmentManageForm);
//        user.setDepartmentManage(departmentManage);
        departmentForm.setDepartmentName("부서 없음");
        Department department = this.departmentService.add(departmentForm);
        // wyu
        this.departmentRepository.saveAndFlush(department);
        this.userRepository.saveAndFlush(user);
        //  이메일 알림 예정 시간이 공백이면 디폴트 이메일 알림 예정 시간으로 설정한다.
@@ -1195,7 +1199,7 @@
    @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()));
src/main/resources/mybatis/query-template/department-template.xml
@@ -8,7 +8,7 @@
        d.id as id,
        d.department_name as departmentName,
        d.department_description as departmentDescription,
        (SELECT COUNT(d.id) FROM user_department ud WHERE d.id = ud.department_id) AS departmentCount
        (SELECT COUNT(d.id) FROM user u WHERE d.id = u.id) AS departmentCount
        FROM
        department d
        WHERE 1=1
src/main/webapp/scripts/components/userWorkspace/userWorkspace.service.js
@@ -34,31 +34,31 @@
            
            //부서 관리
            departmentFind : function (conditions) {
                return $http.post("departmentManage/find", conditions).then(function (response) {
                return $http.post("department/find", conditions).then(function (response) {
                    $log.debug("부서 목록 : ", response);
                    return response;
                });
            },
            departmentDetail : function (conditions) {
                return $http.post("departmentManage/detail", conditions).then(function (response) {
                return $http.post("department/detail", conditions).then(function (response) {
                    $log.debug("부서 상세 : ", response);
                    return response;
                });
            },
            departmentAdd : function (conditions) {
                return $http.post("departmentManage/add", conditions).then(function (response) {
                return $http.post("department/add", conditions).then(function (response) {
                    $log.debug("부서 생성 결과 : ", response);
                    return response;
                });
            },
            departmentModify : function (conditions) {
                return $http.post("departmentManage/modify", conditions).then(function (response) {
                return $http.post("department/modify", conditions).then(function (response) {
                    $log.debug("부서 수정 결과 : ", response);
                    return response;
                });
            },
            departmentRemove : function (conditions) {
                return $http.post("departmentManage/remove", conditions).then(function (response) {
                return $http.post("department/remove", conditions).then(function (response) {
                    $log.debug("부서 삭제 결과 : ", response);
                    return response;
                });