Merge branch 'main' into feat_samplePage

main
Kurt92 2 years ago
commit 2f8f820357

@ -96,3 +96,57 @@ access token : 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
3) MyBatisX 3) MyBatisX
mapper에서 xml을 편하게 이동 mapper에서 xml을 편하게 이동
``` ```
### 팝업 공통처리 : 등록 / 변경 / 삭제 팝업
```html
1) 변수 정의
<c:set var="isUpdate" value="${!empty 조건값}"/>
<c:set var="bizName" value="권한"/>
2) title include
<div class="popup_inner">
<p class="pop_title">권한 </p>
<div class="popup_inner">
<!-- popup title -->
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<div class="popup_btn">
<span class="flr" colspan="4">
<a href="#" class="btn blue" id="btnRegist">등록</a>
<a href="#" class="btn blue" id="btnModify">변경</a>
<a href="#" class="btn red" id="btnRemove">삭제</a>
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
</span>
</div>
<!--팝업 버튼 -->
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
```
#### columns style
```js
{
header: '롤 명',
name: 'roleNm',
width: 150,
sortingType: 'desc',
sortable: true,
filter: 'select',
renderer: {
styles: {
//fontWeight: 'bold',
background: (props) => props.value === 'Y' ? 'cyan' : 'red'
},
attributes: {
'data-type': 'default',
title: (props) => `title: ${props.formattedValue}`
},
classNames: ['blue']
}
}
```

@ -1,6 +1,12 @@
package kr.xit.framework.biz.cmm.model; package kr.xit.framework.biz.cmm.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,50 +18,19 @@ 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 XitAuthorGroupInfoVO extends BaseVO { public class XitAuthorGroupInfoVO extends BaseVO {
/**
* serialVersionUID
*/
private static final long serialVersionUID = -4390096179096398215L; private static final long serialVersionUID = -4390096179096398215L;
private String groupId; //그룹 id
protected String group_id; //그룹 id private String groupNm; //그룹 명
protected String group_nm; //그룹 명 private String groupDc; //그룹 설명
protected String group_creat_de; //그룹 생성 일 private String authorCode; //권한 코드
protected String group_dc; //그룹 설명 private String authorNm;
protected String author_code; //권한 코드 private String groupCreatDe; //그룹 생성 일
public String getGroup_id() {
return group_id;
}
public void setGroup_id(String group_id) {
this.group_id = group_id;
}
public String getGroup_nm() {
return group_nm;
}
public void setGroup_nm(String group_nm) {
this.group_nm = group_nm;
}
public String getGroup_creat_de() {
return group_creat_de;
}
public void setGroup_creat_de(String group_creat_de) {
this.group_creat_de = group_creat_de;
}
public String getGroup_dc() {
return group_dc;
}
public void setGroup_dc(String group_dc) {
this.group_dc = group_dc;
}
public String getAuthor_code() {
return author_code;
}
public void setAuthor_code(String author_code) {
this.author_code = author_code;
}
} }

@ -1,6 +1,12 @@
package kr.xit.framework.biz.cmm.model; package kr.xit.framework.biz.cmm.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 XitAuthorInfoVO extends BaseVO { public class XitAuthorInfoVO extends BaseVO {
/** /**
@ -19,35 +31,8 @@ public class XitAuthorInfoVO extends BaseVO {
*/ */
private static final long serialVersionUID = 4982342550430087973L; private static final long serialVersionUID = 4982342550430087973L;
protected String author_code; //권한 코드 protected String authorCode; //권한 코드
protected String author_nm; //권한 명 protected String authorNm; //권한 명
protected String author_dc; //권한 설명 protected String authorDc; //권한 설명
protected String author_creat_de; //권한 생성 일 protected String authorCreatDe; //권한 생성 일
public String getAuthor_code() {
return author_code;
}
public void setAuthor_code(String author_code) {
this.author_code = author_code;
}
public String getAuthor_nm() {
return author_nm;
}
public void setAuthor_nm(String author_nm) {
this.author_nm = author_nm;
}
public String getAuthor_dc() {
return author_dc;
}
public void setAuthor_dc(String author_dc) {
this.author_dc = author_dc;
}
public String getAuthor_creat_de() {
return author_creat_de;
}
public void setAuthor_creat_de(String author_creat_de) {
this.author_creat_de = author_creat_de;
}
} }

@ -30,12 +30,14 @@ public class XitRoleInfoVO extends BaseVO {
*/ */
private static final long serialVersionUID = -2397747474398186436L; private static final long serialVersionUID = -2397747474398186436L;
protected String roleCode; //역할 코드 private String roleCode; //역할 코드
protected String roleNm; //역할 명 private String roleNm; //역할 명
protected String rolePttrn; //역할 패턴 private String rolePttrn; //역할 패턴
protected String roleDc; //역할 설명 private String roleDc; //역할 설명
protected String roleTy; //역할 유형 private String roleTy; //역할 유형
protected String roleSort; //역할 정렬 private String roleSort; //역할 정렬
protected String roleCreatDe; //역할 생성 일 private String roleCreatDe; //역할 생성 일
private String regYn; // 권한 롤 등록여부 : xit_author_role_relate
private String creatDt; // 권한롤 등록일
} }

@ -1,6 +1,12 @@
package kr.xit.framework.biz.cmm.model; package kr.xit.framework.biz.cmm.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 XitRoleSclsrtRescueVO extends BaseVO { public class XitRoleSclsrtRescueVO extends BaseVO {
/** /**
* serialVersionUID * serialVersionUID
@ -19,20 +31,6 @@ public class XitRoleSclsrtRescueVO extends BaseVO {
private static final long serialVersionUID = 8476668045494460949L; private static final long serialVersionUID = 8476668045494460949L;
protected String parnts_role; //부모 역할 protected String parntsRole; //부모 역할
protected String chldrn_role; //자식 역할 protected String chldrnRole; //자식 역할
public String getParnts_role() {
return parnts_role;
}
public void setParnts_role(String parnts_role) {
this.parnts_role = parnts_role;
}
public String getChldrn_role() {
return chldrn_role;
}
public void setChldrn_role(String chldrn_role) {
this.chldrn_role = chldrn_role;
}
} }

@ -97,7 +97,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getGroup_id())) if(XitCmmnUtil.isEmpty(vo.getGroupId()))
emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table); emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -128,7 +128,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getGroup_id())) if(XitCmmnUtil.isEmpty(vo.getGroupId()))
emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table); emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -161,7 +161,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getGroup_id())) if(XitCmmnUtil.isEmpty(vo.getGroupId()))
emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table); emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -194,7 +194,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getGroup_id())) if(XitCmmnUtil.isEmpty(vo.getGroupId()))
emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table); emsg = String.format("(%s)그룹ID(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -258,7 +258,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getAuthor_code())) if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table); emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -289,7 +289,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getAuthor_code())) if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table); emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -322,7 +322,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getAuthor_code())) if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table); emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -355,7 +355,7 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getAuthor_code())) if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table); emsg = String.format("(%s)권한코드(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -3733,9 +3733,9 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getParnts_role())) if(XitCmmnUtil.isEmpty(vo.getParntsRole()))
emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table);
if(XitCmmnUtil.isEmpty(vo.getChldrn_role())) if(XitCmmnUtil.isEmpty(vo.getChldrnRole()))
emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -3766,9 +3766,9 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getParnts_role())) if(XitCmmnUtil.isEmpty(vo.getParntsRole()))
emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table);
if(XitCmmnUtil.isEmpty(vo.getChldrn_role())) if(XitCmmnUtil.isEmpty(vo.getChldrnRole()))
emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -3801,9 +3801,9 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getParnts_role())) if(XitCmmnUtil.isEmpty(vo.getParntsRole()))
emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table);
if(XitCmmnUtil.isEmpty(vo.getChldrn_role())) if(XitCmmnUtil.isEmpty(vo.getChldrnRole()))
emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);
@ -3836,9 +3836,9 @@ public class XitFrameCrudServiceImpl implements XitFrameCrudService{
* *
*/ */
String emsg = null; String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getParnts_role())) if(XitCmmnUtil.isEmpty(vo.getParntsRole()))
emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)부모역할(은)는 필수조건 입니다.", table);
if(XitCmmnUtil.isEmpty(vo.getChldrn_role())) if(XitCmmnUtil.isEmpty(vo.getChldrnRole()))
emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table); emsg = String.format("(%s)자식역할(은)는 필수조건 입니다.", table);
if(emsg!=null){ if(emsg!=null){
logger.error(emsg); logger.error(emsg);

@ -523,16 +523,16 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
// 그룹의 권한 조회 // 그룹의 권한 조회
XitAuthorGroupInfoVO groupInfo = new XitAuthorGroupInfoVO(); XitAuthorGroupInfoVO groupInfo = new XitAuthorGroupInfoVO();
groupInfo.setGroup_id(groupId); groupInfo.setGroupId(groupId);
groupInfo = xitFrameCrudService.findXitAuthorGroupInfo(groupInfo); groupInfo = xitFrameCrudService.findXitAuthorGroupInfo(groupInfo);
// 권한 설정 // 권한 설정
if (XitCmmnUtil.isEmpty(groupInfo)) if (XitCmmnUtil.isEmpty(groupInfo))
return "ROLE_USER"; return "ROLE_USER";
else { else {
if (XitCmmnUtil.isEmpty(groupInfo.getAuthor_code())) if (XitCmmnUtil.isEmpty(groupInfo.getAuthorCode()))
return "ROLE_USER"; return "ROLE_USER";
else else
return groupInfo.getAuthor_code(); return groupInfo.getAuthorCode();
} }
} }
@ -572,7 +572,7 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
boolean isExists = false; boolean isExists = false;
//사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인 //사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) { for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getParnts_role().equals(userAuthorCode)) { if(item.getParntsRole().equals(userAuthorCode)) {
isExists = true; isExists = true;
break; break;
} }
@ -580,7 +580,7 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
//사용자 권한이 최상위 권한이면 true 반환 //사용자 권한이 최상위 권한이면 true 반환
if(!isExists) if(!isExists)
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) { for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getChldrn_role().equals(userAuthorCode)) { if(item.getChldrnRole().equals(userAuthorCode)) {
log.debug("This user is Top-Level Author !!"); log.debug("This user is Top-Level Author !!");
return true; return true;
} }
@ -622,13 +622,13 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
if (result) if (result)
break; break;
// 권한코드가 일치하지 않으면 skip // 권한코드가 일치하지 않으면 skip
if (!item.getParnts_role().equals(authorCode)) if (!item.getParntsRole().equals(authorCode))
continue; continue;
if (item.getChldrn_role().equals(highAuthorCode)) { // 상위 권한과 일치하면 if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면
result = true; result = true;
} else { // 상위 권한과 일치하지 않으면 재호출 } else { // 상위 권한과 일치하지 않으면 재호출
result = this.isHighAuthor(list, item.getChldrn_role(), highAuthorCode); result = this.isHighAuthor(list, item.getChldrnRole(), highAuthorCode);
} }
} }

@ -4,9 +4,13 @@ import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO;
import kr.xit.framework.core.model.XitBaseSearchVO; import kr.xit.framework.core.model.XitBaseSearchVO;
/** /**
@ -20,26 +24,20 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@Mapper @Mapper
public interface AuthMgtMapper { public interface AuthAuthorMgtMapper {
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param searchVO *
* @param vo
* @param rowBounds
* @return List<XitAuthRegMngVO> * @return List<XitAuthRegMngVO>
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public List<XitAuthRegMngVO> findList(XitAuthRegMngSearchVO searchVO) throws SQLException; List<XitAuthorInfoVO> selectAuthorInfos(final Map<String, Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> selectAuthorInfos(final Map<String, Object> paraMap);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthRegMngSearchVO searchVO) throws SQLException;
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -48,7 +46,30 @@ public interface AuthMgtMapper {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public XitAuthRegMngVO findView(XitAuthRegMngVO vo) throws SQLException; XitAuthorInfoVO selectAuthorInfo(final String authorCode);
int insertAuthorInfo(final XitAuthorInfoVO vo);
int updateAuthorInfo(final XitAuthorInfoVO vo);
int deleteAuthorInfo(final String authorCode);
List<XitRoleSclsrtRescueVO> selectRoleSclsrtRescues(final XitRoleSclsrtRescueVO vo);
XitRoleSclsrtRescueVO selectRoleSclsrtRescue(final XitRoleSclsrtRescueVO vo);
int insertRoleSclsrtRescue(final XitRoleSclsrtRescueVO vo);
int deleteRoleSclsrtRescue(final XitRoleSclsrtRescueVO vo);
List<XitRoleInfoVO> selectAuthRoleGrantList(Map<String, Object> paraMap);
int deleteRoleGrant(Map<String, Object> map);
int saveRoleGrant(Map<String, Object> map);
@ -69,4 +90,5 @@ public interface AuthMgtMapper {
*/ */
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO); public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
} }

@ -2,8 +2,13 @@ package kr.xit.framework.biz.mng.auth.mapper;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
@ -20,6 +25,26 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
@Mapper @Mapper
public interface AuthGrpMgtMapper { public interface AuthGrpMgtMapper {
List<XitAuthorGroupInfoVO> selectAuthorGroupInfos(final Map<String, Object> paraMap, final RowBounds rowBounds);
XitAuthorGroupInfoVO selectAuthorGroupInfo(final String groupId);
int insertAuthorGroupInfo(final XitAuthorGroupInfoVO vo);
int updateAuthorGroupInfo(final XitAuthorGroupInfoVO vo);
int deleteAuthorGroupInfo(final String groupId);
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param searchVO * @param searchVO
@ -46,4 +71,6 @@ public interface AuthGrpMgtMapper {
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) throws SQLException; public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) throws SQLException;
} }

@ -2,6 +2,9 @@ package kr.xit.framework.biz.mng.auth.mapper;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
@ -20,6 +23,9 @@ 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);
/** /**
* <pre> : </pre> * <pre> : </pre>

@ -4,6 +4,8 @@ import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
@ -23,6 +25,10 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
public interface AuthUserMgtMapper { public interface AuthUserMgtMapper {
List<XitAuthUsrMngVO> selectAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitAuthUsrMngVO selectAuthUser(final Map<String,Object> paraMap);
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param searchVO * @param searchVO

@ -18,11 +18,6 @@ public class XitAuthHierarchyMngVO extends BaseVO {
* serialVersionUID * serialVersionUID
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
*
*/
private XitAuthHierarchyMngVO authorManage;
/** /**
* *
*/ */
@ -48,20 +43,6 @@ public class XitAuthHierarchyMngVO extends BaseVO {
*/ */
private String authorRescueCodeNm; private String authorRescueCodeNm;
/**
* authorManage attribute .
* @return AuthorManage
*/
public XitAuthHierarchyMngVO getAuthorManage() {
return authorManage;
}
/**
* authorManage attribute .
* @param authorManage AuthorManage
*/
public void setAuthorManage(XitAuthHierarchyMngVO authorManage) {
this.authorManage = authorManage;
}
/** /**
* authorCode attribute . * authorCode attribute .
* @return String * @return String

@ -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 XitAuthUsrMngVO extends BaseVO { public class XitAuthUsrMngVO extends BaseVO {
/** /**
@ -54,132 +66,4 @@ public class XitAuthUsrMngVO extends BaseVO {
* Uniq ID * Uniq ID
*/ */
private String uniqId; private String uniqId;
/**
* authorGroup attribute .
* @return AuthorGroup
*/
public XitAuthUsrMngVO getAuthorGroup() {
return authorGroup;
}
/**
* authorGroup attribute .
* @param authorGroup AuthorGroup
*/
public void setAuthorGroup(XitAuthUsrMngVO authorGroup) {
this.authorGroup = authorGroup;
}
/**
* userId attribute .
* @return String
*/
public String getUserId() {
return userId;
}
/**
* userId attribute .
* @param userId String
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* userNm attribute .
* @return String
*/
public String getUserNm() {
return userNm;
}
/**
* userNm attribute .
* @param userNm String
*/
public void setUserNm(String userNm) {
this.userNm = userNm;
}
/**
* groupId attribute .
* @return String
*/
public String getGroupId() {
return groupId;
}
/**
* groupId attribute .
* @param groupId String
*/
public void setGroupId(String groupId) {
this.groupId = groupId;
}
/**
* mberTyCode attribute .
* @return String
*/
public String getMberTyCode() {
return mberTyCode;
}
/**
* mberTyCode attribute .
* @param mberTyCode String
*/
public void setMberTyCode(String mberTyCode) {
this.mberTyCode = mberTyCode;
}
/**
* mberTyNm attribute .
* @return String
*/
public String getMberTyNm() {
return mberTyNm;
}
/**
* mberTyNm attribute .
* @param mberTyNm String
*/
public void setMberTyNm(String mberTyNm) {
this.mberTyNm = mberTyNm;
}
/**
* authorCode attribute .
* @return String
*/
public String getAuthorCode() {
return authorCode;
}
/**
* authorCode attribute .
* @param authorCode String
*/
public void setAuthorCode(String authorCode) {
this.authorCode = authorCode;
}
/**
* regYn attribute .
* @return String
*/
public String getRegYn() {
return regYn;
}
/**
* regYn attribute .
* @param regYn String
*/
public void setRegYn(String regYn) {
this.regYn = regYn;
}
/**
* uniqId attribute .
* @return String
*/
public String getUniqId() {
return uniqId;
}
/**
* uniqId attribute .
* @param uniqId String
*/
public void setUniqId(String uniqId) {
this.uniqId = uniqId;
}
} }

