Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthAuthorMgtMapper.java
main
Kurt92 2 years ago
commit c538f8e90e

@ -36,8 +36,16 @@ public interface AuthAuthorMgtMapper {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
List<XitAuthorInfoVO> selectAuthorInfos(final Map<String, Object> paraMap, final RowBounds rowBounds); <T> List<XitAuthorInfoVO> selectAuthorInfos(final Map<String,Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> selectAuthorInfos(final Map<String, Object> paraMap);
/**
*
* @param t Map VO generic (AuthHierarchy VO )
* @return
* @param <T>
*/
<T> List<XitAuthorInfoVO> selectAuthorInfos(final T t);
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param vo * @param vo
@ -60,34 +68,4 @@ public interface AuthAuthorMgtMapper {
List<XitRoleInfoVO> selectAuthRoleGrantList(Map<String, Object> paraMap); List<XitRoleInfoVO> selectAuthRoleGrantList(Map<String, Object> paraMap);
int deleteRoleGrant(Map<String, Object> map); int deleteRoleGrant(Map<String, Object> map);
int saveRoleGrant(Map<String, Object> map); int saveRoleGrant(Map<String, Object> map);
/**
* <pre> : </pre>
* @param searchVO
* @return List<Map<String,String>>
* @author:
* @date: 2020. 4. 16.
*/
public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
} }

@ -30,47 +30,4 @@ public interface AuthGrpMgtMapper {
int insertAuthorGroupInfo(final XitAuthorGroupInfoVO vo); int insertAuthorGroupInfo(final XitAuthorGroupInfoVO vo);
int updateAuthorGroupInfo(final XitAuthorGroupInfoVO vo); int updateAuthorGroupInfo(final XitAuthorGroupInfoVO vo);
int deleteAuthorGroupInfo(final String groupId); int deleteAuthorGroupInfo(final String groupId);
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthGrpMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitAuthGrpMngVO> findList(XitAuthGrpMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthGrpMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitAuthGrpMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) throws SQLException;
} }

@ -22,37 +22,6 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
*/ */
@Mapper @Mapper
public interface AuthHierarchyMgtMapper { public interface AuthHierarchyMgtMapper {
List<XitAuthHierarchyMngVO> selectAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds); List<XitAuthHierarchyMngVO> selectAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthHierarchyMngVO>
* @author:
* @date: 2020. 11. 2.
*/
public List<XitAuthHierarchyMngVO> findList(XitAuthHierarchyMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 11. 2.
*/
public int findListTotCnt(XitAuthHierarchyMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitAuthHierarchyMngVO
* @author:
* @date: 2020. 11. 2.
*/
public XitAuthHierarchyMngVO findView(XitAuthHierarchyMngVO vo) throws SQLException;
} }

@ -27,11 +27,8 @@ public interface AuthRoleMgtMapper {
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param searchVO
* @return List<XitAuthRuleMngVO>
* @author:
* @date: 2020. 4. 16.
*/ */
@SuppressWarnings("MybatisXMapperMethodInspection")
List<XitRoleInfoVO> selectAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds); List<XitRoleInfoVO> selectAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/** /**

@ -23,56 +23,6 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
*/ */
@Mapper @Mapper
public interface AuthUserMgtMapper { public interface AuthUserMgtMapper {
List<XitAuthUsrMngVO> selectAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds); List<XitAuthUsrMngVO> selectAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitAuthUsrMngVO selectAuthUser(final Map<String,Object> paraMap); XitAuthUsrMngVO selectAuthUser(final Map<String,Object> paraMap);
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthUsrMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitAuthUsrMngVO> findList(XitAuthUsrMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthUsrMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitAuthUsrMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitAuthUsrMngVO findView(XitAuthUsrMngVO vo) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return List<Map<String,String>>
* @author:
* @date: 2020. 4. 16.
*/
public List<Map<String, String>> findListGroup(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListGroupTotCnt(XitBaseSearchVO searchVO);
} }

@ -1,6 +1,12 @@
package kr.xit.framework.biz.mng.auth.model; package kr.xit.framework.biz.mng.auth.model;
import kr.xit.framework.core.model.BaseVO; import kr.xit.framework.core.model.BaseVO;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/** /**
* *
@ -12,6 +18,12 @@ import kr.xit.framework.core.model.BaseVO;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ToString
public class XitAuthHierarchyMngVO extends BaseVO { public class XitAuthHierarchyMngVO extends BaseVO {
/** /**
@ -42,74 +54,4 @@ public class XitAuthHierarchyMngVO extends BaseVO {
* *
*/ */
private String authorRescueCodeNm; private String authorRescueCodeNm;
/**
* authorCode attribute .
* @return String
*/
public String getAuthorCode() {
return authorCode;
}
/**
* authorCode attribute .
* @param authorCode String
*/
public void setAuthorCode(String authorCode) {
this.authorCode = authorCode;
}
/**
* authorCreatDe attribute .
* @return String
*/
public String getAuthorCreatDe() {
return authorCreatDe;
}
/**
* authorCreatDe attribute .
* @param authorCreatDe String
*/
public void setAuthorCreatDe(String authorCreatDe) {
this.authorCreatDe = authorCreatDe;
}
/**
* authorDc attribute .
* @return String
*/
public String getAuthorDc() {
return authorDc;
}
/**
* authorDc attribute .
* @param authorDc String
*/
public void setAuthorDc(String authorDc) {
this.authorDc = authorDc;
}
/**
* authorNm attribute .
* @return String
*/
public String getAuthorNm() {
return authorNm;
}
/**
* authorNm attribute .
* @param authorNm String
*/
public void setAuthorNm(String authorNm) {
this.authorNm = authorNm;
}
public String getAuthorRescueCode() {
return authorRescueCode;
}
public void setAuthorRescueCode(String authorRescueCode) {
this.authorRescueCode = authorRescueCode;
}
public String getAuthorRescueCodeNm() {
return authorRescueCodeNm;
}
public void setAuthorRescueCodeNm(String authorRescueCodeNm) {
this.authorRescueCodeNm = authorRescueCodeNm;
}
} }

@ -40,89 +40,6 @@ public interface AuthAuthorMgtService {
void removeAuthAuthor(final String authorCode); void removeAuthAuthor(final String authorCode);
List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap);
void saveAuthRoleGrantList(final Map<String, Object> paraMap);
List<XitRoleInfoVO> findAuthRoleGrantList(Map<String, Object> paraMap);
void saveAuthRoleGrantList(Map<String, Object> paraMap);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitAuthRegMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitAuthRegMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitAuthRegMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids);
/**
* <pre> : </pre>
* @param searchVO
* @return List<Map<String,String>>
* @author:
* @date: 2020. 4. 16.
*/
List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param authCode
* @param trgetRoleCodes
* @param trgetRegYns void
* @author:
* @date: 2020. 4. 16.
*/
void addAuthorRole(String authCode, String[] trgetRoleCodes, String[] trgetRegYns);
} }

@ -28,67 +28,5 @@ public interface AuthGrpMgtService {
void modifyAuthGrp(final XitAuthorGroupInfoVO vo); void modifyAuthGrp(final XitAuthorGroupInfoVO vo);
void removeAuthGrp(final String authorCode); void removeAuthGrp(final String authorCode);
void isCheckUserForCanChange(String uniqId, String trgetAuthorCode); void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode);
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthGrpMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitAuthGrpMngVO> findList(XitAuthGrpMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthGrpMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthGrpMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitAuthGrpMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitAuthGrpMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitAuthGrpMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids);
} }

