- 사용자 등급관리 테이블 및 조회 생성
- 부서 관리 테이블 생성
| | |
| | | public static final String SESSION_ACCOUNT = "account"; |
| | | public static final String EXCEL = "excel"; |
| | | public static final String SESSION_EXPIRE_REDIRECT_URL = "/#/login"; |
| | | public static final String ADMIN_MANAGER = "admin"; |
| | | } |
| | |
| | | |
| | | public static int makeAllPermission() |
| | | { |
| | | int nPermission = (USER_PERMISSION_MNG_WORKSPACE | |
| | | return (USER_PERMISSION_MNG_WORKSPACE | |
| | | USER_PERMISSION_MNG_PROJECT | |
| | | USER_PERMISSION_MNG_USER | |
| | | USER_PERMISSION_MNG_NOTICE | |
| | |
| | | USER_PERMISSION_MNG_EVENT | |
| | | USER_PERMISSION_MNG_GUIDE | |
| | | USER_PERMISSION_MNG_ISSUE_SETTING); |
| | | |
| | | return nPermission; |
| | | } |
| | | |
| | | public static int makeSubAllPermission() |
| | | { |
| | | int nPermission = (/*USER_PERMISSION_MNG_WORKSPACE |*/ |
| | | return (/*USER_PERMISSION_MNG_WORKSPACE |*/ |
| | | USER_PERMISSION_MNG_USER | USER_PERMISSION_MNG_NOTICE | |
| | | USER_PERMISSION_MNG_FAQ | USER_PERMISSION_MNG_QNA | |
| | | USER_PERMISSION_MNG_EVENT | USER_PERMISSION_MNG_GUIDE | |
| | | USER_PERMISSION_MNG_ISSUE_SETTING); |
| | | } |
| | | |
| | | return nPermission; |
| | | // 이슈 시스템 권한 (상태, 워크플로우, 사용자 정의 필드, 이슈유형 포함) |
| | | public static int makeIssuePermission() |
| | | { |
| | | return (USER_PERMISSION_MNG_ISSUE_STATUS | |
| | | USER_PERMISSION_MNG_WORKFLOW | |
| | | USER_PERMISSION_MNG_CUSTOME_FIELD | |
| | | USER_PERMISSION_MNG_ISSUE_TYPE); |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.domain; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.GeneratedValue; |
| | | import javax.persistence.GenerationType; |
| | | import javax.persistence.Id; |
| | | import java.io.Serializable; |
| | | |
| | | @Entity |
| | | public class DepartmentManagement extends BaseEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | |
| | | public DepartmentManagement() { |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | |
| | | public String getDepartmentDescription() { |
| | | return departmentDescription; |
| | | } |
| | | |
| | | public void setDepartmentDescription(String departmentDescription) { |
| | | this.departmentDescription = departmentDescription; |
| | | } |
| | | } |
| | |
| | | private String phone; |
| | | private String profile; |
| | | private String awsKey; |
| | | // private Long departmentId; |
| | | @Enumerated(EnumType.STRING) |
| | | private SocialType socialType; |
| | | private Long lastWorkspaceId; |
| | |
| | | private Date lastLoginDate; |
| | | private String reservationNotifyTime; // 이메일 알림 시간 예정 |
| | | private String language; |
| | | private Integer permission; |
| | | private String licensekey; |
| | | |
| | | @OneToMany(mappedBy = "user", cascade = {CascadeType.ALL}, orphanRemoval = true) |
| | |
| | | @OneToMany(mappedBy = "user", cascade = {CascadeType.ALL}, orphanRemoval = true) |
| | | private Set<IssueTableConfig> issueTableConfigs = new HashSet<>(); |
| | | |
| | | @ManyToOne(targetEntity = UserLevel.class, fetch = FetchType.LAZY) |
| | | @JoinColumn(name="level_id") |
| | | private UserLevel userLevel; |
| | | |
| | | @ManyToOne(targetEntity = DepartmentManagement.class, fetch = FetchType.LAZY) |
| | | @JoinColumn(name="department_id") |
| | | private DepartmentManagement departmentManagement; |
| | | |
| | | |
| | | public User() { |
| | | } |
| | | |
| | |
| | | this.name = name; |
| | | this.account = account; |
| | | } |
| | | |
| | | public DepartmentManagement getDepartmentId() { |
| | | return departmentManagement; |
| | | } |
| | | |
| | | public void setDepartmentId(DepartmentManagement department) { |
| | | this.departmentManagement = department; |
| | | } |
| | | |
| | | public UserLevel getUserLevel() { |
| | | return userLevel; |
| | | } |
| | | |
| | | public void setUserLevel(UserLevel userLevel) { |
| | | this.userLevel = userLevel; |
| | | } |
| | | |
| | | |
| | | public Long getId() { |
| | | return id; |
| | |
| | | this.language = language; |
| | | } |
| | | |
| | | |
| | | public Integer getPermission() { |
| | | return permission; |
| | | return this.userLevel.getPermission(); |
| | | } |
| | | |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | // TEST |
| | | //public void setPermission(Integer permission) { |
| | | // this.userLevel.setPermission(permission); |
| | | //} |
| | | |
| | | public String getLicensekey() { |
| | | return licensekey; |
New file |
| | |
| | | package kr.wisestone.owl.domain; |
| | | |
| | | import javax.persistence.*; |
| | | import java.io.Serializable; |
| | | |
| | | @Entity |
| | | public class UserLevel extends BaseEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | private Long id; |
| | | private String levelName; |
| | | private Integer permission; |
| | | |
| | | public UserLevel() { |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLevelName() { |
| | | return levelName; |
| | | } |
| | | |
| | | public void setLevelName(String levelName) { |
| | | this.levelName = levelName; |
| | | } |
| | | |
| | | public Integer getPermission() { |
| | | return permission; |
| | | } |
| | | |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.mapper; |
| | | |
| | | import kr.wisestone.owl.web.condition.DepartmentManagementCondition; |
| | | import kr.wisestone.owl.web.condition.DepartmentManagementCondition; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by wisestone on 2018-02-26. |
| | | */ |
| | | @Repository |
| | | public interface DepartmentManagementMapper { |
| | | List<Map<String, Object>> find(DepartmentManagementCondition departmentManagementCondition); |
| | | |
| | | List<Map<String, Object>> findAdmin(); |
| | | |
| | | List<Map<String, Object>> findProjectMember(DepartmentManagementCondition DepartmentManagementCondition); |
| | | |
| | | Long count(DepartmentManagementCondition DepartmentManagementCondition); |
| | | |
| | | void deleteCascadeUser(DepartmentManagementCondition DepartmentManagementCondition); |
| | | |
| | | List<Map<String, Object>> findByReservationNotifyTime(Map<String, Object> conditions); |
| | | |
| | | List<Map<String, Object>> findByAllWorkspace(DepartmentManagementCondition DepartmentManagementCondition); |
| | | |
| | | Long countByAllWorkspace(DepartmentManagementCondition DepartmentManagementCondition); |
| | | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.mapper; |
| | | |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.condition.UserLevelCondition; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by wisestone on 2018-02-26. |
| | | */ |
| | | @Repository |
| | | public interface UserLevelMapper { |
| | | List<Map<String, Object>> find(UserLevelCondition userLevelCondition); |
| | | |
| | | List<Map<String, Object>> findAdmin(); |
| | | |
| | | List<Map<String, Object>> findProjectMember(UserLevelCondition userLevelCondition); |
| | | |
| | | Long count(UserLevelCondition userLevelCondition); |
| | | |
| | | void deleteCascadeUser(UserLevelCondition userLevelCondition); |
| | | |
| | | List<Map<String, Object>> findByReservationNotifyTime(Map<String, Object> conditions); |
| | | |
| | | List<Map<String, Object>> findByAllWorkspace(UserLevelCondition userLevelCondition); |
| | | |
| | | Long countByAllWorkspace(UserLevelCondition userLevelCondition); |
| | | |
| | | List<Map<String, Object>> findEvent(); |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.repository; |
| | | |
| | | import kr.wisestone.owl.domain.DepartmentManagement; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | public interface DepartmentManagementRepository extends JpaRepository<DepartmentManagement, Long> { |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.repository; |
| | | |
| | | import kr.wisestone.owl.domain.UserLevel; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | public interface UserLevelRepository extends JpaRepository<UserLevel, Long> { |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service; |
| | | |
| | | import kr.wisestone.owl.domain.DepartmentManagement; |
| | | import kr.wisestone.owl.web.form.DepartmentManagementForm; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | public interface DepartmentManagementService extends AbstractService<DepartmentManagement, Long, JpaRepository<DepartmentManagement, Long>> { |
| | | DepartmentManagement addDepartment(DepartmentManagementForm departmentManagementForm); |
| | | |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service; |
| | | |
| | | import kr.wisestone.owl.domain.UserLevel; |
| | | import kr.wisestone.owl.vo.UserLevelVo; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.condition.UserLevelCondition; |
| | | import kr.wisestone.owl.web.form.UserLevelForm; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface UserLevelService extends AbstractService<UserLevel, Long, JpaRepository<UserLevel, Long>> { |
| | | UserLevel addUserLevel(UserLevelForm userLevelForm); |
| | | |
| | | List<UserLevelVo> findUser(Map<String, Object> resJsonData, UserLevelCondition make, Pageable pageable); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import kr.wisestone.owl.domain.DepartmentManagement; |
| | | import kr.wisestone.owl.repository.DepartmentManagementRepository; |
| | | import kr.wisestone.owl.service.DepartmentManagementService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.web.form.DepartmentManagementForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class DepartmentManagementServiceImpl extends AbstractServiceImpl<DepartmentManagement, Long, JpaRepository<DepartmentManagement, Long>> implements DepartmentManagementService { |
| | | |
| | | @Autowired |
| | | private DepartmentManagementRepository departmentManagementRepository; |
| | | |
| | | @Override |
| | | protected JpaRepository<DepartmentManagement, Long> getRepository() { |
| | | return this.departmentManagementRepository; |
| | | } |
| | | |
| | | @Override |
| | | public DepartmentManagement addDepartment(DepartmentManagementForm departmentManagementForm) { |
| | | DepartmentManagement departmentManagement = ConvertUtil.copyProperties(departmentManagementForm, DepartmentManagement.class); |
| | | departmentManagementRepository.saveAndFlush(departmentManagement); |
| | | return departmentManagement; |
| | | } |
| | | } |
| | |
| | | newPermission |= MngPermission.makePermission(manageUserForm.getPermGuide(), MngPermission.USER_PERMISSION_MNG_GUIDE); |
| | | |
| | | User user = userService.getUser(manageUserForm.getUserId()); |
| | | user.setPermission(newPermission); |
| | | /* user.setPermission(newPermission);*/ |
| | | |
| | | this.userRepository.saveAndFlush(user); |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.service.impl; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.domain.UserLevel; |
| | | import kr.wisestone.owl.mapper.UserLevelMapper; |
| | | import kr.wisestone.owl.mapper.UserMapper; |
| | | import kr.wisestone.owl.repository.UserLevelRepository; |
| | | import kr.wisestone.owl.service.UserLevelService; |
| | | import kr.wisestone.owl.util.CommonUtil; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.vo.ResPage; |
| | | import kr.wisestone.owl.vo.UserLevelVo; |
| | | import kr.wisestone.owl.vo.UserVo; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.condition.UserLevelCondition; |
| | | import kr.wisestone.owl.web.form.UserLevelForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class UserLevelServiceImpl extends AbstractServiceImpl<UserLevel, Long, JpaRepository<UserLevel, Long>> implements UserLevelService { |
| | | |
| | | @Autowired |
| | | private UserLevelRepository userLevelRepository; |
| | | |
| | | @Autowired |
| | | private UserLevelMapper userLevelMapper; |
| | | |
| | | @Override |
| | | protected JpaRepository<UserLevel, Long> getRepository() { |
| | | return this.userLevelRepository; |
| | | } |
| | | |
| | | @Override |
| | | public UserLevel addUserLevel(UserLevelForm userLevelForm) { |
| | | UserLevel userLevel = ConvertUtil.copyProperties(userLevelForm, UserLevel.class); |
| | | userLevelRepository.saveAndFlush(userLevel); |
| | | return userLevel; |
| | | } |
| | | |
| | | @Override |
| | | public List<UserLevelVo> findUser(Map<String, Object> resJsonData, UserLevelCondition condition, |
| | | Pageable pageable) { |
| | | |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | |
| | | List<Map<String, Object>> results = this.userLevelMapper.find(condition); |
| | | Long totalUsersCount = this.userLevelMapper.count(condition); |
| | | |
| | | return this.convertUserLevelVoToMap(results, totalUsersCount, pageable, resJsonData); |
| | | } |
| | | |
| | | // 검색 결과를 UserLevelVo 로 변환한다. |
| | | private List<UserLevelVo> convertUserLevelVoToMap(List<Map<String, Object>> results, Long totalUsersCount, Pageable pageable, Map<String, Object> resJsonData) { |
| | | List<UserLevelVo> userLevelVos = Lists.newArrayList(); |
| | | |
| | | for (Map<String, Object> result : results) { |
| | | UserLevelVo userLevelVo = ConvertUtil.convertMapToClass(result, UserLevelVo.class); |
| | | userLevelVos.add(userLevelVo); |
| | | } |
| | | |
| | | int totalPage = (int) Math.ceil((totalUsersCount - 1) / pageable.getPageSize()) + 1; |
| | | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, userLevelVos); |
| | | resJsonData.put(Constants.REQ_KEY_PAGE_VO, new ResPage(pageable.getPageNumber(), pageable.getPageSize(), |
| | | totalPage, totalUsersCount)); |
| | | |
| | | return userLevelVos; |
| | | } |
| | | |
| | | } |
| | |
| | | import kr.wisestone.owl.util.*; |
| | | import kr.wisestone.owl.vo.*; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.form.DepartmentManagementForm; |
| | | import kr.wisestone.owl.web.form.UserForm; |
| | | import kr.wisestone.owl.web.form.UserLevelForm; |
| | | import kr.wisestone.owl.web.view.ExcelView; |
| | | import org.apache.commons.validator.routines.EmailValidator; |
| | | import org.slf4j.Logger; |
| | |
| | | import org.springframework.security.core.session.SessionRegistry; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Repository; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.Model; |
| | |
| | | |
| | | @Autowired |
| | | private UserRepository userRepository; |
| | | |
| | | @Autowired |
| | | private UserLevelService userLevelService; |
| | | |
| | | @Autowired |
| | | private DepartmentManagementService departmentManagementService; |
| | | |
| | | @Autowired |
| | | private SystemRoleService systemRoleService; |
| | |
| | | user.setAccount(CommonUtil.encryptAES128(userForm.getAccount())); |
| | | user.setPassword(this.passwordEncoder.encode(user.getPassword())); |
| | | |
| | | this.userRepository.saveAndFlush(user); |
| | | //this.userLevelRepository.saveAndFlush(user); |
| | | //userLevelRepository.saveAndFlush(user); |
| | | |
| | | // 프로필 파일이 유효한지 체크한다. |
| | | this.verifyProfile(profile); |
| | |
| | | |
| | | this.userInviteService.includePrimaryWorkspace(user, primaryWorkspace); |
| | | |
| | | |
| | | |
| | | // edit by zenith for permission at 20200803 |
| | | user.setPermission(MngPermission.USER_PERMISSION_MNG_NONE); |
| | | /*user.setPermission(MngPermission.USER_PERMISSION_MNG_NONE);*/ |
| | | |
| | | } else if(validAdmin == 1) { // 라이센스 입력 관리자 |
| | | Workspace primaryWorkspace = this.workspaceService.getPrimaryWorkspace(); |
| | | |
| | | // UserLevel에 Permission 값 넣어줌 |
| | | UserLevelForm userLevelForm = new UserLevelForm(); |
| | | // Constants 에서 ADMIN 값 추가 |
| | | userLevelForm.setLevelName(Constants.ADMIN_MANAGER); |
| | | // Permission 값 추가 |
| | | userLevelForm.setPermission(MngPermission.makeAllPermission()); |
| | | UserLevel userLevel = this.userLevelService.addUserLevel(userLevelForm); |
| | | user.setUserLevel(userLevel); |
| | | |
| | | // DepartmentManagement에 임시로 Name, Description 값 추가 |
| | | DepartmentManagementForm departmentManagementForm = new DepartmentManagementForm(); |
| | | |
| | | departmentManagementForm.setDepartmentName("개발팀"); |
| | | departmentManagementForm.setDepartmentDescription("웹사이트 및 앱 서비스 개발"); |
| | | DepartmentManagement departmentManagement = this.departmentManagementService.addDepartment(departmentManagementForm); |
| | | user.setDepartmentId(departmentManagement); |
| | | |
| | | if(primaryWorkspace == null || primaryWorkspace.getName() != userForm.getWorkspaceName()) { |
| | | // 업무 공간를 생성한다. 가입한 사용자는 업무 공간의 주인이다. |
| | |
| | | user.setLastWorkspaceId(workspace.getId()); |
| | | |
| | | // edit by zenith for permission at 20200803 |
| | | user.setPermission(MngPermission.makeAllPermission()); |
| | | //user.setPermission(MngPermission.makeAllPermission()); |
| | | } else { |
| | | this.userInviteService.includePrimaryWorkspace(user, primaryWorkspace); |
| | | user.setLastWorkspaceId(primaryWorkspace.getId()); |
| | | |
| | | user.setPermission(MngPermission.makeSubAllPermission()); |
| | | /*user.setPermission(MngPermission.makeSubAllPermission());*/ |
| | | } |
| | | } |
| | | this.userRepository.saveAndFlush(user); |
| | | |
| | | // 이메일 알림 예정 시간이 공백이면 디폴트 이메일 알림 예정 시간으로 설정한다. |
| | | user.setReservationNotifyTime(User.DEFAULT_RESERVATION_NOTIFY_TIME); |
| | | this.userRepository.saveAndFlush(user); |
| | | |
| | | // 초대받은 메일이 있는 사용자가 가입했으면 초대했을 때 선택한 프로젝트에 참여 시킨다. |
| | | this.userInviteService.checkInviteUser(user); |
| | |
| | | this.userRepository.saveAndFlush(user); |
| | | } |
| | | |
| | | // 마지막으로 선택한 프로젝트 정보를 저장한다. |
| | | // 마지막으로 선택한 프로젝트 정보를 저장한다. |
| | | @Override |
| | | @Transactional |
| | | public void updateLastProject(Map<String, Object> resJsonData, UserForm userForm) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 업무 공간에서 제외되거나 업무 공간 삭제시 참여 사용자들의 마지막 접근 업무 공간 정보로 세션 업데이트하기 위해 사용 |
| | | @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"); |
| | | UserVo userVo = ConvertUtil.copyProperties(user, UserVo.class, "password", "permission"); |
| | | // user에서 Permission 값을 가져와서 userVo 에 setPermission 함 |
| | | userVo.setPermission(user.getPermission()); |
| | | userVo.setAccount(CommonUtil.decryptAES128(userVo.getAccount())); |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, userVo); |
| | | // 사용자 세션 정보를 분석해서 로그에 남긴다. |
New file |
| | |
| | | package kr.wisestone.owl.vo; |
| | | |
| | | /** |
| | | * Created by jeong on 2017-08-02. |
| | | */ |
| | | public class DepartmentManagementVo extends BaseVo{ |
| | | |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | |
| | | public DepartmentManagementVo() { |
| | | } |
| | | |
| | | public DepartmentManagementVo(Long id, String departmentName, String departmentDescription) { |
| | | this.id = id; |
| | | this.departmentName = departmentName; |
| | | this.departmentDescription = departmentDescription; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | |
| | | public String getDepartmentDescription() { |
| | | return departmentDescription; |
| | | } |
| | | |
| | | public void setDepartmentDescription(String departmentDescription) { |
| | | this.departmentDescription = departmentDescription; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.vo; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by jeong on 2017-08-02. |
| | | */ |
| | | public class UserLevelVo extends BaseVo{ |
| | | |
| | | private Long id; |
| | | private String levelName; |
| | | private Integer permission; |
| | | |
| | | public UserLevelVo() { |
| | | } |
| | | |
| | | public UserLevelVo(Long id, String levelname, Integer permission) { |
| | | this.id = id; |
| | | this.levelName = levelname; |
| | | this.permission = permission; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLevelName() { |
| | | return levelName; |
| | | } |
| | | |
| | | public void setLevelName(String levelName) { |
| | | this.levelName = levelName; |
| | | } |
| | | |
| | | public Integer getPermission() { |
| | | return permission; |
| | | } |
| | | |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | } |
| | |
| | | private String socialType; |
| | | private Long lastWorkspaceId; |
| | | private Long lastProjectId; |
| | | private Long departmentId; |
| | | private Boolean userSocialLogin = Boolean.FALSE; |
| | | private List<ProjectVo> projectVos = Lists.newArrayList(); |
| | | private String reservationNotifyTime; |
| | |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public Long getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(Long departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | private Long id; |
| | | private String userName; |
| | | private String account; |
| | | private Integer premission; |
| | | private Integer permission; |
| | | private Boolean useYn; |
| | | |
| | | public UserWorkspaceVo(){} |
| | |
| | | } |
| | | |
| | | public Integer getPermission() { |
| | | return premission; |
| | | return permission; |
| | | } |
| | | |
| | | public void setPermission(Integer premission) { |
| | | this.premission = premission; |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | |
| | | public Boolean getUseYn() { |
New file |
| | |
| | | package kr.wisestone.owl.web.condition; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by jeong on 2018-01-01. |
| | | */ |
| | | public class DepartmentManagementCondition { |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | private List<String> statuses = Lists.newArrayList(); |
| | | private List<Long> excludeIds = Lists.newArrayList(); |
| | | |
| | | public static DepartmentManagementCondition make(Map<String, Object> departmentManagemantconditions) { |
| | | DepartmentManagementCondition departmentManagementCondition = ConvertUtil.convertMapToClass(departmentManagemantconditions, DepartmentManagementCondition.class); |
| | | departmentManagementCondition.setStatuses(MapUtil.getStrings(departmentManagemantconditions, "statuses")); |
| | | departmentManagementCondition.setExcludeIds(MapUtil.getLongs(departmentManagemantconditions, "excludeIds")); |
| | | |
| | | return departmentManagementCondition; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | |
| | | public String getDepartmentDescription() { |
| | | return departmentDescription; |
| | | } |
| | | |
| | | public void setDepartmentDescription(String departmentDescription) { |
| | | this.departmentDescription = departmentDescription; |
| | | } |
| | | |
| | | public List<String> getStatuses() { |
| | | return statuses; |
| | | } |
| | | |
| | | public void setStatuses(List<String> statuses) { |
| | | this.statuses = statuses; |
| | | } |
| | | |
| | | public List<Long> getExcludeIds() { |
| | | return excludeIds; |
| | | } |
| | | |
| | | public void setExcludeIds(List<Long> excludeIds) { |
| | | this.excludeIds = excludeIds; |
| | | } |
| | | } |
| | |
| | | private Integer pageSize; |
| | | private Long loginUserId; |
| | | private Long workspaceId; |
| | | private Integer permission; |
| | | // private Integer permission; |
| | | private String licensekey; |
| | | |
| | | public static UserCondition make(Map<String, Object> conditions) { |
| | |
| | | this.deep = deep; |
| | | } |
| | | |
| | | public Integer getPermission() { |
| | | return permission; |
| | | } |
| | | |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | // public Integer getPermission() { |
| | | // return permission; |
| | | // } |
| | | // |
| | | // public void setPermission(Integer permission) { |
| | | // this.permission = permission; |
| | | // } |
| | | |
| | | public String getLicensekey() { |
| | | return licensekey; |
New file |
| | |
| | | package kr.wisestone.owl.web.condition; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by jeong on 2018-01-01. |
| | | */ |
| | | public class UserLevelCondition { |
| | | private Long id; |
| | | private String levelName; |
| | | private Integer permission; |
| | | private Integer page; |
| | | private Integer pageSize; |
| | | |
| | | public static UserLevelCondition make(Map<String, Object> userLevelConditions) { |
| | | return ConvertUtil.convertMapToClass(userLevelConditions, UserLevelCondition.class); |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLevelName() { |
| | | return levelName; |
| | | } |
| | | |
| | | public void setLevelName(String levelName) { |
| | | this.levelName = levelName; |
| | | } |
| | | |
| | | public Integer getPermission() { |
| | | return permission; |
| | | } |
| | | |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | |
| | | public Integer getPage() { |
| | | return page; |
| | | } |
| | | |
| | | public void setPage(Integer page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | public Integer getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.controller; |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.domain.enumType.SocialType; |
| | | import kr.wisestone.owl.service.UserLevelService; |
| | | import kr.wisestone.owl.service.UserService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.web.condition.UserCondition; |
| | | import kr.wisestone.owl.web.condition.UserLevelCondition; |
| | | import kr.wisestone.owl.web.form.UserForm; |
| | | import kr.wisestone.owl.web.form.UserLevelForm; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by jeong on 2017-08-02. |
| | | */ |
| | | @Controller |
| | | public class UserLevelController extends BaseController { |
| | | |
| | | @Autowired |
| | | private UserLevelService userLevelService; |
| | | |
| | | // 사용자등급 생성 |
| | | @RequestMapping(value = "/userLevel/add", method = RequestMethod.POST) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> addUserLevel(MultipartHttpServletRequest request) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Map<String, Object> content = ConvertUtil.convertJsonToMap(request.getParameter(Constants.REQ_KEY_CONTENT)); |
| | | this.userLevelService.addUserLevel(UserLevelForm.make(content)); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 사용자등급 조회 |
| | | @RequestMapping(value = "/userLevel/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); |
| | | |
| | | this.userLevelService.findUser(resJsonData, UserLevelCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 사용자등급 수정 |
| | | // @RequestMapping(value = "/userLevel/modify", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | // public |
| | | // @ResponseBody |
| | | // Map<String, Object> modify(MultipartHttpServletRequest request) { |
| | | // Map<String, Object> resJsonData = new HashMap<>(); |
| | | // |
| | | // this.userService.modifyUser(UserForm.make(ConvertUtil.convertJsonToMap(request.getParameter(Constants.REQ_KEY_CONTENT))), request.getFile("file")); |
| | | // |
| | | // return this.setSuccessMessage(resJsonData); |
| | | // } |
| | | |
| | | // 사용자등급 삭제 |
| | | // @RequestMapping(value = "/userLevel/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | // public |
| | | // @ResponseBody |
| | | // Map<String, Object> withDraw() { |
| | | // Map<String, Object> resJsonData = new HashMap<>(); |
| | | // |
| | | // this.userService.withDrawUser(); |
| | | // |
| | | // return this.setSuccessMessage(resJsonData); |
| | | // } |
| | | |
| | | // 사용자 등급 엑셀 다운로드 |
| | | // @RequestMapping(value = "/userLevel/downloadExcel", method = RequestMethod.POST) |
| | | // public ModelAndView downloadExcel(HttpServletRequest request, Model model) { |
| | | // return this.userService.downloadExcel(model); |
| | | // } |
| | | |
| | | /*// 이벤트 당첨자 엑셀 다운로드 |
| | | @RequestMapping(value = "/user/downloadExcelEvent", method = RequestMethod.POST) |
| | | public ModelAndView downloadExcelEvent(HttpServletRequest request, Model model) { |
| | | return this.userService.downloadExcelEvent(model); |
| | | }*/ |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @Autowired |
| | | private UserWorkspaceService userWorkspaceService; |
| | | |
| | | // 사용자 등급 조회 |
| | | @RequestMapping(value = "/userWorkspace/levelFind", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> levelFind(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); |
| | | |
| | | this.userWorkspaceService.findUserWorkspace(resJsonData, UserWorkspaceCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | //this.userWorkspaceService.levelFind(resJsonData, UserWorkspaceCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 부서 조회 |
| | | @RequestMapping(value = "/userWorkspace/departmentFind", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> departmentFind(@RequestBody Map<String, Map<String, Object>> params) { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); |
| | | |
| | | this.userWorkspaceService.findUserWorkspace(resJsonData, UserWorkspaceCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | //this.userWorkspaceService.departmentFind(resJsonData, UserWorkspaceCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable); |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 업무공간에 참여하는 사용자 조회 |
| | | @RequestMapping(value = "/userWorkspace/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
New file |
| | |
| | | package kr.wisestone.owl.web.form; |
| | | |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by jeong on 2017-12-30. |
| | | */ |
| | | public class DepartmentManagementForm { |
| | | private Long id; |
| | | private String departmentName; |
| | | private String departmentDescription; |
| | | |
| | | public DepartmentManagementForm() { |
| | | } |
| | | |
| | | public static DepartmentManagementForm make(Map<String, Object> params) { |
| | | return ConvertUtil.convertMapToClass(params, DepartmentManagementForm.class); |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getDepartmentName() { |
| | | return departmentName; |
| | | } |
| | | |
| | | public void setDepartmentName(String departmentName) { |
| | | this.departmentName = departmentName; |
| | | } |
| | | |
| | | public String getDepartmentDescription() { |
| | | return departmentDescription; |
| | | } |
| | | |
| | | public void setDepartmentDescription(String departmentDescription) { |
| | | this.departmentDescription = departmentDescription; |
| | | } |
| | | } |
| | |
| | | private String profile; |
| | | private String status; |
| | | private String phone; |
| | | private Long levelId; |
| | | private String departmentId; |
| | | private String workspaceName; |
| | | private String socialType; |
| | | private Long lastWorkspaceId; |
| | |
| | | return phone; |
| | | } |
| | | |
| | | public Long getLevelId() { |
| | | return levelId; |
| | | } |
| | | |
| | | public void setLevelId(Long levelId) { |
| | | this.levelId = levelId; |
| | | } |
| | | |
| | | public String getDepartmentId() { |
| | | return departmentId; |
| | | } |
| | | |
| | | public void setDepartmentId(String departmentId) { |
| | | this.departmentId = departmentId; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
New file |
| | |
| | | package kr.wisestone.owl.web.form; |
| | | |
| | | import kr.wisestone.owl.domain.User; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by jeong on 2017-12-30. |
| | | */ |
| | | public class UserLevelForm { |
| | | private Long id; |
| | | private String levelName; |
| | | private Integer permission; |
| | | |
| | | public UserLevelForm(){} |
| | | |
| | | public static UserLevelForm make(Map<String, Object> params) { |
| | | return ConvertUtil.convertMapToClass(params, UserLevelForm.class); |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLevelName() { |
| | | return levelName; |
| | | } |
| | | |
| | | public void setLevelName(String levelName) { |
| | | this.levelName = levelName; |
| | | } |
| | | |
| | | public Integer getPermission() { |
| | | return permission; |
| | | } |
| | | |
| | | public void setPermission(Integer permission) { |
| | | this.permission = permission; |
| | | } |
| | | } |
| | |
| | | <query> |
| | | SELECT u |
| | | FROM User u |
| | | WHERE u.permission > 2047 |
| | | INNER JOIN u.userLevel ul |
| | | INNER JOIN u.departmentManagement dm |
| | | WHERE ul.permission > 2047 |
| | | AND u.status = '01' |
| | | </query> |
| | | </named-query> |
New file |
| | |
| | | ALTER TABLE `user` DROP COLUMN `permission`; |
| | | ALTER TABLE `user` ADD COLUMN `level_id` BIGINT(11) NULL; |
| | | ALTER TABLE `user` ADD COLUMN `department_id` BIGINT(11) NULL; |
| | | |
| | | CREATE TABLE `department_management`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `department_name` VARCHAR(50) NOT NULL, |
| | | `department_description` VARCHAR(255) NOT NULL, |
| | | `register_id` BIGINT(20) NOT NULL, |
| | | `register_date` TIMESTAMP NULL, |
| | | `modify_id` BIGINT(20) NOT NULL, |
| | | `modify_date` TIMESTAMP NULL, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
| | | |
| | | CREATE TABLE `user_level`( |
| | | `id` BIGINT(11) AUTO_INCREMENT, |
| | | `level_name` VARCHAR(50) NOT NULL, |
| | | `permission` INT NULL, |
| | | `register_id` BIGINT(20) NOT NULL COMMENT 'register_id', |
| | | `register_date` TIMESTAMP NULL COMMENT 'register_date', |
| | | `modify_id` BIGINT(20) NOT NULL COMMENT 'modify_id', |
| | | `modify_date` TIMESTAMP NULL COMMENT 'modify_date', |
| | | PRIMARY KEY (`id`) USING btree |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
New file |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="kr.wisestone.owl.mapper.UserLevelMapper"> |
| | | |
| | | <select id="find" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.UserLevelCondition"> |
| | | SELECT |
| | | ul.id as id, |
| | | ul.level_name as levelName, |
| | | ul.permission as permission |
| | | FROM |
| | | user_level ul |
| | | WHERE 1=1 |
| | | <if test="levelName != '' and levelName != null"> |
| | | AND ul.level_name like CONCAT('%',#{levelName},'%') |
| | | </if> |
| | | limit #{pageSize} offset #{page}; |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.UserLevelCondition"> |
| | | SELECT |
| | | count(ul.id) |
| | | FROM |
| | | user_level ul |
| | | WHERE 1=1 |
| | | <if test="levelName != '' and levelName != null"> |
| | | AND ul.level_name like CONCAT('%',#{levelName},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | u.id as userId, |
| | | u.name as userName, |
| | | u.account as account, |
| | | u.permission as permission, |
| | | /*u.permission as permission,*/ |
| | | CASE WHEN uw.use_yn = 'Y' THEN 'true' ELSE 'false' END as useYn |
| | | FROM |
| | | user_workspace uw |
| | |
| | | $scope.vm.tableConfigs.push($tableProvider.config() |
| | | .setHName("manageUser.manageNoticePerm") |
| | | .setHWidth("width-140-p") |
| | | .setDType("renderer") |
| | | .setDType("renderer") |
| | | .setDAlign("text-center pdr0 pdt0 pdl0 pdb0") |
| | | .setDName("Notice") |
| | | .setDRenderer("WORKSPACE_USE_YN")); |
| | |
| | | currentPage = selectedPage; |
| | | } |
| | | |
| | | var conditions = { |
| | | var conditions = { |
| | | name : $scope.vm.search.levelName //등급명 |
| | | }; |
| | | |
| | | |
| | | //테이블 리스트 데이터 컨트롤러 요청 |
| | | UserWorkspace.levelFind($resourceProvider.getContent(conditions, |
| | | $resourceProvider.getPageContent(currentPage, $scope.vm.page.selectedPageRowCount))).then(function (result) { |
| | |
| | | app.factory("UserWorkspace", ['$http', '$log', function ($http, $log) { |
| | | return { |
| | | levelFind : function (conditions) { |
| | | return $http.post("userWorkspace/levelFind", conditions).then(function (response) { |
| | | return $http.post("userLevel/find", conditions).then(function (response) { |
| | | $log.debug("사용자 등급 목록 : ", response); |
| | | return response; |
| | | }); |