@ -3,6 +3,10 @@ package kr.xit.framework.biz.mng.auth.service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO;
import kr.xit.framework.core.model.XitBaseSearchVO; import kr.xit.framework.core.model.XitBaseSearchVO;
@ -17,7 +21,7 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
* @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.
*/ */
public interface AuthMgtService { public interface AuthAuthorMgtService {
/** /**
@ -27,25 +31,37 @@ public interface AuthMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public List<XitAuthRegMngVO> findList(XitAuthRegMngSearchVO searchVO); List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap);
XitAuthorInfoVO findAuthAuthor(final String authorCode);
void addAuthAuthor(final XitAuthorInfoVO vo);
void modifyAuthAuthor(final XitAuthorInfoVO vo);
void removeAuthAuthor(final String authorCode);
List<XitRoleInfoVO> findAuthRoleGrantList(Map<String, Object> paraMap);
void saveAuthRoleGrantList(Map<String, Object> paraMap);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthRegMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthRegMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitAuthRegMngVO findView(XitAuthRegMngVO vo);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -89,7 +105,7 @@ public interface AuthMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO); List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO);
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param searchVO * @param searchVO
@ -97,7 +113,7 @@ public interface AuthMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO); int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
/** /**
* <pre> : </pre> * <pre> : </pre>
* @param authCode * @param authCode
@ -106,6 +122,7 @@ public interface AuthMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public void addAuthorRole(String authCode, String[] trgetRoleCodes, String[] trgetRegYns); void addAuthorRole(String authCode, String[] trgetRoleCodes, String[] trgetRegYns);
} }

@ -1,7 +1,12 @@
package kr.xit.framework.biz.mng.auth.service; package kr.xit.framework.biz.mng.auth.service;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
@ -17,6 +22,16 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
*/ */
public interface AuthGrpMgtService { public interface AuthGrpMgtService {
List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitAuthorGroupInfoVO findAuthGrp(final String groupId);
void addAuthGrp(final XitAuthorGroupInfoVO vo);
void modifyAuthGrp(final XitAuthorGroupInfoVO vo);
void removeAuthGrp(final String authorCode);
void isCheckUserForCanChange(String uniqId, String trgetAuthorCode);
/** /**
* <pre> : </pre> * <pre> : </pre>

@ -1,6 +1,9 @@
package kr.xit.framework.biz.mng.auth.service; package kr.xit.framework.biz.mng.auth.service;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
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;
@ -17,6 +20,10 @@ 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);
/** /**
* <pre> : </pre> * <pre> : </pre>

@ -3,6 +3,8 @@ package kr.xit.framework.biz.mng.auth.service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
import kr.xit.framework.core.model.XitBaseSearchVO; import kr.xit.framework.core.model.XitBaseSearchVO;
@ -19,6 +21,9 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
*/ */
public interface AuthUserMgtService { public interface AuthUserMgtService {
List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
void saveAuthUserList(final List<Map<String, Object>> paraList);
void removeAuthUserList(final List<Map<String, Object>> paraList);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -99,4 +104,5 @@ public interface AuthUserMgtService {
*/ */
public int findListGroupTotCnt(XitBaseSearchVO searchVO); public int findListGroupTotCnt(XitBaseSearchVO searchVO);
} }

@ -1,33 +1,34 @@
package kr.xit.framework.biz.mng.auth.service.impl; package kr.xit.framework.biz.mng.auth.service.impl;
import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO; import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.cmm.model.XitAuthorRoleRelateVO; import kr.xit.framework.biz.cmm.model.XitAuthorRoleRelateVO;
import kr.xit.framework.biz.cmm.model.XitRoleInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO; import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.service.XitFrameUnitService; import kr.xit.framework.biz.cmm.service.XitFrameUnitService;
import kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper; import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthMgtService; import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO;
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.extern.slf4j.Slf4j;
@Slf4j
@Service @Service
public class AuthMgtServiceImpl implements AuthMgtService { public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
private static final Logger logger = LoggerFactory.getLogger(AuthMgtServiceImpl.class);
@Resource @Resource
private AuthMgtMapper xitAuthRegMngMapper; private AuthAuthorMgtMapper mapper;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Resource @Resource
@ -40,38 +41,89 @@ public class AuthMgtServiceImpl implements AuthMgtService {
@Override @Override
public List<XitAuthRegMngVO> findList(XitAuthRegMngSearchVO searchVO) { public List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds) {
List<XitAuthRegMngVO> result = null; return mapper.selectAuthorInfos(paraMap, rowBounds);
try { }
result = xitAuthRegMngMapper.findList(searchVO);
} catch (SQLException e) { @Override
throw new RuntimeException("권한관리 목록 조회 FAIL::", e); public List<XitAuthorInfoVO> findAuthAuthors(Map<String, Object> paraMap) {
} return mapper.selectAuthorInfos(paraMap);
return result; }
@Override
public XitAuthorInfoVO findAuthAuthor(final String authorCode) {
return mapper.selectAuthorInfo(authorCode);
} }
/* =====================================================
* 2020.05.21
*
* -: egovFrame ~ "익명사용자->사용자->관리자"
* ROLE .
* "관리자>매니저>정회원>준회원>비회원"
* ( ) .
* -: "익명사용자->사용자->관리자"
* "익명사용자->사용자->신규권한1/신규권한2/...->관리자"
* n "사용자" ROLE
* n ROLE "관리자" .
* AS-IS: "익명사용자->사용자->관리자" (PARENT) ROLE .
* TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자" (PARENT) ROLE .
===================================================== */
@Override @Override
public int findListTotCnt(XitAuthRegMngSearchVO searchVO) { public void addAuthAuthor(final XitAuthorInfoVO vo){
int result = 0; //권한정보 Insert
try { mapper.insertAuthorInfo(vo);
result = xitAuthRegMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) { //계층구조생성
throw new RuntimeException("권한관리 목록 총건수 조회 FAIL::", e); XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
} //부모관계 생성
return result; roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(vo.getAuthorCode());
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParntsRole(vo.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
} }
@Override @Override
public XitAuthRegMngVO findView(XitAuthRegMngVO vo) { public void modifyAuthAuthor(final XitAuthorInfoVO vo){
XitAuthRegMngVO result = null; mapper.updateAuthorInfo(vo);
try { }
result = xitAuthRegMngMapper.findView(vo); public void removeAuthAuthor(final String authorCode){
} catch (SQLException e) { //계층구조 삭제
throw new RuntimeException("권한관리 상세정보 조회 FAIL::", e); XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
} roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
return result; roleSclsrtRescueVO.setChldrnRole(authorCode);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거
roleSclsrtRescueVO.setParntsRole(authorCode);
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
mapper.deleteAuthorInfo(authorCode);
}
@Override
public List<XitRoleInfoVO> findAuthRoleGrantList(Map<String, Object> paraMap) {
return mapper.selectAuthRoleGrantList(paraMap);
} }
@Override
public void saveAuthRoleGrantList(final Map<String, Object> paraMap) {
List<Map<String,Object>> mapList = (List<Map<String, Object>>)paraMap.get("grantData");
mapList.forEach(map -> {
map.put("authorCode", paraMap.get("authorCode"));
if(Objects.equals(map.get("regYn"), "N"))
mapper.deleteRoleGrant(map);
else
mapper.saveRoleGrant(map);
});
}
@Override @Override
public void addProc(XitAuthRegMngVO vo) { public void addProc(XitAuthRegMngVO vo) {
/* ===================================================== /* =====================================================
@ -113,15 +165,15 @@ public class AuthMgtServiceImpl implements AuthMgtService {
try { try {
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성 //부모관계 생성
roleSclsrtRescueVO.setParnts_role(PARNTS_AUTHOR); roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrn_role(authorInfoVO.getAuthor_code()); roleSclsrtRescueVO.setChldrnRole(authorInfoVO.getAuthorCode());
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO); xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성 //자녀관계 생성
roleSclsrtRescueVO.setParnts_role(authorInfoVO.getAuthor_code()); roleSclsrtRescueVO.setParntsRole(authorInfoVO.getAuthorCode());
roleSclsrtRescueVO.setChldrn_role(CHLDRN_AUTHOR); roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO); xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
} catch (Exception e) { } catch (Exception e) {
logger.debug(String.format("권한계층 Insert Fail : %s", e.getMessage())); log.debug(String.format("권한계층 Insert Fail : %s", e.getMessage()));
} }
} }
@ -177,15 +229,15 @@ public class AuthMgtServiceImpl implements AuthMgtService {
try { try {
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 제거 //부모관계 제거
roleSclsrtRescueVO.setParnts_role(PARNTS_AUTHOR); roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrn_role(authorInfoVO.getAuthor_code()); roleSclsrtRescueVO.setChldrnRole(authorInfoVO.getAuthorCode());
xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO); xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거 //자녀관계 제거
roleSclsrtRescueVO.setParnts_role(authorInfoVO.getAuthor_code()); roleSclsrtRescueVO.setParntsRole(authorInfoVO.getAuthorCode());
roleSclsrtRescueVO.setChldrn_role(CHLDRN_AUTHOR); roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO); xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO);
} catch (Exception e) { } catch (Exception e) {
logger.debug(String.format("권한계층 Delete Fail : %s", e.getMessage())); log.debug(String.format("권한계층 Delete Fail : %s", e.getMessage()));
} }
//권한정보 Delete //권한정보 Delete
xitFrameCrudService.removeXitAuthorInfo(authorInfoVO); xitFrameCrudService.removeXitAuthorInfo(authorInfoVO);
@ -211,12 +263,12 @@ public class AuthMgtServiceImpl implements AuthMgtService {
@Override @Override
public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO) { public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO) {
return xitAuthRegMngMapper.findListAuthorRole(searchVO); return mapper.findListAuthorRole(searchVO);
} }
@Override @Override
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO) { public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO) {
return xitAuthRegMngMapper.findListAuthorRoleTotCnt(searchVO); return mapper.findListAuthorRoleTotCnt(searchVO);
} }
@Override @Override
@ -263,9 +315,9 @@ public class AuthMgtServiceImpl implements AuthMgtService {
*/ */
private XitAuthorInfoVO convertToCrudVO(XitAuthRegMngVO vo) { private XitAuthorInfoVO convertToCrudVO(XitAuthRegMngVO vo) {
XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO(); XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO();
authorInfoVO.setAuthor_code (vo.getAuthorCode()); //권한 코드 authorInfoVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
authorInfoVO.setAuthor_nm (vo.getAuthorNm()); //권한 명 authorInfoVO.setAuthorNm(vo.getAuthorNm()); //권한 명
authorInfoVO.setAuthor_dc (vo.getAuthorDc()); //권한 설명 authorInfoVO.setAuthorDc(vo.getAuthorDc()); //권한 설명
// authorInfoVO.setAuthor_creat_de(vo.getAuthorCreatDe()); //권한 생성 일 // authorInfoVO.setAuthor_creat_de(vo.getAuthorCreatDe()); //권한 생성 일
return authorInfoVO; return authorInfoVO;

@ -2,28 +2,44 @@ package kr.xit.framework.biz.mng.auth.service.impl;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException; import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService; import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO; import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.cmm.model.XitUserScrtySetupVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.service.XitFrameUnitService; import kr.xit.framework.biz.cmm.service.XitFrameUnitService;
import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper; import kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService; import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService;
import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
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.extern.slf4j.Slf4j;
@Slf4j
@Service @Service
public class AuthGrpMgtServiceImpl implements AuthGrpMgtService { public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
@Resource @Resource
private AuthGrpMgtMapper xitAuthGrpMngMapper; private AuthGrpMgtMapper mapper;
@Resource
private AuthAuthorMgtMapper authAuthorMgtMapper;
@Resource
private UserMgtMapper userMgtMapper;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Resource @Resource
@ -33,11 +49,142 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
@Resource @Resource
private XitMessageSource xitMessageSource; private XitMessageSource xitMessageSource;
@Override
public List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorGroupInfos(paraMap, rowBounds);
}
@Override
public XitAuthorGroupInfoVO findAuthGrp(final String groupId) {
return mapper.selectAuthorGroupInfo(groupId);
}
@Override
public void addAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
try {
vo.setGroupId(idgenService.getNextStringId());
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthorGroupInfo(vo);
}
@Override
public void modifyAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
mapper.updateAuthorGroupInfo(vo);
}
@Override
public void removeAuthGrp(final String groupId) {
mapper.deleteAuthorGroupInfo(groupId);
}
public void isCheckUserForCanChange(String uniqId, String trgetAuthorCode) {
//사용자보안설정 조회
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setScrtySetupTrgetId(uniqId);
List<XitUserScrtySetupVO> listUserScrtySetupVO = userMgtMapper.selectUserScrtySetups(userScrtySetupVO);
String userAuthorCode = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthorCode();
if(!this.isCheckUserAuthorCodeForCanChange(userAuthorCode, trgetAuthorCode))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");;
}
private boolean isCheckUserAuthorCodeForCanChange(String userAuthorCode, String trgetAuthorCode) {
//역할(권한)계층구조 데이터 목록 조회
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null);
//역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) {
log.debug("Do not use a RoleSclsrtRescue Data !!");
return true;
}else {
//사용자의 권한 정보가 없을 때(비정상적인 루트로 등록한 사용자 계정으로 판단)
if(XitCmmnUtil.isEmpty(userAuthorCode)) {
log.debug("This user is have not UserScrtySetup Data !!");
return false;
}
}
boolean isExists = false;
//사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getParntsRole().equals(userAuthorCode)) {
isExists = true;
break;
}
}
//사용자 권한이 최상위 권한이면 true 반환
if(!isExists)
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getChldrnRole().equals(userAuthorCode)) {
log.debug("This user is Top-Level Author !!");
return true;
}
}
//사용자의 역할(권한)정보가 없으면 false 반환
if(!isExists) {
log.debug("This user is have not RoleSclsrtRescue Data !!");
return false;
}
/**
*
*
*/
return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true;
}
private boolean isHighAuthor(List<XitRoleSclsrtRescueVO> list, String authorCode, String highAuthorCode) {
boolean result = false;
for (XitRoleSclsrtRescueVO item : list) {
// 상위 권한으로 확인 되었으면 stop
if (result)
break;
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authorCode))
continue;
if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면
result = true;
} else { // 상위 권한과 일치하지 않으면 재호출
result = this.isHighAuthor(list, item.getChldrnRole(), highAuthorCode);
}
}
return result;
}
@Override @Override
public List<XitAuthGrpMngVO> findList(XitAuthGrpMngSearchVO searchVO) { public List<XitAuthGrpMngVO> findList(XitAuthGrpMngSearchVO searchVO) {
List<XitAuthGrpMngVO> result = null; List<XitAuthGrpMngVO> result = null;
try { try {
result = xitAuthGrpMngMapper.findList(searchVO); result = mapper.findList(searchVO);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 목록 조회 FAIL::", e); throw new RuntimeException("사용자그룹관리 목록 조회 FAIL::", e);
} }
@ -48,7 +195,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
public int findListTotCnt(XitAuthGrpMngSearchVO searchVO) { public int findListTotCnt(XitAuthGrpMngSearchVO searchVO) {
int result = 0; int result = 0;
try { try {
result = xitAuthGrpMngMapper.findListTotCnt(searchVO); result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 목록 총건수 조회 FAIL::", e); throw new RuntimeException("사용자그룹관리 목록 총건수 조회 FAIL::", e);
} }
@ -59,7 +206,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) { public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) {
XitAuthGrpMngVO result = null; XitAuthGrpMngVO result = null;
try { try {
result = xitAuthGrpMngMapper.findView(vo); result = mapper.findView(vo);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 상세정보 조회 FAIL::", e); throw new RuntimeException("사용자그룹관리 상세정보 조회 FAIL::", e);
} }
@ -155,11 +302,11 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
*/ */
private XitAuthorGroupInfoVO convertToCrudVO(XitAuthGrpMngVO vo) { private XitAuthorGroupInfoVO convertToCrudVO(XitAuthGrpMngVO vo) {
XitAuthorGroupInfoVO authorGroupInfoVO = new XitAuthorGroupInfoVO(); XitAuthorGroupInfoVO authorGroupInfoVO = new XitAuthorGroupInfoVO();
authorGroupInfoVO.setGroup_id (vo.getGroupId()); //그룹 id authorGroupInfoVO.setGroupId(vo.getGroupId()); //그룹 id
authorGroupInfoVO.setGroup_nm (vo.getGroupNm()); //그룹 명 authorGroupInfoVO.setGroupNm(vo.getGroupNm()); //그룹 명
// authorGroupInfoVO.setGroup_creat_de(); //그룹 생성 일 // authorGroupInfoVO.setGroup_creat_de(); //그룹 생성 일
authorGroupInfoVO.setGroup_dc (vo.getGroupDc()); //그룹 설명 authorGroupInfoVO.setGroupDc(vo.getGroupDc()); //그룹 설명
authorGroupInfoVO.setAuthor_code (vo.getAuthorCode()); //권한 코드 authorGroupInfoVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
return authorGroupInfoVO; return authorGroupInfoVO;
} }

@ -9,6 +9,7 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -18,32 +19,42 @@ import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO; import kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.service.XitFrameUnitService; import kr.xit.framework.biz.cmm.service.XitFrameUnitService;
import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.mapper.AuthHierarchyMgtMapper; import kr.xit.framework.biz.mng.auth.mapper.AuthHierarchyMgtMapper;
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;
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 lombok.AllArgsConstructor;
@AllArgsConstructor
@Service @Service
public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService { public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
private static final Logger logger = LoggerFactory.getLogger(AuthHierarchyMgtServiceImpl.class);
@Resource private final AuthHierarchyMgtMapper mapper;
private AuthHierarchyMgtMapper xitAuthHierarchyMngMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitFrameUnitService xitFrameUnitService;
@Resource(name = "databaseSecurityMetadataSource")
private EgovReloadableFilterInvocationSecurityMetadataSource databaseSecurityMetadataSource;
private final AuthAuthorMgtMapper authAuthorMgtMapper;
@Override
public List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds) {
List<XitAuthHierarchyMngVO> voList = mapper.selectAuthHierarchies(paraMap, rowBounds);
//권한구조 설정
if(XitCmmnUtil.notEmpty(voList)) {
for(XitAuthHierarchyMngVO vo : voList) {
String strAuthorRescueCode = this.getStrAuthHierarchy(vo.getAuthorCode());
vo.setAuthorRescueCode(strAuthorRescueCode);
vo.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode));
}
}
return voList;
}
@Override @Override
public List<XitAuthHierarchyMngVO> findList(XitAuthHierarchyMngSearchVO searchVO) { public List<XitAuthHierarchyMngVO> findList(XitAuthHierarchyMngSearchVO searchVO) {
List<XitAuthHierarchyMngVO> result = null; List<XitAuthHierarchyMngVO> result = null;
try { try {
result = xitAuthHierarchyMngMapper.findList(searchVO); result = mapper.findList(searchVO);
//권한구조 설정 //권한구조 설정
if(XitCmmnUtil.notEmpty(result)) { if(XitCmmnUtil.notEmpty(result)) {
@ -64,7 +75,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
public int findListTotCnt(XitAuthHierarchyMngSearchVO searchVO) { public int findListTotCnt(XitAuthHierarchyMngSearchVO searchVO) {
int result = 0; int result = 0;
try { try {
result = xitAuthHierarchyMngMapper.findListTotCnt(searchVO); result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("권한계층관리 목록 총건수 조회 FAIL::", e); throw new RuntimeException("권한계층관리 목록 총건수 조회 FAIL::", e);
} }
@ -75,12 +86,12 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
public XitAuthHierarchyMngVO findView(XitAuthHierarchyMngVO vo) { public XitAuthHierarchyMngVO findView(XitAuthHierarchyMngVO vo) {
XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO(); XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO();
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = xitFrameCrudService.findXitRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO))
return result; return result;
String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrn_role()); String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole());
topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim(); topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim();
String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode); String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode);
result.setAuthorRescueCode(strAuthorRescueCode); result.setAuthorRescueCode(strAuthorRescueCode);
@ -95,19 +106,12 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
@Override @Override
public void modifyProc(XitAuthHierarchyMngVO vo) { public void modifyProc(XitAuthHierarchyMngVO vo) {
/**
*
*/
if(XitCmmnUtil.isEmpty(vo.getAuthorCode())) if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
throw new RuntimeException("권한코드는 필수조건 입니다."); throw new RuntimeException("권한코드는 필수조건 입니다.");
/**
*
*/
// XitRoleSclsrtRescueVO roleSclsrtRescueVO = convertToCrudVO(vo);
String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록 String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록
/** /**
* *
* - . * - .
@ -127,20 +131,9 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
} }
if(cnt > 1) if(cnt > 1)
throw new RuntimeException("다중상속은 하나의 구간만 설정 가능 합니다."); throw new RuntimeException("다중상속은 하나의 구간만 설정 가능 합니다.");
// 권한계층관리 데이터 유무
// boolean isExistRoleHierarchy = XitCmmnUtil.isEmpty(xitFrameCrudService.findXitRoleSclsrtRescues(new XitRoleSclsrtRescueVO()))?false:true;
// if(isExistRoleHierarchy)
// this.isValidate(arrAuthorCodeGrp);
/**
*
*/
//권한계층구조 일괄 제거 //권한계층구조 일괄 제거
xitFrameCrudService.removesXitRoleSclsrtRescue(new XitRoleSclsrtRescueVO()); authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO());
//권한계층 데이터 등록 //권한계층 데이터 등록
for(int i=0; i<arrAuthorCodeGrp.length; i++) { for(int i=0; i<arrAuthorCodeGrp.length; i++) {
//마지막 권한이면 stop //마지막 권한이면 stop
@ -155,10 +148,9 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
for(int k=0; k<arrChldrnRole.length; k++) { for(int k=0; k<arrChldrnRole.length; k++) {
String chldrnRole = arrChldrnRole[k]; String chldrnRole = arrChldrnRole[k];
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParnts_role(parntsRole); roleSclsrtRescueVO.setParntsRole(parntsRole);
roleSclsrtRescueVO.setChldrn_role(chldrnRole); roleSclsrtRescueVO.setChldrnRole(chldrnRole);
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO); authAuthorMgtMapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
} }
} }
} }
@ -186,25 +178,6 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
} }
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitRoleSclsrtRescueVO
* @author:
* @date: 2020. 11. 2.
*/
// private XitRoleSclsrtRescueVO convertToCrudVO(XitAuthHierarchyMngVO vo) {
// XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
// roleSclsrtRescueVO.setParnts_role(vo.getParntsRole());
// roleSclsrtRescueVO.setChldrn_role(vo.getChldrnRole());
//
// return roleSclsrtRescueVO;
// }
/** /**
* <pre> : .</pre> * <pre> : .</pre>
* @param authorCode * @param authorCode
@ -217,7 +190,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>();
List<XitRoleSclsrtRescueVO> list = xitFrameCrudService.findXitRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); List<XitRoleSclsrtRescueVO> list = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
this.getAuthHierarchy(list, authorCode, false, mParnts); this.getAuthHierarchy(list, authorCode, false, mParnts);
this.getAuthHierarchy(list, authorCode, true, mChldrn); this.getAuthHierarchy(list, authorCode, true, mChldrn);
@ -252,20 +225,18 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
if(isChldrnSearch) { if(isChldrnSearch) {
// 권한코드가 일치하지 않으면 skip // 권한코드가 일치하지 않으면 skip
if (!item.getParnts_role().equals(authorCode)) if (!item.getParntsRole().equals(authorCode))
continue; continue;
//권한코드 Set //권한코드 Set
if(resultMap.containsKey(authorCode)) { if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음 //동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getChldrn_role())) if(resultMap.get(authorCode).equals(item.getChldrnRole()))
continue; continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrn_role()); resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrnRole());
}else { }else {
//동일한 값이 있으면 담지 않음 //동일한 값이 있으면 담지 않음
// if(!resultMap.containsValue(item.getChldrn_role()))
// resultMap.put(authorCode, item.getChldrn_role());
Iterator<String> it = resultMap.values().iterator(); Iterator<String> it = resultMap.values().iterator();
boolean isExists = false; boolean isExists = false;
LOOP: LOOP:
@ -273,55 +244,40 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
String[] values = it.next().split(","); String[] values = it.next().split(",");
for(int j=0; j<values.length; j++) { for(int j=0; j<values.length; j++) {
String value = values[j].trim(); String value = values[j].trim();
if(value.equals(item.getChldrn_role())) { if(value.equals(item.getChldrnRole())) {
isExists = true; isExists = true;
break LOOP; break LOOP;
} }
} }
} }
if(!isExists) if(!isExists)
resultMap.put(authorCode, item.getChldrn_role()); resultMap.put(authorCode, item.getChldrnRole());
} }
//재탐색 //재탐색
this.getAuthHierarchy(list, item.getChldrn_role(), isChldrnSearch, resultMap); this.getAuthHierarchy(list, item.getChldrnRole(), isChldrnSearch, resultMap);
}else { }else {
// 권한코드가 일치하지 않으면 skip // 권한코드가 일치하지 않으면 skip
if (!item.getChldrn_role().equals(authorCode)) if (!item.getChldrnRole().equals(authorCode))
continue; continue;
//재탐색 //재탐색
this.getAuthHierarchy(list, item.getParnts_role(), isChldrnSearch, resultMap); this.getAuthHierarchy(list, item.getParntsRole(), isChldrnSearch, resultMap);
//권한코드 Set //권한코드 Set
if(resultMap.containsKey(authorCode)) { if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음 //동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getParnts_role())) if(resultMap.get(authorCode).equals(item.getParntsRole()))
continue; continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getParnts_role()); resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getParntsRole());
}else { }else {
//동일한 값이 있으면 담지 않음 //동일한 값이 있으면 담지 않음
if(!resultMap.containsValue(item.getParnts_role())) if(!resultMap.containsValue(item.getParntsRole())) {
resultMap.put(authorCode, item.getParnts_role()); resultMap.put(authorCode, item.getParntsRole());
// Iterator<String> it = resultMap.values().iterator(); }
// boolean isExists = false;
// LOOP:
// while(it.hasNext()) {
// String[] values = it.next().split(",");
// for(int j=0; j<values.length; j++) {
// String value = values[j].trim();
// if(value.equals(item.getParnts_role())) {
// isExists = true;
// break LOOP;
// }
//
// }
// }
// if(!isExists)
// resultMap.put(authorCode, item.getChldrn_role());
} }
} }
@ -332,13 +288,12 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
private String convertKorNm(String strAuthorRescueCode) { private String convertKorNm(String strAuthorRescueCode) {
//권한코드 Map 생성 //권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO()); List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>(); Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) { for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthor_code(), item.getAuthor_nm()); mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
} }
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
String[] items = strAuthorRescueCode.split(">"); String[] items = strAuthorRescueCode.split(">");
for(int i=0; i<items.length; i++) { for(int i=0; i<items.length; i++) {
@ -359,105 +314,6 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
} }
} }
return sb.toString(); return sb.toString();
} }
// /**
// * <pre>메소드 설명: 상위권한을 취득 할 수 없도록 다음을 검증 한다.
// * -자신의 형제를 부모로 설정 할 수 없어야 한다. (ex: 형제 권한의 role 취득 가능)
// * -자신의 권한보다 상위권한을 부모(or형제)로 설정 할 수 없어야 한다. (ex: 상위 권한의 role 취득 가능)
// * -자신의 부모,형제를 자신의 상위권한의 자녀로 설정 할 수 없어야 한다. (ex: n개의 계정 중 본 계정 외 권한을 자녀로 설정하여 상위 권한의 role 취득 가능)
// * </pre>
// * @param arrAuthorCodeGrp void 요청처리 후 응답객체
// * @author: 박민규
// * @date: 2020. 11. 3.
// */
// private void isValidate(String[] arrAuthorCodeGrp) {
// //사용자보안설정 조회
// XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
// userScrtySetupVO.setScrty_setup_trget_id(XitCmmnUtil.getUserInfo().getUniqId());
// List<XitUserScrtySetupVO> listUserScrtySetupVO = xitFrameCrudService.findXitUserScrtySetups(userScrtySetupVO);
// String userAuthorCode = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthor_code();
// if(XitCmmnUtil.notEmpty(userAuthorCode)) {
// //변경 전 형제권한 Map 생성
// Map<String, String> mSiblingsRole = new HashMap<String, String>();
// XitRoleSclsrtRescueVO xitRoleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
// xitRoleSclsrtRescueVO.setChldrn_role(userAuthorCode);
// List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = xitFrameCrudService.findXitRoleSclsrtRescues(xitRoleSclsrtRescueVO);
// if(XitCmmnUtil.notEmpty(listRoleSclsrtRescueVO)) {
// String parntsRole = listRoleSclsrtRescueVO.get(0).getParnts_role();
// xitRoleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
// xitRoleSclsrtRescueVO.setParnts_role(parntsRole);
// List<XitRoleSclsrtRescueVO> listSiblingsRole = xitFrameCrudService.findXitRoleSclsrtRescues(xitRoleSclsrtRescueVO);
// for(XitRoleSclsrtRescueVO siblingsRole : listSiblingsRole) {
// //형제 중 자신의 권한은 제외
// if(siblingsRole.equals(userAuthorCode))
// continue;
//
// mSiblingsRole.put(siblingsRole.getChldrn_role(), "");
// }
// }
//
// //부모 및 형제 권한 추출
// List<String> listParntsRole = new ArrayList<String>(); //추출한 부모권한 목록
// List<String> listParntsAndSiblingsRole = new ArrayList<String>(); //추출한 부모&형제 권한 목록
// boolean isCheckingParnts = true;
// CheckComplete:
// for(int i=0; i<arrAuthorCodeGrp.length; i++) {
// //일치하는 권한이 탐색되었으면 stop
// if(!isCheckingParnts)
// break CheckComplete;
//
// String[] arrAuthorCode = arrAuthorCodeGrp[i].split(";");
// String[] arrTemp = new String[arrAuthorCode.length];
// for(int j=0; j<arrAuthorCode.length; j++) {
// String authorCode = arrAuthorCode[j].trim();
//
// //부모 권한 배열에 임시저장
// arrTemp[j] = authorCode;
// //부모 및 형제 권한 담기
// listParntsAndSiblingsRole.add(authorCode);
//
// //일치하는 권한이 탐색되면 체킹여부 false로 설정
// if(authorCode.equals(userAuthorCode))
// isCheckingParnts = false;
// }
//
// //부모 권한 담기
// if(isCheckingParnts) {
// for(String parntsRole : arrTemp)
// listParntsRole.add(parntsRole);
// }
// }
//
//
// //자신의 권한보다 상위권한을 부모(or형제)로 설정했는지 확인
// for(String authorRole : listParntsAndSiblingsRole) {
//
// boolean isChangePermission = xitFrameUnitService.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), authorRole);
// if(!isChangePermission)
// throw new RuntimeException("자신의 권한보다 상위 권한을 부모(or형제)로 설정 할 수 없습니다.");
// }
// for(String authorRole : listParntsRole) {
// //자신의 형제를 부모로 설정했는지 확인
// if(mSiblingsRole.containsKey(authorRole))
// throw new RuntimeException("자신의 형제 권한을 부모로 설정 할 수 없습니다.");
//
// }
// //[미구현]자신의 부모를 상위권한의 형제or자녀로 설정했는지 확인
//// for(String authorRole : listParntsAndSiblingsRole) {
////
//// //자녀객체 목록 필요
//// //변경전 부모 권한 목록 필요
//// boolean isChangePermission = xitFrameUnitService.isCheckUserForCanChange(authorRole, authorRole);
//// if(!isChangePermission)
//// throw new RuntimeException("자신의 권한보다 상위 권한을 부모(or형제)로 설정 할 수 없습니다.");
//// }
// }
// }
} }

@ -3,18 +3,23 @@ package kr.xit.framework.biz.mng.auth.service.impl;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cmm.model.XitUserScrtySetupVO; import kr.xit.framework.biz.cmm.model.XitUserScrtySetupVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.service.XitFrameUnitService; import kr.xit.framework.biz.cmm.service.XitFrameUnitService;
import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService;
import kr.xit.framework.biz.mng.auth.service.AuthUserMgtService; import kr.xit.framework.biz.mng.auth.service.AuthUserMgtService;
import kr.xit.framework.biz.mng.auth.mapper.AuthUserMgtMapper; import kr.xit.framework.biz.mng.auth.mapper.AuthUserMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper;
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;
@ -22,17 +27,64 @@ import kr.xit.framework.core.utils.XitCmmnUtil;
public class AuthUserMgtServiceImpl implements AuthUserMgtService { public class AuthUserMgtServiceImpl implements AuthUserMgtService {
@Resource @Resource
private AuthUserMgtMapper xitAuthUsrMngMapper; private AuthUserMgtMapper mapper;
@Resource
private UserMgtMapper userMapper;
@Resource
private AuthGrpMgtService authGrpMgtService;
@Resource
private UserMgtService userMgtService;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Resource @Resource
private XitFrameUnitService xitFrameUnitService; private XitFrameUnitService xitFrameUnitService;
@Override
public List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthUsers(paraMap, rowBounds);
}
@Override
public void saveAuthUserList(List<Map<String, Object>> paraList) {
String sessionUniqId = XitCmmnUtil.getUserInfo().getUniqId();
paraList.forEach(map -> {
//유효성확인
authGrpMgtService.isCheckUserForCanChange(sessionUniqId, String.valueOf(map.get("authorCode")));
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId")));
vo.setMberTyCode(String.valueOf(map.get("mberTyCode")));
vo.setAuthorCode(String.valueOf(map.get("authorCode")));
if(Objects.equals("N", map.get("regYn"))){
userMapper.insertUserScrtySetup(vo);
}else{
userMapper.updateUserScrtySetup(vo);
}
});
}
@Override
public void removeAuthUserList(List<Map<String, Object>> paraList) {
//삭제 시 사용자의 권한을 소속 그룹의 권한 또는 Defualt 권한으로 설정
paraList.forEach(map -> {
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId")));
vo.setMberTyCode(String.valueOf(map.get("mberTyCode")));
vo.setAuthorCode(userMgtService.getDefaultAuthorCode(String.valueOf(map.get("groupId"))));
userMapper.updateUserScrtySetup(vo);
});
}
@Override @Override
public List<XitAuthUsrMngVO> findList(XitAuthUsrMngSearchVO searchVO) { public List<XitAuthUsrMngVO> findList(XitAuthUsrMngSearchVO searchVO) {
List<XitAuthUsrMngVO> result = null; List<XitAuthUsrMngVO> result = null;
try { try {
result = xitAuthUsrMngMapper.findList(searchVO); result = mapper.findList(searchVO);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("사용자별권한관리 목록 조회 FAIL::", e); throw new RuntimeException("사용자별권한관리 목록 조회 FAIL::", e);
} }
@ -43,7 +95,7 @@ public class AuthUserMgtServiceImpl implements AuthUserMgtService {
public int findListTotCnt(XitAuthUsrMngSearchVO searchVO) { public int findListTotCnt(XitAuthUsrMngSearchVO searchVO) {
int result = 0; int result = 0;
try { try {
result = xitAuthUsrMngMapper.findListTotCnt(searchVO); result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("사용자별권한관리 목록 총건수 조회 FAIL::", e); throw new RuntimeException("사용자별권한관리 목록 총건수 조회 FAIL::", e);
} }
@ -54,7 +106,7 @@ public class AuthUserMgtServiceImpl implements AuthUserMgtService {
public XitAuthUsrMngVO findView(XitAuthUsrMngVO vo) { public XitAuthUsrMngVO findView(XitAuthUsrMngVO vo) {
XitAuthUsrMngVO result = null; XitAuthUsrMngVO result = null;
try { try {
result = xitAuthUsrMngMapper.findView(vo); result = mapper.findView(vo);
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException("사용자별권한관리 상세정보 조회 FAIL::", e); throw new RuntimeException("사용자별권한관리 상세정보 조회 FAIL::", e);
} }
@ -145,13 +197,13 @@ public class AuthUserMgtServiceImpl implements AuthUserMgtService {
@Override @Override
public List<Map<String, String>> findListGroup(XitBaseSearchVO searchVO) { public List<Map<String, String>> findListGroup(XitBaseSearchVO searchVO) {
return xitAuthUsrMngMapper.findListGroup(searchVO); return mapper.findListGroup(searchVO);
} }
@Override @Override
public int findListGroupTotCnt(XitBaseSearchVO searchVO) { public int findListGroupTotCnt(XitBaseSearchVO searchVO) {
return xitAuthUsrMngMapper.findListGroupTotCnt(searchVO); return mapper.findListGroupTotCnt(searchVO);
} }

@ -1,6 +1,8 @@
package kr.xit.framework.biz.mng.auth.web; package kr.xit.framework.biz.mng.auth.web;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -10,29 +12,44 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
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.RequestBody;
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;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus; import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView;
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.XitAuthorInfoVO;
import kr.xit.framework.biz.cmm.model.XitRoleInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthMgtService; import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
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.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.ValidationError;
import kr.xit.framework.support.util.constants.MessageKey;
/** /**
* *
@ -46,10 +63,10 @@ import kr.xit.framework.support.util.AjaxUtils;
*/ */
@Controller @Controller
@RequestMapping("/framework/biz/mng/auth") @RequestMapping("/framework/biz/mng/auth")
public class AuthMgtController { public class AuthAuthorMgtController {
@Resource @Resource
private AuthMgtService xitAuthRegMngService; private AuthAuthorMgtService service;
@Autowired @Autowired
private XitBeanValidator beanValidator; private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource") @Resource(name = "xitMessageSource")
@ -63,69 +80,125 @@ public class AuthMgtController {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
@RequestMapping(value = "/mngAuthMgtForm", method={RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/mngAuthAuthorMgtForm")
public void mngAuthMgtForm() { public void mngAuthAuthorMgtForm() {
} }
@RequestMapping(value = "/mngAuthAuthorMgtPopup")
public ModelAndView mngAuthAuthorMgtPopup(@ModelAttribute final XitAuthorInfoVO vo){
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getAuthorCode())){
mav.addObject("authorInfoVO", new XitAuthorInfoVO());
mav.addObject("pageTitle", "권한 등록");
} else {
mav.addObject("authorInfoVO", vo);
mav.addObject("pageTitle", "권한 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthAuthorMgtPopup.popup");
return mav;
}
/** /**
* <pre> : </pre> * <pre> : </pre>
* @return String * @return String
* @author: * @author:
* @date: 2020. 7. 30. * @date: 2020. 7. 30.
*/ */
@RequestMapping(value = "AuthRegMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "findAuthAuthors")
@ResponseBody public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) {
public Map<String, Object> AuthRegMng_listAjax(@ModelAttribute("authorManageVO") XitAuthRegMngSearchVO searchVO, ModelMap model) { return ResultResponse.of(service.findAuthAuthors(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/** paging */
PaginationInfo paginationInfo = new PaginationInfo(); @PostMapping(value = "/addAuthAuthor")
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex()); //public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit()); public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo){
paginationInfo.setPageSize(searchVO.getPageSize()); ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = xitAuthRegMngService.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", xitAuthRegMngService.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; //TODO : validate
//ValidationError.of("", vo, bindingResult);
service.addAuthAuthor(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
} }
@PostMapping(value = "/modifyAuthAuthor")
//public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.modifyAuthAuthor(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(value = "/removeAuthAuthor")
public ModelAndView removeAuthAuthor(final String authorCode){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeAuthAuthor(authorCode);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
@RequestMapping(value = "/mngAuthRoleGrantMgtPopup")
public ModelAndView mngAuthRoleGrantMgtPopup(@RequestParam Map<String,Object> paraMap) {
ModelAndView mav = new ModelAndView();
List<Map<String,String>> regYnList = new ArrayList<>();
Map<String,String> map = new HashMap<>();
map.put("code", "Y");
map.put("code_nm", "등록");
regYnList.add(map);
map = new HashMap<>();;
map.put("code", "N");
map.put("code_nm", "미등록");
regYnList.add(map);
mav.addObject("regYnList", regYnList);
mav.addObject("authorRoleManageVO", paraMap);
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthRoleGrantMgtPopup.popup");
return mav;
}
@GetMapping(value="/findAuthRoleGrantList")
public ModelAndView findAuthRoleGrantList(@RequestParam final Map<String,Object> paraMap) {
return ResultResponse.of(service.findAuthRoleGrantList(paraMap));
}
@PostMapping(value = "/saveAuthRoleGrantList")
public ModelAndView saveAuthRoleGrantList(@RequestBody final Map<String, Object> paraMap) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.saveAuthRoleGrantList(paraMap);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
/** /**
* <pre> : .</pre> * <pre> : .</pre>
* @param page * @param cmd
* @param tilesDef Type(none: tiles ) * @param tilesDef Type(none: tiles )
* @param model * @param model
* @return String * @return String
@ -143,7 +216,7 @@ public class AuthMgtController {
break; break;
case "edit": //수정 페이지 case "edit": //수정 페이지
case "view": //상세 페이지 case "view": //상세 페이지
model.addAttribute("authorManage", xitAuthRegMngService.findView(vo)); //model.addAttribute("authorManage", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break; break;
default: default:
@ -158,101 +231,6 @@ public class AuthMgtController {
} }
/**
* <pre> : .</pre>
* @param page
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "AuthRegMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String AuthRegMng_page_popup(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("authorManageSearchVO") XitAuthRegMngSearchVO searchVO
, @ModelAttribute("authorManageVO") XitAuthRegMngVO vo
, ModelMap model) {
switch (cmd) {
case "rolegrant": //권한롤부여
model.addAttribute("authorRoleManageVO", searchVO);
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthRegMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
}
/**
* <pre> : ajax .</pre>
* @param searchVO
* @param modelMap
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value="AuthRegMng_{cmd}_popup.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> AuthRegMng_page_popupAjax(@PathVariable String cmd
, @ModelAttribute XitAuthRegMngSearchVO searchVO
, @ModelAttribute XitAuthRegMngVO vo, ModelMap model) {
Map<String, Object> resultMap = new HashMap<String, Object>();
switch (cmd) {
case "rolegrant": //권한롤부여
/** 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());
try {
/**
*
*/
List<Map<String, String>> authorRoleList = xitAuthRegMngService.findListAuthorRole(searchVO);
int totCnt = xitAuthRegMngService.findListAuthorRoleTotCnt(searchVO);
/**
*
*/
/* ***************************
* 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", authorRoleList); //[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
}
break;
}
return resultMap;
}
@ -296,7 +274,7 @@ public class AuthMgtController {
} }
//처리 //처리
try { try {
xitAuthRegMngService.addProc(vo); service.addProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.insert"); message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -323,7 +301,7 @@ public class AuthMgtController {
} }
//처리 //처리
try { try {
xitAuthRegMngService.modifyProc(vo); service.modifyProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.update"); message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -338,7 +316,7 @@ public class AuthMgtController {
case "delete": //삭제 case "delete": //삭제
//처리 //처리
try { try {
xitAuthRegMngService.removeProc(vo); service.removeProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
break; break;
@ -354,7 +332,7 @@ public class AuthMgtController {
case "deletes": //다건 삭제 case "deletes": //다건 삭제
//처리 //처리
try { try {
xitAuthRegMngService.removesProc(authorCodes); service.removesProc(authorCodes);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -369,7 +347,7 @@ public class AuthMgtController {
//처리 //처리
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_rolegrant_popup"; sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_rolegrant_popup";
try { try {
xitAuthRegMngService.addAuthorRole(authorCode, roleCodes.split(";"), regYns.split(";")); service.addAuthorRole(authorCode, roleCodes.split(";"), regYns.split(";"));
status.setComplete(); status.setComplete();
model.addAttribute("message", xitMessageSource.getMessage("success.common.insert")); model.addAttribute("message", xitMessageSource.getMessage("success.common.insert"));
} catch (RuntimeException e) { } catch (RuntimeException e) {

@ -18,6 +18,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;
@ -26,6 +27,7 @@ import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
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.XitAuthGrpMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
@ -34,9 +36,14 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngSearchVO;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
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.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.constants.MessageKey;
/** /**
* *
@ -53,7 +60,7 @@ import kr.xit.framework.support.util.AjaxUtils;
public class AuthGrpMgtController { public class AuthGrpMgtController {
@Resource @Resource
private AuthGrpMgtService xitAuthGrpMngService; private AuthGrpMgtService service;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Autowired @Autowired
@ -68,16 +75,83 @@ public class AuthGrpMgtController {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
@GetMapping(value = "/mngAuthGrpMgtForm") @RequestMapping(value = "/mngAuthGrpMgtForm")
public ModelAndView mngAuthGrpMgtForm(@ModelAttribute("groupManageVO") XitAuthGrpMngSearchVO searchVO) { public void mngAuthGrpMgtForm() {
// ModelAndView mav = new ModelAndView();
// return mav;
}
@RequestMapping(value = "/mngAuthGrpMgtPopup")
public ModelAndView mngAuthAuthorMgtPopup(@ModelAttribute final XitAuthorGroupInfoVO vo){
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO(); if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getGroupId())){
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(authorInfoVO); mav.addObject("groupManage", new XitAuthorGroupInfoVO());
mav.addObject("listAuthorInfoVO", listAuthorInfoVO); mav.addObject("pageTitle", "권한그룹 등록");
} else {
mav.addObject("groupManage", vo);
mav.addObject("pageTitle", "권한그룹 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthGrpMgtPopup.popup");
return mav;
}
@GetMapping(value = "/findAuthGrps")
public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) {
return ResultResponse.of(service.findAuthGrps(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(value = "/addAuthGrp")
//public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorGroupInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.addAuthGrp(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav; return mav;
} }
@PostMapping(value = "/modifyAuthGrp")
//public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorGroupInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.modifyAuthGrp(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(value = "/removeAuthGrp")
public ModelAndView removeAuthAuthor(final String groupId){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeAuthGrp(groupId);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
/** /**
* <pre> : </pre> * <pre> : </pre>
* @return String * @return String
@ -102,7 +176,7 @@ public class AuthGrpMgtController {
/** /**
* *
*/ */
int totCnt = xitAuthGrpMngService.findListTotCnt(searchVO); int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt); paginationInfo.setTotalRecordCount(totCnt);
/** /**
* *
@ -113,7 +187,7 @@ public class AuthGrpMgtController {
resultMap.put("result", true); //[tui Grid] result resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitAuthGrpMngService.findList(searchVO)); //[tui Grid] data-contents data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>(); Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage()); pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt); pagination.put("totalCount", totCnt);
@ -164,7 +238,7 @@ public class AuthGrpMgtController {
break; break;
case "edit": //수정 페이지 case "edit": //수정 페이지
case "view": //상세 페이지 case "view": //상세 페이지
model.addAttribute("groupManage", xitAuthGrpMngService.findView(vo)); model.addAttribute("groupManage", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break; break;
default: default:
@ -243,7 +317,7 @@ public class AuthGrpMgtController {
} }
//처리 //처리
try { try {
xitAuthGrpMngService.addProc(vo); service.addProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.insert"); message = xitMessageSource.getMessage("success.common.insert");
model.addAttribute("groupId", vo.getGroupId()); model.addAttribute("groupId", vo.getGroupId());
@ -270,7 +344,7 @@ public class AuthGrpMgtController {
} }
//처리 //처리
try { try {
xitAuthGrpMngService.modifyProc(vo); service.modifyProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.update"); message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -285,7 +359,7 @@ public class AuthGrpMgtController {
case "delete": //삭제 case "delete": //삭제
//처리 //처리
try { try {
xitAuthGrpMngService.removeProc(vo); service.removeProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
break; break;
@ -301,7 +375,7 @@ public class AuthGrpMgtController {
case "deletes": //다건 삭제 case "deletes": //다건 삭제
//처리 //처리
try { try {
xitAuthGrpMngService.removesProc(groupIds); service.removesProc(groupIds);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) { } catch (RuntimeException e) {

@ -19,6 +19,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
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.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -26,21 +27,27 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus; import org.springframework.web.bind.support.SessionStatus;
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;
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.AuthAuthorMgtService;
import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService; import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
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.mybatis.MybatisUtils;
import kr.xit.framework.support.util.AjaxUtils; import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.util.Checks;
/** /**
* *
@ -57,7 +64,10 @@ import kr.xit.framework.support.util.AjaxUtils;
public class AuthHierarchyMgtController { public class AuthHierarchyMgtController {
@Resource @Resource
private AuthHierarchyMgtService xitAuthHierarchyMngService; private AuthHierarchyMgtService service;
@Resource
private AuthAuthorMgtService authAuthorMgtService;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Autowired @Autowired
@ -79,9 +89,95 @@ public class AuthHierarchyMgtController {
* @author: * @author:
* @date: 2020. 11. 2. * @date: 2020. 11. 2.
*/ */
@RequestMapping(value = "/mngAuthHierarchyMgtForm", method={RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "/mngAuthHierarchyMgtForm")
public void mngAuthHierarchyMgtForm() { public void mngAuthHierarchyMgtForm() {
} }
@RequestMapping(value = "/mngAuthHierarchyMgtPopup")
public ModelAndView mngAuthHierarchyMgtPopup(XitAuthHierarchyMngVO vo){
ModelAndView mav = new ModelAndView();
//최하위 권한의 권한계층 조회
XitAuthHierarchyMngVO authHierarchyMngVO = service.findView(vo);
//권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtService.findAuthAuthors(null);
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 = authHierarchyMngVO.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);
}
mav.addObject("authorList", listAuthorInfo);
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("pageTitle", "권한 계층 설정");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthHierarchyMgtPopup.popup");
return mav;
}
@GetMapping(value = "/findAuthHierarchies")
public ModelAndView findAuthHierarchies(@RequestParam final Map<String,Object> paraMap){
return ResultResponse.of(service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -107,7 +203,7 @@ public class AuthHierarchyMgtController {
/** /**
* *
*/ */
int totCnt = xitAuthHierarchyMngService.findListTotCnt(searchVO); int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt); paginationInfo.setTotalRecordCount(totCnt);
/** /**
* *
@ -118,7 +214,7 @@ public class AuthHierarchyMgtController {
resultMap.put("result", true); //[tui Grid] result resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitAuthHierarchyMngService.findList(searchVO)); //[tui Grid] data-contents data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>(); Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage()); pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt); pagination.put("totalCount", totCnt);
@ -142,7 +238,7 @@ public class AuthHierarchyMgtController {
/** /**
* <pre> : .</pre> * <pre> : .</pre>
* @param page * @param cmd
* @param tilesDef Type(none: tiles ) * @param tilesDef Type(none: tiles )
* @param model * @param model
* @return String * @return String
@ -152,7 +248,7 @@ public class AuthHierarchyMgtController {
@RequestMapping(value = "AuthHierarchyMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "AuthHierarchyMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String AuthHierarchyMng_page(@PathVariable String cmd public String AuthHierarchyMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO //, @ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO
, @ModelAttribute("vo") XitAuthHierarchyMngVO vo , @ModelAttribute("vo") XitAuthHierarchyMngVO vo
, ModelMap model) { , ModelMap model) {
switch (cmd) { switch (cmd) {
@ -161,12 +257,12 @@ public class AuthHierarchyMgtController {
case "edit": //수정 페이지 case "edit": //수정 페이지
// case "view": //상세 페이지 // case "view": //상세 페이지
//최하위 권한의 권한계층 조회 //최하위 권한의 권한계층 조회
XitAuthHierarchyMngVO result = xitAuthHierarchyMngService.findView(vo); XitAuthHierarchyMngVO result = service.findView(vo);
//권한코드 Map 생성 //권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO()); List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO());
Map<String, String> mAuthorInfo = new HashMap<String, String>(); Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) { for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthor_code(), item.getAuthor_nm()); mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
} }
//권한코드 목록에서 비중복 권한만 추출 //권한코드 목록에서 비중복 권한만 추출
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>(); Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
@ -187,8 +283,8 @@ public class AuthHierarchyMgtController {
while(it.hasNext()) { while(it.hasNext()) {
String authorCode = it.next(); String authorCode = it.next();
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO(); XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
authorInfo.setAuthor_code(authorCode); authorInfo.setAuthorCode(authorCode);
authorInfo.setAuthor_nm(mNoDuplAuthorInfo.get(authorCode)); authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
listAuthorInfo.add(authorInfo); listAuthorInfo.add(authorInfo);
} }
@ -213,7 +309,7 @@ public class AuthHierarchyMgtController {
/** /**
* <pre> : .</pre> * <pre> : .</pre>
* @param page * @param cmd
* @param model * @param model
* @return String * @return String
* @author: * @author:
@ -283,7 +379,7 @@ public class AuthHierarchyMgtController {
} }
//처리 //처리
try { try {
xitAuthHierarchyMngService.modifyProc(vo); service.modifyProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.update"); message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -298,7 +394,7 @@ public class AuthHierarchyMgtController {
case "delete": //삭제 case "delete": //삭제
//처리 //처리
try { try {
xitAuthHierarchyMngService.removeProc(vo); service.removeProc(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
break; break;

@ -69,7 +69,7 @@ public class AuthRoleMgtController {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
@RequestMapping(value = "/mngAuthRoleMgtForm", method={RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/mngAuthRoleMgtForm")
public void mngAuthRoleMgtForm() { public void mngAuthRoleMgtForm() {
} }
@ -77,7 +77,7 @@ public class AuthRoleMgtController {
public ModelAndView mngAuthRoleMgtPopup(@ModelAttribute final XitRoleInfoVO vo){ public ModelAndView mngAuthRoleMgtPopup(@ModelAttribute final XitRoleInfoVO vo){
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo)){ if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getRoleCode())){
mav.addObject("roleManage", new XitRoleInfoVO()); mav.addObject("roleManage", new XitRoleInfoVO());
mav.addObject("pageTitle", "롤 등록"); mav.addObject("pageTitle", "롤 등록");
} else { } else {

@ -19,6 +19,8 @@ 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.RequestBody;
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;
@ -27,7 +29,7 @@ import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
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.XitAuthorInfoVO; import kr.xit.framework.biz.cache.util.CacheServiceUtils;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
@ -35,9 +37,13 @@ import kr.xit.framework.biz.mng.auth.service.AuthUserMgtService;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
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.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.constants.MessageKey;
/** /**
* *
@ -54,7 +60,7 @@ import kr.xit.framework.support.util.AjaxUtils;
public class AuthUserMgtController { public class AuthUserMgtController {
@Resource @Resource
private AuthUserMgtService xitAuthUsrMngService; private AuthUserMgtService service;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Autowired @Autowired
@ -69,13 +75,51 @@ public class AuthUserMgtController {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
@GetMapping(value = "/mngAuthUserMgtForm") @RequestMapping(value = "/mngAuthUserMgtForm")
public ModelAndView mngAuthUserMgtForm(@ModelAttribute("authorGroupVO") XitAuthUsrMngSearchVO searchVO) { public ModelAndView mngAuthUserMgtForm() {
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
mav.addObject("authorManageList", xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO())); mav.addObject("authorList", CacheServiceUtils.getComboCodes(null, "AUTHOR"));
return mav; return mav;
} }
@GetMapping(value = "/findAuthUsers")
public ModelAndView findAuthUsers(@RequestParam final Map<String,Object> paraMap) {
return ResultResponse.of(service.findAuthUsers(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(value = "/saveAuthUserList")
public ModelAndView saveAuthUserList(@RequestBody final List<Map<String, Object>> paraList) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.saveAuthUserList(paraList);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(value = "/removeAuthUserList")
public ModelAndView removeAuthUserList(@RequestBody final List<Map<String, Object>> paraList) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeAuthUserList(paraList);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
/** /**
* <pre> : </pre> * <pre> : </pre>
* @return String * @return String
@ -100,7 +144,7 @@ public class AuthUserMgtController {
/** /**
* *
*/ */
int totCnt = xitAuthUsrMngService.findListTotCnt(searchVO); int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt); paginationInfo.setTotalRecordCount(totCnt);
/** /**
* *
@ -111,7 +155,7 @@ public class AuthUserMgtController {
resultMap.put("result", true); //[tui Grid] result resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitAuthUsrMngService.findList(searchVO)); //[tui Grid] data-contents data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>(); Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage()); pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt); pagination.put("totalCount", totCnt);
@ -195,9 +239,9 @@ public class AuthUserMgtController {
searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
list = xitAuthUsrMngService.findListGroup(searchVO); list = service.findListGroup(searchVO);
totCnt = xitAuthUsrMngService.findListGroupTotCnt(searchVO); totCnt = service.findListGroupTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt); paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("groupList", list); model.addAttribute("groupList", list);
@ -265,9 +309,9 @@ public class AuthUserMgtController {
vo.setAuthorCode(strAuthorCodes[i]); vo.setAuthorCode(strAuthorCodes[i]);
vo.setMberTyCode(strMberTyCode[i]); vo.setMberTyCode(strMberTyCode[i]);
if("N".equals(strRegYns[i])) if("N".equals(strRegYns[i]))
xitAuthUsrMngService.addProc(vo); service.addProc(vo);
else else
xitAuthUsrMngService.modifyProc(vo); service.modifyProc(vo);
} }
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.insert"); message = xitMessageSource.getMessage("success.common.insert");
@ -292,7 +336,7 @@ public class AuthUserMgtController {
case "deletes": //다건 삭제 case "deletes": //다건 삭제
//처리 //처리
try { try {
xitAuthUsrMngService.removesProc(userIds, groupIds); service.removesProc(userIds, groupIds);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) { } catch (RuntimeException e) {

@ -32,6 +32,7 @@ public interface UserMgtMapper {
*/ */
List<XitUserInfoVO> selectUsers(final Map<String,Object> paraMap, final RowBounds rowBounds); List<XitUserInfoVO> selectUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitUserInfoVO selectUser(final String uniqId); XitUserInfoVO selectUser(final String uniqId);
@SuppressWarnings("MybatisXMapperMethodInspection")
Map<String,Object> selectCheckUserInfo(final String userId); Map<String,Object> selectCheckUserInfo(final String userId);
int insertUserInfo(final XitUserInfoVO vo); int insertUserInfo(final XitUserInfoVO vo);
int updateUserInfo(final XitUserInfoVO vo); int updateUserInfo(final XitUserInfoVO vo);
@ -42,11 +43,12 @@ public interface UserMgtMapper {
Map<String,Object> selectAuthorGroupInfo(final Map<String,Object> map); //Map<String,Object> selectAuthorGroupInfo(final Map<String,Object> map);
List<XitUserScrtySetupVO> selectUserScrtySetups(final XitUserScrtySetupVO vo);
XitUserScrtySetupVO selectUserScrtySetup(final String scrtySetupTrgetId); XitUserScrtySetupVO selectUserScrtySetup(final String scrtySetupTrgetId);
int insertUserScrtySetup(final XitUserScrtySetupVO vo); int insertUserScrtySetup(final XitUserScrtySetupVO vo);
int updateUserScrtySetup(final XitUserScrtySetupVO vo); int updateUserScrtySetup(final XitUserScrtySetupVO vo);

@ -38,8 +38,6 @@ public interface UserMgtService {
String getDefaultAuthorCode(final String groupId); String getDefaultAuthorCode(final String groupId);
Map<String, Object> findAuthorGroupInfo(final String groupId);
int addUserScrtySetup(final XitUserScrtySetupVO vo); int addUserScrtySetup(final XitUserScrtySetupVO vo);
int addXitUserEtcOption(final XitUserEtcOptionVO vo); int addXitUserEtcOption(final XitUserEtcOptionVO vo);

@ -13,11 +13,13 @@ import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException; import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService; import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.cmm.model.XitUserEtcOptionVO; import kr.xit.framework.biz.cmm.model.XitUserEtcOptionVO;
import kr.xit.framework.biz.cmm.model.XitUserInfoVO; import kr.xit.framework.biz.cmm.model.XitUserInfoVO;
import kr.xit.framework.biz.cmm.model.XitUserScrtySetupVO; import kr.xit.framework.biz.cmm.model.XitUserScrtySetupVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.cmm.model.XitLoginVO; import kr.xit.framework.biz.cmm.model.XitLoginVO;
import kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper;
import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper; import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper;
import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO; import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO;
import kr.xit.framework.biz.mng.user.service.UserMgtService; import kr.xit.framework.biz.mng.user.service.UserMgtService;
@ -33,6 +35,8 @@ public class UserMgtServiceImpl implements UserMgtService {
@Resource @Resource
private UserMgtMapper mapper; private UserMgtMapper mapper;
@Resource @Resource
private AuthGrpMgtMapper authGrpMgtMapper;
@Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Resource @Resource
private XitMessageSource xitMessageSource; private XitMessageSource xitMessageSource;
@ -165,26 +169,18 @@ public class UserMgtServiceImpl implements UserMgtService {
public String getDefaultAuthorCode(final String groupId) { public String getDefaultAuthorCode(final String groupId) {
if(Checks.isEmpty(groupId)) return "ROLE_USER"; if(Checks.isEmpty(groupId)) return "ROLE_USER";
Map<String,Object> authMap = findAuthorGroupInfo(groupId); XitAuthorGroupInfoVO vo = authGrpMgtMapper.selectAuthorGroupInfo(groupId);
// 권한 설정 // 권한 설정
if (Checks.isEmpty(authMap)) if (Checks.isEmpty(vo))
return "ROLE_USER"; return "ROLE_USER";
else { else {
if (Checks.isEmpty(authMap.get("author_code"))) if (Checks.isEmpty(vo.getAuthorCode()))
return "ROLE_USER"; return "ROLE_USER";
else else
return String.valueOf(authMap.get("author_code")); return vo.getAuthorCode();
} }
} }
@Override
public Map<String, Object> findAuthorGroupInfo(final String groupId) {
if(Checks.isEmpty(groupId)) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "그룹ID(은)는 필수조건 입니다");
Map<String,Object> map = new HashMap<>();
map.put("groupId", groupId);
return mapper.selectAuthorGroupInfo(map);
}
@Override @Override
public int addUserScrtySetup(final XitUserScrtySetupVO vo) { public int addUserScrtySetup(final XitUserScrtySetupVO vo) {

@ -19,6 +19,7 @@ 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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;
@ -117,7 +118,7 @@ public class UserMgtController {
@PostMapping(value = "/modifyUser") @PostMapping(value = "/modifyUser")
public ModelAndView modifyUser(@ModelAttribute final XitUserInfoVO vo, final BindingResult bindingResult){ public ModelAndView modifyUser(@RequestBody final XitUserInfoVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("userInfoVO", vo, bindingResult); ValidationError.of("userInfoVO", vo, bindingResult);

@ -2,11 +2,13 @@ package kr.xit.framework.support.exception.resolver;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.PrintStream; import java.io.PrintStream;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -36,11 +38,24 @@ public class AjaxExceptionViewResolver extends AbstractExceptionViewResolver {
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream pinrtStream = new PrintStream(out); PrintStream pinrtStream = new PrintStream(out);
exception.printStackTrace(pinrtStream);
String stackTraceString = "";
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
Map<String,Object> tempMap = AjaxMessageMapRenderer.error(errorCode, errorArguments); Map<String,Object> tempMap = AjaxMessageMapRenderer.error(errorCode, errorArguments);
String stackTraceString = "";
tempMap.put("result", false); tempMap.put("result", false);
exception.printStackTrace(pinrtStream);
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
// Duplicate exception
if(exception instanceof SQLIntegrityConstraintViolationException
|| exception instanceof DataIntegrityViolationException){
tempMap.put("message", "요청 처리에 실패하였습니다[이미 등록된 데이타 요청]");
}else{
if(Globals.IS_SP_ALERT_MSG){
exception.printStackTrace(pinrtStream);
stackTraceString = out.toString();
}
}
if(Globals.IS_SP_ALERT_MSG) tempMap.put("message", tempMap.get("message")+"\n"+stackTraceString); if(Globals.IS_SP_ALERT_MSG) tempMap.put("message", tempMap.get("message")+"\n"+stackTraceString);
else tempMap.put("message", tempMap.get("message")); else tempMap.put("message", tempMap.get("message"));
return new ModelAndView(getView(), tempMap); return new ModelAndView(getView(), tempMap);

@ -2,11 +2,13 @@ package kr.xit.framework.support.exception.resolver;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.PrintStream; import java.io.PrintStream;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.support.util.AjaxMessageMapRenderer; import kr.xit.framework.support.util.AjaxMessageMapRenderer;
@ -26,19 +28,33 @@ public class NormalExceptionViewResolver extends AbstractExceptionViewResolver {
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream pinrtStream = new PrintStream(out); PrintStream pinrtStream = new PrintStream(out);
exception.printStackTrace(pinrtStream);
String stackTraceString = ""; String stackTraceString = "";
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
Map<String,Object> tempMap = AjaxMessageMapRenderer.error(errorCode, errorArguments); Map<String,Object> tempMap = AjaxMessageMapRenderer.error(errorCode, errorArguments);
tempMap.put("result", false);
exception.printStackTrace(pinrtStream);
if(Globals.IS_SP_ALERT_MSG) stackTraceString = out.toString();
// Duplicate exception
if(exception instanceof SQLIntegrityConstraintViolationException
|| exception instanceof DataIntegrityViolationException){
tempMap.put("message", "요청 처리에 실패하였습니다[이미 등록된 데이타 요청]");
}else{
if(Globals.IS_SP_ALERT_MSG){
exception.printStackTrace(pinrtStream);
stackTraceString = out.toString();
}
}
if(Globals.IS_SP_ALERT_MSG) tempMap.put("message", tempMap.get("message")+"\n"+stackTraceString); if(Globals.IS_SP_ALERT_MSG) tempMap.put("message", tempMap.get("message")+"\n"+stackTraceString);
else tempMap.put("message", tempMap.get("message")); else tempMap.put("message", tempMap.get("message"));
mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, tempMap); mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, tempMap);
// mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, AjaxMessageMapRenderer.error(errorCode, errorArguments)); // mav.addObject(Globals.JSON_ERROR_ROOT_ELEMENT_VALUE, AjaxMessageMapRenderer.error(errorCode, errorArguments));
Map<String, Object> errorMessage = AjaxMessageMapRenderer.error(errorCode, errorArguments);
logger.error(new StringBuffer().append("error_code : {}\n").append("error_message : {}").toString(),
new Object[]{ errorCode, errorMessage}); logger.error("error_code : {}\n" + "error_message : {}",
new Object[]{ errorCode, tempMap});
return mav; return mav;
} }

@ -41,6 +41,7 @@ public class CodeSelectBoxTag extends TagSupport {
private String alt = ""; private String alt = "";
private String onchange = ""; private String onchange = "";
private boolean disabled = false; private boolean disabled = false;
private boolean display = true;
// 공통코드가 아닌경우 구분 코드 // 공통코드가 아닌경우 구분 코드
private String type = ""; private String type = "";
@ -58,6 +59,10 @@ public class CodeSelectBoxTag extends TagSupport {
if(this.disabled){ if(this.disabled){
sb.append(" disabled "); sb.append(" disabled ");
} }
if(!this.display){
sb.append(" style='display:none'");
}
//sb.append(" display='").append(this.display).append("'>").append("\n");
sb.append(" alt='").append(this.alt).append("'>").append("\n"); sb.append(" alt='").append(this.alt).append("'>").append("\n");
//out.print("<select id='"+this.id+"' name='"+(this.name == null ? this.id : this.name)+"' class='"+this.cls+"' onchange='"+this.onchange+"' alt='"+this.alt+"'>"); //out.print("<select id='"+this.id+"' name='"+(this.name == null ? this.id : this.name)+"' class='"+this.cls+"' onchange='"+this.onchange+"' alt='"+this.alt+"'>");

@ -127,7 +127,7 @@ fail.common.loginIncorrect = [{0}] \uD68C \uC774\uC0C1 \uB85C\uADF8\uC778 \uC811
fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558) fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558)
fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.request.msg = \uC694\uCCAD\uCC98\uB9AC\uB97C \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4. fail.request.msg = \uC694\uCCAD \uCC98\uB9AC\uC5D0 \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4.
fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4. fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
#UI User Message# #UI User Message#

@ -127,7 +127,7 @@ fail.common.loginIncorrect = [{0}] \uD68C \uC774\uC0C1 \uB85C\uADF8\uC778 \uC811
fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558) fail.common.login.password = \uD328\uC2A4\uC6CC\uB4DC \uC790\uB9AC \uC218\uAC00 \uC77C\uCE58 \uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.(8\uC790\uB9AC \uC774\uC0C1 20\uC790\uB9AC \uC774\uD558)
fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.idsearch = \uC544\uC774\uB514\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. fail.common.pwsearch = \uBE44\uBC00\uBC88\uD638\uB97C \uCC3E\uC744\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
fail.request.msg = \uC694\uCCAD\uCC98\uB9AC\uB97C \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4. fail.request.msg = \uC694\uCCAD \uCC98\uB9AC\uC5D0 \uC2E4\uD328\uD558\uC600\uC2B5\uB2C8\uB2E4.
fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4. fail.common.login.ip = \uB4F1\uB85D\uB41C IP\uAC00 \uC544\uB2C8\uBBC0\uB85C \uB85C\uADF8\uC778\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
#UI User Message# #UI User Message#

@ -19,7 +19,7 @@
</select> </select>
<select id="selectComboCodes" parameterType="map" resultType="caseMap"> <select id="selectComboCodes" parameterType="map" resultType="caseMap">
/* cachecode-mysql-mapper|selectComboCodes-공통코드 코드그룹 콤보코드 조회|julim */ /* cachecode-mysql-mapper|selectComboCodes-공통[업무] 콤보코드 조회|julim */
<choose> <choose>
@ -37,8 +37,23 @@
FROM xit_author_group_info FROM xit_author_group_info
</when> </when>
<!-- 공통 코드 --> <when test='type != null and type == "AUTHOR"'>
/* 권한 코드 */
SELECT author_code AS code
, author_nm AS code_nm
FROM xit_author_info
</when>
<when test='type != null and type == "AUTHOR_GRP"'>
/* 권한 그룹 코드 */
SELECT group_id AS code
, group_nm AS code_nm
FROM xit_author_group_info
</when>
<otherwise> <otherwise>
/* 공통 코드 */
SELECT code SELECT code
, code_nm , code_nm
FROM xit_cmmn_detail_code FROM xit_cmmn_detail_code

@ -82,7 +82,9 @@
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE = #{author_creat_de}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE =
#{authorCreatDe
</if>
</select> </select>
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO"> <select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfo */ /** findXitAuthorInfo */
@ -93,7 +95,7 @@
,AUTHOR_CREAT_DE ,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO FROM XIT_AUTHOR_INFO
WHERE 1=1 WHERE 1=1
AND AUTHOR_CODE = #{author_code} AND AUTHOR_CODE = #{authorCode
</select> </select>
<insert id="addXitAuthorInfo"> <insert id="addXitAuthorInfo">
/** addXitAuthorInfo */ /** addXitAuthorInfo */
@ -116,17 +118,17 @@
UPDATE XIT_AUTHOR_INFO UPDATE XIT_AUTHOR_INFO
SET SET
AUTHOR_CREAT_DE = AUTHOR_CREAT_DE AUTHOR_CREAT_DE = AUTHOR_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{author_nm}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{authorNm</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{author_dc}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{authorDc</if>
WHERE 1=1 WHERE 1=1
AND AUTHOR_CODE = #{author_code} AND AUTHOR_CODE = #{authorCode
</update> </update>
<delete id="removeXitAuthorInfo"> <delete id="removeXitAuthorInfo">
/** removeXitAuthorInfo */ /** removeXitAuthorInfo */
/** 권한정보 삭제 */ /** 권한정보 삭제 */
DELETE FROM XIT_AUTHOR_INFO DELETE FROM XIT_AUTHOR_INFO
WHERE 1=1 WHERE 1=1
AND AUTHOR_CODE = #{author_code} AND AUTHOR_CODE = #{authorCode
</delete> </delete>
@ -2008,8 +2010,8 @@
,CHLDRN_ROLE ,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parnts_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parntsRole</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrnRole</if>
</select> </select>
<select id="findXitRoleSclsrtRescue" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO"> <select id="findXitRoleSclsrtRescue" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/** findXitRoleSclsrtRescue */ /** findXitRoleSclsrtRescue */
@ -2018,8 +2020,8 @@
,CHLDRN_ROLE ,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
AND PARNTS_ROLE = #{parnts_role} AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrn_role} AND CHLDRN_ROLE = #{chldrnRole
</select> </select>
<insert id="addXitRoleSclsrtRescue"> <insert id="addXitRoleSclsrtRescue">
/** addXitRoleSclsrtRescue */ /** addXitRoleSclsrtRescue */
@ -2046,16 +2048,16 @@
/** 역할계층구조 삭제 */ /** 역할계층구조 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
AND PARNTS_ROLE = #{parnts_role} AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrn_role} AND CHLDRN_ROLE = #{chldrnRole
</delete> </delete>
<delete id="removesXitRoleSclsrtRescue"> <delete id="removesXitRoleSclsrtRescue">
/** removesXitRoleSclsrtRescue */ /** removesXitRoleSclsrtRescue */
/** 역할계층구조 다건 삭제 */ /** 역할계층구조 다건 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parnts_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parntsRole</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrnRole</if>
</delete> </delete>

@ -82,7 +82,9 @@
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE = #{author_creat_de}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE =
#{authorCreatDe
</if>
</select> </select>
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO"> <select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfo */ /** findXitAuthorInfo */
@ -93,7 +95,7 @@
,AUTHOR_CREAT_DE ,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO FROM XIT_AUTHOR_INFO
WHERE 1=1 WHERE 1=1
AND AUTHOR_CODE = #{author_code} AND AUTHOR_CODE = #{authorCode
</select> </select>
<insert id="addXitAuthorInfo"> <insert id="addXitAuthorInfo">
/** addXitAuthorInfo */ /** addXitAuthorInfo */
@ -116,17 +118,17 @@
UPDATE XIT_AUTHOR_INFO UPDATE XIT_AUTHOR_INFO
SET SET
AUTHOR_CREAT_DE = AUTHOR_CREAT_DE AUTHOR_CREAT_DE = AUTHOR_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{author_nm}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{authorNm</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{author_dc}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{authorDc</if>
WHERE 1=1 WHERE 1=1
AND AUTHOR_CODE = #{author_code} AND AUTHOR_CODE = #{authorCode
</update> </update>
<delete id="removeXitAuthorInfo"> <delete id="removeXitAuthorInfo">
/** removeXitAuthorInfo */ /** removeXitAuthorInfo */
/** 권한정보 삭제 */ /** 권한정보 삭제 */
DELETE FROM XIT_AUTHOR_INFO DELETE FROM XIT_AUTHOR_INFO
WHERE 1=1 WHERE 1=1
AND AUTHOR_CODE = #{author_code} AND AUTHOR_CODE = #{authorCode
</delete> </delete>
@ -2008,8 +2010,8 @@
,CHLDRN_ROLE ,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parnts_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parntsRole</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrnRole</if>
</select> </select>
<select id="findXitRoleSclsrtRescue" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO"> <select id="findXitRoleSclsrtRescue" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/** findXitRoleSclsrtRescue */ /** findXitRoleSclsrtRescue */
@ -2018,8 +2020,8 @@
,CHLDRN_ROLE ,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
AND PARNTS_ROLE = #{parnts_role} AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrn_role} AND CHLDRN_ROLE = #{chldrnRole
</select> </select>
<insert id="addXitRoleSclsrtRescue"> <insert id="addXitRoleSclsrtRescue">
/** addXitRoleSclsrtRescue */ /** addXitRoleSclsrtRescue */
@ -2046,16 +2048,16 @@
/** 역할계층구조 삭제 */ /** 역할계층구조 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
AND PARNTS_ROLE = #{parnts_role} AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrn_role} AND CHLDRN_ROLE = #{chldrnRole
</delete> </delete>
<delete id="removesXitRoleSclsrtRescue"> <delete id="removesXitRoleSclsrtRescue">
/** removesXitRoleSclsrtRescue */ /** removesXitRoleSclsrtRescue */
/** 역할계층구조 다건 삭제 */ /** 역할계층구조 다건 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1 WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parnts_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parnts_role)">AND PARNTS_ROLE = #{parntsRole</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_role}</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrn_role)">AND CHLDRN_ROLE = #{chldrnRole</if>
</delete> </delete>

@ -1,139 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper">
<!-- SQL 페이징 코드 -->
<sql id="pageBefore">
SELECT * FROM
(SELECT LIST.*, ROWNUM AS "RN" FROM(
</sql>
<sql id="pageAfter">
) LIST
) WHERE RN BETWEEN #{firstIndex} + 1 AND #{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 '%'||#{searchKeyword}||'%'
</if>
</sql>
<select id="findList" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO">
/** XitAuthRegMngMapper.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">
/** XitAuthRegMngMapper.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.XitAuthRegMngVO">
/** XitAuthRegMngMapper.findView */
/** 권한관리 상세정보 조회 */
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE A.AUTHOR_CODE=#{authorCode}
</select>
<select id="findListAuthorRole" resultType="java.util.Map">
/** XitAuthRegMngMapper.findListAuthorRole */
/** 권한롤관리 목록 조회 */
<if test="searchGubun == 'list'">
<include refid="pageBefore"/>
</if>
<include refid="findListAuthorRole_SELECT"/>
<include refid="findListAuthorRole_FROM"/>
WHERE 1 = 1
<include refid="findListAuthorRole_WHERE"/>
ORDER BY A.ROLE_CODE
<if test="searchGubun == 'list'">
<include refid="pageAfter"/>
</if>
</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>

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper">
<!-- *************************************************************************************************************
* xit_author_info : 권한 정보
************************************************************************************************************** -->
<select id="selectAuthorInfos" parameterType="map" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
SELECT author_code
, author_nm
, author_dc
, author_creat_de
FROM xit_author_info
<where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(authorCode)">
AND author_code = #{authorCode}
</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(authorNm)">
AND INSTR(author_nm, #{authorNm}) > 0
</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(authorDc)">
AND INSTR(author_dc, #{authorDc}) > 0
</if>
</where>
ORDER BY author_creat_de DESC
</select>
<select id="selectAuthorInfo" parameterType="string" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfo-권한 정보 조회|julim */
SELECT author_code
, author_nm
, author_dc
, author_creat_de
FROM xit_author_info
WHERE author_code = #{authorCode}
</select>
<insert id="insertAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|insertAuthorInfo-권한 정보 등록|julim */
INSERT INTO xit_author_info (
author_code
, author_nm
, author_dc
, author_creat_de
) VALUES (
#{authorCode}
,#{authorNm}
,#{authorDc}
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="updateAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
UPDATE xit_author_info
SET author_nm = IF(author_nm = #{authorNm}, author_nm, #{authorNm})
, author_dc = IF(author_dc = #{authorDc}, author_dc, #{authorDc})
WHERE author_code = #{authorCode}
</update>
<delete id="deleteAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
DELETE
FROM xit_author_info
WHERE author_code = #{authorCode}
</delete>
<select id="selectAuthRoleGrantList" resultType="kr.xit.framework.biz.cmm.model.XitRoleInfoVO">
/* auth-author-mysql-mapper|selectAuthRoleGrantList- 권한별 롤 조회|julim */
SELECT xri.role_code
, xri.role_nm
, xri.role_pttrn
, xri.role_dc
, xri.role_ty
, xri.role_sort
, DATE_FORMAT(arr.creat_dt, '%Y%m%d%H%i%s') AS creatDt
, IF(arr.role_code IS NULL, 'N', 'Y') AS "regYn"
FROM xit_role_info xri
LEFT OUTER JOIN ( SELECT author_code
, role_code
, creat_dt
FROM xit_author_role_relate
WHERE author_code = #{authorCode}
) arr
ON xri.role_code = arr.role_code
ORDER BY arr.role_code DESC, xri.role_sort
</select>
<delete id="deleteRoleGrant" parameterType="map">
/* auth-author-mysql-mapper|deleteRoleGrant-권한 롤 삭제|julim */
DELETE
FROM xit_author_role_relate
WHERE author_code = #{authorCode}
AND role_code = #{roleCode}
</delete>
<delete id="saveRoleGrant" parameterType="map">
/* auth-author-mysql-mapper|saveRoleGrant-권한 롤 등록|julim */
INSERT INTO xit_author_role_relate (
author_code
, role_code
, creat_dt
) VALUES (
#{authorCode}
, #{roleCode}
, NOW()
)
ON DUPLICATE KEY UPDATE
creat_dt = NOW()
</delete>
<!-- *************************************************************************************************************
* xit_role_sclsrt_rescue : 역할 계층 정보
************************************************************************************************************** -->
<select id="selectRoleSclsrtRescues" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|selectRoleSclsrtRescues-역할계층 조회|julim */
SELECT parnts_role
, chldrn_role
FROM xit_role_sclsrt_rescue
<where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">
AND parnts_role = #{parntsRole}
</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">
AND chldrn_role = #{chldrnRole}
</if>
</where>
</select>
<select id="selectRoleSclsrtRescue" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|selectRoleSclsrtRescue-역할계층 정보 조회|julim */
SELECT parnts_role
, chldrn_role
FROM xit_role_sclsrt_rescue
WHERE parnts_role = #{parntsRole}
AND chldrn_role = #{chldrnRole}
</select>
<insert id="insertRoleSclsrtRescue" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|insertRoleSclsrtRescue-역할계층 정보 등록|julim */
INSERT
INTO xit_role_sclsrt_rescue(
parnts_role
, chldrn_role
)VALUES(
#{parntsRole}
, #{chldrnRole}
)
</insert>
<delete id="deleteRoleSclsrtRescue" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|deleteRoleSclsrtRescue-역할계층 삭제 조회|julim */
DELETE
FROM xit_role_sclsrt_rescue
<where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">
AND parnts_role = #{parntsRole}
</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">
AND chldrn_role = #{chldrnRole}
</if>
</where>
</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>

@ -3,71 +3,68 @@
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper"> <mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper">
<!-- ************************************************************************************************************* <!-- *************************************************************************************************************
* xit_user_info : 업무사용자 정보 * xit_author_group_info : 권한그룹 정보
************************************************************************************************************** --> ************************************************************************************************************** -->
<select id="findXitAuthorGroupInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO"> <select id="selectAuthorGroupInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfos */ /* auth-grp-mysql-mapper|selectAuthorGroupInfos-권한그룹 목록 조회|julim */
/** 권한그룹정보 다건 조회 */ SELECT agi.group_id
SELECT GROUP_ID , agi.group_nm
,GROUP_NM , agi.group_dc
,GROUP_CREAT_DE , agi.author_code
,GROUP_DC , xai.author_nm
,AUTHOR_CODE , agi.group_creat_de
FROM XIT_AUTHOR_GROUP_INFO FROM xit_author_group_info agi
WHERE 1=1 LEFT OUTER JOIN xit_author_info xai
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_id )">AND GROUP_ID = #{group_id }</if> ON agi.author_code = xai.author_code
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">AND GROUP_NM = #{group_nm }</if> <where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_creat_de)">AND GROUP_CREAT_DE = #{group_creat_de }</if> <if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">AND GROUP_DC = #{group_dc }</if> AND agi.group_nm = #{groupNm}
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if> </if>
</where>
</select> </select>
<select id="findXitAuthorGroupInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfo */ <select id="selectAuthorGroupInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** 권한그룹정보 조회 */ /* auth-grp-mysql-mapper|selectAuthorGroupInfo-권한그룹 정보 조회|julim */
SELECT GROUP_ID SELECT group_id
,GROUP_NM , group_nm
,GROUP_CREAT_DE , group_dc
,GROUP_DC , author_code
,AUTHOR_CODE , group_creat_de
FROM XIT_AUTHOR_GROUP_INFO FROM xit_author_group_info
WHERE 1=1 WHERE group_id = #{groupId}
AND GROUP_ID = #{group_id}
</select> </select>
<insert id="addXitAuthorGroupInfo">
/** addXitAuthorGroupInfo */ <insert id="insertAuthorGroupInfo">
/** 권한그룹정보 등록 */ /* auth-grp-mysql-mapper|insertAuthorGroupInfo-권한그룹 등록|julim */
INSERT INTO XIT_AUTHOR_GROUP_INFO( INSERT INTO xit_author_group_info(
GROUP_ID group_id
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">,GROUP_NM</if> , group_nm
,GROUP_CREAT_DE , group_dc
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">,GROUP_DC</if> , author_code
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code)">,AUTHOR_CODE</if> , group_creat_de
)VALUES( )VALUES(
#{group_id } #{groupId}
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">,#{group_nm }</if> , #{groupNm}
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s') , #{groupDc}
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">,#{group_dc }</if> , #{authorCode}
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code)">,#{author_code }</if> , DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
) )
</insert> </insert>
<update id="modifyXitAuthorGroupInfo">
/** modifyXitAuthorGroupInfo */ <update id="updateAuthorGroupInfo">
/** 권한그룹정보 수정 */ /* auth-grp-mysql-mapper|updateAuthorGroupInfo-권한그룹 정보 변경|julim */
UPDATE XIT_AUTHOR_GROUP_INFO UPDATE xit_author_group_info
SET SET group_nm = IF(group_nm = #{groupNm}, group_nm, #{groupNm})
GROUP_CREAT_DE = GROUP_CREAT_DE , group_dc = IF(group_dc = #{groupDc}, group_dc, #{groupDc})
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_nm )">,GROUP_NM = #{group_nm }</if> , author_code = IF(author_code = #{authorCode}, author_code, #{authorCode})
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_dc )">,GROUP_DC = #{group_dc }</if> WHERE group_id = #{groupId}
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_code)">,AUTHOR_CODE = #{author_code}</if>
WHERE 1=1
AND GROUP_ID = #{group_id}
</update> </update>
<delete id="removeXitAuthorGroupInfo">
/** removeXitAuthorGroupInfo */ <delete id="deleteAuthorGroupInfo">
/** 권한그룹정보 삭제 */ /* auth-grp-mysql-mapper|deleteAuthorGroupInfo-권한그룹 삭제|julim */
DELETE FROM XIT_AUTHOR_GROUP_INFO DELETE
WHERE 1=1 FROM xit_author_group_info
AND GROUP_ID = #{group_id} WHERE group_id = #{groupId}
</delete> </delete>
@ -77,6 +74,17 @@
<!-- SQL 페이징 코드 --> <!-- SQL 페이징 코드 -->
<sql id="pageBefore"> <sql id="pageBefore">
SELECT LIST.* FROM( SELECT LIST.* FROM(

@ -5,6 +5,19 @@
<!-- ************************************************************************************************************* <!-- *************************************************************************************************************
* xit_user_info : 업무사용자 정보 * xit_user_info : 업무사용자 정보
************************************************************************************************************** --> ************************************************************************************************************** -->
<select id="selectAuthHierarchies" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO">
SELECT author_code
, author_nm
, author_dc
, author_creat_de
FROM xit_author_info
<where>
AND author_nm LIKE CONCAT('%',#{searchKeyword},'%')
</where>
</select>
<!-- SQL 페이징 코드 --> <!-- SQL 페이징 코드 -->
<sql id="pageBefore"> <sql id="pageBefore">
@ -74,8 +87,4 @@
</mapper> </mapper>

@ -1,207 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper">
<!-- *************************************************************************************************************
* xit_user_info : 업무사용자 정보
************************************************************************************************************** -->
<select id="findXitAuthorInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfos */
/** 권한정보 다건 조회 */
SELECT AUTHOR_CODE
,AUTHOR_NM
,AUTHOR_DC
,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE = #{author_creat_de}</if>
</select>
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfo */
/** 권한정보 조회 */
SELECT AUTHOR_CODE
,AUTHOR_NM
,AUTHOR_DC
,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
</select>
<insert id="addXitAuthorInfo">
/** addXitAuthorInfo */
/** 권한정보 등록 */
INSERT INTO XIT_AUTHOR_INFO(
AUTHOR_CODE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm)">,AUTHOR_NM</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc)">,AUTHOR_DC</if>
,AUTHOR_CREAT_DE
)VALUES(
#{author_code }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm)">,#{author_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc)">,#{author_dc }</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="modifyXitAuthorInfo">
/** modifyXitAuthorInfo */
/** 권한정보 수정 */
UPDATE XIT_AUTHOR_INFO
SET
AUTHOR_CREAT_DE = AUTHOR_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{author_nm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{author_dc}</if>
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
</update>
<delete id="removeXitAuthorInfo">
/** removeXitAuthorInfo */
/** 권한정보 삭제 */
DELETE FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
</delete>
<!-- 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.XitAuthRegMngVO">
/** XitAuthRegMngMapper.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">
/** XitAuthRegMngMapper.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.XitAuthRegMngVO">
/** XitAuthRegMngMapper.findView */
/** 권한관리 상세정보 조회 */
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE A.AUTHOR_CODE=#{authorCode}
</select>
<select id="findListAuthorRole" resultType="java.util.Map">
/** XitAuthRegMngMapper.findListAuthorRole */
/** 권한롤관리 목록 조회 */
<if test="searchGubun == 'list'">
<include refid="pageBefore"/>
</if>
<include refid="findListAuthorRole_SELECT"/>
<include refid="findListAuthorRole_FROM"/>
WHERE 1 = 1
<include refid="findListAuthorRole_WHERE"/>
ORDER BY A.ROLE_CODE
<if test="searchGubun == 'list'">
<include refid="pageAfter"/>
</if>
</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>

@ -2,148 +2,62 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthUserMgtMapper"> <mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthUserMgtMapper">
<!-- ************************************************************************************************************* <!-- ***** ********************************************************************************************************
* xit_user_info : 업무사용자 정보 * xit_user _info : 업무사용자 정보
************************************************************************************************************** --> ********** **************************************************************************************************** -->
<sql id ="sqlAuthUser">
<!-- SQL 페이징 코드 --> SELECT xui.user_id
<sql id="pageBefore"> , xui.user_nm
SELECT LIST.* FROM( , xui.group_id
</sql> , uss.mber_ty_code
, cdc.code_nm AS mberTyNm
<sql id="pageAfter"> , uss.author_code
) LIST LIMIT #{firstIndex}, #{recordCountPerPage} , IF(uss.scrty_setup_trget_id IS NULL, 'N', 'Y') AS regYn
</sql> , esntl_id AS uniqId
<sql id="findList_SELECT">
SELECT A.USER_ID AS "userId"
,A.USER_NM AS "userNm"
,A.GROUP_ID AS "groupId"
,B.MBER_TY_CODE AS "mberTyCode"
,(SELECT CODE_NM
FROM XIT_CMMN_DETAIL_CODE
WHERE CODE_ID = 'XIT012'
AND CODE = B.MBER_TY_CODE
AND USE_AT = 'Y') AS "mberTyNm"
,B.AUTHOR_CODE AS "authorCode"
,CASE WHEN B.SCRTY_SETUP_TRGET_ID IS NULL THEN 'N'
ELSE 'Y'
END AS "regYn"
,ESNTL_ID AS "uniqId"
</sql>
<sql id="findList_FROM">
FROM ( FROM (
SELECT MBER_ID USER_ID, MBER_NM USER_NM, GROUP_ID, ESNTL_ID SELECT mber_id USER_ID
FROM XIT_GNRL_MBER , mber_nm USER_NM
UNION ALL , group_id
SELECT ENTRPRS_MBER_ID USER_ID, CMPNY_NM USER_NM, GROUP_ID, ESNTL_ID , esntl_id
FROM XIT_ENTRPRS_MBER FROM xit_gnrl_mber
UNION ALL UNION ALL
SELECT USER_ID, USER_NM USER_NM, GROUP_ID, ESNTL_ID SELECT entrprs_mber_id user_id
FROM XIT_USER_INFO ) A , cmpny_nm user_nm
LEFT OUTER JOIN XIT_USER_SCRTY_SETUP B ON A.ESNTL_ID = B.SCRTY_SETUP_TRGET_ID , group_id
</sql> , esntl_id
<sql id="findList_WHERE"> FROM xit_entrprs_mber
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(searchKeyword)"> UNION ALL
<if test="'1'.toString() == searchCondition"> SELECT user_id
AND A.USER_ID LIKE CONCAT('%',#{searchKeyword},'%') , user_nm user_nm
</if> , group_id
<if test="'2'.toString() == searchCondition"> , esntl_id
AND A.USER_NM LIKE CONCAT('%',#{searchKeyword},'%') FROM xit_user_info ) xui
</if> LEFT OUTER JOIN xit_user_scrty_setup uss
<if test="'3'.toString() == searchCondition"> ON xui.esntl_id = uss.scrty_setup_trget_id
AND A.GROUP_ID = #{searchKeyword} LEFT OUTER JOIN xit_cmmn_detail_code cdc
</if> ON cdc.code_id = 'XIT012'
</if> AND uss.mber_ty_code = cdc.code
</sql> <where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(searchKeyword)">
<if test="'userId' == searchCondition">
AND INSTR(xui.user_id, #{searchKeyword}) > 0
<select id="findList" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO"> </if>
/** XitAuthUsrMngMapper.findList */ <if test="'userNm' == searchCondition">
/** 사용자별권한관리 목록 조회 */ AND INSTR(xui.user_nm, #{searchKeyword}) > 0
<if test="searchGubun == 'list'"> </if>
<include refid="pageBefore" /> <if test="'groupId' == searchCondition">
</if> AND xui.group_id = #{searchKeyword}
</if>
<include refid="findList_SELECT"/> </if>
<include refid="findList_FROM"/> </where>
WHERE 1=1 </sql>
<include refid="findList_WHERE"/>
<select id ="selectAuthUsers" parameterType="map" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO">
<if test="searchGubun == 'list'"> /* auth-user-mysql-mapper|selectAuthUsers-사용자별권한관리 목록 조회|julim */
<include refid="pageAfter" /> <include refid="sqlAuthUser"/>
</if>
</select> </select>
<select id ="selectAuthUser" parameterType="map" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO">
/* auth-user-mysql-mapper|selectAuthUser-사용자별권한관리 정보 조회|julim */
<include refid="sqlAuthUser"/>
<select id="findListTotCnt" resultType="int">
/** XitAuthUsrMngMapper.findListTotCnt */
/** 사용자별권한관리 목록 총건수 조회 */
SELECT COUNT(1) AS "CNT"
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
</select> </select>
<select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO">
/** XitAuthUsrMngMapper.findView */
/** 사용자별권한관리 상세정보 조회 */
<include refid="findList_SELECT"/>
<include refid="findList_FROM"/>
WHERE A.ESNTL_ID = #{uniqId}
</select>
<select id="findListGroup" resultType="java.util.Map">
/** XitAuthUsrMngMapper.findListGroup */
/** 그룹 목록 조회 */
<if test="searchGubun == 'list'">
<include refid="pageBefore"/>
</if>
<include refid="findListGroup_SELECT"/>
<include refid="findListGroup_FROM"/>
WHERE 1 = 1
<include refid="findListGroup_WHERE"/>
<if test="searchGubun == 'list'">
<include refid="pageAfter"/>
</if>
</select>
<select id="findListGroupTotCnt" resultType="int">
/** XitAuthUsrMngMapper.findListGroupTotCnt */
/** 그룹 목록 조회 총 건수 */
SELECT COUNT(1) AS "CNT"
<include refid="findListGroup_FROM"/>
WHERE 1 = 1
<include refid="findListGroup_WHERE"/>
</select>
<sql id="findListGroup_SELECT">
SELECT A.GROUP_ID AS "groupId"
,A.GROUP_NM AS "groupNm"
,A.GROUP_DC AS "groupDc"
,A.GROUP_CREAT_DE AS "groupCreatDe"
</sql>
<sql id="findListGroup_FROM">
FROM XIT_AUTHOR_GROUP_INFO A
</sql>
<sql id="findListGroup_WHERE">
<if test="'1'.toString() == searchCondition">
AND A.GROUP_NM LIKE CONCAT('%',#{searchKeyword},'%')
</if>
</sql>
</mapper> </mapper>

@ -205,13 +205,14 @@
<!-- ************************************************************************************************************* <!-- *************************************************************************************************************
* xit_entrprs_mber : 기업사용자 정보 * xit_entrprs_mber : 기업사용자 정보
************************************************************************************************************** --> ************************************************************************************************************** -->
<delete id="delectEntrprsMber" parameterType="string"> <delete id="deleteEntrprsMber" parameterType="string">
/* user-mysql-mapper|delectEntrprsMber-기업사용자정보 삭제|julim */ /* user-mysql-mapper|delectEntrprsMber-기업사용자정보 삭제|julim */
DELETE DELETE
FROM xit_entrprs_mber FROM xit_entrprs_mber
WHERE entrprs_mber_id = #{userId} WHERE entrprs_mber_id = #{userId}
</delete> </delete>
<!-- ************************************************************************************************************* <!-- *************************************************************************************************************
* xit_author_group_info : 권한그룹 정보 * xit_author_group_info : 권한그룹 정보
************************************************************************************************************** --> ************************************************************************************************************** -->
@ -467,116 +468,5 @@
<select id="findXitUserInfoChangeDtlss" resultType="kr.xit.framework.biz.cmm.model.XitUserInfoChangeDtlsVO">
/** findXitUserInfoChangeDtlss */
/** 사용자정보변경내역 다건 조회 */
SELECT USER_ID
,CHANGE_DE
,ORGNZT_ID
,GROUP_ID
,EMPL_NO
,SEXDSTN_CODE
,BRTHDY
,FXNUM
,HOUSE_ADRES
,HOUSE_END_TELNO
,AREA_NO
,DETAIL_ADRES
,ZIP
,OFFM_TELNO
,MBTLNUM
,EMAIL_ADRES
,HOUSE_MIDDLE_TELNO
,PSTINST_CODE
,USER_STTUS_CODE
,ESNTL_ID
FROM XIT_USER_INFO_CHANGE_DTLS
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(user_id )">AND USER_ID = #{user_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(change_de )">AND CHANGE_DE = #{change_de }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(orgnzt_id )">AND ORGNZT_ID = #{orgnzt_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_id )">AND GROUP_ID = #{group_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(empl_no )">AND EMPL_NO = #{empl_no }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(sexdstn_code )">AND SEXDSTN_CODE = #{sexdstn_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(brthdy )">AND BRTHDY = #{brthdy }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(fxnum )">AND FXNUM = #{fxnum }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(house_adres )">AND HOUSE_ADRES = #{house_adres }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(house_end_telno )">AND HOUSE_END_TELNO = #{house_end_telno }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(area_no )">AND AREA_NO = #{area_no }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(detail_adres )">AND DETAIL_ADRES = #{detail_adres }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(zip )">AND ZIP = #{zip }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(offm_telno )">AND OFFM_TELNO = #{offm_telno }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(mbtlnum )">AND MBTLNUM = #{mbtlnum }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(email_adres )">AND EMAIL_ADRES = #{email_adres }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(house_middle_telno)">AND HOUSE_MIDDLE_TELNO = #{house_middle_telno}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(pstinst_code )">AND PSTINST_CODE = #{pstinst_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(user_sttus_code )">AND USER_STTUS_CODE = #{user_sttus_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(esntl_id )">AND ESNTL_ID = #{esntl_id }</if>
</select>
<select id="findXitUserInfoChangeDtls" resultType="kr.xit.framework.biz.cmm.model.XitUserInfoChangeDtlsVO">
/** findXitUserInfoChangeDtls */
/** 사용자정보변경내역 조회 */
SELECT USER_ID
,CHANGE_DE
,ORGNZT_ID
,GROUP_ID
,EMPL_NO
,SEXDSTN_CODE
,BRTHDY
,FXNUM
,HOUSE_ADRES
,HOUSE_END_TELNO
,AREA_NO
,DETAIL_ADRES
,ZIP
,OFFM_TELNO
,MBTLNUM
,EMAIL_ADRES
,HOUSE_MIDDLE_TELNO
,PSTINST_CODE
,USER_STTUS_CODE
,ESNTL_ID
FROM XIT_USER_INFO_CHANGE_DTLS
WHERE 1=1
AND USER_ID = #{user_id }
AND CHANGE_DE = #{change_de}
</select>
<update id="modifyXitUserInfoChangeDtls">
/** modifyXitUserInfoChangeDtls */
/** 사용자정보변경내역 수정 */
UPDATE XIT_USER_INFO_CHANGE_DTLS
SET
CHANGE_DE = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(orgnzt_id )">,ORGNZT_ID = #{orgnzt_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_id )">,GROUP_ID = #{group_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(empl_no )">,EMPL_NO = #{empl_no }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(sexdstn_code )">,SEXDSTN_CODE = #{sexdstn_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(brthdy )">,BRTHDY = #{brthdy }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(fxnum )">,FXNUM = #{fxnum }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(house_adres )">,HOUSE_ADRES = #{house_adres }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(house_end_telno )">,HOUSE_END_TELNO = #{house_end_telno }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(area_no )">,AREA_NO = #{area_no }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(detail_adres )">,DETAIL_ADRES = #{detail_adres }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(zip )">,ZIP = #{zip }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(offm_telno )">,OFFM_TELNO = #{offm_telno }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(mbtlnum )">,MBTLNUM = #{mbtlnum }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(email_adres )">,EMAIL_ADRES = #{email_adres }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(house_middle_telno)">,HOUSE_MIDDLE_TELNO = #{house_middle_telno}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(pstinst_code )">,PSTINST_CODE = #{pstinst_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(user_sttus_code )">,USER_STTUS_CODE = #{user_sttus_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(esntl_id )">,ESNTL_ID = #{esntl_id }</if>
WHERE 1=1
AND USER_ID = #{user_id }
AND CHANGE_DE = #{change_de}
</update>
<delete id="removeXitUserInfoChangeDtls">
/** removeXitUserInfoChangeDtls */
/** 사용자정보변경내역 삭제 */
DELETE FROM XIT_USER_INFO_CHANGE_DTLS
WHERE 1=1
AND USER_ID = #{user_id }
AND CHANGE_DE = #{change_de}
</delete>
</mapper> </mapper>

@ -499,7 +499,7 @@
api: { api: {
readData: { readData: {
url: '<c:url value="/adm/send/rqst/mng/find.do"/>' url: '<c:url value="/adm/send/rqst/mng/find.do"/>'
, serializer: (params) => fnAddPageInfo(document.frmSearch, params) ,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
} }
} }
}; };
@ -712,19 +712,7 @@
} }
return true; return true;
}, }
/* ========================
* 페이지 이동
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
======================== */
pageLink: function(flag, url, params){
switch (flag) {
case "move": //페이지 이동
break;
default:
break;
}
},
} }

@ -325,6 +325,7 @@
api: { api: {
readData: { readData: {
url: '<c:url value="/fims/biz/rt/findRt0200List.do"/>' url: '<c:url value="/fims/biz/rt/findRt0200List.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
} }
} }
}; };

@ -0,0 +1,21 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- TODO: 완료후 comment 삭제
아래와 같이 isUpdate 정의 필요
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
--%>
<!-- popup button -->
<div class="popup_btn">
<span class="flr">
<c:choose>
<c:when test="${isUpdate}">
<a href="#" class="btn blue" id="btnModify">변경</a>
<a href="#" class="btn red" id="btnRemove">삭제</a>
</c:when>
<c:otherwise>
<a href="#" class="btn blue" id="btnRegist">등록</a>
</c:otherwise>
</c:choose>
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
</span>
</div>

@ -0,0 +1,20 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- TODO: 완료후 comment 삭제
아래와 같이 isUpdate 정의 필요
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
<c:set var="bizName" value="권한그룹"/>
--%>
<!-- popup title -->
<p class="pop_title">
<c:choose>
<c:when test="${isUpdate}">
<c:out value="${bizName}"/> 변경
</c:when>
<c:otherwise>
<c:out value="${bizName}"/> 등록
</c:otherwise>
</c:choose>
</p>

@ -444,10 +444,10 @@
$(document).ready(function(){ $(document).ready(function(){
placeHolder(); placeHolder();
$('#searchRdNm').bind('click', function(){ $('#searchRdNm').on('click', function(){
$('.popWrap3').css({'display':'block','top':'21px','right':'121px'}); $('.popWrap3').css({'display':'block','top':'21px','right':'121px'});
}); });
$('#popupClose2').bind('click', function(){ $('#popupClose2').on('click', function(){
$('.popWrap3').css('display','none'); $('.popWrap3').css('display','none');
}); });

@ -263,7 +263,7 @@ GridConfig.setOptDataSource({ //DataSource
----------------------- */ ----------------------- */
api: { api: {
readData : { readData : {
url: '<c:url value="/framework/biz/mng/auth/AuthRegMng_list.ajax"/>', method: 'GET' url: '<c:url value="/framework/biz/mng/auth/findAuthAuthors"/>', method: 'GET'
,initParams: {} ,initParams: {}
,serializer: function(params) { ,serializer: function(params) {
var form = document.listForm; var form = document.listForm;

@ -28,9 +28,9 @@
<col style="width: 8%;"/> <col style="width: 8%;"/>
<col style="width: 20%;"/> <col style="width: 20%;"/>
<col style="width: 8%;"/> <col style="width: 8%;"/>
<col style="width: ;"/> <col/>
<col style="width: 8%;"/> <col style="width: 8%;"/>
<col style="width: ;"/> <col/>
<col style="width: 7%;"/> <col style="width: 7%;"/>
</colgroup> </colgroup>
<tbody> <tbody>

@ -1,7 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form:form id="frmSearch" name="frmSearch"> <form id="frmSearch" name="frmSearch">
<div class="search r2"> <div class="search r2">
<table> <table>
@ -16,9 +16,9 @@
<col style="width: 7%;"/> <col style="width: 7%;"/>
</colgroup> </colgroup>
<tbody> <tbody>
<th>권한 명</th> <th>권한명</th>
<td> <td>
<input id="roleCodeNm" name="roleCodeNm" type="text" size="25" title="권한코드명" /> <input id="authorNm" name="authorNm" type="text" size="25" title="권한코드명" />
</td> </td>
<td colspan="6"> <td colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" /> <input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
@ -26,18 +26,20 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</form>
<!-- //검색 --> <!-- //검색 -->
<div class="page_btn"> <div class="page_btn">
<span class="fll"> <span class="fll">
<a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a> <div class="list clearfix" id="totCnt">전체 ㅣ <span></span></div>
</span> </span>
</div> <span class="flr">
<!-- //버튼 및 페이지정보 --> <a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a>
</span>
</div>
<!-- 데이터 출력 --> <!-- 데이터 출력 -->
<div id="grid"></div> <div id="grid"></div>
</form:form>
<script type="text/javaScript"> <script type="text/javaScript">
/************************************************************************** /**************************************************************************
@ -54,33 +56,35 @@
GRID.reloadData(); GRID.reloadData();
} }
,add : function(){ ,pagePopup: function(flag, url, params){
CmmPopup.open( let popTitle;
'<c:url value="/framework/biz/mng/menu/mngProgramMgtPopup.do"/>' let popOption = {width: 530, height:535}
, null switch (flag) {
, { case "add": //입력
width: 720 popTitle = "권한 등록";
, height: 655 popOption = {width: 420, height:410}
} break;
, '프로그램 등록' case "rolePopup": //상세
) popTitle = "롤정보 상세";
popOption = {width: 1000, height:800}
break;
case "modify": //수정
popTitle = "권한 정보 변경";
popOption = {width: 420, height:410}
break;
default:
break;
}
CmmPopup.open(url, params, popOption, popTitle);
} }
,fnClickAuthRegBtn : function(props){
,onClickProgramBtn: function(props){
const rowData = props.grid.getRow(props.rowKey); const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('modify', "<c:url value='/framework/biz/mng/auth/mngAuthAuthorMgtPopup.do'/>", rowData);
CmmPopup.open( }
'<c:url value="/framework/biz/mng/menu/mngProgramMgtPopup.do"/>' ,fnClickRoleListBtn : function(props){
, { const rowData = props.grid.getRow(props.rowKey);
progrmFileNm: rowData.progrmFileNm const params = {roleCode: rowData.authorCode}
} fnBiz.pagePopup('rolePopup', "<c:url value='/framework/biz/mng/auth/mngAuthRoleGrantMgtPopup.do'/>", params);
, {
width: 720
, height: 655
}
, '프로그램 상세'
)
} }
} }
@ -93,7 +97,7 @@
}); });
$('#btnRegist').on('click', () => { $('#btnRegist').on('click', () => {
fnBiz.add(); fnBiz.pagePopup('add', "<c:url value='/framework/biz/mng/auth/mngAuthAuthorMgtPopup.do'/>", {});
}); });
}); });
@ -117,14 +121,14 @@
type: CustomButtonRenderer, type: CustomButtonRenderer,
options: { options: {
formatter : function(props){ formatter : function(props){
var rowData = props.grid.getRow(props.rowKey); var rowData = props.grid.getRow(props.rowKey);
var obj = { var obj = {
formatter : rowData.authorCode formatter : rowData.authorCode
,element : "text" ,element : "text"
} }
return obj; return obj;
} }
,eventFunction: XitAuthRegMng_list.fnClickAuthRegBtn ,eventFunction: fnBiz.fnClickAuthRegBtn
,eventType : "click" ,eventType : "click"
} }
} }
@ -148,10 +152,13 @@
name: 'authorCreatDe', name: 'authorCreatDe',
width: 120, width: 120,
sortable: false, sortable: false,
align: 'center' align: 'center',
formatter({value}) {
return setDateTimeFmt(value); //
}
}, },
{ {
header: '롤 정보', header: '롤정보',
name: 'roleInfo', name: 'roleInfo',
width: 100, width: 100,
sortable: false, sortable: false,
@ -159,15 +166,13 @@
renderer: { renderer: {
type: CustomButtonRenderer, type: CustomButtonRenderer,
options: { options: {
formatter : function(props){ formatter : () => {
var rowData = props.grid.getRow(props.rowKey); return {
var obj = { formatter : "롤정보등록"
formatter : "자세히보기" ,element: "text"
,element : "text"
} }
return obj;
} }
,eventFunction: XitAuthRegMng_list.fnClickRoleListBtn ,eventFunction: fnBiz.fnClickRoleListBtn
,eventType : "click" ,eventType : "click"
} }
} }
@ -180,19 +185,16 @@
initialRequest: true, // 화면 load시 조회 안함 - default initialRequest: true, // 화면 load시 조회 안함 - default
api: { api: {
readData: { readData: {
url: '<c:url value="/framework/biz/mng/auth/findPrograms.do"/>' url: '<c:url value="/framework/biz/mng/auth/findAuthAuthors.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
} }
} }
} }
const gridOptions = { const gridOptions = {
el: 'grid_t0', el: 'grid',
rowHeaders: ['rowNum'], rowHeaders: ['rowNum'],
columns: gridColumns, columns: gridColumns
columnOptions: {
frozenCount: 1 //고정컬럼 갯수
, minWidth: 80 //최소 사이즈
}
}; };
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => { GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
}); });

@ -0,0 +1,135 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
<c:set var="bizName" value="권한"/>
<form>
<div class="popup" style="min-width: 400px;">
<div class="popup_inner" style="max-width: 400px;">
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<table class="tbl03">
<caption><c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/></caption>
<colgroup>
<col style="width: 20%;"/>
<col/>
</colgroup>
<tr>
<th class="required" scope="row" nowrap="nowrap">
<label>권한코드</label>
</th>
<td nowrap="nowrap">
<c:choose>
<c:when test="${isUpdate}">
<input name="authorCode" id="authorCode" type="text" value="<c:out value='${authorInfoVO.authorCode}'/>" readonly size="40" title="권한코드" />&nbsp;
</c:when>
<c:otherwise>
<input name="authorCode" id="authorCode" type="text" size="40" title="권한코드" />&nbsp;
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th class="required" scope="row" nowrap="nowrap">
<label>권한명</label>
</th>
<td nowrap="nowrap">
<input name="authorNm" id="authorNm" type="text" value="<c:out value='${authorInfoVO.authorNm}'/>" maxLength="50" size="40" title="권한명" />&nbsp;
</td>
</tr>
<tr>
<th scope="row" nowrap="nowrap">
<label>설명</label>
</th>
<td nowrap="nowrap">
<input name="authorDc" id="authorDc" type="text" value="<c:out value='${authorInfoVO.authorDc}'/>" maxLength="50" size="50" title="설명" />
</td>
</tr>
<tr>
<th scope="row" nowrap="nowrap">
<label>등록일자</label>
</th>
<td nowrap="nowrap">
<input name="authorCreatDe" id="authorCreatDe" type="text" value="<c:out value='${authorInfoVO.authorCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/>
</td>
</tr>
</table>
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
</div>
</div>
<!-- //popup -->
</form>
<script type="text/javaScript">
/**************************************************************************
* Global Variable
**************************************************************************/
/* *******************************
* Biz function
******************************* */
const fnBiz = {
add: () => {
if(!fnBiz.validate()) return;
cmmBizAjax('add', {
url: '<c:url value="/framework/biz/mng/auth/addAuthAuthor.do"/>'
,data: $("form").serialize()
//,contentType: 'x-www-form-url-encoded'
})
}
,modify: () => {
if(!fnBiz.validate()) return;
cmmBizAjax('modify', {
url: '<c:url value="/framework/biz/mng/auth/modifyAuthAuthor.do"/>'
,data: $("form").serialize()
});
}
, remove: () => {
cmmBizAjax('remove', {
url: '<c:url value="/framework/biz/mng/auth/removeAuthAuthor.do"/>'
,data: {authorCode: $('#authorCode').val()}
});
}
,validate: () => {
if($('#authorCode').val() === ''){
alert('[권한코드]는 필수 입니다.');
$('#authorCode').focus();
return false;
}
if($('#authorNm').val() === ''){
alert('[권한명]은 필수 입니다.');
$('#authorNm').focus();
return false;
}
return true;
}
};
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnRegist').on('click', () => fnBiz.add());
$('#btnModify').on('click', () => fnBiz.modify());
$('#btnRemove').on('click', () => fnBiz.remove());
});
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
$('#authorCreatDe').val(setDateTimeFmt('<c:out value="${authorInfoVO.authorCreatDe}"/>'));
});
</script>

@ -1,29 +1,24 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form:form id="listForm" name="listForm" action="" method="post"> <form:form id="frmSearch" name="frmSearch">
<input type="hidden" name="groupId"/>
<input type="hidden" name="groupIds"/>
<input type="hidden" name="pageIndex" value="<c:out value='${groupManageVO.pageIndex}'/>"/>
<input type="hidden" id="searchGubun" name="searchGubun" value="excel">
<input type="hidden" name="searchCondition"/>
<div class="search r2"> <div class="search r2">
<table> <table>
<caption>검색조건</caption> <caption>검색조건</caption>
<colgroup> <colgroup>
<col style="width: 8%;"/>
<col style="width: 20%;"/> <col style="width: 20%;"/>
<col style="width: 8%;"/> <col style="width: 30%;"/>
<col style="width: ;"/> <col/>
<col style="width: 8%;"/> <col/>
<col style="width: ;"/> <col/>
<col style="width: 7%;"/> <col/>
<col/>
</colgroup> </colgroup>
<tbody> <tbody>
<th>그룹 명</th> <th>권한그룹명</th>
<td> <td>
<input id="searchKeyword" name="searchKeyword" type="text" value="<c:out value='${groupManageVO.searchKeyword}'/>" size="25" title="검색" onkeypress="press();" /> <input id="groupNm" name="groupNm" type="text" size="25" title="검색" onkeypress="press();" />
</td> </td>
<td colspan="6"> <td colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" /> <input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
@ -31,323 +26,172 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- //검색 --> </form:form>
<div class="page_btn"> <div class="page_btn">
<span class="fll"> <span class="flr">
<a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a> <a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a>
<a href="#" class="btn red" id="btnRemove" title="삭제">삭제</a> </span>
</span> </div>
</div> <!-- //버튼 및 페이지정보 -->
<!-- //버튼 및 페이지정보 -->
<!-- 데이터 출력 --> <!-- 데이터 출력 -->
<div id="grid"></div> <div id="grid"></div>
</form:form>
<script type="text/javaScript" language="javascript" defer="defer"> <script type="text/javaScript">
$(document).ready(function(){
XitAuthGrpMng_list.init();
});
/* *******************************
* 사용자 그룹관리 Functions
******************************* */
var XitAuthGrpMng_list = {
init : function(){
/**
* Grid Config Settings
*/
//Grid Style Set
Grid.applyTheme('striped'); // Call API of static method
//Grid 체크박스 checked EventListner
instance.on('check', function(ev) {
// console.log('check!', ev);
});
//Grid 체크박스 unchecked EventListner
instance.on('uncheck', function(ev) {
// console.log('uncheck!', ev);
});
//Grid 체크박스 focus이동 EventListner
instance.on('focusChange', function(ev) {
// console.log('change focused cell!', ev);
});
/** class Form {
* Elements EventListener Settings constructor(grid) {
*/ this.grid = grid;
//검색 Event 설정 };
$('#btnSearch').on({ search(){
click: function(){ grid.reloadData();
XitAuthGrpMng_list.findData(); }
} }
});
$("#btnRegist").click(function(){
XitAuthGrpMng_list.pagePopup('input', '<c:url value="/framework/biz/mng/auth/AuthGrpMng_input.do"/>');
});
//삭제 버튼 Event
$("#btnRemove").click(function(){
if(confirm("삭제하시겠습니까?")){
var checkArr = instance.getCheckedRows();
var returnValue = "";
var returnBoolean = false;
if(instance.getData().length == 0 ){
alert("조회된 결과가 없습니다.");
}else if(checkArr.length == 0){
alert("선택된 권한이 없습니다.");
}else{
checkArr.forEach(function(item, index){
returnValue += item.groupId;
if(checkArr.length -1 > index){
returnValue += ";";
}
})
document.listForm.groupIds.value = returnValue;
XitAuthGrpMng_list.removeData();
}
}
});
},
/* ========================
* 데이터 조회
======================== */
findData : function(){
instance.reloadData();
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
},
/* ========================
* 데이터 수정
======================== */
modifyData : function(){
},
/* ========================
* 데이터 삭제
======================== */
removeData : function(){
var varFrom = document.getElementById("listForm");
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthGrpMng_deletes_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
XitAuthGrpMng_list.findData();
},
error: function(){
}
}); /**************************************************************************
}, * Global Variable
/* ======================== **************************************************************************/
* 페이지 이동 let GRID = null;
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main ) var callbackSearch = () => fnBiz.search();
======================== */
pageLink: function(flag, url, params){ /* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
}
,pagePopup: function(flag, params){
let url = '<c:url value="/framework/biz/mng/auth/mngAuthGrpMgtPopup.do"/>';
let popTitle;
let popOption = {width: 530, height:535}
switch (flag) { switch (flag) {
case "move": //페이지 이동 case "add": //등록
document.listForm.searchKeyword.value = ""; popTitle = "권한 그룹 등록";
document.listForm.action = url;
document.listForm.submit();
break; break;
case "popup": //팝업 OPEN
XitAuthGrpMng_list.pagePopup(flag, url, params);
break;
default:
break;
}
},
/* ========================
* 페이지 Open
-팝업페이지를 Open 한다.
======================== */
pagePopup: function(flag, url, params){
var popUrl = url;
popUrl += "?tilesDef=popup";
if(!(params == undefined || params == null)){
popUrl += "&";
popUrl += params;
}
var popTitle = '';
switch (flag) {
case "detail": //상세 case "detail": //상세
popTitle = "사용자 그룹 관리 상세"; popTitle = "권한 그룹 상세";
popOption = "scrollbars = yes, top=100px, left=100px, height=475px, width=430px;";
break;
case "input": //입력
popTitle = "사용자 그룹 관리 입력";
popOption = "scrollbars = yes, top=100px, left=100px, height=475px, width=430px;";
break; break;
default: default:
break; break;
} }
CmmPopup.open(url, params, popOption, popTitle);
}
window.open(popUrl, popTitle ,popOption); ,onClickGrid: function(props){
}, const rowData = props.grid.getRow(props.rowKey);
/* ======================== fnBiz.pagePopup('detail', rowData);
* 상세 팝업 오픈 버튼 클릭
-상세 팝업을 OPEN 한다.
======================== */
fnClickGrpBtn: function(props){
var rowData = props.grid.getRow(props.rowKey);
var params = "";
params += "groupId=" + rowData.groupId;
XitAuthGrpMng_list.pagePopup('detail', "<c:url value='/framework/biz/mng/auth/AuthGrpMng_edit.do'/>", params);
} }
} }
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').on('click', () => {
fnBiz.pagePopup('add', null);
});
});
/* ****************************** /* *******************************
* Grid 환경 설정 * Grid
****************************** */ ******************************* */
var GridConfig = new XitTuiGridConfig(); const initGrid = () => {
GridConfig.setOptGridId('grid'); //Grid를 출력할 Element ID(해당 Element에 Grid가 출력 됨) const gridColumns = [
GridConfig.setOptGridHeight(270); //Grid 높이(단위: px) {
GridConfig.setOptRowHeight(20); //Grid row 높이(단위: px) header: '그룹 ID',
GridConfig.setOptRowHeaderType('checkbox'); //Row 첫번째 Cell 타입(rowNum: 순번, checkbox: 체크박스, '': 아무것도 출력 안함) name: 'groupId',
GridConfig.setOptPageOptions({ //페이징(Pagination) 옵션 width: 120,
useClient: true //Client Paging 여부(true 설정 시 클라이언트 자체 페이징 처리. 서버호출 X) sortable: true,
,perPage: 10 //페이지당 표시 건수 sortingType: 'desc',
}); align: 'center',
GridConfig.setOptColumnOptions({ //컬럼고정 옵션 renderer: {
}); type: CustomButtonRenderer,
GridConfig.setOptDataSource({ //DataSource options: {
/* ----------------------- formatter : function(props){
* DataSource Config Setting const rowData = props.grid.getRow(props.rowKey);
* -설정항목은 Global 적용 되며 return {
* -API별 적용을 원할 경우 각 API 안에 작성 가능(우선순위: 개별->글로벌) formatter: rowData.groupId
----------------------- */ ,element: "text"
//contentType: 'application/json', }
//headers: { 'x-custom-header': 'custom-header' }, }
initialRequest: true, //디폴트 값은 true(false: 인스턴스 생성 시 요청은 보내지 않음. 이런 경우 "instance.reloadData()"를 사용하여 요청 가능) ,eventFunction: fnBiz.onClickGrid //function(props){XitAuthGrpMng_list.fnClickGrpBtn(props )} //function(){alert("1234")}
//serializer: function(params) { ,eventType : "click"
//return $(document.listForm).serialize(); }
// },
/* -----------------------
* DataSource API Setting
----------------------- */
api: {
readData : {
url: '<c:url value="/framework/biz/mng/auth/AuthGrpMng_list.ajax"/>', method: 'GET'
,initParams: {}
,serializer: function(params) {
var form = document.listForm;
var serializeParam = $(form).serialize();
for(var key in params){
if(key=='perPage'){
if(params[key]==undefined)
serializeParam +='&'+key+'=-1';
else
serializeParam +='&'+key+'='+params[key];
}else
serializeParam +='&'+key+'='+params[key];
} }
return serializeParam; },
} {
} header: '그룹 명',
,createData: { url: '', method: 'POST'} name: 'groupNm',
,updateData: { url: '', method: 'PUT'} minWidth: 150,
,modifyData: { url: '', method: 'PUT'} sortable: false,
,deleteData: { url: '', method: 'DELETE'} align: 'left'
} },
}); {
GridConfig.setOptHeader({ header: '설명',
}); //Grid 헤더 정보(헤더 셀 병합 필요 시 설정) name: 'groupDc',
GridConfig.setOptColumns([ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등) minWidth: 200,
{ sortable: false,
header: '그룹 ID', align: 'left'
name: 'groupId', },
width: 120, {
sortable: true, header: '권한',
sortingType: 'desc', name: 'authorDetail',
align: 'center', width: 200,
renderer: { sortable: false,
type: CustomButtonRenderer, align: 'left',
options: { renderer: {
formatter : function(props){ type: XitColumnMergeRenderer,
var rowData = props.grid.getRow(props.rowKey); options: {
var obj = { listColumns: ['authorNm', 'authorCode'],
formatter : rowData.groupId format: '{0}({1})'
,element : "text"
} }
return obj;
} }
,eventFunction: XitAuthGrpMng_list.fnClickGrpBtn //function(props){XitAuthGrpMng_list.fnClickGrpBtn(props )} //function(){alert("1234")} },
,eventType : "click" {
header: '등록일시',
name: 'groupCreatDe',
width: 120,
sortable: false,
align: 'center',
formatter({value}) {
return setDateTimeFmt(value); //
}
} }
} ];
},
{ const gridOptions = {
header: '그룹 명', el: 'grid',
name: 'groupNm', rowHeaders: ['rowNum'],
minWidth: 150, columns: gridColumns
sortable: false, };
align: 'left'
}, const gridDatasource = { //DataSource
{ initialRequest: true // 화면 load시 조회 안함 - default
header: '설명', ,api: {
name: 'groupDc', readData: {
minWidth: 200, url: '<c:url value="/framework/biz/mng/auth/findAuthGrps.do"/>'
sortable: false, ,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
align: 'left'
},
{
header: '권한',
name: 'authorDetail',
width: 200,
sortable: false,
align: 'left',
renderer: {
type: XitColumnMergeRenderer,
options: {
listColumns: ['authorNm', 'authorCode'],
format: '{0}({1})'
}
}
},
{
header: '등록일자',
name: 'groupCreatDe',
width: 120,
sortable: false,
align: 'center'
},
{
header: '',
name: '',
width: 80,
sortable: false,
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : function(props){
var rowData = props.grid.getRow(props.rowKey);
var obj = {
formatter : "상세조회"
,element : "text"
}
return obj;
} }
,eventFunction: XitAuthGrpMng_list.fnClickGrpBtn //function(){alert("1234")}
,eventType : "click"
} }
} };
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
});
} }
]);
var Grid = tui.Grid;
var instance = GridConfig.instance(Grid); //Grid 인스턴스
/* ********************************************************
* 처리결과메시지 출력
******************************************************** */
<c:if test="${!empty message}">alert("${message}");</c:if>
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script> </script>

@ -1,180 +1,142 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ 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" %>
<form>
<c:set var="registerFlag" value="${empty groupManageVO.groupId ? 'INSERT' : 'UPDATE'}"/> <c:set var="isUpdate" value="${!empty groupManage.groupId}"/>
<c:set var="registerFlagName" value="${empty groupManageVO.groupId ? '그룹 등록' : '그룹 수정'}"/> <c:set var="bizName" value="권한그룹"/>
<!-- 검색 필드 박스 시작 --> <c:out value='${isUpdate}'/>
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="groupManage" staticJavascript="false" xhtml="true" cdata="false"/>
<form:form commandName="groupManage" method="post" >
<div class="popup" style="min-width: 400px;"> <div class="popup" style="min-width: 400px;">
<div class="popup_inner" style="max-width: 400px;"> <div class="popup_inner" style="max-width: 400px;">
<p class="pop_title">권한 등록</p> <%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<table class="tbl03"> <table class="tbl03">
<caption>권한 등록</caption> <caption>
<tr> <c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/>
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 ID</th> </caption>
<td nowrap="nowrap"><input name="groupId" id="groupId" type="text" readonly="readonly" value="<c:out value='${groupManage.groupId}'/>" size="40" title="그룹 ID" /></td> <colgroup>
<col style="width: 25%;"/>
<col/>
</colgroup>
<tr>
<th class="required" scope="row" nowrap="nowrap">
<label>권한그룹 ID</label>
</th>
<td nowrap="nowrap">
<c:choose>
<c:when test="${isUpdate}">
<input name="groupId" id="groupId" type="text" readonly value="<c:out value='${groupManage.groupId}'/>" size="40" title="권한그룹ID" />
</c:when>
<c:otherwise>
<input name="groupId" id="groupId" type="text" size="40" title="권한그룹ID" />
</c:otherwise>
</c:choose>
</td>
</tr> </tr>
<tr> <tr>
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 명 <th class="required" scope="row" nowrap="nowrap">
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" /> <label>권한그룹 명</label>
</th> </th>
<td nowrap="nowrap"><input name="groupNm" id="groupNm" type="text" value="<c:out value='${groupManage.groupNm}'/>" maxLength="50" size="40" title="그룹명" />&nbsp;<form:errors path="groupNm" /></td> <td nowrap="nowrap">
<input name="groupNm" id="groupNm" type="text" value="<c:out value='${groupManage.groupNm}'/>" maxLength="50" size="40" title="권한그룹명" />&nbsp;
</td>
</tr> </tr>
<tr> <tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">설명</th> <th scope="row" nowrap="nowrap">
<td nowrap="nowrap"><input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" /></td> <label>권한</label>
</th>
<td nowrap="nowrap">
<code:select type="AUTHOR" id="authorCode" name="authorCode" defaultSelect="${groupManage.authorCode}" title="권한" cls="selectBox" alt="selectBox tag"/>
</td>
</tr> </tr>
<tr> <tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">권한</th> <th scope="row" nowrap="nowrap">
<label>설명</label>
</th>
<td nowrap="nowrap"> <td nowrap="nowrap">
<select id="authorCode" name="authorCode"> <input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" />
<option value="">== 선택하세요 ==</option>
<c:forEach var="row" items="${listAuthorInfoVO }">
<option value="<c:out value="${row.author_code }"/>" <c:if test="${row.author_code eq groupManage.authorCode}">selected="selected"</c:if> ><c:out value="${row.author_nm }"/></option>
</c:forEach>
</select>
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">등록일자</th> <th scope="row" nowrap="nowrap">
<td nowrap="nowrap"><input name="groupCreatDe" id="groupCreatDe" type="text" value="<c:out value='${groupManage.groupCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/></td> <label>등록일자</label>
</th>
<td nowrap="nowrap">
<input name="groupCreatDe" id="groupCreatDe" type="text" value="<c:out value='${groupManage.groupCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/>
</td>
</tr> </tr>
</table> </table>
<div class="popup_btn"> <%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
<span class="flr" colspan="4">
<c:if test="${registerFlag == 'INSERT'}">
<a href="#LINK" class="btn blue" id="btnSave">저장</a>
</c:if>
<c:if test="${registerFlag == 'UPDATE'}">
<a href="#LINK" class="btn blue" id="update_btn">변경</a>
<a href="#LINK" class="btn red" id="delete_btn">삭제</a>
</c:if>
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
</span>
</div>
<!-- //등록버튼 -->
</div> </div>
</div> </div>
<!-- //popup --> </form>
<!-- 검색조건 유지 -->
<c:if test="${registerFlag == 'UPDATE'}">
<input type="hidden" name="searchCondition" value="<c:out value='${groupManageSearchVO.searchCondition}'/>"/>
<input type="hidden" name="searchKeyword" value="<c:out value='${groupManageSearchVO.searchKeyword}'/>"/>
<input type="hidden" name="pageIndex" value="<c:out value='${groupManageSearchVO.pageIndex}'/>"/>
</c:if>
</form:form>
<script type="text/javaScript"> <script type="text/javaScript">
/**************************************************************************
* Global Variable
**************************************************************************/
$(document).ready(function(){ /* *******************************
XitAuthGrpMng_edit.init(); * Biz function
}); ******************************* */
/* ******************************* const fnBiz = {
* 사용자그룹관리 수정 Functions add: () => {
******************************* */ if(!fnBiz.validate()) return;
var XitAuthGrpMng_edit = {
init : function(){
//닫기 버튼 Event
$("#btnClose").click(function() {
window.close();
});
//저장 버튼 Event 설정
$('#btnSave').on({
click: function(){
XitAuthGrpMng_edit.addData();
}
});
$('#update_btn').on({
click: function(){
XitAuthGrpMng_edit.modifyData();
}
});
$('#delete_btn').on({
click: function(){
XitAuthGrpMng_edit.removeData();
}
});
$(".popup").css("position","absolute");
$(".content_header").css("display","none");
$("#cur_loc").css("display","none");
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
var varFrom = document.getElementById("groupManage");
if(confirm("저장 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthGrpMng_insert_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthGrpMng_list.findData();
window.close();
},
error: function(){
} cmmBizAjax('add', {
}); url: '<c:url value="/framework/biz/mng/auth/addAuthGrp.do"/>'
} ,data: $("form").serialize()
//,contentType: 'x-www-form-url-encoded'
})
} }
/* ========================
* 데이터 수정
======================== */
,modifyData : function(){
var varFrom = document.getElementById("groupManage");
if(confirm("수정 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthGrpMng_update_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthGrpMng_list.findData();
window.close();
},
error: function(){
} ,modify: () => {
}); if(!fnBiz.validate()) return;
}
cmmBizAjax('modify', {
url: '<c:url value="/framework/biz/mng/auth/modifyAuthGrp.do"/>'
,data: $("form").serialize()
});
} }
/* ========================
* 데이터 삭제
======================== */
,removeData : function(){
var varFrom = document.getElementById("groupManage");
if(confirm("삭제 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthGrpMng_delete_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthGrpMng_list.findData();
window.close();
},
error: function(){
} , remove: () => {
}); cmmBizAjax('remove', {
url: '<c:url value="/framework/biz/mng/auth/removeAuthGrp.do"/>'
,data: {groupId: $('#groupId').val()}
});
}
,validate: () => {
if($('#groupId').val() === ''){
alert('[권한그룹 ID]는 필수 입니다.');
$('#authorCode').focus();
return false;
}
if($('#groupNm').val() === ''){
alert('[권한그룹 명]은 필수 입니다.');
$('#authorNm').focus();
return false;
} }
return true;
} }
};
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnRegist').on('click', () => fnBiz.add());
$('#btnModify').on('click', () => fnBiz.modify());
$('#btnRemove').on('click', () => fnBiz.remove());
});
} /**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
$('#groupCreatDe').val(setDateTimeFmt('<c:out value="${groupManage.groupCreatDe}"/>'));
});
</script> </script>

@ -0,0 +1,186 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form id="frmSearch" name="frmSearch">
<div class="search r2">
<table>
<caption>검색조건</caption>
<colgroup>
<col style="width: 8%;"/>
<col style="width: 20%;"/>
<col style="width: 8%;"/>
<col/>
<col style="width: 8%;"/>
<col/>
<col style="width: 7%;"/>
</colgroup>
<tbody>
<th>권한명</th>
<td>
<input id="searchKeyword" name="searchKeyword" type="text" value="<c:out value='${searchVO.searchKeyword}'/>" size="25" title="검색" onkeypress="XitAuthHierarchyMng_list.press();" />
</td>
<td colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
</td>
</tbody>
</table>
</div>
</form> <!-- //검색 -->
<%--
<div class="page_btn">
<span class="flr">
<a href="#" class="btn darkgray" id="btnPopup" title="권한계층설정">권한계층설정</a>
</span>
</div>
--%>
<!-- //버튼 및 페이지정보 -->
<!-- 데이터 출력 -->
<div id="grid"></div>
<script type="text/javaScript">
/**************************************************************************
* Global Variable
**************************************************************************/
let GRID = null;
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
}
,add: () => {
const arrChecks = GRID.getCheckedRows();
if(arrChecks.length==0) {
alert("등록[변경]할 목록을 선택하세요.");
return false;
}
const data = {
authorCode: $('#authorCode').val()
,grantData: arrChecks.map((row) => {
return {roleCode: row.roleCode, regYn: row.regYn}
})
}
if(confirm("등록 하시겠습니까?")) {
cmmAjax({
url: '<c:url value="/framework/biz/mng/auth/saveAuthRoleGrantList.do"/>'
,data: JSON.stringify(data)
,contentType: 'application/json; charset=utf-8'
,success: () => {
fnBiz.search();
}
})
}
}
,onClickGrid: function(props){
const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('add', rowData);
}
,pagePopup: function(flag, params){
let url = '<c:url value="/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.do"/>';
let popTitle;
let popOption = {width: 955, height:500}
switch (flag) {
case "add": //등록
popTitle = "권한 계층 설정";
break;
default:
break;
}
CmmPopup.open(url, params, popOption, popTitle);
}
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => fnBiz.search());
// $('#btnPopup').on('click', () => {
// fnBiz.pagePopup('add', {});
// });
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [
{
header: '권한코드',
name: 'authorCode',
width: 200,
sortable: true,
sortingType: 'desc',
align: 'left',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : function(props){
const rowData = props.grid.getRow(props.rowKey);
return {
formatter: rowData.authorCode
,element: "text"
}
}
,eventFunction: fnBiz.onClickGrid //function(props){XitAuthGrpMng_list.fnClickGrpBtn(props )} //function(){alert("1234")}
,eventType : "click"
}
}
},
{
header: '권한 명',
name: 'authorNm',
width:200,
sortable: false,
align: 'left'
},
{
header: '권한(role) 상속 구조',
name: 'authorRescueCodeNm',
minWidth: 200,
sortable: true,
align: 'left'
}
];
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum'],
columns: gridColumns
};
const gridDatasource = { //DataSource
//initialRequest: true, // 화면 load시 조회 안함 - default
api: {
readData: {
url: '<c:url value="/framework/biz/mng/auth/findAuthHierarchies.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
}
}
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
console.log('~~~~~~~~~~')
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
console.log('~~~~~~~~~~~>>>>>>>>>')
initGrid();
});
</script>

@ -37,7 +37,7 @@
</tr> </tr>
<tr> <tr>
<td id="authorRescue" class="connectWith"> <td id="authorRescue" class="connectWith">
<c:set var="strAuthorRescueCode" value="${fn:trim(vo.authorRescueCode) }" /> <c:set var="strAuthorRescueCode" value="${fn:trim(authHierarchyManage.authorRescueCode) }" />
<c:set var="arrAuthorCode" value="${fn:split(strAuthorRescueCode, '>') }" /> <c:set var="arrAuthorCode" value="${fn:split(strAuthorRescueCode, '>') }" />
<c:forEach var="row" items="${arrAuthorCode }" varStatus="status"> <c:forEach var="row" items="${arrAuthorCode }" varStatus="status">
<c:set var="arrSilbingAutorCode" value="${fn:split(row, ',') }" /> <c:set var="arrSilbingAutorCode" value="${fn:split(row, ',') }" />
@ -91,10 +91,10 @@
<span class="flr" colspan="4"> <span class="flr">
<a href="#LINK" class="btn blue" id="btnSave">저장</a> <a href="#" class="btn blue" id="btnRegist">저장</a>
<a href="#LINK" class="btn gray" id="init_btn">원래대로</a> <a href="#" class="btn gray" id="init_btn">원래대로</a>
<a href="#LINK" class="btn red" id="reload_btn">설정정보 적용</a> <a href="#" class="btn red" id="reload_btn">설정정보 적용</a>
<a href="#" class="btn lightgray" id="btnClose">닫기</a> <a href="#" class="btn lightgray" id="btnClose">닫기</a>
</span> </span>
<!-- //등록버튼 --> <!-- //등록버튼 -->

@ -1,245 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form:form id="listForm" name="listForm" action="" method="post">
<input type="hidden" name="authorCode"/>
<input type="hidden" name="authorCodes"/>
<input type="hidden" name="pageIndex" value="<c:out value='${searchVO.pageIndex}'/>"/>
<input type="hidden" id="searchGubun" name="searchGubun" value="excel">
<input type="hidden" name="searchCondition"/>
<div class="search r2">
<table>
<caption>검색조건</caption>
<colgroup>
<col style="width: 8%;"/>
<col style="width: 20%;"/>
<col style="width: 8%;"/>
<col style="width: ;"/>
<col style="width: 8%;"/>
<col style="width: ;"/>
<col style="width: 7%;"/>
</colgroup>
<tbody>
<th>권한 명</th>
<td>
<input id="searchKeyword" name="searchKeyword" type="text" value="<c:out value='${searchVO.searchKeyword}'/>" size="25" title="검색" onkeypress="XitAuthHierarchyMng_list.press();" />
</td>
<td colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
</td>
</tbody>
</table>
</div>
<!-- //검색 -->
<div class="page_btn">
<span class="fll">
<a href="#" class="btn darkgray" id="btnSave" title="권한계층 설정">권한계층 설정</a>
</span>
</div>
<!-- //버튼 및 페이지정보 -->
<!-- 데이터 출력 -->
<div id="grid"></div>
</form:form>
<script type="text/javaScript" language="javascript" defer="defer">
$(document).ready(function(){
XitAuthHierarchyMng_list.init();
});
/* *******************************
* 권한계층관리 Functions
******************************* */
var XitAuthHierarchyMng_list = {
init : function(){
/**
* Grid Config Settings
*/
//Grid Style Set
Grid.applyTheme('striped'); // Call API of static method
//Grid 체크박스 checked EventListner
instance.on('check', function(ev) {
// console.log('check!', ev);
});
//Grid 체크박스 unchecked EventListner
instance.on('uncheck', function(ev) {
// console.log('uncheck!', ev);
});
//Grid 체크박스 focus이동 EventListner
instance.on('focusChange', function(ev) {
// console.log('change focused cell!', ev);
});
/**
* Elements EventListener Settings
*/
//검색 Event 설정
$('#btnSearch').on({
click: function(){
XitAuthHierarchyMng_list.findData();
}
});
//권한계층 설정 버튼 Event
$("#btnSave").click(function(){
var params = "";
XitAuthHierarchyMng_list.pagePopup('edit', "<c:url value='/framework/biz/mng/auth/AuthHierarchyMng_edit.do'/>", params);
});
},
press : function(){
if(event.keyCode==13){
fncSelectAuthorList('1');
}
},
/* ========================
* 데이터 조회
======================== */
findData : function(){
instance.reloadData();
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
},
/* ========================
* 데이터 수정
======================== */
modifyData : function(){
},
/* ========================
* 데이터 삭제
======================== */
removeData : function(){
},
/* ========================
* 페이지 이동
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
======================== */
pageLink: function(flag, url, params){
switch (flag) {
case "move": //페이지 이동
document.listForm.searchKeyword.value = "";
document.listForm.action = url;
document.listForm.submit();
break;
case "popup": //팝업 OPEN
XitAuthHierarchyMng_list.pagePopup(flag, url, params);
break;
default:
break;
}
},
/* ========================
* 페이지 Open
-팝업페이지를 Open 한다.
======================== */
pagePopup: function(flag, url, params){
var popUrl = url;
popUrl += "?tilesDef=popup";
if(!(params == undefined || params == null)){
popUrl += "&";
popUrl += params;
}
var popTitle = '';
switch (flag) {
case "edit": //수정
popTitle = "권한계층 설정";
popOption = "scrollbars = yes, top=100px, left=100px, height=500px, width=955px;";
break;
default:
break;
}
window.open(popUrl, popTitle ,popOption);
}
}
/* ******************************
* Grid 환경 설정
****************************** */
var GridConfig = new XitTuiGridConfig();
GridConfig.setOptGridId('grid'); //Grid를 출력할 Element ID(해당 Element에 Grid가 출력 됨)
GridConfig.setOptGridHeight(270); //Grid 높이(단위: px)
GridConfig.setOptRowHeight(20); //Grid row 높이(단위: px)
GridConfig.setOptRowHeaderType('rowNum'); //Row 첫번째 Cell 타입(rowNum: 순번, checkbox: 체크박스, '': 아무것도 출력 안함)
GridConfig.setOptPageOptions({ //페이징(Pagination) 옵션
useClient: true //Client Paging 여부(true 설정 시 클라이언트 자체 페이징 처리. 서버호출 X)
,perPage: 10 //페이지당 표시 건수
});
GridConfig.setOptColumnOptions({ //컬럼고정 옵션
});
GridConfig.setOptDataSource({ //DataSource
/* -----------------------
* DataSource Config Setting
* -설정항목은 Global 적용 되며
* -API별 적용을 원할 경우 각 API 안에 작성 가능(우선순위: 개별->글로벌)
----------------------- */
//contentType: 'application/json',
//headers: { 'x-custom-header': 'custom-header' },
initialRequest: true, //디폴트 값은 true(false: 인스턴스 생성 시 요청은 보내지 않음. 이런 경우 "instance.reloadData()"를 사용하여 요청 가능)
//serializer: function(params) {
//return $(document.listForm).serialize();
// },
/* -----------------------
* DataSource API Setting
----------------------- */
api: {
readData : {
url: '<c:url value="/framework/biz/mng/auth/AuthHierarchyMng_list.ajax"/>', method: 'GET'
,initParams: {}
,serializer: function(params) {
var form = document.listForm;
var serializeParam = $(form).serialize();
for(var key in params){
if(key=='perPage'){
if(params[key]==undefined)
serializeParam +='&'+key+'=-1';
else
serializeParam +='&'+key+'='+params[key];
}else
serializeParam +='&'+key+'='+params[key];
}
return serializeParam;
}
}
,createData: { url: '', method: 'POST'}
,updateData: { url: '', method: 'PUT'}
,modifyData: { url: '', method: 'PUT'}
,deleteData: { url: '', method: 'DELETE'}
}
});
GridConfig.setOptHeader({
}); //Grid 헤더 정보(헤더 셀 병합 필요 시 설정)
GridConfig.setOptColumns([ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등)
{
header: '권한코드',
name: 'authorCode',
width: 200,
sortable: true,
sortingType: 'desc',
align: 'left'
},
{
header: '권한 명',
name: 'authorNm',
width:200,
sortable: false,
align: 'left'
},
{
header: '권한(role) 상속 구조',
name: 'authorRescueCodeNm',
minWidth: 200,
sortable: true,
align: 'left'
}
]);
var Grid = tui.Grid;
var instance = GridConfig.instance(Grid); //Grid 인스턴스
</script>

@ -1,171 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<c:set var="registerFlag" value="${empty authorManageVO.authorCode ? 'INSERT' : 'UPDATE'}"/>
<c:set var="registerFlagName" value="${empty authorManageVO.authorCode ? '권한 등록' : '권한 수정'}"/>
<!-- 검색 필드 박스 시작 -->
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="authorManage" staticJavascript="false" xhtml="true" cdata="false"/>
<form:form commandName="authorManage" method="post" >
<div class="popup" style="min-width: 400px;">
<div class="popup_inner" style="max-width: 400px;">
<p class="pop_title">권한 등록</p>
<table class="tbl03">
<caption>권한 등록</caption>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">권한 코드
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
</th>
<td nowrap="nowrap"><input name="authorCode" id="authorCode" type="text" value="<c:out value='${authorManage.authorCode}'/>" size="40" title="권한코드" />&nbsp;<form:errors path="authorCode" /></td>
</tr>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">권한 명
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
</th>
<td nowrap="nowrap"><input name="authorNm" id="authorNm" type="text" value="<c:out value='${authorManage.authorNm}'/>" maxLength="50" size="40" title="권한명" />&nbsp;<form:errors path="authorNm" /></td>
</tr>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">설명</th>
<td nowrap="nowrap"><input name="authorDc" id="authorDc" type="text" value="<c:out value='${authorManage.authorDc}'/>" maxLength="50" size="50" title="설명" /></td>
</tr>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">등록일자</th>
<td nowrap="nowrap"><input name="authorCreatDe" id="authorCreatDe" type="text" value="<c:out value='${authorManage.authorCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/></td>
</tr>
</table>
<div class="popup_btn">
<span class="flr" colspan="4">
<c:if test="${registerFlag == 'INSERT'}">
<a href="#LINK" class="btn blue" id="btnSave">저장</a>
</c:if>
<c:if test="${registerFlag == 'UPDATE'}">
<a href="#LINK" class="btn blue" id="update_btn">변경</a>
<a href="#LINK" class="btn red" id="delete_btn">삭제</a>
</c:if>
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
</span>
</div>
<!-- //등록버튼 -->
</div>
</div>
<!-- //popup -->
</form:form>
<script type="text/javaScript">
$(document).ready(function(){
XitAuthRegMng_edit.init();
});
/* *******************************
* 권한관리 수정화면 Functions
******************************* */
var XitAuthRegMng_edit = {
init : function(){
//닫기 버튼 Event
$("#btnClose").click(function() {
window.close();
});
//저장 버튼 Event 설정
$('#btnSave').on({
click: function(){
XitAuthRegMng_edit.addData();
}
});
$('#update_btn').on({
click: function(){
XitAuthRegMng_edit.modifyData();
}
});
$('#delete_btn').on({
click: function(){
XitAuthRegMng_edit.removeData();
}
});
$(".popup").css("position","absolute");
$(".content_header").css("display","none");
$("#cur_loc").css("display","none");
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
if(!validateAuthorManage(document.getElementById("authorManage")))
return;
var varFrom = document.getElementById("authorManage");
if(confirm("저장 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthRegMng_insert_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthRegMng_list.findData();
window.close();
},
error: function(){
}
});
}
}
/* ========================
* 데이터 수정
======================== */
,modifyData : function(){
if(!validateAuthorManage(document.getElementById("authorManage")))
return;
var varFrom = document.getElementById("authorManage");
if(confirm("수정 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthRegMng_update_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthRegMng_list.findData();
window.close();
},
error: function(){
}
});
}
}
/* ========================
* 데이터 삭제
======================== */
,removeData : function(){
var varFrom = document.getElementById("authorManage");
if(confirm("삭제 하시겠습니까?")){
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthRegMng_delete_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
window.opener.XitAuthRegMng_list.findData();
window.close();
},
error: function(){
}
});
}
}
}
</script>