@ -5,6 +5,7 @@ import java.util.Map;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
@ -21,68 +22,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
public interface AuthHierarchyMgtService { public interface AuthHierarchyMgtService {
List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds pagingInfo); List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds pagingInfo);
XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo);
void saveAuthHierarchy(final XitAuthHierarchyMngVO vo);
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthHierarchyMngVO>
* @author:
* @date: 2020. 11. 2.
*/
public List<XitAuthHierarchyMngVO> findList(XitAuthHierarchyMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 11. 2.
*/
public int findListTotCnt(XitAuthHierarchyMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthHierarchyMngVO
* @author:
* @date: 2020. 11. 2.
*/
public XitAuthHierarchyMngVO findView(XitAuthHierarchyMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 11. 2.
*/
public void addProc(XitAuthHierarchyMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 11. 2.
*/
public void modifyProc(XitAuthHierarchyMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 11. 2.
*/
public void removeProc(XitAuthHierarchyMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 11. 2.
*/
public void removesProc(String ids);
} }

@ -46,7 +46,7 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
void addAuthRole(XitRoleInfoVO vo); void addAuthRole(final XitRoleInfoVO vo);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -54,7 +54,7 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
void modifyAuthRole(XitRoleInfoVO vo); void modifyAuthRole(final XitRoleInfoVO vo);
/** /**
* <pre> : </pre> * <pre> : </pre>

@ -24,85 +24,4 @@ public interface AuthUserMgtService {
List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds); List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
void saveAuthUserList(final List<Map<String, Object>> paraList); void saveAuthUserList(final List<Map<String, Object>> paraList);
void removeAuthUserList(final List<Map<String, Object>> paraList); void removeAuthUserList(final List<Map<String, Object>> paraList);
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthUsrMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitAuthUsrMngVO> findList(XitAuthUsrMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthUsrMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthUsrMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitAuthUsrMngVO findView(XitAuthUsrMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitAuthUsrMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitAuthUsrMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitAuthUsrMngVO vo);
/**
* <pre> : </pre>
* @param ids
* @param groupIds void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String groupIds);
/**
* <pre> : </pre>
* @param searchVO
* @return List<Map<String,String>>
* @author:
* @date: 2020. 4. 16.
*/
public List<Map<String, String>> findListGroup(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListGroupTotCnt(XitBaseSearchVO searchVO);
} }

@ -29,10 +29,6 @@ import lombok.extern.slf4j.Slf4j;
public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService { public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
@Resource @Resource
private AuthAuthorMgtMapper mapper; private AuthAuthorMgtMapper mapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitFrameUnitService xitFrameUnitService;
/** 부모 권한코드 */ /** 부모 권한코드 */
final String PARNTS_AUTHOR = "ROLE_USER"; final String PARNTS_AUTHOR = "ROLE_USER";
@ -46,7 +42,7 @@ public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
} }
@Override @Override
public List<XitAuthorInfoVO> findAuthAuthors(Map<String, Object> paraMap) { public List<XitAuthorInfoVO> findAuthAuthors(final Map<String, Object> paraMap) {
return mapper.selectAuthorInfos(paraMap); return mapper.selectAuthorInfos(paraMap);
} }
@ -106,7 +102,7 @@ public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
} }
@Override @Override
public List<XitRoleInfoVO> findAuthRoleGrantList(Map<String, Object> paraMap) { public List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap) {
return mapper.selectAuthRoleGrantList(paraMap); return mapper.selectAuthRoleGrantList(paraMap);
} }
@ -122,204 +118,4 @@ public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
mapper.saveRoleGrant(map); mapper.saveRoleGrant(map);
}); });
} }
@Override
public void addProc(XitAuthRegMngVO vo) {
/* =====================================================
* 2020.05.21
*
* -: egovFrame ~ "익명사용자->사용자->관리자"
* ROLE .
* "관리자>매니저>정회원>준회원>비회원"
* ( ) .
* -: "익명사용자->사용자->관리자"
* "익명사용자->사용자->신규권한1/신규권한2/...->관리자"
* n "사용자" ROLE
* n ROLE "관리자" .
* AS-IS: "익명사용자->사용자->관리자" (PARENT) ROLE .
* TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자" (PARENT) ROLE .
===================================================== */
/* -----------------------
* 2020.05.21
-----------------------*/
// /**
// * 필수값 설정
// */
// XitAuthorInfoVO authorInfoVO = convertToCrudVO(vo);
// /**
// * 처리
// */
// xitFrameCrudService.addXitAuthorInfo(authorInfoVO);
/**
*
*/
XitAuthorInfoVO authorInfoVO = convertToCrudVO(vo);
/**
*
*/
//권한정보 Insert
xitFrameCrudService.addXitAuthorInfo(authorInfoVO);
//권한계층 Insert
try {
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authorInfoVO.getAuthorCode());
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParntsRole(authorInfoVO.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
} catch (Exception e) {
log.debug(String.format("권한계층 Insert Fail : %s", e.getMessage()));
}
}
@Override
public void modifyProc(XitAuthRegMngVO vo) {
/**
*
*/
XitAuthorInfoVO authorInfoVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.modifyXitAuthorInfo(authorInfoVO);
}
@Override
public void removeProc(XitAuthRegMngVO vo) {
/* =====================================================
* 2020.05.21
*
* -: egovFrame ~ "익명사용자->사용자->관리자"
* ROLE .
* "관리자>매니저>정회원>준회원>비회원"
* ( ) .
* -: "익명사용자->사용자->관리자"
* "익명사용자->사용자->신규권한1/신규권한2/...->관리자"
* n "사용자" ROLE
* n ROLE "관리자" .
* AS-IS: "익명사용자->사용자->관리자" (PARENT) ROLE .
* TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자" (PARENT) ROLE .
===================================================== */
/* -----------------------
* 2020.05.21
-----------------------*/
// /**
// * 필수값 설정
// */
// XitAuthorInfoVO authorInfoVO = convertToCrudVO(vo);
// /**
// * 처리
// */
// xitFrameCrudService.removeXitAuthorInfo(authorInfoVO);
/**
*
*/
XitAuthorInfoVO authorInfoVO = convertToCrudVO(vo);
/**
*
*/
//권한계층 Delete
try {
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 제거
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authorInfoVO.getAuthorCode());
xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거
roleSclsrtRescueVO.setParntsRole(authorInfoVO.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO);
} catch (Exception e) {
log.debug(String.format("권한계층 Delete Fail : %s", e.getMessage()));
}
//권한정보 Delete
xitFrameCrudService.removeXitAuthorInfo(authorInfoVO);
}
@Override
public void removesProc(String ids) {
/**
*
*/
String[] authorCodes = ids.split(";");
for (int i = 0; i < authorCodes.length; i++) {
XitAuthRegMngVO vo = new XitAuthRegMngVO();
vo.setAuthorCode(authorCodes[i]);
this.removeProc(vo);
}
}
@Override
public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO) {
return mapper.findListAuthorRole(searchVO);
}
@Override
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO) {
return mapper.findListAuthorRoleTotCnt(searchVO);
}
@Override
public void addAuthorRole(String authorCode, String[] trgetRoleCodes, String[] trgetRegYns) {
/**
*
*/
if(XitCmmnUtil.isEmpty(authorCode))
throw new RuntimeException("권한코드(은)는 필수조건 입니다.");
if(XitCmmnUtil.isEmpty(trgetRoleCodes))
throw new RuntimeException("역할코드(은)는 필수조건 입니다.");
if(XitCmmnUtil.isEmpty(trgetRegYns))
throw new RuntimeException("등록여부(은)는 필수조건 입니다.");
/**
*
*/
if(trgetRoleCodes.length != trgetRegYns.length)
throw new RuntimeException("권한코드와 등록여부 건수가 일치하지 않습니다.");
/**
*
*/
for(int i=0; i<trgetRoleCodes.length;i++) {
//필수값 설정
XitAuthorRoleRelateVO vo = new XitAuthorRoleRelateVO();
vo.setAuthor_code(authorCode);
vo.setAuthor_code(trgetRoleCodes[i]);
//권한역할관계 등록 단위서비스 호출
xitFrameUnitService.addAuthRoleRelation(authorCode, trgetRoleCodes[i], "Y".equals(trgetRegYns[i]) );
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitAuthorInfoVO
* @author:
* @date: 2020. 4. 16.
*/
private XitAuthorInfoVO convertToCrudVO(XitAuthRegMngVO vo) {
XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO();
authorInfoVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
authorInfoVO.setAuthorNm(vo.getAuthorNm()); //권한 명
authorInfoVO.setAuthorDc(vo.getAuthorDc()); //권한 설명
// authorInfoVO.setAuthor_creat_de(vo.getAuthorCreatDe()); //권한 생성 일
return authorInfoVO;
}
} }