@ -0,0 +1,253 @@
<%@ page import="org.json.simple.JSONObject" %>
<%@ page import="org.json.simple.JSONArray" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<title>권한별 롤 목록</title>
<div class="popup" style="min-width: 400px;">
<div class="popup_inner">
<p class="pop_title">권한별 롤 목록</p>
<form name="frmSearch" id="frmSearch">
<div class="search r2">
<table>
<caption>검색조건</caption>
<colgroup>
<col style="width: 8%;"/>
<col style="width: 20%;"/>
<col style="width: 8%;"/>
<col/>
<col style="width: 8%;"/>
<col/>
<col style="width: 7%;"/>
</colgroup>
<tbody>
<tr>
<th>권한코드 : </th>
<td colspan="6">
<input id="authorCode" name="authorCode" type="text" size="30" value="<c:out value='${authorRoleManageVO.roleCode}'/>" title="검색" readonly="readonly" />
</td>
<td>
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
</td>
</tr>
</tbody>
</table>
</div>
</form>
<!-- 데이터 출력 -->
<div id="grid"></div>
<div class="popup_btn">
<span class="fll">
<div class="list clearfix" id="totCnt">전체 ㅣ <span></span></div>
</span>
<span class="flr">
<a href="#" class="btn blue" id="btnRegist" title="저장">저장</a>
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
</span>
</div>
</div>
</div>
<script type="text/javascript">
/**************************************************************************
* Global Variable
**************************************************************************/
let GRID = null;
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
//TODO : onGridUpdated
GRID.on('onGridUpdated', (ev) => {
console.log('%%%%%%%%%%%%%>>>>>>>',ev)
}) // 그리드 레이아웃 새로고침 (로드가 다 되지 않는 경우 그리드가 흰색 화면으로 출력될 때가 있다.))
}
,add: () => {
const arrChecks = GRID.getCheckedRows();
if(arrChecks.length==0) {
alert("등록[변경]할 목록을 선택하세요.");
return false;
}
const data = {
authorCode: $('#authorCode').val()
,grantData: arrChecks.map((row) => {
return {roleCode: row.roleCode, regYn: row.regYn}
})
}
if(confirm("등록 하시겠습니까?")) {
cmmAjax({
url: '<c:url value="/framework/biz/mng/auth/saveAuthRoleGrantList.do"/>'
,data: JSON.stringify(data)
,contentType: 'application/json; charset=utf-8'
,success: () => {
fnBiz.search();
}
})
}
}
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').on('click', () => {
fnBiz.add();
});
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [
{
header: '롤 ID',
name: 'roleCode',
width: 150,
sortingType: 'asc',
sortable: true,
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 설정방법은 상이하므로 사이트 참조)
// filter: { type: 'text', showApplyBtn: true, showClearBtn: true },
},
{
header: '롤 명',
name: 'roleNm',
width: 150,
sortingType: 'desc',
sortable: true,
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 설정방법은 상이하므로 사이트 참조)
},
{
header: '등록여부',
headerCellClass: 'blue',
name: 'regYn',
width: 60,
align: 'center',
sortable: true,
filter: 'select',
/* 에디터 적용 */
formatter: 'listItemText',
editor: {
type: 'radio', //select, radio, checkbox, text
options: {
listItems: [
<c:forEach var="row" items="${regYnList}" varStatus="status">
<c:if test="${not status.first}">,</c:if>
{
text: '${row.code_nm}'
,value: '${row.code}'
}
</c:forEach>
]
}
},
//TODO : 컬럼 스타일 : README.md 참조
renderer: {
styles: {
background: (props) => props.value === 'Y' ? 'cyan' : 'red'
}
}
},
{
header: '롤 패턴',
name: 'rolePttrn',
minWidth: 150,
sortable: true
},
{
header: '롤 설명',
name: 'roleDc',
minWidth: 150,
sortable: true
},
{
header: '롤 타입',
name: 'roleTy',
width: 50,
sortingType: 'desc',
sortable: true,
align: 'center',
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 text/date 설정방법은 상이하므로 사이트 참조)
},
{
header: '정렬순서',
name: 'roleSort',
width: 50,
sortable: true,
align: 'center'
},
{
header: '등록일시',
name: 'creatDt',
width: 100,
align: 'center',
sortable: true,
formatter({value}){
return setDateTimeFmt(value);
}
}
];
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum', 'checkbox'],
columns: gridColumns,
//TODO : 페이징 미사용시
//페이지처리 hide
pagination: false,
pageOptions: null,
// pageOptions: {
// useClient: true,
// perPage: 100
// },
columnOptions: {
frozenCount: 3
},
bodyHeight: 400,
onGridMounted: (ev)=>{
console.log('mounted~~~~~~~~',ev)
}
};
const gridDatasource = { //DataSource
initialRequest: true, // 화면 load시 조회 안함 - default
api: {
readData: {
url: '<c:url value="/framework/biz/mng/auth/findAuthRoleGrantList.do"/>'
, initParams: {authorCode: $('#authorCode').val()}
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
}
}
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (ev) => {
console.table('---------->>>',ev)
console.log('---------->>>',ev.instance)
console.log('---------->>>',ev.responseData)
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>

@ -58,21 +58,6 @@
GRID.reloadData(); GRID.reloadData();
} }
,pageLink: function(flag, url, params){
switch (flag) {
case "move": //페이지 이동
document.frmSearch.roleNm.value = "";
document.frmSearch.action = url;
document.frmSearch.submit();
break;
case "popup": //팝업 OPEN
fnBiz.pagePopup(flag, url, params);
break;
default:
break;
}
}
,pagePopup: function(flag, params){ ,pagePopup: function(flag, params){
let url = '<c:url value="/framework/biz/mng/auth/mngAuthRoleMgtPopup.do"/>'; let url = '<c:url value="/framework/biz/mng/auth/mngAuthRoleMgtPopup.do"/>';
let popTitle; let popTitle;
@ -100,9 +85,9 @@
* event * event
**************************************************************************/ **************************************************************************/
$(() => { $(() => {
$('#btnSearch').bind('click', () => fnBiz.search()); $('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').bind('click', () => { $('#btnRegist').on('click', () => {
fnBiz.pagePopup('add', {}); fnBiz.pagePopup('add', {});
}); });
@ -176,21 +161,15 @@
const gridOptions = { const gridOptions = {
el: 'grid', el: 'grid',
rowHeaders: ['rowNum'], rowHeaders: ['rowNum'],
columns: gridColumns, columns: gridColumns
columnOptions: {
frozenCount: 3 //고정컬럼 갯수
, minWidth: 80 //최소 사이즈
}
}; };
const gridDatasource = { //DataSource const gridDatasource = { //DataSource
/* ----------------------- initialRequest: true // 화면 load시 조회 안함 - default
* DataSource API Setting ,api: {
----------------------- */
//initialRequest: true, // 화면 load시 조회 안함 - default
api: {
readData: { readData: {
url: '<c:url value="/framework/biz/mng/auth/findAuthRoles.do"/>' url: '<c:url value="/framework/biz/mng/auth/findAuthRoles.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
} }
} }
}; };

@ -7,21 +7,13 @@
<%--@elvariable id="roleManage" type=""--%> <%--@elvariable id="roleManage" type=""--%>
<form:form commandName="roleManage" name="roleManage"> <form:form commandName="roleManage" name="roleManage">
<c:set var="isUpdate" value="${!empty roleManage.roleCode}"/> <c:set var="isUpdate" value="${!empty roleManage.roleCode}"/>
<c:set var="bizName" value="롤"/>
<div class="popup" style="min-width: 500px;"> <div class="popup" style="min-width: 500px;">
<div class="popup_inner" style="max-width: 500px;"> <div class="popup_inner" style="max-width: 500px;">
<p class="pop_title"> <%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<c:choose>
<c:when test="${isUpdate}">
롤 <spring:message code="title.update"/>
</c:when>
<c:otherwise>
롤 <spring:message code="title.create"/>
</c:otherwise>
</c:choose>
</p>
<table class="tbl03"> <table class="tbl03">
<caption> <spring:message code="title.update"/> / <spring:message code="title.create"/></caption> <caption><c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/></caption>
<colgroup> <colgroup>
<col style="width: 30%; height: 23px;"/> <col style="width: 30%; height: 23px;"/>
<col style="width: 70%; height: 23px;"/> <col style="width: 70%; height: 23px;"/>
@ -89,20 +81,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="popup_btn"> <%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
<span class="flr" colspan="4">
<c:choose>
<c:when test="${isUpdate}">
<a href="#" class="btn blue" id="btnModify">변경</a>
<a href="#" class="btn red" id="btnRemove">삭제</a>
</c:when>
<c:otherwise>
<a href="#" class="btn blue" id="btnRegist">등록</a>
</c:otherwise>
</c:choose>
<a href="#" class="btn lightgray" id="btnClose" onclick="window.close()">닫기</a>
</span>
</div>
<!-- //등록버튼 --> <!-- //등록버튼 -->
</div> </div>

@ -1,15 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form:form id="listForm" name="listForm" action="<c:url value='/framework/biz/mng/auth/AuthUsrMng_list.do'/>" method="post"> <form:form id="frmSearch" name="frmSearch">
<input type="hidden" id="searchGubun" name="searchGubun" value="excel">
<input type="hidden" name="userId" id="userId"/>
<input type="hidden" name="userIds" id="userIds"/>
<input type="hidden" name="authorCodes" id="authorCodes"/>
<input type="hidden" name="regYns" id="regYns"/>
<input type="hidden" name="mberTyCodes" id="mberTyCodes"/>
<input type="hidden" name="groupIds" id="groupIds"/>
<input type="hidden" name="pageIndex" value="<c:out value='${authorGroupVO.pageIndex}'/>"/>
<div class="search r2"> <div class="search r2">
<table> <table>
@ -18,20 +10,20 @@
<col style="width: 8%;"/> <col style="width: 8%;"/>
<col style="width: 20%;"/> <col style="width: 20%;"/>
<col style="width: 8%;"/> <col style="width: 8%;"/>
<col style="width: ;"/> <col/>
<col style="width: 8%;"/> <col style="width: 8%;"/>
<col style="width: ;"/> <col/>
<col style="width: 7%;"/> <col style="width: 7%;"/>
</colgroup> </colgroup>
<tbody> <tbody>
<td colspan="6"> <td colspan="6">
<select id="searchCondition" name="searchCondition" title="조회조건"> <select id="searchCondition" name="searchCondition" title="조회조건" onchange="fnBiz.onSearchChange()">
<option value="1" <c:if test="${authorGroupVO.searchCondition == '1'}">selected</c:if> >사용자 ID</option> <option value="userId">사용자 ID</option>
<option value="2" <c:if test="${authorGroupVO.searchCondition == '2'}">selected</c:if> >사용자 명</option> <option value="userNm">사용자 명</option>
<option value="3" <c:if test="${authorGroupVO.searchCondition == '3'}">selected</c:if> >그룹</option> <option value="groupId">그룹</option>
</select> </select>
<input name="searchKeyword" title="검색어" type="text" value="<c:out value="${userSearchVO.searchKeyword}"/>" /> <input name="searchKeyword" title="검색어" type="text" value="<c:out value="${searchKeyword}"/>"/>
<a href="#LINK" id="grpSearch_btn" class="btn sm darkgray" ><img src="<c:url value='/images/img_search.gif' />" alt="그룹검색" />검색</a> <code:select type="AUTHOR_GRP" id="searchKeyword" name="searchKeyword" title="권한그룹" cls="selectBox" alt="selectBox tag" display="false" disabled="true"/>
</td> </td>
<td> <td>
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" /> <input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
@ -42,7 +34,7 @@
<!-- //검색 --> <!-- //검색 -->
<div class="page_btn"> <div class="page_btn">
<span class="fll"> <span class="flr">
<a href="#" class="btn darkgray" id="btnRegist" title="권한등록">권한등록</a> <a href="#" class="btn darkgray" id="btnRegist" title="권한등록">권한등록</a>
<a href="#" class="btn red" id="btnRemove" title="권한취소">권한취소</a> <a href="#" class="btn red" id="btnRemove" title="권한취소">권한취소</a>
</span> </span>
@ -53,315 +45,201 @@
<div id="grid"></div> <div id="grid"></div>
</form:form> </form:form>
<script type="text/javaScript" language="javascript" defer="defer"> <script type="text/javaScript">
$(document).ready(function(){ let GRID = null;
XitAuthUsrMng_list.init();
});
/* *******************************
* 사용자별 권한관리 Functions
******************************* */
var XitAuthUsrMng_list = {
init : function(){
/**
* Grid Config Settings
*/
//Grid Style Set
Grid.applyTheme('striped'); // Call API of static method
//Grid 체크박스 checked EventListner
instance.on('check', function(ev) {
// console.log('check!', ev);
});
//Grid 체크박스 unchecked EventListner
instance.on('uncheck', function(ev) {
// console.log('uncheck!', ev);
});
//Grid 체크박스 focus이동 EventListner
instance.on('focusChange', function(ev) {
// console.log('change focused cell!', ev);
});
/** /* *******************************
* Elements EventListener Settings * Biz function
*/ ******************************* */
//검색 Event 설정 const fnBiz = {
$('#btnSearch').on({ search : function(){
click: function(){ GRID.reloadData();
XitAuthUsrMng_list.findData(); },
} /* ========================
}); * 데이터 등록
//등록 Event 설정 ======================== */
$("#btnRegist").click(function(){ add : function(){
if(confirm("권한등록을 하시겠습니까?")){ const arrDatas = fnBiz.getCheckedList();
XitAuthUsrMng_list.fncManageChecked();
if($('#userIds').val()){ if(confirm("권한을 등록 하시겠습니까?")) {
XitAuthUsrMng_list.addData(); cmmAjax({
} url: '<c:url value="/framework/biz/mng/auth/saveAuthUserList.do"/>'
} ,data: JSON.stringify(arrDatas)
}); ,contentType: 'application/json; charset=utf-8'
//삭제 Event 설정 ,success: () => {
$("#btnRemove").click(function(){ fnBiz.search();
if(confirm("삭제하시겠습니까?")){ }
XitAuthUsrMng_list.fncManageChecked(); })
if($('#userIds').val()){
XitAuthUsrMng_list.removeData();
}
} }
}); }
//그룹검색 버튼 Event 설정
$("#grpSearch_btn").click(function(){
XitAuthUsrMng_list.pagePopup('grp',"<c:url value='/framework/biz/mng/auth/AuthUsrMng_groupsearch_popup.do'/>", null);
});
},
/* ========================
* 데이터 조회
======================== */
findData : function(){
instance.reloadData();
},
/* ========================
* 데이터 등록
======================== */
addData : function(){
var varFrom = document.getElementById("listForm");
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthUsrMng_insert_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
XitAuthUsrMng_list.findData();
},
error: function(){
} ,modify : function(){
}); }
},
/* ========================
* 데이터 수정
======================== */
modifyData : function(){
},
/* ========================
* 데이터 삭제
======================== */
removeData : function(){
var varFrom = document.getElementById("listForm");
var param = $(varFrom).serialize();
$.ajax({
url : "/framework/biz/mng/auth/AuthUsrMng_deletes_proc.do",
data : param,
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
XitAuthUsrMng_list.findData();
},
error: function(){
,remove : function(){
const arrDatas = fnBiz.getCheckedList();
if(confirm("권한을 취소 하시겠습니까?")) {
cmmAjax({
url: '<c:url value="/framework/biz/mng/auth/removeAuthUserList.do"/>'
,data: JSON.stringify(arrDatas)
,contentType: 'application/json; charset=utf-8'
,success: () => {
fnBiz.search();
}
})
} }
});
},
/* ========================
* 페이지 이동
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
======================== */
pageLink: function(flag, url, params){
switch (flag) {
case "": //
break;
default:
break;
}
},
/* ========================
* 페이지 Open
-팝업페이지를 Open 한다.
======================== */
pagePopup: function(flag, url, params){
var popUrl = url;
popUrl += "?tilesDef=popup";
if(!(params == undefined || params == null)){
popUrl += "&";
popUrl += params;
} }
var popTitle = '';
switch (flag) {
case "grp": //등록
popTitle = "그룹 조회";
popOption = "height=500, width=800, top=50, left=20, scrollbars=no, resizable=no";
break;
default:
break;
}
window.open(popUrl, popTitle ,popOption);
},
fncManageChecked : function(){
var checkArr = instance.getCheckedRows();
var returnId = "";
var returnAuthor = "";
var returnRegYn = "";
var returnmberTyCode = "";
var returnGroupId = "";
var returnBoolean = false; ,getCheckedList: ()=>{
const arrChecks = GRID.getCheckedRows();
if(instance.getData().length == 0 ){ if(arrChecks.length === 0) {
alert("조회된 결과가 없습니다."); alert("목록을 선택해 주세요.");
}else if(checkArr.length == 0){ return false;
alert("선택된 권한이 없습니다."); }
}else{
checkArr.forEach(function(item, index){
returnId += item.uniqId;
returnAuthor += item.authorCode;
returnRegYn += item.regYn;
returnmberTyCode += item.mberTyCode;
returnGroupId += item.groupId;
if(checkArr.length -1 > index){ return arrChecks.map((row) => {
returnId += ";"; return {
returnAuthor += ";"; uniqId: row.uniqId
returnRegYn += ";"; , authorCode: row.authorCode
returnmberTyCode += ";"; , mberTyCode: row.mberTyCode
returnGroupId += ";"; , groupId: row.groupId
, regYn: row.regYn
} }
}) });
}
document.listForm.userIds.value = returnId; ,onSearchChange: () => {
document.listForm.authorCodes.value = returnAuthor; if($('#searchCondition').val() === 'groupId'){
document.listForm.regYns.value = returnRegYn; $('select[name="searchKeyword"]')
document.listForm.mberTyCodes.value = returnmberTyCode; .css('display', 'inline-block')
document.listForm.groupIds.value = returnGroupId; .attr('disabled', false);
$('input[name="searchKeyword"]')
.css('display', 'none')
.attr('disabled', true);
}else{
$('select[name="searchKeyword"]')
.css('display', 'none')
.attr('disabled', true);
$('input[name="searchKeyword"]')
.css('display', 'inline-block')
.attr('disabled', false);
}
} }
} }
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => {
fnBiz.search();
});
$("#btnRegist").click(function(){
fnBiz.add();
});
/* ****************************** $("#btnRemove").click(function(){
* Grid 환경 설정 fnBiz.remove();
****************************** */ });
var GridConfig = new XitTuiGridConfig(); });
GridConfig.setOptGridId('grid'); //Grid를 출력할 Element ID(해당 Element에 Grid가 출력 됨)
GridConfig.setOptGridHeight(270); //Grid 높이(단위: px) /* *******************************
GridConfig.setOptRowHeight(20); //Grid row 높이(단위: px) * Grid
GridConfig.setOptRowHeaderType('checkbox'); //Row 첫번째 Cell 타입(rowNum: 순번, checkbox: 체크박스, '': 아무것도 출력 안함) ******************************* */
GridConfig.setOptPageOptions({ //페이징(Pagination) 옵션 const initGrid = () => {
useClient: true //Client Paging 여부(true 설정 시 클라이언트 자체 페이징 처리. 서버호출 X) const gridColumns = [
,perPage: 10 //페이지당 표시 건수 {
}); header: '사용자 ID',
GridConfig.setOptColumnOptions({ //컬럼고정 옵션 name: 'userId',
}); minWidth: 160,
GridConfig.setOptDataSource({ //DataSource sortable: true,
/* ----------------------- filter: 'select',
* DataSource Config Setting sortingType: 'desc',
* -설정항목은 Global 적용 되며 align: 'center'
* -API별 적용을 원할 경우 각 API 안에 작성 가능(우선순위: 개별->글로벌) },
----------------------- */ {
//contentType: 'application/json', header: '사용자 명',
//headers: { 'x-custom-header': 'custom-header' }, name: 'userNm',
initialRequest: true, //디폴트 값은 true(false: 인스턴스 생성 시 요청은 보내지 않음. 이런 경우 "instance.reloadData()"를 사용하여 요청 가능) minWidth: 150,
//serializer: function(params) { sortable: true,
//return $(document.listForm).serialize(); filter: 'select',
// }, align: 'center'
/* ----------------------- },
* DataSource API Setting {
----------------------- */ header: '사용자 유형',
api: { name: 'mberTyNm',
readData : { minWidth: 160,
url: '<c:url value="/framework/biz/mng/auth/AuthUsrMng_list.ajax"/>', method: 'GET' sortable: false,
,initParams: {} align: 'center'
,serializer: function(params) { },
var form = document.listForm; {
var serializeParam = $(form).serialize(); header: '권한',
for(var key in params){ name: 'authorCode',
if(key=='perPage'){ width: 120,
if(params[key]==undefined) sortable: true,
serializeParam +='&'+key+'=-1'; formatter: 'listItemText',
else editor: {
serializeParam +='&'+key+'='+params[key]; type: "radio",
}else options: {
serializeParam +='&'+key+'='+params[key]; listItems: [
} <c:forEach var="row" items="${authorList}" varStatus="status">
return serializeParam; <c:if test="${not status.first}">,</c:if>
{
text: '${row.code_nm}'
,value: '${row.code}'
}
</c:forEach>
]
}
},
align: 'center'
},
{
header: '등록여부',
name: 'regYn',
width: 60,
sortable: false,
align: 'center',
edit: true
} }
} ];
,createData: { url: '', method: 'POST'}
,updateData: { url: '', method: 'PUT'} const gridOptions = {
,modifyData: { url: '', method: 'PUT'} el: 'grid',
,deleteData: { url: '', method: 'DELETE'} rowHeaders: ['rowNum', 'checkbox'],
} columns: gridColumns,
}); pageOptions: {
GridConfig.setOptHeader({ useClient: true,
}); //Grid 헤더 정보(헤더 셀 병합 필요 시 설정) perPage: 100
GridConfig.setOptColumns([ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등) },
{ columnOptions: {
header: '사용자 ID', frozenCount: 3
name: 'userId', },
minWidth: 160, bodyHeight: 400
sortable: true, };
filter: 'select',
sortingType: 'desc', const gridDatasource = { //DataSource
align: 'center' initialRequest: true, // 화면 load시 조회 안함 - default
}, api: {
{ readData: {
header: '사용자 명', url: '<c:url value="/framework/biz/mng/auth/findAuthUsers.do"/>'
name: 'userNm', ,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
minWidth: 150, }
sortable: true,
filter: 'select',
align: 'center'
},
{
header: '사용자 유형',
name: 'mberTyNm',
minWidth: 160,
sortable: false,
align: 'center'
},
{
header: '권한',
name: 'authorCode',
width: 120,
sortable: true,
filter: 'select',
formatter: 'listItemText',
editor: {
type: "select",
options: {
listItems: [
<c:forEach var="row" items="${authorManageList}" varStatus="status">
<c:if test="${not status.first}">,</c:if>
{
text: '${row.author_nm}'
,value: '${row.author_code}'
}
</c:forEach>
]
} }
}, };
align: 'center'
},
{
header: '등록여부',
name: 'regYn',
width: 60,
sortable: false,
align: 'center'
}
]);
var Grid = tui.Grid;
var instance = GridConfig.instance(Grid); //Grid 인스턴스
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
});
}
/* ******************************************************** /**************************************************************************
* 처리결과메시지 출력 * initialize
******************************************************** */ **************************************************************************/
<c:if test="${!empty message}">alert("${message}");</c:if> $(document).ready(function(){
initGrid();
});
</script> </script>