@ -39,15 +39,8 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
@Resource @Resource
private UserMgtMapper userMgtMapper; private UserMgtMapper userMgtMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitFrameUnitService xitFrameUnitService;
@Resource(name="xitGroupIdGnrService") @Resource(name="xitGroupIdGnrService")
private EgovIdGnrService idgenService; private EgovIdGnrService idgenService;
@Resource
private XitMessageSource xitMessageSource;
@Override @Override
public List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String, Object> paraMap, final RowBounds rowBounds) { public List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String, Object> paraMap, final RowBounds rowBounds) {
@ -85,7 +78,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
mapper.deleteAuthorGroupInfo(groupId); mapper.deleteAuthorGroupInfo(groupId);
} }
public void isCheckUserForCanChange(String uniqId, String trgetAuthorCode) { public void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode) {
//사용자보안설정 조회 //사용자보안설정 조회
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setScrtySetupTrgetId(uniqId); userScrtySetupVO.setScrtySetupTrgetId(uniqId);
@ -97,7 +90,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
} }
private boolean isCheckUserAuthorCodeForCanChange(String userAuthorCode, String trgetAuthorCode) { private boolean isCheckUserAuthorCodeForCanChange(final String userAuthorCode, final String trgetAuthorCode) {
//역할(권한)계층구조 데이터 목록 조회 //역할(권한)계층구조 데이터 목록 조회
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null); List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null);
//역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환 //역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환
@ -141,7 +134,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true; return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true;
} }
private boolean isHighAuthor(List<XitRoleSclsrtRescueVO> list, String authorCode, String highAuthorCode) { private boolean isHighAuthor(final List<XitRoleSclsrtRescueVO> list, final String authorCode, final String highAuthorCode) {
boolean result = false; boolean result = false;
for (XitRoleSclsrtRescueVO item : list) { for (XitRoleSclsrtRescueVO item : list) {
@ -161,153 +154,4 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
return result; return result;
} }
@Override
public List<XitAuthGrpMngVO> findList(XitAuthGrpMngSearchVO searchVO) {
List<XitAuthGrpMngVO> result = null;
try {
result = mapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitAuthGrpMngSearchVO searchVO) {
int result = 0;
try {
result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) {
XitAuthGrpMngVO result = null;
try {
result = mapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitAuthGrpMngVO vo) {
/**
*
*/
boolean isChangePermission = xitFrameUnitService.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
if(!isChangePermission)
throw new RuntimeException("자신의 권한보다 상위 권한을 설정 할 수 없습니다.");
/**
*
*/
try {
vo.setGroupId(idgenService.getNextStringId());
} catch (FdlException e) {
throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage()));
}
XitAuthorGroupInfoVO authorGroupInfoVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.addXitAuthorGroupInfo(authorGroupInfoVO);
}
@Override
public void modifyProc(XitAuthGrpMngVO vo) {
/**
*
*/
boolean isChangePermission = xitFrameUnitService.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
if(!isChangePermission)
throw new RuntimeException("자신의 권한보다 상위 권한을 설정 할 수 없습니다.");
/**
*
*/
XitAuthorGroupInfoVO authorGroupInfoVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.modifyXitAuthorGroupInfo(authorGroupInfoVO);
}
@Override
public void removeProc(XitAuthGrpMngVO vo) {
/**
*
*/
XitAuthorGroupInfoVO authorGroupInfoVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.removeXitAuthorGroupInfo(authorGroupInfoVO);
}
@Override
public void removesProc(String ids) {
/**
*
*/
String [] groupIds = ids.split(";");
for(int i=0; i<groupIds.length;i++) {
XitAuthGrpMngVO vo = new XitAuthGrpMngVO();
vo.setGroupId(groupIds[i]);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitAuthorGroupInfoVO
* @author:
* @date: 2020. 4. 16.
*/
private XitAuthorGroupInfoVO convertToCrudVO(XitAuthGrpMngVO vo) {
XitAuthorGroupInfoVO authorGroupInfoVO = new XitAuthorGroupInfoVO();
authorGroupInfoVO.setGroupId(vo.getGroupId()); //그룹 id
authorGroupInfoVO.setGroupNm(vo.getGroupNm()); //그룹 명
// authorGroupInfoVO.setGroup_creat_de(); //그룹 생성 일
authorGroupInfoVO.setGroupDc(vo.getGroupDc()); //그룹 설명
authorGroupInfoVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
return authorGroupInfoVO;
}
} }

@ -25,6 +25,8 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService; import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService;
import kr.xit.framework.core.utils.XitCmmnUtil; import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
@ -51,39 +53,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
} }
@Override @Override
public List<XitAuthHierarchyMngVO> findList(XitAuthHierarchyMngSearchVO searchVO) { public XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo) {
List<XitAuthHierarchyMngVO> result = null;
try {
result = mapper.findList(searchVO);
//권한구조 설정
if(XitCmmnUtil.notEmpty(result)) {
for(XitAuthHierarchyMngVO item : result) {
String strAuthorRescueCode = this.getStrAuthHierarchy(item.getAuthorCode());
item.setAuthorRescueCode(strAuthorRescueCode);
item.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode));
}
}
} catch (SQLException e) {
throw new RuntimeException("권한계층관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitAuthHierarchyMngSearchVO searchVO) {
int result = 0;
try {
result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("권한계층관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitAuthHierarchyMngVO findView(XitAuthHierarchyMngVO vo) {
XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO(); XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO();
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
@ -99,16 +69,10 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
return result; return result;
} }
@Override
public void addProc(XitAuthHierarchyMngVO vo) {
this.modifyProc(vo);
}
@Override
public void modifyProc(XitAuthHierarchyMngVO vo) {
public void saveAuthHierarchy(final XitAuthHierarchyMngVO vo) {
if(XitCmmnUtil.isEmpty(vo.getAuthorCode())) if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
throw new RuntimeException("권한코드는 필수조건 입니다."); throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "권한코드는 필수조건 입니다.");
String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록 String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록
@ -117,12 +81,11 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
* - . * - .
* - () . * - () .
*/ */
// 최상위 부모 갯수 확인
if(arrAuthorCodeGrp[0].split(";").length>1) if(arrAuthorCodeGrp[0].split(";").length>1)
throw new RuntimeException("최상위 부모는 한개만 설정 가능 합니다."); throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최상위 부모는 한개만 설정 가능 합니다.");
// 최하위 자녀 갯수 확인 // 최하위 자녀 갯수 확인
if(arrAuthorCodeGrp[arrAuthorCodeGrp.length-1].split(";").length>1) if(arrAuthorCodeGrp[arrAuthorCodeGrp.length-1].split(";").length>1)
throw new RuntimeException("최하위 자녀는 한개만 설정 가능 합니다."); throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최하위 자녀는 한개만 설정 가능 합니다.");
// 다중상속 구간 갯수 확인 // 다중상속 구간 갯수 확인
int cnt = 0; int cnt = 0;
for(String authorCodeGrp : arrAuthorCodeGrp) { for(String authorCodeGrp : arrAuthorCodeGrp) {
@ -130,7 +93,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
cnt++; cnt++;
} }
if(cnt > 1) if(cnt > 1)
throw new RuntimeException("다중상속은 하나의 구간만 설정 가능 합니다."); throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"다중상속은 하나의 구간만 설정 가능 합니다.");
//권한계층구조 일괄 제거 //권한계층구조 일괄 제거
authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO()); authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO());
@ -154,27 +117,6 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
} }
} }
} }
}
@Override
public void removeProc(XitAuthHierarchyMngVO vo) {
}
@Override
public void removesProc(String ids) {
/**
*
*/
String[] authorCodes = ids.split(";");
for (int i = 0; i < authorCodes.length; i++) {
XitAuthHierarchyMngVO vo = new XitAuthHierarchyMngVO();
vo.setAuthorCode(authorCodes[i]);
this.removeProc(vo);
}
} }
@ -185,7 +127,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
* @author: * @author:
* @date: 2020. 11. 2. * @date: 2020. 11. 2.
*/ */
private String getStrAuthHierarchy(String authorCode) { private String getStrAuthHierarchy(final String authorCode) {
LinkedHashMap<String, String> mParnts = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> mParnts = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>();
@ -219,7 +161,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
* @author: * @author:
* @date: 2020. 11. 2. * @date: 2020. 11. 2.
*/ */
private void getAuthHierarchy(List<XitRoleSclsrtRescueVO> list, String authorCode, boolean isChldrnSearch, LinkedHashMap<String, String> resultMap) { private void getAuthHierarchy(final List<XitRoleSclsrtRescueVO> list, final String authorCode, final boolean isChldrnSearch, final LinkedHashMap<String, String> resultMap) {
for (XitRoleSclsrtRescueVO item : list) { for (XitRoleSclsrtRescueVO item : list) {
@ -286,7 +228,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
} }
private String convertKorNm(String strAuthorRescueCode) { private String convertKorNm(final String strAuthorRescueCode) {
//권한코드 Map 생성 //권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null); List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>(); Map<String, String> mAuthorInfo = new HashMap<String, String>();

@ -24,8 +24,6 @@ public class AuthRoleMgtServiceImpl implements AuthRoleMgtService {
private AuthRoleMgtMapper mapper; private AuthRoleMgtMapper mapper;
@Resource(name="xitRoleIdGnrService") @Resource(name="xitRoleIdGnrService")
private EgovIdGnrService idgenService; private EgovIdGnrService idgenService;
@Resource
private XitMessageSource xitMessageSource;
@Override @Override
public List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds) { public List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds) {
@ -46,13 +44,13 @@ public class AuthRoleMgtServiceImpl implements AuthRoleMgtService {
try { try {
vo.setRoleCode(roleTyp.concat("-").concat(idgenService.getNextStringId())); vo.setRoleCode(roleTyp.concat("-").concat(idgenService.getNextStringId()));
} catch (FdlException e) { } catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, String.format("%s %s", xitMessageSource.getMessage(MessageKey.CMM_INSERT_FAIL), e.getMessage())); throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
} }
mapper.insertAuthRole(vo); mapper.insertAuthRole(vo);
} }
@Override @Override
public void modifyAuthRole(XitRoleInfoVO vo) { public void modifyAuthRole(final XitRoleInfoVO vo) {
mapper.updateAuthRole(vo); mapper.updateAuthRole(vo);
} }

@ -22,25 +22,18 @@ import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper;
import kr.xit.framework.biz.mng.user.service.UserMgtService; import kr.xit.framework.biz.mng.user.service.UserMgtService;
import kr.xit.framework.core.model.XitBaseSearchVO; import kr.xit.framework.core.model.XitBaseSearchVO;
import kr.xit.framework.core.utils.XitCmmnUtil; import kr.xit.framework.core.utils.XitCmmnUtil;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service @Service
public class AuthUserMgtServiceImpl implements AuthUserMgtService { public class AuthUserMgtServiceImpl implements AuthUserMgtService {
@Resource private final AuthUserMgtMapper mapper;
private AuthUserMgtMapper mapper;
@Resource private final UserMgtMapper userMapper;
private UserMgtMapper userMapper;
@Resource private final AuthGrpMgtService authGrpMgtService;
private AuthGrpMgtService authGrpMgtService; private final UserMgtService userMgtService;
@Resource
private UserMgtService userMgtService;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitFrameUnitService xitFrameUnitService;
@Override @Override
public List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds) { public List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds) {
@ -80,153 +73,4 @@ public class AuthUserMgtServiceImpl implements AuthUserMgtService {
}); });
} }
@Override
public List<XitAuthUsrMngVO> findList(XitAuthUsrMngSearchVO searchVO) {
List<XitAuthUsrMngVO> result = null;
try {
result = mapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("사용자별권한관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitAuthUsrMngSearchVO searchVO) {
int result = 0;
try {
result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("사용자별권한관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitAuthUsrMngVO findView(XitAuthUsrMngVO vo) {
XitAuthUsrMngVO result = null;
try {
result = mapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("사용자별권한관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitAuthUsrMngVO vo) {
/**
*
*/
boolean isChangePermission = xitFrameUnitService.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
if(!isChangePermission)
throw new RuntimeException("자신의 권한보다 상위 권한을 설정 할 수 없습니다.");
/**
*
*/
XitUserScrtySetupVO userScrtySetupVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO);
}
@Override
public void modifyProc(XitAuthUsrMngVO vo) {
/**
*
*/
boolean isChangePermission = xitFrameUnitService.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
if(!isChangePermission)
throw new RuntimeException("자신의 권한보다 상위 권한을 설정 할 수 없습니다.");
/**
*
*/
XitUserScrtySetupVO userScrtySetupVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.modifyXitUserScrtySetup(userScrtySetupVO);
}
@Override
public void removeProc(XitAuthUsrMngVO vo) {
/**
*
*/
XitUserScrtySetupVO userScrtySetupVO = convertToCrudVO(vo);
userScrtySetupVO.setMberTyCode(null);
String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(vo.getGroupId());
userScrtySetupVO.setAuthorCode(defaultAuthorCode);
/**
*
*/
/* ============================
* 2020.10.30.
* ()
* -: Defualt
* -:
* as-is: delete
* to-be: update
============================ */
// xitFrameCrudService.removeXitUserScrtySetup(userScrtySetupVO);
xitFrameCrudService.modifyXitUserScrtySetup(userScrtySetupVO);
}
@Override
public void removesProc(String ids, String groupIds) {
/**
*
*/
String [] userIds = ids.split(";");
String [] grpIds = groupIds.split(";");
for(int i=0; i<userIds.length;i++) {
XitAuthUsrMngVO vo = new XitAuthUsrMngVO();
vo.setUniqId(userIds[i]);
vo.setGroupId(grpIds[i]);
this.removeProc(vo);
}
}
@Override
public List<Map<String, String>> findListGroup(XitBaseSearchVO searchVO) {
return mapper.findListGroup(searchVO);
}
@Override
public int findListGroupTotCnt(XitBaseSearchVO searchVO) {
return mapper.findListGroupTotCnt(searchVO);
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitUserScrtySetupVO
* @author:
* @date: 2020. 4. 16.
*/
private XitUserScrtySetupVO convertToCrudVO(XitAuthUsrMngVO vo) {
XitUserScrtySetupVO crudVO = new XitUserScrtySetupVO();
crudVO.setScrtySetupTrgetId(vo.getUniqId()); //보안 설정 대상 id
crudVO.setMberTyCode(vo.getMberTyCode()); //회원 유형 코드
crudVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
return crudVO;
}
} }

@ -50,6 +50,7 @@ import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.ValidationError; import kr.xit.framework.support.util.ValidationError;
import kr.xit.framework.support.util.constants.MessageKey; import kr.xit.framework.support.util.constants.MessageKey;
import lombok.AllArgsConstructor;
/** /**
* *
@ -61,24 +62,16 @@ import kr.xit.framework.support.util.constants.MessageKey;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@AllArgsConstructor
@Controller @Controller
@RequestMapping("/framework/biz/mng/auth") @RequestMapping("/framework/biz/mng/auth")
public class AuthAuthorMgtController { public class AuthAuthorMgtController {
@Resource private final AuthAuthorMgtService service;
private AuthAuthorMgtService service;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
XitMessageSource xitMessageSource;
/** /**
* <pre> : </pre> * <pre> : </pre>
* @return String
* @author:
* @date: 2020. 4. 16.
*/ */
@RequestMapping(value = "/mngAuthAuthorMgtForm") @RequestMapping(value = "/mngAuthAuthorMgtForm")
public void mngAuthAuthorMgtForm() { public void mngAuthAuthorMgtForm() {
@ -101,9 +94,6 @@ public class AuthAuthorMgtController {
/** /**
* <pre> : </pre> * <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 30.
*/ */
@GetMapping(value = "findAuthAuthors") @GetMapping(value = "findAuthAuthors")
public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) { public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) {
@ -177,218 +167,4 @@ public class AuthAuthorMgtController {
return mav; return mav;
} }
/**
* <pre> : .</pre>
* @param cmd
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthRegMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String AuthRegMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("authorManageSearchVO") XitAuthRegMngSearchVO searchVO
, @ModelAttribute("authorManageVO") XitAuthRegMngVO vo
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
break;
case "edit": //수정 페이지
case "view": //상세 페이지
//model.addAttribute("authorManage", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthRegMng_"+cmd+tilesDef;
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthRegMng_{cmd}_proc", method=RequestMethod.POST)
public void AuthRegMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("authorManage") XitAuthRegMngVO vo
,@RequestParam(value="authorCodes", required=false, defaultValue="") String authorCodes
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
,@RequestParam(value="authorCode", required=false, defaultValue="") String authorCode
,@RequestParam(value="roleCodes", required=false, defaultValue="") String roleCodes
,@RequestParam(value="regYns", required=false, defaultValue="") String regYns
) throws ServletException, IOException {
/**
*
*/
String sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_list.do";
String message = null;
switch (cmd) {
case "insert": //등록
//유효성 확인
//2020.11.24. 주석처리
beanValidator.validate(vo, bindingResult);
// beanValidator.validate("authorManage", vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_input.do";
break;
}
//처리
try {
service.addProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_input.do";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_input.do";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
//유효성 확인
//2020.11.24. 주석처리
beanValidator.validate(vo, bindingResult);
// beanValidator.validate("authorManage", vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_edit.do";
break;
}
//처리
try {
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_edit";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_edit";
}
break;
case "delete": //삭제
//처리
try {
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_edit";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_edit";
}
break;
case "deletes": //다건 삭제
//처리
try {
service.removesProc(authorCodes);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
}
break;
case "insertRoleGrant": //등록 권한롤부여
//처리
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_rolegrant_popup";
try {
service.addAuthorRole(authorCode, roleCodes.split(";"), regYns.split(";"));
status.setComplete();
model.addAttribute("message", xitMessageSource.getMessage("success.common.insert"));
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.insert");
}
break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
/* ============================
* 2020.09.10
*
* - ajax json
* [AS-IS] String, return url "forward"
* [TO-BE] void, DispatchServlet forward , ajax json forward
============================ */
//2020.09.10 주석처리
// model.addAttribute("message", message);
// return sLocationUrl;
model.addAttribute("message", message);
if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시
//반환 데이터 설정
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
} }

@ -44,6 +44,7 @@ import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.AjaxUtils; import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.constants.MessageKey; import kr.xit.framework.support.util.constants.MessageKey;
import lombok.AllArgsConstructor;
/** /**
* *
@ -55,19 +56,12 @@ import kr.xit.framework.support.util.constants.MessageKey;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@AllArgsConstructor
@Controller @Controller
@RequestMapping("/framework/biz/mng/auth") @RequestMapping("/framework/biz/mng/auth")
public class AuthGrpMgtController { public class AuthGrpMgtController {
@Resource private final AuthGrpMgtService service;
private AuthGrpMgtService service;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
XitMessageSource xitMessageSource;
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -133,285 +127,4 @@ public class AuthGrpMgtController {
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav; return mav;
} }
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 31.
*/
@RequestMapping(value = "AuthGrpMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> AuthGrpMng_listAjax(@ModelAttribute("groupManageVO") XitAuthGrpMngSearchVO searchVO, ModelMap model) {
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt);
data.put("pagination", pagination); //[tui Grid] data-paging
resultMap.put("data", data); //[tui Grid] data
/* ***************************
* //tui Grid Response Set
*************************** */
} catch (Exception e) {
/**
*
*/
//tui Grid Response Set
resultMap.put("result", false); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthGrpMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String AuthGrpMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("groupManageVO") XitAuthGrpMngVO vo
, @ModelAttribute("groupManageSearchVO") XitAuthGrpMngSearchVO searchVO
, ModelMap model) {
/**
*
*/
//권한 목록 조회
XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO();
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(authorInfoVO);
model.addAttribute("listAuthorInfoVO", listAuthorInfoVO);
switch (cmd) {
case "input": //등록 페이지
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("groupManage", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthGrpMng_"+cmd+tilesDef;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthGrpMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String AuthGrpMng_page_popup(
@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("groupManageVO") XitAuthGrpMngVO vo
, @ModelAttribute("groupManageSearchVO") XitAuthGrpMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/grp/XitAuthGrpMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthGrpMng_{cmd}_proc", method=RequestMethod.POST)
public void AuthGrpMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("groupManageVO") XitAuthGrpMngVO vo
,@ModelAttribute("groupManageSearchVO") XitAuthGrpMngSearchVO searchVO
,@RequestParam(value="groupIds", required=false, defaultValue="") String groupIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
String sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_list.do";
String message = null;
switch (cmd) {
case "insert": //등록
//유효성 확인
beanValidator.validate(vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_input.do";
break;
}
//처리
try {
service.addProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
model.addAttribute("groupId", vo.getGroupId());
sLocationUrl = "redirect:/framework/biz/mng/auth/AuthGrpMng_edit.do";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_input.do";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_input.do";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
//유효성 확인
beanValidator.validate(vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_edit.do";
break;
}
//처리
try {
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_edit.do";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_edit.do";
}
break;
case "delete": //삭제
//처리
try {
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_edit.do";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthGrpMng_edit.do";
}
break;
case "deletes": //다건 삭제
//처리
try {
service.removesProc(groupIds);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
}
break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
/* ============================
* 2020.09.10
*
* - ajax json
* [AS-IS] String, return url "forward"
* [TO-BE] void, DispatchServlet forward , ajax json forward
============================ */
//2020.09.10 주석처리
// model.addAttribute("message", message);
// return sLocationUrl;
model.addAttribute("message", message);
if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시
//반환 데이터 설정
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
} }

@ -22,6 +22,7 @@ import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -32,7 +33,6 @@ import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.security.securedobject.EgovSecuredObjectService; import egovframework.rte.fdl.security.securedobject.EgovSecuredObjectService;
import egovframework.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager; import egovframework.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO; import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
@ -45,9 +45,13 @@ import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.core.utils.XitCmmnUtil; import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.core.validation.XitBeanValidator; import kr.xit.framework.core.validation.XitBeanValidator;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.mybatis.MybatisUtils; import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.AjaxUtils; import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.ValidationError;
import kr.xit.framework.support.util.constants.MessageKey;
/** /**
* *
@ -68,12 +72,6 @@ public class AuthHierarchyMgtController {
@Resource @Resource
private AuthAuthorMgtService authAuthorMgtService; private AuthAuthorMgtService authAuthorMgtService;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
XitMessageSource xitMessageSource;
@Resource @Resource
private EgovSecuredObjectService egovSecuredObjectService; private EgovSecuredObjectService egovSecuredObjectService;
@Resource(name="roleHierarchy") @Resource(name="roleHierarchy")
@ -93,20 +91,17 @@ public class AuthHierarchyMgtController {
public void mngAuthHierarchyMgtForm() { public void mngAuthHierarchyMgtForm() {
} }
@RequestMapping(value = "/mngAuthHierarchyMgtPopup") @RequestMapping(value = "/mngAuthHierarchyMgtPopup")
public ModelAndView mngAuthHierarchyMgtPopup(XitAuthHierarchyMngVO vo){ public ModelAndView mngAuthHierarchyMgtPopup(XitAuthHierarchyMngVO vo){
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
//최하위 권한의 권한계층 조회 //최하위 권한의 권한계층 조회
XitAuthHierarchyMngVO authHierarchyMngVO = service.findView(vo); XitAuthHierarchyMngVO authHierarchyMngVO = service.findAuthHierarchyInfo(vo);
//권한코드 Map 생성 //권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtService.findAuthAuthors(null); List<XitAuthorInfoVO> authorInfoVOList = authAuthorMgtService.findAuthAuthors(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>(); Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) { authorInfoVOList.forEach(infoVO -> mAuthorInfo.put(infoVO.getAuthorCode(), infoVO.getAuthorNm()));
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
}
//권한코드 목록에서 비중복 권한만 추출 //권한코드 목록에서 비중복 권한만 추출
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>(); Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
mNoDuplAuthorInfo.putAll(mAuthorInfo); mNoDuplAuthorInfo.putAll(mAuthorInfo);
@ -121,27 +116,18 @@ public class AuthHierarchyMgtController {
} }
} }
//권한계층 미설정 권한 목록 설정 //권한계층 미설정 권한 목록 설정
List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<XitAuthorInfoVO>(); List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<>();
Iterator<String> it = mNoDuplAuthorInfo.keySet().iterator(); for (String authorCode : mNoDuplAuthorInfo.keySet()) {
while(it.hasNext()) {
String authorCode = it.next();
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO(); XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
authorInfo.setAuthorCode(authorCode); authorInfo.setAuthorCode(authorCode);
authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode)); authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
listAuthorInfo.add(authorInfo); listAuthorInfo.add(authorInfo);
} }
mav.addObject("authorList", listAuthorInfo); mav.addObject("authorList", listAuthorInfo);
mav.addObject("mAuthorInfo", mAuthorInfo); mav.addObject("mAuthorInfo", mAuthorInfo);
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getAuthorCode())){
mav.addObject("authHierarchyManage", new XitAuthHierarchyMngVO());
mav.addObject("pageTitle", "권한 계층 설정");
} else {
mav.addObject("authHierarchyManage", authHierarchyMngVO); mav.addObject("authHierarchyManage", authHierarchyMngVO);
mav.addObject("pageTitle", "권한 계층 설정"); mav.addObject("pageTitle", "권한 계층 설정");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthHierarchyMgtPopup.popup"); mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthHierarchyMgtPopup.popup");
return mav; return mav;
} }
@ -151,321 +137,35 @@ public class AuthHierarchyMgtController {
return ResultResponse.of(service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap))); return ResultResponse.of(service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap)));
} }
@PostMapping(value = "/saveAuthHierarchy")
public ModelAndView saveAuthHierarchy(@ModelAttribute final XitAuthHierarchyMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("authHierarchyManage", vo, bindingResult);
service.saveAuthHierarchy(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
return mav;
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 30.
*/
@RequestMapping(value = "AuthHierarchyMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> AuthHierarchyMng_listAjax(@ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO, ModelMap model) {
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt);
data.put("pagination", pagination); //[tui Grid] data-paging
resultMap.put("data", data); //[tui Grid] data
/* ***************************
* //tui Grid Response Set
*************************** */
} catch (Exception e) {
/**
*
*/
//tui Grid Response Set
resultMap.put("result", false); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 11. 2.
*/
@RequestMapping(value = "AuthHierarchyMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String AuthHierarchyMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
//, @ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO
, @ModelAttribute("vo") XitAuthHierarchyMngVO vo
, ModelMap model) {
switch (cmd) {
// case "input": //등록 페이지
// break;
case "edit": //수정 페이지
// case "view": //상세 페이지
//최하위 권한의 권한계층 조회
XitAuthHierarchyMngVO result = service.findView(vo);
//권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO());
Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
}
//권한코드 목록에서 비중복 권한만 추출
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
mNoDuplAuthorInfo.putAll(mAuthorInfo);
String[] arrAuthorRescue = result.getAuthorRescueCode().split(">");
for(int i=0; i<arrAuthorRescue.length; i++) {
String[] arrAuthorCode = arrAuthorRescue[i].split(",");
for(int j=0; j<arrAuthorCode.length; j++) {
String authorCode = arrAuthorCode[j].trim();
if(mNoDuplAuthorInfo.containsKey(authorCode)) {
mNoDuplAuthorInfo.remove(authorCode);
}
}
}
//권한계층 미설정 권한 목록 설정
List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<XitAuthorInfoVO>();
Iterator<String> it = mNoDuplAuthorInfo.keySet().iterator();
while(it.hasNext()) {
String authorCode = it.next();
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
authorInfo.setAuthorCode(authorCode);
authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
listAuthorInfo.add(authorInfo);
}
model.addAttribute("authorList", listAuthorInfo);
model.addAttribute("mAuthorInfo", mAuthorInfo);
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
model.addAttribute("vo", result);
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthHierarchyMng_"+cmd+tilesDef;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 11. 2.
*/
@RequestMapping(value = "AuthHierarchyMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String AuthHierarchyMng_page_popup(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO
, @ModelAttribute("vo") XitAuthHierarchyMngVO vo
, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthHierarchyMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
}
/**
* <pre>
* : CUD
* </pre>
*
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 11. 2.
*/
@RequestMapping(value = "AuthHierarchyMng_{cmd}_proc", method=RequestMethod.POST)
public void AuthHierarchyMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("vo") XitAuthHierarchyMngVO vo
,@RequestParam(value="authorCodes", required=false, defaultValue="") String authorCodes
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
String sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_list.do";
String message = null;
switch (cmd) {
// case "insert": //등록
// break;
// case "inserts": //다건 등록
// break;
case "update": //수정
//유효성 확인
beanValidator.validate(vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
break;
}
//처리
try {
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
} }
break;
case "delete": //삭제 @PostMapping(value = "/reloadAuthHierarchy")
//처리 public ModelAndView reloadAuthHierarchy(){
try { ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
}
break;
case "reload": //롤계층정보 재적용
//처리
/** /**
* reload * reload
* - . * - .
*/ */
String hierachicaRoles = null; String hierachicaRoles = null;
try { try {
hierachicaRoles = egovSecuredObjectService.getHierarchicalRoles(); hierachicaRoles = egovSecuredObjectService.getHierarchicalRoles();
} catch (Exception e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
roleHierarchyImpl.setHierarchy(hierachicaRoles); roleHierarchyImpl.setHierarchy(hierachicaRoles);
RoleHierarchy roleHierarchy = roleHierarchyImpl; RoleHierarchy roleHierarchy = roleHierarchyImpl;
egovJdbcUserDetailsManager.setRoleHierarchy(roleHierarchy); egovJdbcUserDetailsManager.setRoleHierarchy(roleHierarchy);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
// List<XitUserInfoVO> listUserInfo = xitFrameCrudService.findXitUserInfos(new XitUserInfoVO()); return mav;
// for(XitUserInfoVO userInfo : listUserInfo) {
// egovJdbcUserDetailsManager.loadUserByUsername(userInfo.getUser_id());
// }
message = xitMessageSource.getMessage("success.request.msg");
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.request.msg");
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
}
break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
/* ============================
* 2020.09.10
*
* - ajax json
* [AS-IS] String, return url "forward"
* [TO-BE] void, DispatchServlet forward , ajax json forward
============================ */
//2020.09.10 주석처리
// model.addAttribute("message", message);
// return sLocationUrl;
model.addAttribute("message", message);
if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시
//반환 데이터 설정
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
} }
} }

@ -44,6 +44,7 @@ import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.AjaxMessageMapRenderer; import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.AjaxUtils; import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.util.constants.MessageKey; import kr.xit.framework.support.util.constants.MessageKey;
import lombok.AllArgsConstructor;
/** /**
* *
@ -55,18 +56,12 @@ import kr.xit.framework.support.util.constants.MessageKey;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@AllArgsConstructor
@Controller @Controller
@RequestMapping("/framework/biz/mng/auth") @RequestMapping("/framework/biz/mng/auth")
public class AuthUserMgtController { public class AuthUserMgtController {
@Resource private final AuthUserMgtService service;
private AuthUserMgtService service;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
XitMessageSource xitMessageSource;
/** /**
@ -104,275 +99,4 @@ public class AuthUserMgtController {
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav; return mav;
} }
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 8.04.
*/
@RequestMapping(value = "AuthUsrMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> AuthUsrMng_listAjax(@ModelAttribute("authorGroupVO") XitAuthUsrMngSearchVO searchVO, ModelMap model) {
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt);
data.put("pagination", pagination); //[tui Grid] data-paging
resultMap.put("data", data); //[tui Grid] data
/* ***************************
* //tui Grid Response Set
*************************** */
} catch (Exception e) {
/**
*
*/
//tui Grid Response Set
resultMap.put("result", false); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthUsrMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String AuthUsrMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("authorGroupVO") XitAuthUsrMngVO vo
, @ModelAttribute("authorGroupSearchVO") XitAuthUsrMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "":
break;
// case "input": //등록 페이지
// case "edit": //수정 페이지
// case "view": //상세 페이지
// break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthUsrMng_"+cmd+tilesDef;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthUsrMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String AuthUsrMng_page_popup(@PathVariable String cmd
, @ModelAttribute XitAuthUsrMngSearchVO searchVO
, @ModelAttribute XitAuthUsrMngVO vo, ModelMap model) {
switch (cmd) {
case "groupsearch": //그룹조회 팝업
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
int totCnt = 0;
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
list = service.findListGroup(searchVO);
totCnt = service.findListGroupTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("groupList", list);
model.addAttribute("paginationInfo", paginationInfo);
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthUsrMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthUsrMng_{cmd}_proc", method=RequestMethod.POST)
public void AuthUsrMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("authorGroupVO") XitAuthUsrMngVO vo
,@ModelAttribute("authorGroupSearchVO") XitAuthUsrMngSearchVO searchVO
,@RequestParam(value="userIds", required=false, defaultValue="") String userIds
,@RequestParam(value="authorCodes", required=false, defaultValue="") String authorCodes
,@RequestParam(value="regYns", required=false, defaultValue="") String regYns
,@RequestParam(value="mberTyCodes", required=false, defaultValue="") String mberTyCodes
,@RequestParam(value="groupIds", required=false, defaultValue="") String groupIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
String sLocationUrl = "forward:/framework/biz/mng/auth/AuthUsrMng_list";
String message = null;
switch (cmd) {
case "insert": //등록
//유효성 확인
beanValidator.validate(vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.insert");
// sLocationUrl = "forward:/framework/biz/mng/auth/AuthUsrMng_input";
break;
}
//처리
try {
String [] strUserIds = userIds.split(";");
String [] strAuthorCodes = authorCodes.split(";");
String [] strRegYns = regYns.split(";");
String [] strMberTyCode = mberTyCodes.split(";");
for(int i=0; i<strUserIds.length;i++) {
vo.setUniqId(strUserIds[i]);
vo.setAuthorCode(strAuthorCodes[i]);
vo.setMberTyCode(strMberTyCode[i]);
if("N".equals(strRegYns[i]))
service.addProc(vo);
else
service.modifyProc(vo);
}
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) {
message = e.getMessage();
// sLocationUrl = "forward:/framework/biz/mng/auth/AuthUsrMng_input";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.insert");
// sLocationUrl = "forward:/framework/biz/mng/auth/AuthUsrMng_input";
}
break;
// case "inserts": //다건 등록
// break;
// case "update": //수정
// break;
// case "delete": //삭제
// break;
case "deletes": //다건 삭제
//처리
try {
service.removesProc(userIds, groupIds);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
}
break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
/* ============================
* 2020.09.10
*
* - ajax json
* [AS-IS] String, return url "forward"
* [TO-BE] void, DispatchServlet forward , ajax json forward
============================ */
//2020.09.10 주석처리
// model.addAttribute("message", message);
// return sLocationUrl;
model.addAttribute("message", message);
if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시
//반환 데이터 설정
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
} }

@ -50,7 +50,6 @@ import kr.xit.framework.biz.mng.auth.service.XitLoginPolicyMngService;
public class XitLoginPolicyMngController { public class XitLoginPolicyMngController {
private final XitLoginPolicyMngService xitLoginPolicyMngService; private final XitLoginPolicyMngService xitLoginPolicyMngService;
private final XitFrameCodeService xitFrameCodeService;
private final XitBeanValidator beanValidator; private final XitBeanValidator beanValidator;
private final XitMessageSource xitMessageSource; private final XitMessageSource xitMessageSource;

@ -5,7 +5,7 @@
<!-- ************************************************************************************************************* <!-- *************************************************************************************************************
* xit_author_info : 권한 정보 * xit_author_info : 권한 정보
************************************************************************************************************** --> ************************************************************************************************************** -->
<select id="selectAuthorInfos" parameterType="map" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO"> <select id="selectAuthorInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */ /* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
SELECT author_code SELECT author_code
, author_nm , author_nm
@ -52,7 +52,7 @@
</insert> </insert>
<update id="updateAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO"> <update id="updateAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */ /* auth-author-mysql-mapper|updateAuthorInfos-권한 정보 변경|julim */
UPDATE xit_author_info UPDATE xit_author_info
SET author_nm = IF(author_nm = #{authorNm}, author_nm, #{authorNm}) SET author_nm = IF(author_nm = #{authorNm}, author_nm, #{authorNm})
, author_dc = IF(author_dc = #{authorDc}, author_dc, #{authorDc}) , author_dc = IF(author_dc = #{authorDc}, author_dc, #{authorDc})
@ -60,7 +60,7 @@
</update> </update>
<delete id="deleteAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO"> <delete id="deleteAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */ /* auth-author-mysql-mapper|deleteAuthorInfos-권한 정보 삭제|julim */
DELETE DELETE
FROM xit_author_info FROM xit_author_info
WHERE author_code = #{authorCode} WHERE author_code = #{authorCode}
@ -162,70 +162,4 @@
</if> </if>
</where> </where>
</delete> </delete>
<select id="findListAuthorRole" resultType="java.util.Map">
/** XitAuthRegMngMapper.findListAuthorRole */
/** 권한롤관리 목록 조회 */
<include refid="findListAuthorRole_SELECT"/>
<include refid="findListAuthorRole_FROM"/>
WHERE 1 = 1
<include refid="findListAuthorRole_WHERE"/>
ORDER BY A.ROLE_CODE
</select>
<select id="findListAuthorRoleTotCnt" resultType="int">
/** XitAuthRegMngMapper.findListAuthorRoleTotCnt */
/** 권한롤관리 목록 조회 총 건수 */
SELECT COUNT(1) AS "CNT"
<include refid="findListAuthorRole_FROM"/>
WHERE 1 = 1
<include refid="findListAuthorRole_WHERE"/>
</select>
<sql id="findListAuthorRole_SELECT">
SELECT A.ROLE_CODE AS "roleCode"
,A.ROLE_NM AS "roleNm"
,A.ROLE_PTTRN AS "rolePtn"
,A.ROLE_DC AS "roleDc"
,A.ROLE_TY AS "roleTyp"
,A.ROLE_SORT AS "roleSort"
,B.AUTHOR_CODE AS "authorCode"
,B.CREAT_DT AS "creatDt"
,(CASE WHEN B.ROLE_CODE IS NULL THEN 'N' ELSE 'Y' END) AS "regYn"
</sql>
<sql id="findListAuthorRole_FROM">
FROM XIT_ROLE_INFO A
LEFT OUTER JOIN ( SELECT AUTHOR_CODE, ROLE_CODE, CREAT_DT
FROM XIT_AUTHOR_ROLE_RELATE
WHERE AUTHOR_CODE = #{searchKeyword}
) B ON A.ROLE_CODE = B.ROLE_CODE
</sql>
<sql id="findListAuthorRole_WHERE">
</sql>
</mapper> </mapper>

@ -67,92 +67,4 @@
WHERE group_id = #{groupId} WHERE group_id = #{groupId}
</delete> </delete>
<!-- SQL 페이징 코드 -->
<sql id="pageBefore">
SELECT LIST.* FROM(
</sql>
<sql id="pageAfter">
) LIST LIMIT #{firstIndex}, #{recordCountPerPage}
</sql>
<sql id="findList_SELECT">
SELECT A.GROUP_ID AS "groupId"
,A.GROUP_NM AS "groupNm"
,A.GROUP_DC AS "groupDc"
,A.GROUP_CREAT_DE AS "groupCreatDe"
,A.AUTHOR_CODE AS "authorCode"
,(SELECT SA.AUTHOR_NM FROM XIT_AUTHOR_INFO SA WHERE SA.AUTHOR_CODE=A.AUTHOR_CODE) AS "authorNm"
</sql>
<sql id="findList_FROM">
FROM XIT_AUTHOR_GROUP_INFO A
</sql>
<sql id="findList_WHERE">
<if test="'1'.toString() == searchCondition">
AND A.GROUP_NM LIKE CONCAT('%',#{searchKeyword},'%')
</if>
</sql>
<select id="findList" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO">
/** XitAuthGrpMngMapper.findList */
/** 사용자그룹관리 목록 조회 */
<if test="searchGubun == 'list'">
<include refid="pageBefore" />
</if>
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
ORDER BY A.GROUP_CREAT_DE DESC
<if test="searchGubun == 'list'">
<include refid="pageAfter" />
</if>
</select>
<select id="findListTotCnt" resultType="int">
/** XitAuthGrpMngMapper.findListTotCnt */
/** 사용자그룹관리 목록 총건수 조회 */
SELECT COUNT(1) AS "CNT"
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
</select>
<select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO">
/** XitAuthGrpMngMapper.findView */
/** 사용자그룹관리 상세정보 조회 */
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE A.GROUP_ID = #{groupId}
</select>
</mapper> </mapper>

@ -12,79 +12,8 @@
, author_creat_de , author_creat_de
FROM xit_author_info FROM xit_author_info
<where> <where>
AND author_nm LIKE CONCAT('%',#{searchKeyword},'%') AND INSTR(author_nm, #{searchKeyword}) > 0
</where> </where>
</select> </select>
<!-- SQL 페이징 코드 -->
<sql id="pageBefore">
SELECT LIST.* FROM(
</sql>
<sql id="pageAfter">
) LIST LIMIT #{firstIndex}, #{recordCountPerPage}
</sql>
<sql id="findList_SELECT">
SELECT A.AUTHOR_CODE AS "authorCode"
,A.AUTHOR_NM AS "authorNm"
,A.AUTHOR_DC AS "authorDc"
,A.AUTHOR_CREAT_DE AS "authorCreatDe"
</sql>
<sql id="findList_FROM">
FROM XIT_AUTHOR_INFO A
</sql>
<sql id="findList_WHERE">
<if test="'1'.toString() == searchCondition">
AND A.AUTHOR_NM LIKE CONCAT('%',#{searchKeyword},'%')
</if>
</sql>
<select id="findList" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO">
/** XitAuthHierarchyMngMapper.findList */
/** 권한계층관리 목록 조회 */
<if test="searchGubun == 'list'">
<include refid="pageBefore" />
</if>
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
ORDER BY A.AUTHOR_CREAT_DE DESC
<if test="searchGubun == 'list'">
<include refid="pageAfter" />
</if>
</select>
<select id="findListTotCnt" resultType="int">
/** XitAuthHierarchyMngMapper.findListTotCnt */
/** 권한계층관리 목록 총건수 조회 */
SELECT COUNT(1) AS "CNT"
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
</select>
<select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO">
/** XitAuthHierarchyMngMapper.findView */
/** 권한계층관리 상세정보 조회 */
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE A.AUTHOR_CODE=#{authorCode}
</select>
</mapper> </mapper>

@ -28,13 +28,11 @@
</div> </div>
</form> <!-- //검색 --> </form> <!-- //검색 -->
<%--
<div class="page_btn"> <div class="page_btn">
<span class="flr"> <span class="flr">
<a href="#" class="btn darkgray" id="btnPopup" title="권한계층설정">권한계층설정</a> <a href="#" class="btn darkgray" id="btnPopup" title="권한계층설정">권한계층설정</a>
</span> </span>
</div> </div>
--%>
<!-- //버튼 및 페이지정보 --> <!-- //버튼 및 페이지정보 -->
@ -46,6 +44,9 @@
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
var callbackSearch = () => {
if(GRID) fnBiz.search();
}
let GRID = null; let GRID = null;
/* ******************************* /* *******************************
@ -81,10 +82,10 @@
}) })
} }
} }
,onClickGrid: function(props){ // ,onClickGrid: function(props){
const rowData = props.grid.getRow(props.rowKey); // const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('add', rowData); // fnBiz.pagePopup('add', rowData);
} // }
,pagePopup: function(flag, params){ ,pagePopup: function(flag, params){
let url = '<c:url value="/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.do"/>'; let url = '<c:url value="/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.do"/>';
let popTitle; let popTitle;
@ -106,9 +107,9 @@
$(() => { $(() => {
$('#btnSearch').on('click', () => fnBiz.search()); $('#btnSearch').on('click', () => fnBiz.search());
// $('#btnPopup').on('click', () => { $('#btnPopup').on('click', () => {
// fnBiz.pagePopup('add', {}); fnBiz.pagePopup('add', {});
// }); });
}); });
@ -123,7 +124,8 @@
width: 200, width: 200,
sortable: true, sortable: true,
sortingType: 'desc', sortingType: 'desc',
align: 'left', align: 'left'
/*
renderer: { renderer: {
type: CustomButtonRenderer, type: CustomButtonRenderer,
options: { options: {
@ -138,6 +140,7 @@
,eventType : "click" ,eventType : "click"
} }
} }
*/
}, },
{ {
header: '권한 명', header: '권한 명',
@ -172,7 +175,6 @@
}; };
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => { GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
console.log('~~~~~~~~~~')
}); });
} }
@ -180,7 +182,6 @@
* initialize * initialize
**************************************************************************/ **************************************************************************/
$(document).ready(function(){ $(document).ready(function(){
console.log('~~~~~~~~~~~>>>>>>>>>')
initGrid(); initGrid();
}); });
</script> </script>

@ -2,12 +2,52 @@
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> <%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<style type="text/css">
ul li {
color: #0f438a;
margin: 2px 0 0 5px;
}
div.popup, div.popup_inner{
width: 930px;
min-width: 930px;
}
table li {
margin-top: 10px;
}
table li:not(.separator) span{
border: solid #dddddd 1px;
border-radius: 8px;
padding: 3px;
margin: 10px 2px 10px 0px;
}
#authorRescue {
white-space: normal;
word-break: break-word;
}
#authorRescue li, #authorList li {
/* 가로 정렬 */
margin: 10px 0 10px 0;
padding: 0 0 0 0;
border : 0;
float: left;
}
table span {
/* border: solid 1px gray; */
padding: 2px;
cursor: pointer;
}
table.tbl03 th {
font-weight: bold;
font-size: 100%;
}
</style>
<!-- 검색 필드 박스 시작 --> <!-- 검색 필드 박스 시작 -->
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="authHierarchyManage" staticJavascript="false" xhtml="true" cdata="false"/> <validator:javascript formName="authHierarchyManage" staticJavascript="false" xhtml="true" cdata="false"/>
<form:form commandName="authHierarchyManage" name="authHierarchyManage" method="post" > <%--@elvariable id="authHierarchyManage" type=""--%>
<form:form commandName="authHierarchyManage" name="authHierarchyManage">
<div class="popup"> <div class="popup">
<div class="popup_inner"> <div class="popup_inner">
@ -89,15 +129,14 @@
</div> </div>
<div class="popup_btn">
<span class="flr"> <span class="flr">
<a href="#" class="btn blue" id="btnRegist">저장</a> <a href="#" class="btn blue" id="btnRegist">저장</a>
<a href="#" class="btn gray" id="init_btn">원래대로</a> <a href="#" class="btn gray" id="btnInit">원래대로</a>
<a href="#" class="btn red" id="reload_btn">설정정보 적용</a> <a href="#" class="btn red" id="btnReload">설정정보적용</a>
<a href="#" class="btn lightgray" id="btnClose">닫기</a> <a href="#" class="btn lightgray" id="btnClose">닫기</a>
</span> </span>
<!-- //등록버튼 --> </div> <!-- //등록버튼 -->
</div> </div>
</div> </div>
@ -105,171 +144,81 @@
</form:form> </form:form>
<style type="text/css">
ul li {
color: #0f438a;
margin: 2px 0 0 5px;
}
div.popup, div.popup_inner{
width: 930px;
min-width: 930px;
}
table li {
margin-top: 10px;
}
table li:not(.separator) span{
border: solid #dddddd 1px;
border-radius: 8px;
padding: 3px;
margin: 10px 2px 10px 0px;
}
#authorRescue {
white-space: normal;
word-break: break-word;
}
#authorRescue li, #authorList li {
/* 가로 정렬 */
margin: 10px 0 10px 0;
padding: 0 0 0 0;
border : 0;
float: left;
}
table span {
/* border: solid 1px gray; */
padding: 2px;
cursor: pointer;
}
table.tbl03 th {
font-weight: bold;
font-size: 100%;
}
</style>
<script type="text/javaScript"> <script type="text/javaScript">
$(document).ready(function(){ /**************************************************************************
XitAuthHierarchyMng_edit.init(); * Global Variable
}); **************************************************************************/
/* ******************************* let initArrAuthorCode;
* 권한계층관리 수정화면 Functions
/* *******************************
* Biz function
******************************* */ ******************************* */
var XitAuthHierarchyMng_edit = { const fnBiz = {
init : function(){ save: () => {
//닫기 버튼 Event // if(!fnBiz.validate()) return;
$("#btnClose").click(function() { //if(!validateAuthHierarchyManage(document.authHierarchyManage)) return;
window.close(); console.log($(document.authHierarchyManage).serialize());
}); console.log($(document.authHierarchyManage));
//저장 버튼 Event 설정
$('#btnSave').on({ let data = $(document.authHierarchyManage).serialize();
click: function(){ if(initArrAuthorCode === data){
XitAuthHierarchyMng_edit.modifyData(); alert('변경된 내역이 없습니다.');
} return false;
});
$('#init_btn').on({
click: function(){
document.authHierarchyManage.action = '<c:url value="/framework/biz/mng/auth/AuthHierarchyMng_edit.do"/>';
document.authHierarchyManage.submit();
}
});
$('#reload_btn').on({
click: function(){
XitAuthHierarchyMng_edit.modifyData('reload');
} }
}); data = $(document.authHierarchyManage).serialize();
//부모&자녀 param Set
XitAuthHierarchyMng_edit.setParam();
//sortable 적용
$('.connectWith').sortable({
connectWith: '.connectWith'
,stop : function(){
//구분자 생성
$('#authorList li.separator').remove();
$('#authorList').prepend('<li class="separator"><span style="font-weight: bold">&nbsp;>&nbsp;</span></li>');
//param 설정 if(data.indexOf('%2C') > 0){
XitAuthHierarchyMng_edit.setParam(); data = decodeURIComponent(data);
} data = data.split(',').join('&authorCode=')
});
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
} }
/* ========================
* 데이터 수정
======================== */
,modifyData : function(flag){
var varFrom = document.authHierarchyManage;
if(flag=='reload'){
var msg = [];
msg.push('설정하신 정보를 적용 하시겠습니까?');
msg.push('적용된 설정은 사이트를 재접속 하셔야 동작 합니다.');
msg.push('※"설정정보 적용"을 하지 않을 시 저장하신 정보는 서버가 재기동 되기전까진 반영되지 않습니다.');
if(confirm(msg.join('\n'))){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthHierarchyMng_reload_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
},
error: function(){
if(confirm("저장 하시겠습니까?")) {
cmmAjax({
url: '<c:url value="/framework/biz/mng/auth/saveAuthHierarchy.do"/>'
, data: $(document.authHierarchyManage).serialize()
,success: () => {
//$('#btnReload').css('display', 'inline-block');
}
})
} }
});
} }
}else{
if(confirm("저장 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthHierarchyMng_update_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthHierarchyMng_list.findData();
// window.close();
},
error: function(){
,init: () => {
window.location = '<c:url value="/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.do"/>'
} }
, reload: () => {
const msg = [];
msg.push('설정하신 정보를 적용 하시겠습니까?');
msg.push('적용된 설정은 사이트를 재접속 하셔야 동작 합니다.');
msg.push('※"설정정보 적용"을 하지 않을 시 저장하신 정보는 서버가 재기동 되기전까진 반영되지 않습니다.');
if(confirm(msg.join('\n'))) {
cmmAjax({
url: '<c:url value="/framework/biz/mng/auth/reloadAuthHierarchy.do"/>'
}); });
} }
} }
}
/* ======================== ,setParam : function(){
* 데이터 삭제 let i = 0;
======================== */ const totCnt = $('#authorRescue li').length;
,removeData : function(){ let sb = [];
}, const arrAuthorCode = [];
/* ========================
* 파라미터 설정
======================== */
setParam : function(){
var i = 0;
var totCnt = $('#authorRescue li').length;
var sb = [];
var arrAuthorCode = [];
$('#authorRescue li').each(function(){ $('#authorRescue li').each(function(){
if($(this).hasClass('separator')){ //구분자 일때 if($(this).hasClass('separator')){ //구분자 일때
//배열에 담기 //배열에 담기
if(sb.length>0) if(sb.length>0)
arrAuthorCode.push(sb.join(';')); arrAuthorCode.push(sb);
//StringBuffer 초기화 //StringBuffer 초기화
sb = []; sb = [];
console.log(arrAuthorCode)
}else{ //구분자가 아닐때 }else{ //구분자가 아닐때
//StringBuffer에 담기 const authorCode = $(this).find('#authorCode').val();
console.log(arrAuthorCode, arrAuthorCode.length)
sb.push($(this).find('#authorCode').val()); sb.push($(this).find('#authorCode').val());
} }
@ -277,20 +226,17 @@ $(document).ready(function(){
if(i == totCnt-1){ if(i == totCnt-1){
//배열에 담기 //배열에 담기
if(sb.length>0) if(sb.length>0)
arrAuthorCode.push(sb.join(';')); arrAuthorCode.push(sb);
} }
i++; i++;
}); });
//if(arrAuthorCode.)
const frm = document.authHierarchyManage;
var frm = document.authHierarchyManage;
//Elements 삭제 //Elements 삭제
$(frm).find('input[name="authorCode"]').remove(); $(frm).find('input[name="authorCode"]').remove();
//Elements 생성 //Elements 생성
for(var i=0; i<arrAuthorCode.length; i++){ for(let i = 0; i<arrAuthorCode.length; i++){
var param = document.createElement('input'); const param = document.createElement('input');
param.setAttribute('type', 'hidden'); param.setAttribute('type', 'hidden');
param.setAttribute('name', 'authorCode'); param.setAttribute('name', 'authorCode');
param.setAttribute('value', arrAuthorCode[i]); param.setAttribute('value', arrAuthorCode[i]);
@ -298,5 +244,57 @@ $(document).ready(function(){
} }
} }
} ,validate: () => {
if($('#groupId').val() === ''){
alert('[권한그룹 ID]는 필수 입니다.');
$('#authorCode').focus();
return false;
}
if($('#groupNm').val() === ''){
alert('[권한그룹 명]은 필수 입니다.');
$('#authorNm').focus();
return false;
}
return true;
}
};
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnClose').on('click', () => {
window.opener.callbackSearch();
window.close();
});
$('#btnRegist').on('click', () => fnBiz.save());
$('#btnInit').on('click', () => fnBiz.init());
$('#btnReload').on('click', () => fnBiz.reload());
//sortable 적용
$('.connectWith').sortable({
connectWith: '.connectWith'
,stop : function(){
//구분자 생성
$('#authorList li.separator').remove();
$('#authorList').prepend('<li class="separator"><span style="font-weight: bold">&nbsp;>&nbsp;</span></li>');
//param 설정
fnBiz.setParam();
}
});
});
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
fnBiz.setParam();
initArrAuthorCode = $(document.authHierarchyManage).serialize();
//$('#btnReload').css('display', 'none');
});
</script> </script>

@ -60,6 +60,11 @@
======================== */ ======================== */
add : function(){ add : function(){
const arrDatas = fnBiz.getCheckedList(); const arrDatas = fnBiz.getCheckedList();
if(arrDatas.length === 0) {
alert("목록을 선택해 주세요.");
return false;
}
if(confirm("권한을 등록 하시겠습니까?")) { if(confirm("권한을 등록 하시겠습니까?")) {
cmmAjax({ cmmAjax({
@ -78,6 +83,10 @@
,remove : function(){ ,remove : function(){
const arrDatas = fnBiz.getCheckedList(); const arrDatas = fnBiz.getCheckedList();
if(arrDatas.length === 0) {
alert("목록을 선택해 주세요.");
return false;
}
if(confirm("권한을 취소 하시겠습니까?")) { if(confirm("권한을 취소 하시겠습니까?")) {
cmmAjax({ cmmAjax({
@ -94,11 +103,6 @@
,getCheckedList: ()=>{ ,getCheckedList: ()=>{
const arrChecks = GRID.getCheckedRows(); const arrChecks = GRID.getCheckedRows();
if(arrChecks.length === 0) {
alert("목록을 선택해 주세요.");
return false;
}
return arrChecks.map((row) => { return arrChecks.map((row) => {
return { return {
uniqId: row.uniqId uniqId: row.uniqId

Loading…
Cancel
Save