@ -11,6 +11,7 @@
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script> <script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="menuManageVO" staticJavascript="false" xhtml="true" cdata="false"/> <validator:javascript formName="menuManageVO" staticJavascript="false" xhtml="true" cdata="false"/>
<%--@elvariable id="menuManageVO" type=""--%>
<form:form commandName="menuManageVO" name="menuManageVO" action ="<c:url value='/framework/biz/mng/menu/MenuListMng_insert_proc.do' />" method="post"> <form:form commandName="menuManageVO" name="menuManageVO" action ="<c:url value='/framework/biz/mng/menu/MenuListMng_insert_proc.do' />" method="post">
<input type="hidden" name="tmp_SearchElementName" value=""/> <input type="hidden" name="tmp_SearchElementName" value=""/>
@ -22,37 +23,53 @@
<p class="pop_title"> 메뉴목록 생성</p> <p class="pop_title"> 메뉴목록 생성</p>
<table class="tbl03" summary="메뉴 등록화면"> <table class="tbl03" summary="메뉴 등록화면">
<caption>메뉴 등록화면</caption> <caption>메뉴 등록화면</caption>
<colgroup>
<col style="width: 15%; height: 23px"/>
<col style="width: 35%; height: 23px"/>
<col style="width: 15%; height: 23px"/>
<col style="width: 35%; height: 23px"/>
</colgroup>
<tr> <tr>
<th width="15%" height="23" class="required" scope="row"><label for="menuNo">메뉴번호</label><img src="${ImgUrl}/required.gif" width="15" height="15" alt="필수"></th> <th class="required" scope="row">
<td width="35%" nowrap="nowrap"> <label for="menuNo">메뉴번호</label>
</th>
<td nowrap="nowrap">
&nbsp; &nbsp;
<form:input path="menuNo" size="10" maxlength="10" title="메뉴No"/> <form:input path="menuNo" size="10" maxlength="10" title="메뉴No"/>
<form:errors path="menuNo" /> <form:errors path="menuNo" />
</td> </td>
<th width="15%" height="23" class="required" scope="row"><label for="menuOrdr">메뉴순서</label><img src="${ImgUrl}/required.gif" width="15" height="15" alt="필수"></th> <th class="required" scope="row">
<td width="35%" nowrap="nowrap"> <label for="menuOrdr">메뉴순서</label>
</th>
<td nowrap="nowrap">
&nbsp; &nbsp;
<form:input path="menuOrdr" size="10" maxlength="10" title="메뉴순서" /> <form:input path="menuOrdr" size="10" maxlength="10" title="메뉴순서" />
<form:errors path="menuOrdr" /> <form:errors path="menuOrdr" />
</td> </td>
</tr> </tr>
<tr> <tr>
<th width="15%" height="23" class="required" scope="row"><label for="menuNm">메뉴명</label><img src="${ImgUrl}/required.gif" width="15" height="15" alt="필수"></th> <th class="required" scope="row">
<td width="35%" nowrap="nowrap"> <label for="menuNm">메뉴명</label>
</th>
<td nowrap="nowrap">
&nbsp; &nbsp;
<form:input path="menuNm" size="30" maxlength="30" title="메뉴명" /> <form:input path="menuNm" size="30" maxlength="30" title="메뉴명" />
<form:errors path="menuNm" /> <form:errors path="menuNm" />
</td> </td>
<th width="15%" height="23" class="required" scope="row"><label for="upperMenuId">상위메뉴번호</label><img src="${ImgUrl}/required.gif" width="15" height="15" alt="필수"></th> <th class="required" scope="row">
<td width="35%" nowrap="nowrap"> <label for="upperMenuId">상위메뉴번호</label>
</th>
<td nowrap="nowrap">
&nbsp; &nbsp;
<form:input path="upperMenuId" size="10" maxlength="10" title="상위메뉴No"/> <form:input path="upperMenuId" size="10" maxlength="10" title="상위메뉴No"/>
<form:errors path="upperMenuId" /> <form:errors path="upperMenuId" />
</td> </td>
</tr> </tr>
<tr> <tr>
<th width="15%" height="23" class="required" scope="row"><label for="progrmFileNm">프로그램파일명</label><img src="${ImgUrl}/required.gif" width="15" height="15" alt="필수"></th> <th class="required" scope="row">
<td width="85%" colspan="3" nowrap="nowrap"> <label for="progrmFileNm">프로그램파일명</label>
</th>
<td colspan="3" nowrap="nowrap">
&nbsp; &nbsp;
<input type="text" name="progrmFileNm_view" size="60" disabled="disabled"> <input type="text" name="progrmFileNm_view" size="60" disabled="disabled">
<form:input path="progrmFileNm" size="60" maxlength="60" title="프로그램파일명" cssStyle="display:none"/> <form:input path="progrmFileNm" size="60" maxlength="60" title="프로그램파일명" cssStyle="display:none"/>
@ -85,8 +102,8 @@
</table> </table>
<div class="popup_btn"> <div class="popup_btn">
<span class="flr" colspan="4"> <span class="flr" colspan="4">
<a href="#LINK" class="btn blue" id="btnSave">등록</a> <a href="#" class="btn blue" id="btnRegist">등록</a>
<a href="#" class="btn lightgray" id="btnClose">닫기</a> <a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
</span> </span>
</div> </div>
<!-- //등록버튼 --> <!-- //등록버튼 -->
@ -118,10 +135,6 @@ $(document).ready(function(){
******************************* */ ******************************* */
var XitMenuListMng_input = { var XitMenuListMng_input = {
init : function(){ init : function(){
//닫기 버튼 Event
$("#btnClose").click(function() {
window.close();
});
//저장 버튼 Event 설정 //저장 버튼 Event 설정
$('#btnSave').on({ $('#btnSave').on({
click: function(){ click: function(){

@ -40,8 +40,8 @@
<!-- //검색 --> <!-- //검색 -->
<div class="page_btn"> <div class="page_btn">
<span class="fll"> <span class="flr">
<a href="#" class="btn darkgray" id="allRegist_btn" title="일괄등록">일괄등록</a> <a href="#" class="btn blue" id="allRegist_btn" title="일괄등록">일괄등록</a>
<a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a> <a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a>
<a href="#" class="btn red" id="btnRemove" title="삭제">삭제</a> <a href="#" class="btn red" id="btnRemove" title="삭제">삭제</a>
</span> </span>

@ -164,6 +164,7 @@
api: { api: {
readData: { readData: {
url: '<c:url value="/framework/biz/mng/menu/findPrograms.do"/>' url: '<c:url value="/framework/biz/mng/menu/findPrograms.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
} }
} }
} }

@ -2,6 +2,9 @@
<%@ 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" %>
<c:set var="isUpdate" value="${!empty progrmMngVO.progrmFileNm}"/>
<c:set var="bizName" value="프로그램 정보"/>
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script> <script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="progrmMngVO" staticJavascript="false" xhtml="true" cdata="false"/> <validator:javascript formName="progrmMngVO" staticJavascript="false" xhtml="true" cdata="false"/>
<%--@elvariable id="progrmMngVO" type=""--%> <%--@elvariable id="progrmMngVO" type=""--%>
@ -9,19 +12,10 @@
<div class="popup" style="min-width: 700px;"> <div class="popup" style="min-width: 700px;">
<div class="popup_inner" style="max-width:700px;"> <div class="popup_inner" style="max-width:700px;">
<p class="pop_title"> <%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<c:choose>
<c:when test="${empty progrmMngVO.progrmFileNm}">
프로그램 정보 <spring:message code="title.create"/>
</c:when>
<c:otherwise>
프로그램 정보 <spring:message code="title.update"/>
</c:otherwise>
</c:choose>
</p>
<table class="tbl03"> <table class="tbl03">
<caption>프로그램 정보 등록 / 변경</caption> <caption><c:out value="${bizName}"/> 등록 / 변경</caption>
<colgroup> <colgroup>
<col style="width: 20%; height: 23px;"> <col style="width: 20%; height: 23px;">
<col style="width: 80%; height: 23px;"> <col style="width: 80%; height: 23px;">
@ -31,15 +25,7 @@
<th scope="row" class="required"> <th scope="row" class="required">
<label for="progrmFileNm">프로그램파일명</label> <label for="progrmFileNm">프로그램파일명</label>
<td nowrap="nowrap"> <td nowrap="nowrap">
<c:choose> <form:input path="progrmFileNm" size="50" maxlength="50" title="프로그램파일명" readonly="${isUpdate}" />
<c:when test="${!empty progrmMngVO.progrmFileNm and fn:length(progrmMngVO.progrmFileNm) > 0}">
<input type="text" id='progrmFileNm' name='progrmFileNm' disabled="disabled" value="<c:out value='${progrmMngVO.progrmFileNm}'/>">
</c:when>
<c:otherwise>
<input type="text" id='progrmFileNm' name='progrmFileNm' value="<c:out value='${progrmMngVO.progrmFileNm}'/>">
</c:otherwise>
</c:choose>
<form:input path="progrmFileNm" size="50" maxlength="50" title="프로그램파일명" cssStyle="display:none" />
<form:errors path="progrmFileNm"/> <form:errors path="progrmFileNm"/>
</td> </td>
</tr> </tr>
@ -73,21 +59,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="popup_btn"> <%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
<span class="flr">
<c:choose>
<c:when test="${!empty progrmMngVO.progrmFileNm}">
<a href="#LINK" class="btn blue" id="btnModify">변경</a>
<a href="#LINK" class="btn red" id="btnRemove">삭제</a>
</c:when>
<c:otherwise>
<a href="#LINK" class="btn blue" id="btnRegist">등록</a>
</c:otherwise>
</c:choose>
<a href="#" class="btn lightgray" id="btnClose" onclick="window.close()">닫기</a>
</span>
</div>
<!-- //등록버튼 -->
</div> </div>
</div> </div>
<!-- //popup --> <!-- //popup -->
@ -152,8 +124,5 @@
* initialize * initialize
**************************************************************************/ **************************************************************************/
$(document).ready(function(){ $(document).ready(function(){
$(".popup").css("position","absolute");
$(".content_header").css("display","none");
$("#cur_loc").css("display","none");
}); });
</script> </script>

@ -66,21 +66,6 @@
GRID.reloadData(); GRID.reloadData();
} }
,pageLink: function(flag, url, params){
switch (flag) {
case "move": //페이지 이동
document.frmSearch.searchKeyword.value = "";
document.frmSearch.action = url;
document.frmSearch.submit();
break;
case "popup": //팝업 OPEN
fnBiz.pagePopup(flag, url, params);
break;
default:
break;
}
}
,pagePopup: function(flag, params){ ,pagePopup: function(flag, params){
let url; let url;
let popTitle; let popTitle;
@ -113,9 +98,9 @@
* event * event
**************************************************************************/ **************************************************************************/
$(() => { $(() => {
$('#btnSearch').bind('click', () => fnBiz.search()); $('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').bind('click', () => { $('#btnRegist').on('click', () => {
fnBiz.pagePopup('add', {}); fnBiz.pagePopup('add', {});
}); });
@ -217,6 +202,7 @@
api: { api: {
readData: { readData: {
url: '<c:url value="/framework/biz/mng/usr/findUsers.do"/>' url: '<c:url value="/framework/biz/mng/usr/findUsers.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
} }
} }
}; };

@ -2,27 +2,20 @@
<%@ 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" %>
<c:set var="isUpdate" value="${!empty userInfoVO.uniqId}"/>
<c:set var="bizName" value="업무사용"/>
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script> <script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="userInfoVO" staticJavascript="false" xhtml="true" cdata="false"/> <validator:javascript formName="userInfoVO" staticJavascript="false" xhtml="true" cdata="false"/>
<%--@elvariable id="userInfoVO" type=""--%> <%--@elvariable id="userInfoVO" type=""--%>
<form:form commandName="userInfoVO" name="userInfoVO"> <form:form commandName="userInfoVO" name="userInfoVO">
<c:set var="isUpdate" value="${!empty userInfoVO.uniqId}"/>
<div class="popup" style="min-width: 1100px;"> <div class="popup" style="min-width: 1100px;">
<div class="popup_inner" style="max-width: 1100px;"> <div class="popup_inner" style="max-width: 1100px;">
<p class="pop_title"> <%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<c:choose>
<c:when test="${isUpdate}">
<spring:message code="comUssUmt.deptUserManage.title"/> <spring:message code="title.update"/>
</c:when>
<c:otherwise>
<spring:message code="comUssUmt.deptUserManage.title"/> <spring:message code="title.create"/>
</c:otherwise>
</c:choose>
</p>
<table class="tbl03"> <table class="tbl03">
<caption><spring:message code="comUssUmt.deptUserManage.title"/> <spring:message code="title.update"/> / <spring:message code="title.create"/></caption> <caption><:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/></caption>
<colgroup> <colgroup>
<col style="width: 20%;"/> <col style="width: 20%;"/>
<col style="width: 30%;"/> <col style="width: 30%;"/>
@ -77,12 +70,6 @@
</th> </th>
<td> <td>
<code:select id="passwordHint" name="passwordHint" codeId="XIT022" defaultSelect="${userInfoVO.passwordHint}" title="비밀번호힌트" cls="selectBox" alt="비밀번호힌트"/> <code:select id="passwordHint" name="passwordHint" codeId="XIT022" defaultSelect="${userInfoVO.passwordHint}" title="비밀번호힌트" cls="selectBox" alt="비밀번호힌트"/>
<%--
<form:select path="passwordHint" id="passwordHint" title="비밀번호힌트">
<form:option value="" label="--선택하세요--" />
<form:options items="${passwordHint_result}" itemValue="code" itemLabel="codeNm" />
</form:select>
--%>
<form:errors path="passwordHint" cssClass="error" /></td> <form:errors path="passwordHint" cssClass="error" /></td>
<th height="23" class="required"> <th height="23" class="required">
<label>비밀번호 정답</label> <label>비밀번호 정답</label>
@ -107,12 +94,6 @@
</th> </th>
<td> <td>
<code:select id="pstinstCode" name="pstinstCode" codeId="XIT025" defaultSelect="${userInfoVO.pstinstCode}" title="소속기관" cls="selectBox" alt="소속기관"/> <code:select id="pstinstCode" name="pstinstCode" codeId="XIT025" defaultSelect="${userInfoVO.pstinstCode}" title="소속기관" cls="selectBox" alt="소속기관"/>
<%--
<form:select path="pstinstCode" id="pstinstCode" title="소속기관">
<form:option value="" label="--선택하세요--" />
<form:options items="${pstinstCode_result}" itemValue="code" itemLabel="codeNm" />
</form:select>
--%>
<form:errors path="pstinstCode" cssClass="error" /> <form:errors path="pstinstCode" cssClass="error" />
</td> </td>
</tr> </tr>
@ -123,12 +104,6 @@
</th> </th>
<td> <td>
<code:select type="ORGN" id="orgnztId" name="orgnztId" defaultSelect="${userInfoVO.orgnztId}" title="부서" cls="selectBox" alt="부서"/> <code:select type="ORGN" id="orgnztId" name="orgnztId" defaultSelect="${userInfoVO.orgnztId}" title="부서" cls="selectBox" alt="부서"/>
<%--
<form:select path="orgnztId" id="orgnztId" title="부서">
<form:option value="" label="--선택하세요--" />
<form:options items="${orgnztId_result}" itemValue="code" itemLabel="codeNm" />
</form:select>
--%>
<form:errors path="orgnztId" cssClass="error" /> <form:errors path="orgnztId" cssClass="error" />
</td> </td>
<th height="23"> <th height="23">
@ -206,12 +181,6 @@
</th> </th>
<td> <td>
<code:select id="userSttusCode" name="userSttusCode" codeId="XIT013" defaultSelect="${!isUpdate? 'A': userInfoVO.userSttusCode}" disabled="${!isUpdate}" title="사용자상태" cls="selectBox" alt="사용자상태"/> <code:select id="userSttusCode" name="userSttusCode" codeId="XIT013" defaultSelect="${!isUpdate? 'A': userInfoVO.userSttusCode}" disabled="${!isUpdate}" title="사용자상태" cls="selectBox" alt="사용자상태"/>
<%--
<form:select path="userSttusCode" id="userSttusCode" title="사용자상태코드">
<form:option value="" label="--선택하세요--" />
<form:options items="${userSttusCode_result}" itemValue="code" itemLabel="codeNm" />
</form:select>
--%>
<form:errors path="userSttusCode" cssClass="error" /> <form:errors path="userSttusCode" cssClass="error" />
</td> </td>
<th height="23" class="required"> <th height="23" class="required">
@ -219,38 +188,17 @@
</th> </th>
<td> <td>
<code:select type="GROUP" id="groupId" name="groupId" defaultSelect="${userInfoVO.groupId}" title="그룹아이디" cls="selectBox" alt="그룹아이디"/> <code:select type="GROUP" id="groupId" name="groupId" defaultSelect="${userInfoVO.groupId}" title="그룹아이디" cls="selectBox" alt="그룹아이디"/>
<%-- <form:errors path="groupId" cssClass="error" />
<form:select path="groupId" id="groupId" title="그룹아이디"> </td>
<form:option value="" label="--선택하세요--" /> </tr>
<form:options items="${groupId_result}" itemValue="code" itemLabel="codeNm" /> </tbody>
</form:select> </table>
--%>
<form:errors path="groupId" cssClass="error" />
</td>
</tr>
</tbody>
</table>
<div class="popup_btn">
<span class="flr">
<c:choose>
<c:when test="${isUpdate}">
<a href="#" class="btn blue" id="btnModify">변경</a>
<a href="#" class="btn red" id="btnRemove">삭제</a>
</c:when>
<c:otherwise>
<a href="#" class="btn blue" id="btnRegist">등록</a>
</c:otherwise>
</c:choose>
<a href="#" class="btn lightgray" id="btnClose">닫기</a> <%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
</span> </div>
</div> </div>
<!-- //popup_btn --> <!-- //popup -->
</div> </form:form>
</div>
<!-- //popup -->
</form:form>
<script type="text/javaScript"> <script type="text/javaScript">
/************************************************************************** /**************************************************************************
@ -266,20 +214,25 @@
} }
,add: () => { ,add: () => {
if(!validateUserInfoVO($('#userInfoVO'))) return; if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return;
cmmBizAjax('add', { cmmBizAjax('add', {
url: '<c:url value="/framework/biz/mng/usr/addUser.do"/>' url: '<c:url value="/framework/biz/mng/usr/addUser.do"/>'
,data: $("#userInfoVO").serialize() ,data: $("#userInfoVO").serialize()
//,contentType: 'x-www-form-url-encoded'
}) })
} }
,modify: () => { ,modify: () => {
if(!validateUserInfoVO($('#userInfoVO'))) return; if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return;
const data = getFormJson(document.getElementById('userInfoVO'));
console.log(data);
cmmBizAjax('modify', { cmmBizAjax('modify', {
url: '<c:url value="/framework/biz/mng/usr/modifyUser.do"/>' url: '<c:url value="/framework/biz/mng/usr/modifyUser.do"/>'
,data: $("#userInfoVO").serialize() ,data: JSON.stringify(data) //$("#userInfoVO").serialize()
,contentType: 'application/json; charset=utf-8'
}); });
} }

@ -78,7 +78,10 @@
</attribute> </attribute>
<attribute> <attribute>
<name>disabled</name> <name>disabled</name>
<required>false</required> <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>display</name>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
</tag> </tag>

@ -139,8 +139,8 @@ var XitCmmnUtil = {
* @param {Object} params json * @param {Object} params json
* @returns {Object} form data + params = serialize data return * @returns {Object} form data + params = serialize data return
*/ */
const fnAddPageInfo = (formEliment, params) => { const fnAddPageInfo = (searchForm, params) => {
let serializeParam = $(formEliment).serialize(); let serializeParam = $(searchForm).serialize();
for(var key in params){ for(var key in params){
if(key=='perPage'){ if(key=='perPage'){
if(params[key]==undefined) if(params[key]==undefined)
@ -196,6 +196,7 @@ const cmmAjax = (param) => {
,data: param.data ,data: param.data
,async: nvl(param.async, true) ,async: nvl(param.async, true)
,dataType: nvl(param.dataType, "json") ,dataType: nvl(param.dataType, "json")
,contentType: nvl(param.contentType, 'application/x-www-form-urlencoded')
,success: function (res) { ,success: function (res) {
if (!param.showSuccessMsg || param.showSuccessMsg === true) { if (!param.showSuccessMsg || param.showSuccessMsg === true) {
alert(res.message); alert(res.message);
@ -214,13 +215,20 @@ const cmmAjax = (param) => {
}; };
/** /**
* <pre>
* 팝업호출시(isPopup)
* 1) alert confirm 업무처리 * 1) alert confirm 업무처리
* 2) 부모(opener) callBackSerch 실행 * 2) 부모(opener) callBackSerch 실행
* 3) window close * 3) window close
* 일반호출시
* 1) alert confirm 업무처리
* 2) fnBiz.search() 호출
* </pre>
* @param {String} workType add | modify | remove * @param {String} workType add | modify | remove
* @param {Object} param * @param {Object} param parameter data
*
*/ */
const cmmBizAjax = (workType, param) => { const cmmBizAjax = (workType, param, isPopup = true) => {
let confirmMsg = '하시겠습니까?'; let confirmMsg = '하시겠습니까?';
if(workType === 'add') confirmMsg = `등록 ${confirmMsg}`; if(workType === 'add') confirmMsg = `등록 ${confirmMsg}`;
else if(workType === 'modify') confirmMsg = `변경 ${confirmMsg}`; else if(workType === 'modify') confirmMsg = `변경 ${confirmMsg}`;
@ -234,8 +242,12 @@ const cmmBizAjax = (workType, param) => {
success: ()=>{ success: ()=>{
//if(callback === 'function') window.opener.callback(); //if(callback === 'function') window.opener.callback();
//else window.opener.callbackSearch(); //else window.opener.callbackSearch();
window.opener.callbackSearch(); if(isPopup) {
window.close(); window.opener.callbackSearch();
window.close();
}else{
fnBiz.search();
}
} }
}); });
if(confirm(confirmMsg)) { if(confirm(confirmMsg)) {

@ -377,7 +377,9 @@ function setComma(n) {
return n; return n;
} }
const setDateTimeFmt = (srcDateStr, delimiter = '-') => { function setDateTimeFmt(srcDateStr, delimiter = '-') {
if(srcDateStr == null || srcDateStr.isBlank()) return srcDateStr;
let srcDate = srcDateStr.replace(/\-|\s|\:|\./g,''); let srcDate = srcDateStr.replace(/\-|\s|\:|\./g,'');
if(srcDate.length == 8) { if(srcDate.length == 8) {
return srcDate.substring(0, 4)+delimiter+srcDate.substring(4, 6)+delimiter+srcDate.substring(6, 8); return srcDate.substring(0, 4)+delimiter+srcDate.substring(4, 6)+delimiter+srcDate.substring(6, 8);
@ -389,7 +391,9 @@ const setDateTimeFmt = (srcDateStr, delimiter = '-') => {
} }
} }
const setDateFmt = (srcDateStr, delimiter = '-') => { function setDateFmt(srcDateStr, delimiter = '-') {
if(srcDateStr == null || srcDateStr.isBlank()) return srcDateStr;
let srcDate = srcDateStr.replace(/\-|\s|\:|\./g,''); let srcDate = srcDateStr.replace(/\-|\s|\:|\./g,'');
if(srcDate.length >= 8) { if(srcDate.length >= 8) {
return srcDate.substring(0, 4)+delimiter+srcDate.substring(4, 6)+delimiter+srcDate.substring(6, 8); return srcDate.substring(0, 4)+delimiter+srcDate.substring(4, 6)+delimiter+srcDate.substring(6, 8);
@ -398,3 +402,51 @@ const setDateFmt = (srcDateStr, delimiter = '-') => {
} }
} }
/**
* <pre>
* form의 element data를 json data로 return
* form 내의 element name 필수
* </pre>
* @param {Object} formObj form Object
* @returns {Object} json Object
*/
function getFormJson(formObj) {
// Getting an FormData
let data = new FormData(formObj);
// Getting a Serialize Data from FormData
return serialize(data);
// Log
//console.log(JSON.stringify(serializedFormData));
}
/**
* <pre>
* FormData(new FormData(formObj)) json Object로 return
* form 내의 element의 name 필수
* </pre>
* @param formData new FormData(formObj) 형태의 데이타
* @returns {Object} json Object
*/
function serialize (formData) {
let rtnData = {};
for (let [key, value] of formData) {
let sel = document.querySelectorAll("[name=" + key + "]");
// Array Values
if (sel.length > 1) {
if (rtnData[key] === undefined) {
rtnData[key] = [];
}
rtnData[key].push(value);
}
// Other
else {
rtnData[key] = value;
}
}
return rtnData;
}

@ -97,7 +97,8 @@ const TuiGrid = {
readData: { readData: {
contentType: 'application/json', contentType: 'application/json',
dataType: 'json', dataType: 'json',
method: 'get' method: 'get',
initParams: {}
} }
, createData: {url: '', method: 'POST'} , createData: {url: '', method: 'POST'}
, updateData: {url: '', method: 'PUT'} , updateData: {url: '', method: 'PUT'}
@ -118,8 +119,8 @@ const TuiGrid = {
perPage: 15 perPage: 15
}, //[선택]한 페이지에 출력할 건수 }, //[선택]한 페이지에 출력할 건수
columnOptions: { //[선택]고정 컬럼 columnOptions: { //[선택]고정 컬럼
frozenCount: 1 //고정컬럼 갯수 //frozenCount: 0 //고정컬럼 갯수
, frozenBorderWidth: 2 //고정컬럼 보더(border) 두께 frozenBorderWidth: 2 //고정컬럼 보더(border) 두께
, resizable: true , resizable: true
, minWidth: 100 //최소 사이즈 , minWidth: 100 //최소 사이즈
}, },
@ -145,11 +146,19 @@ const TuiGrid = {
console.log(msg); console.log(msg);
//if($('#totCnt span')){ //if($('#totCnt span')){
if(document.getElementById('totCnt')){ if(document.getElementById('totCnt')){
$('#totCnt span').text(JSON.parse(ev.xhr.response).data.pagination.totalCount); const res = JSON.parse(ev.xhr.response);
// paging
if(res.data.pagination){
$('#totCnt span').text(res.data.pagination.totalCount);
// no paging
}else{
$('#totCnt span').text(res.count)
}
console.log('totCnt >>>>> ',$('#totCnt span').text()) console.log('totCnt >>>>> ',$('#totCnt span').text())
} }
if(successCallback) successCallback(JSON.parse(ev.xhr.response)); //if(successCallback) successCallback(JSON.parse(ev.xhr.response));
if(successCallback) successCallback(ev);
}); });
// 결과가 false인 경우 발생한 경우 // 결과가 false인 경우 발생한 경우
this.instance.on('failResponse', function(ev){ this.instance.on('failResponse', function(ev){

Loading…
Cancel
Save