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

main
Kurt92 2 years ago
commit f7f24f0769

@ -96,3 +96,35 @@ access token : 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
3) MyBatisX
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"%>
```

@ -1,6 +1,12 @@
package kr.xit.framework.biz.cmm.model;
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.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ToString
public class XitAuthorGroupInfoVO extends BaseVO {
/**
* serialVersionUID
*/
private static final long serialVersionUID = -4390096179096398215L;
protected String group_id; //그룹 id
protected String group_nm; //그룹 명
protected String group_creat_de; //그룹 생성 일
protected String group_dc; //그룹 설명
protected String author_code; //권한 코드
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;
}
private String groupId; //그룹 id
private String groupNm; //그룹 명
private String groupDc; //그룹 설명
private String authorCode; //권한 코드
private String authorNm;
private String groupCreatDe; //그룹 생성 일
}

@ -1,6 +1,12 @@
package kr.xit.framework.biz.cmm.model;
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.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ToString
public class XitAuthorInfoVO extends BaseVO {
/**
@ -19,35 +31,8 @@ public class XitAuthorInfoVO extends BaseVO {
*/
private static final long serialVersionUID = 4982342550430087973L;
protected String author_code; //권한 코드
protected String author_nm; //권한 명
protected String author_dc; //권한 설명
protected String author_creat_de; //권한 생성 일
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;
}
protected String authorCode; //권한 코드
protected String authorNm; //권한 명
protected String authorDc; //권한 설명
protected String authorCreatDe; //권한 생성 일
}

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

@ -1,6 +1,12 @@
package kr.xit.framework.biz.cmm.model;
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.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ToString
public class XitRoleSclsrtRescueVO extends BaseVO {
/**
* serialVersionUID
@ -19,20 +31,6 @@ public class XitRoleSclsrtRescueVO extends BaseVO {
private static final long serialVersionUID = 8476668045494460949L;
protected String parnts_role; //부모 역할
protected String chldrn_role; //자식 역할
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;
}
protected String parntsRole; //부모 역할
protected String chldrnRole; //자식 역할
}

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

@ -523,16 +523,16 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
// 그룹의 권한 조회
XitAuthorGroupInfoVO groupInfo = new XitAuthorGroupInfoVO();
groupInfo.setGroup_id(groupId);
groupInfo.setGroupId(groupId);
groupInfo = xitFrameCrudService.findXitAuthorGroupInfo(groupInfo);
// 권한 설정
if (XitCmmnUtil.isEmpty(groupInfo))
return "ROLE_USER";
else {
if (XitCmmnUtil.isEmpty(groupInfo.getAuthor_code()))
if (XitCmmnUtil.isEmpty(groupInfo.getAuthorCode()))
return "ROLE_USER";
else
return groupInfo.getAuthor_code();
return groupInfo.getAuthorCode();
}
}
@ -572,7 +572,7 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
boolean isExists = false;
//사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getParnts_role().equals(userAuthorCode)) {
if(item.getParntsRole().equals(userAuthorCode)) {
isExists = true;
break;
}
@ -580,7 +580,7 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
//사용자 권한이 최상위 권한이면 true 반환
if(!isExists)
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getChldrn_role().equals(userAuthorCode)) {
if(item.getChldrnRole().equals(userAuthorCode)) {
log.debug("This user is Top-Level Author !!");
return true;
}
@ -622,13 +622,13 @@ public class XitFrameUnitServiceImpl implements XitFrameUnitService {
if (result)
break;
// 권한코드가 일치하지 않으면 skip
if (!item.getParnts_role().equals(authorCode))
if (!item.getParntsRole().equals(authorCode))
continue;
if (item.getChldrn_role().equals(highAuthorCode)) { // 상위 권한과 일치하면
if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면
result = true;
} 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.Map;
import org.apache.ibatis.session.RowBounds;
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.XitAuthRegMngSearchVO;
import kr.xit.framework.core.model.XitBaseSearchVO;
/**
@ -20,26 +24,19 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthMgtMapper {
public interface AuthAuthorMgtMapper {
/**
* <pre> : </pre>
* @param searchVO
*
* @param vo
* @param rowBounds
* @return List<XitAuthRegMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitAuthRegMngVO> findList(XitAuthRegMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthRegMngSearchVO searchVO) throws SQLException;
List<XitAuthorInfoVO> selectAuthorInfos(Map<String, Object> vo, RowBounds rowBounds);
/**
* <pre> : </pre>
@ -48,9 +45,32 @@ public interface AuthMgtMapper {
* @author:
* @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);
/**
* <pre> : </pre>
@ -69,4 +89,5 @@ public interface AuthMgtMapper {
*/
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
}

@ -2,8 +2,13 @@ package kr.xit.framework.biz.mng.auth.mapper;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
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.XitAuthGrpMngVO;
@ -20,6 +25,26 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
@Mapper
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>
* @param searchVO
@ -46,4 +71,6 @@ public interface AuthGrpMgtMapper {
* @date: 2020. 4. 16.
*/
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) throws SQLException;
}

@ -3,6 +3,10 @@ package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
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.XitAuthRegMngVO;
import kr.xit.framework.core.model.XitBaseSearchVO;
@ -17,7 +21,7 @@ import kr.xit.framework.core.model.XitBaseSearchVO;
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthMgtService {
public interface AuthAuthorMgtService {
/**
@ -27,26 +31,36 @@ public interface AuthMgtService {
* @author:
* @date: 2020. 4. 16.
*/
public List<XitAuthRegMngVO> findList(XitAuthRegMngSearchVO searchVO);
/**
* <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);
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds);
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 vo void
@ -89,7 +103,7 @@ public interface AuthMgtService {
* @author:
* @date: 2020. 4. 16.
*/
public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO);
List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
@ -97,7 +111,7 @@ public interface AuthMgtService {
* @author:
* @date: 2020. 4. 16.
*/
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO);
/**
* <pre> : </pre>
* @param authCode
@ -106,6 +120,7 @@ public interface AuthMgtService {
* @author:
* @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;
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.XitAuthGrpMngVO;
@ -17,6 +22,16 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
*/
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);
/**
* <pre> : </pre>

@ -1,77 +1,124 @@
package kr.xit.framework.biz.mng.auth.service.impl;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
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.service.XitFrameCrudService;
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.service.AuthMgtService;
import kr.xit.framework.biz.mng.auth.model.XitAuthRegMngSearchVO;
import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService;
import kr.xit.framework.core.model.XitBaseSearchVO;
import kr.xit.framework.core.utils.XitCmmnUtil;
@Service
public class AuthMgtServiceImpl implements AuthMgtService {
private static final Logger logger = LoggerFactory.getLogger(AuthMgtServiceImpl.class);
public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
private static final Logger logger = LoggerFactory.getLogger(AuthAuthorMgtServiceImpl.class);
@Resource
private AuthMgtMapper xitAuthRegMngMapper;
private AuthAuthorMgtMapper mapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitFrameUnitService xitFrameUnitService;
/** 부모 권한코드 */
final String PARNTS_AUTHOR = "ROLE_USER";
final String PARNTS_AUTHOR = "ROLE_USER";
/** 자녀 권한코드 */
final String CHLDRN_AUTHOR = "ROLE_ADMIN";
final String CHLDRN_AUTHOR = "ROLE_ADMIN";
@Override
public List<XitAuthRegMngVO> findList(XitAuthRegMngSearchVO searchVO) {
List<XitAuthRegMngVO> result = null;
try {
result = xitAuthRegMngMapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("권한관리 목록 조회 FAIL::", e);
}
return result;
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorInfos(paraMap, rowBounds);
}
@Override
public int findListTotCnt(XitAuthRegMngSearchVO searchVO) {
int result = 0;
try {
result = xitAuthRegMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("권한관리 목록 총건수 조회 FAIL::", e);
}
return result;
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
public XitAuthRegMngVO findView(XitAuthRegMngVO vo) {
XitAuthRegMngVO result = null;
try {
result = xitAuthRegMngMapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("권한관리 상세정보 조회 FAIL::", e);
}
return result;
public void addAuthAuthor(final XitAuthorInfoVO vo){
//권한정보 Insert
mapper.insertAuthorInfo(vo);
//계층구조생성
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(vo.getAuthorCode());
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParntsRole(vo.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
@Override
public void modifyAuthAuthor(final XitAuthorInfoVO vo){
mapper.updateAuthorInfo(vo);
}
public void removeAuthAuthor(final String authorCode){
//계층구조 삭제
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
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
public void addProc(XitAuthRegMngVO vo) {
/* =====================================================
@ -113,12 +160,12 @@ public class AuthMgtServiceImpl implements AuthMgtService {
try {
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성
roleSclsrtRescueVO.setParnts_role(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrn_role(authorInfoVO.getAuthor_code());
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authorInfoVO.getAuthorCode());
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParnts_role(authorInfoVO.getAuthor_code());
roleSclsrtRescueVO.setChldrn_role(CHLDRN_AUTHOR);
roleSclsrtRescueVO.setParntsRole(authorInfoVO.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
} catch (Exception e) {
logger.debug(String.format("권한계층 Insert Fail : %s", e.getMessage()));
@ -177,12 +224,12 @@ public class AuthMgtServiceImpl implements AuthMgtService {
try {
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 제거
roleSclsrtRescueVO.setParnts_role(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrn_role(authorInfoVO.getAuthor_code());
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authorInfoVO.getAuthorCode());
xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거
roleSclsrtRescueVO.setParnts_role(authorInfoVO.getAuthor_code());
roleSclsrtRescueVO.setChldrn_role(CHLDRN_AUTHOR);
roleSclsrtRescueVO.setParntsRole(authorInfoVO.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
xitFrameCrudService.removeXitRoleSclsrtRescue(roleSclsrtRescueVO);
} catch (Exception e) {
logger.debug(String.format("권한계층 Delete Fail : %s", e.getMessage()));
@ -211,12 +258,12 @@ public class AuthMgtServiceImpl implements AuthMgtService {
@Override
public List<Map<String, String>> findListAuthorRole(XitBaseSearchVO searchVO) {
return xitAuthRegMngMapper.findListAuthorRole(searchVO);
return mapper.findListAuthorRole(searchVO);
}
@Override
public int findListAuthorRoleTotCnt(XitBaseSearchVO searchVO) {
return xitAuthRegMngMapper.findListAuthorRoleTotCnt(searchVO);
return mapper.findListAuthorRoleTotCnt(searchVO);
}
@Override
@ -263,9 +310,9 @@ public class AuthMgtServiceImpl implements AuthMgtService {
*/
private XitAuthorInfoVO convertToCrudVO(XitAuthRegMngVO vo) {
XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO();
authorInfoVO.setAuthor_code (vo.getAuthorCode()); //권한 코드
authorInfoVO.setAuthor_nm (vo.getAuthorNm()); //권한 명
authorInfoVO.setAuthor_dc (vo.getAuthorDc()); //권한 설명
authorInfoVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
authorInfoVO.setAuthorNm(vo.getAuthorNm()); //권한 명
authorInfoVO.setAuthorDc(vo.getAuthorDc()); //권한 설명
// authorInfoVO.setAuthor_creat_de(vo.getAuthorCreatDe()); //권한 생성 일
return authorInfoVO;

@ -2,28 +2,44 @@ package kr.xit.framework.biz.mng.auth.service.impl;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
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.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.model.XitAuthGrpMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthGrpMngVO;
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.utils.XitCmmnUtil;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
@Resource
private AuthGrpMgtMapper xitAuthGrpMngMapper;
private AuthGrpMgtMapper mapper;
@Resource
private AuthAuthorMgtMapper authAuthorMgtMapper;
@Resource
private UserMgtMapper userMgtMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
@ -33,11 +49,145 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
@Resource
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) {
// 유효성 확인
boolean isChangePermission = isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
if(!isChangePermission)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");
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) {
// 유효성 확인
boolean isChangePermission = isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
if(!isChangePermission)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");
mapper.updateAuthorGroupInfo(vo);
}
@Override
public void removeAuthGrp(final String groupId) {
mapper.deleteAuthorGroupInfo(groupId);
}
private boolean 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();
return this.isCheckUserAuthorCodeForCanChange(userAuthorCode, trgetAuthorCode);
}
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
public List<XitAuthGrpMngVO> findList(XitAuthGrpMngSearchVO searchVO) {
List<XitAuthGrpMngVO> result = null;
try {
result = xitAuthGrpMngMapper.findList(searchVO);
result = mapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 목록 조회 FAIL::", e);
}
@ -48,7 +198,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
public int findListTotCnt(XitAuthGrpMngSearchVO searchVO) {
int result = 0;
try {
result = xitAuthGrpMngMapper.findListTotCnt(searchVO);
result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 목록 총건수 조회 FAIL::", e);
}
@ -59,7 +209,7 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
public XitAuthGrpMngVO findView(XitAuthGrpMngVO vo) {
XitAuthGrpMngVO result = null;
try {
result = xitAuthGrpMngMapper.findView(vo);
result = mapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("사용자그룹관리 상세정보 조회 FAIL::", e);
}
@ -155,11 +305,11 @@ public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
*/
private XitAuthorGroupInfoVO convertToCrudVO(XitAuthGrpMngVO vo) {
XitAuthorGroupInfoVO authorGroupInfoVO = new XitAuthorGroupInfoVO();
authorGroupInfoVO.setGroup_id (vo.getGroupId()); //그룹 id
authorGroupInfoVO.setGroup_nm (vo.getGroupNm()); //그룹 명
authorGroupInfoVO.setGroupId(vo.getGroupId()); //그룹 id
authorGroupInfoVO.setGroupNm(vo.getGroupNm()); //그룹 명
// authorGroupInfoVO.setGroup_creat_de(); //그룹 생성 일
authorGroupInfoVO.setGroup_dc (vo.getGroupDc()); //그룹 설명
authorGroupInfoVO.setAuthor_code (vo.getAuthorCode()); //권한 코드
authorGroupInfoVO.setGroupDc(vo.getGroupDc()); //그룹 설명
authorGroupInfoVO.setAuthorCode(vo.getAuthorCode()); //권한 코드
return authorGroupInfoVO;
}

@ -80,7 +80,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
return result;
String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrn_role());
String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole());
topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim();
String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode);
result.setAuthorRescueCode(strAuthorRescueCode);
@ -155,8 +155,8 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
for(int k=0; k<arrChldrnRole.length; k++) {
String chldrnRole = arrChldrnRole[k];
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParnts_role(parntsRole);
roleSclsrtRescueVO.setChldrn_role(chldrnRole);
roleSclsrtRescueVO.setParntsRole(parntsRole);
roleSclsrtRescueVO.setChldrnRole(chldrnRole);
xitFrameCrudService.addXitRoleSclsrtRescue(roleSclsrtRescueVO);
}
@ -252,16 +252,16 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
if(isChldrnSearch) {
// 권한코드가 일치하지 않으면 skip
if (!item.getParnts_role().equals(authorCode))
if (!item.getParntsRole().equals(authorCode))
continue;
//권한코드 Set
if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getChldrn_role()))
if(resultMap.get(authorCode).equals(item.getChldrnRole()))
continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrn_role());
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrnRole());
}else {
//동일한 값이 있으면 담지 않음
// if(!resultMap.containsValue(item.getChldrn_role()))
@ -273,39 +273,39 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
String[] values = it.next().split(",");
for(int j=0; j<values.length; j++) {
String value = values[j].trim();
if(value.equals(item.getChldrn_role())) {
if(value.equals(item.getChldrnRole())) {
isExists = true;
break LOOP;
}
}
}
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 {
// 권한코드가 일치하지 않으면 skip
if (!item.getChldrn_role().equals(authorCode))
if (!item.getChldrnRole().equals(authorCode))
continue;
//재탐색
this.getAuthHierarchy(list, item.getParnts_role(), isChldrnSearch, resultMap);
this.getAuthHierarchy(list, item.getParntsRole(), isChldrnSearch, resultMap);
//권한코드 Set
if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getParnts_role()))
if(resultMap.get(authorCode).equals(item.getParntsRole()))
continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getParnts_role());
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getParntsRole());
}else {
//동일한 값이 있으면 담지 않음
if(!resultMap.containsValue(item.getParnts_role()))
resultMap.put(authorCode, item.getParnts_role());
if(!resultMap.containsValue(item.getParntsRole()))
resultMap.put(authorCode, item.getParntsRole());
// Iterator<String> it = resultMap.values().iterator();
// boolean isExists = false;
// LOOP:
@ -335,7 +335,7 @@ public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO());
Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthor_code(), item.getAuthor_nm());
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
}

@ -11,28 +11,41 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
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.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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView;
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.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.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
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.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.Checks;
import kr.xit.framework.support.util.ValidationError;
import kr.xit.framework.support.util.constants.MessageKey;
/**
*
@ -46,10 +59,10 @@ import kr.xit.framework.support.util.AjaxUtils;
*/
@Controller
@RequestMapping("/framework/biz/mng/auth")
public class AuthMgtController {
public class AuthAuthorMgtController {
@Resource
private AuthMgtService xitAuthRegMngService;
private AuthAuthorMgtService service;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
@ -63,69 +76,113 @@ public class AuthMgtController {
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "/mngAuthMgtForm", method={RequestMethod.GET, RequestMethod.POST})
public void mngAuthMgtForm() {
@RequestMapping(value = "/mngAuthAuthorMgtForm", method={RequestMethod.GET, RequestMethod.POST})
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>
* @return String
* @author:
* @date: 2020. 7. 30.
*/
@RequestMapping(value = "AuthRegMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> AuthRegMng_listAjax(@ModelAttribute("authorManageVO") XitAuthRegMngSearchVO searchVO, ModelMap model) {
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = 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;
@GetMapping(value = "findAuthAuthors")
public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) {
return ResultResponse.of(service.findAuthAuthors(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(value = "/addAuthAuthor")
//public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//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();
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>
* @param page
* @param cmd
* @param tilesDef Type(none: tiles )
* @param model
* @return String
@ -143,7 +200,7 @@ public class AuthMgtController {
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("authorManage", xitAuthRegMngService.findView(vo));
//model.addAttribute("authorManage", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
@ -156,103 +213,8 @@ public class AuthMgtController {
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthRegMng_"+cmd+tilesDef;
}
/**
* <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 +258,7 @@ public class AuthMgtController {
}
//처리
try {
xitAuthRegMngService.addProc(vo);
service.addProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) {
@ -323,7 +285,7 @@ public class AuthMgtController {
}
//처리
try {
xitAuthRegMngService.modifyProc(vo);
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
@ -338,7 +300,7 @@ public class AuthMgtController {
case "delete": //삭제
//처리
try {
xitAuthRegMngService.removeProc(vo);
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
@ -354,7 +316,7 @@ public class AuthMgtController {
case "deletes": //다건 삭제
//처리
try {
xitAuthRegMngService.removesProc(authorCodes);
service.removesProc(authorCodes);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
@ -369,7 +331,7 @@ public class AuthMgtController {
//처리
sLocationUrl = "forward:/framework/biz/mng/auth/AuthRegMng_rolegrant_popup";
try {
xitAuthRegMngService.addAuthorRole(authorCode, roleCodes.split(";"), regYns.split(";"));
service.addAuthorRole(authorCode, roleCodes.split(";"), regYns.split(";"));
status.setComplete();
model.addAttribute("message", xitMessageSource.getMessage("success.common.insert"));
} 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.ModelAttribute;
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.RequestMethod;
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 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.service.XitFrameCrudService;
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.TILES_TYPE;
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.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.Checks;
import kr.xit.framework.support.util.constants.MessageKey;
/**
*
@ -53,7 +60,7 @@ import kr.xit.framework.support.util.AjaxUtils;
public class AuthGrpMgtController {
@Resource
private AuthGrpMgtService xitAuthGrpMngService;
private AuthGrpMgtService service;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Autowired
@ -69,15 +76,82 @@ public class AuthGrpMgtController {
* @date: 2020. 4. 16.
*/
@GetMapping(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();
XitAuthorInfoVO authorInfoVO = new XitAuthorInfoVO();
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(authorInfoVO);
mav.addObject("listAuthorInfoVO", listAuthorInfoVO);
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getGroupId())){
mav.addObject("groupManage", new XitAuthorGroupInfoVO());
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;
}
@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>
* @return String
@ -102,7 +176,7 @@ public class AuthGrpMgtController {
/**
*
*/
int totCnt = xitAuthGrpMngService.findListTotCnt(searchVO);
int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
@ -113,7 +187,7 @@ public class AuthGrpMgtController {
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", 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>();
pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt);
@ -164,7 +238,7 @@ public class AuthGrpMgtController {
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("groupManage", xitAuthGrpMngService.findView(vo));
model.addAttribute("groupManage", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
@ -243,7 +317,7 @@ public class AuthGrpMgtController {
}
//처리
try {
xitAuthGrpMngService.addProc(vo);
service.addProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
model.addAttribute("groupId", vo.getGroupId());
@ -270,7 +344,7 @@ public class AuthGrpMgtController {
}
//처리
try {
xitAuthGrpMngService.modifyProc(vo);
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
@ -285,7 +359,7 @@ public class AuthGrpMgtController {
case "delete": //삭제
//처리
try {
xitAuthGrpMngService.removeProc(vo);
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
@ -301,7 +375,7 @@ public class AuthGrpMgtController {
case "deletes": //다건 삭제
//처리
try {
xitAuthGrpMngService.removesProc(groupIds);
service.removesProc(groupIds);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {

@ -166,7 +166,7 @@ public class AuthHierarchyMgtController {
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO());
Map<String, String> mAuthorInfo = new HashMap<String, String>();
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>();
@ -187,8 +187,8 @@ public class AuthHierarchyMgtController {
while(it.hasNext()) {
String authorCode = it.next();
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
authorInfo.setAuthor_code(authorCode);
authorInfo.setAuthor_nm(mNoDuplAuthorInfo.get(authorCode));
authorInfo.setAuthorCode(authorCode);
authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
listAuthorInfo.add(authorInfo);
}

@ -77,7 +77,7 @@ public class AuthRoleMgtController {
public ModelAndView mngAuthRoleMgtPopup(@ModelAttribute final XitRoleInfoVO vo){
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo)){
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getRoleCode())){
mav.addObject("roleManage", new XitRoleInfoVO());
mav.addObject("pageTitle", "롤 등록");
} else {

@ -32,6 +32,7 @@ public interface UserMgtMapper {
*/
List<XitUserInfoVO> selectUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitUserInfoVO selectUser(final String uniqId);
@SuppressWarnings("MybatisXMapperMethodInspection")
Map<String,Object> selectCheckUserInfo(final String userId);
int insertUserInfo(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);
int insertUserScrtySetup(final XitUserScrtySetupVO vo);
int updateUserScrtySetup(final XitUserScrtySetupVO vo);

@ -38,8 +38,6 @@ public interface UserMgtService {
String getDefaultAuthorCode(final String groupId);
Map<String, Object> findAuthorGroupInfo(final String groupId);
int addUserScrtySetup(final XitUserScrtySetupVO 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.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.XitUserInfoVO;
import kr.xit.framework.biz.cmm.model.XitUserScrtySetupVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
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.model.XitUserRegMngVO;
import kr.xit.framework.biz.mng.user.service.UserMgtService;
@ -33,6 +35,8 @@ public class UserMgtServiceImpl implements UserMgtService {
@Resource
private UserMgtMapper mapper;
@Resource
private AuthGrpMgtMapper authGrpMgtMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitMessageSource xitMessageSource;
@ -165,26 +169,18 @@ public class UserMgtServiceImpl implements UserMgtService {
public String getDefaultAuthorCode(final String groupId) {
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";
else {
if (Checks.isEmpty(authMap.get("author_code")))
if (Checks.isEmpty(vo.getAuthorCode()))
return "ROLE_USER";
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
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.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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -117,7 +118,7 @@ public class UserMgtController {
@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);
ValidationError.of("userInfoVO", vo, bindingResult);

@ -19,7 +19,7 @@
</select>
<select id="selectComboCodes" parameterType="map" resultType="caseMap">
/* cachecode-mysql-mapper|selectComboCodes-공통코드 코드그룹 콤보코드 조회|julim */
/* cachecode-mysql-mapper|selectComboCodes-공통[업무] 콤보코드 조회|julim */
<choose>
@ -37,8 +37,18 @@
FROM xit_author_group_info
</when>
<!-- 공통 코드 -->
<when test='type != null and type == "AUTH_GRP"'>
/* 권한 그룹 코드 */
SELECT author_code AS code
, author_nm AS code_nm
FROM xit_author_info
</when>
<otherwise>
/* 공통 코드 */
SELECT code
, code_nm
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_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>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE =
#{authorCreatDe
</if>
</select>
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfo */
@ -93,7 +95,7 @@
,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
AND AUTHOR_CODE = #{authorCode
</select>
<insert id="addXitAuthorInfo">
/** addXitAuthorInfo */
@ -116,17 +118,17 @@
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>
<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 = #{authorDc</if>
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
AND AUTHOR_CODE = #{authorCode
</update>
<delete id="removeXitAuthorInfo">
/** removeXitAuthorInfo */
/** 권한정보 삭제 */
DELETE FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
AND AUTHOR_CODE = #{authorCode
</delete>
@ -2008,8 +2010,8 @@
,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE
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(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_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 = #{chldrnRole</if>
</select>
<select id="findXitRoleSclsrtRescue" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/** findXitRoleSclsrtRescue */
@ -2018,8 +2020,8 @@
,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
AND PARNTS_ROLE = #{parnts_role}
AND CHLDRN_ROLE = #{chldrn_role}
AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrnRole
</select>
<insert id="addXitRoleSclsrtRescue">
/** addXitRoleSclsrtRescue */
@ -2046,16 +2048,16 @@
/** 역할계층구조 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
AND PARNTS_ROLE = #{parnts_role}
AND CHLDRN_ROLE = #{chldrn_role}
AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrnRole
</delete>
<delete id="removesXitRoleSclsrtRescue">
/** removesXitRoleSclsrtRescue */
/** 역할계층구조 다건 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE
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(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_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 = #{chldrnRole</if>
</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_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>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE =
#{authorCreatDe
</if>
</select>
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfo */
@ -93,7 +95,7 @@
,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
AND AUTHOR_CODE = #{authorCode
</select>
<insert id="addXitAuthorInfo">
/** addXitAuthorInfo */
@ -116,17 +118,17 @@
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>
<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 = #{authorDc</if>
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
AND AUTHOR_CODE = #{authorCode
</update>
<delete id="removeXitAuthorInfo">
/** removeXitAuthorInfo */
/** 권한정보 삭제 */
DELETE FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
AND AUTHOR_CODE = #{authorCode
</delete>
@ -2008,8 +2010,8 @@
,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE
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(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_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 = #{chldrnRole</if>
</select>
<select id="findXitRoleSclsrtRescue" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
/** findXitRoleSclsrtRescue */
@ -2018,8 +2020,8 @@
,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
AND PARNTS_ROLE = #{parnts_role}
AND CHLDRN_ROLE = #{chldrn_role}
AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrnRole
</select>
<insert id="addXitRoleSclsrtRescue">
/** addXitRoleSclsrtRescue */
@ -2046,16 +2048,16 @@
/** 역할계층구조 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
AND PARNTS_ROLE = #{parnts_role}
AND CHLDRN_ROLE = #{chldrn_role}
AND PARNTS_ROLE = #{parntsRole
AND CHLDRN_ROLE = #{chldrnRole
</delete>
<delete id="removesXitRoleSclsrtRescue">
/** removesXitRoleSclsrtRescue */
/** 역할계층구조 다건 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE
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(chldrn_role)">AND CHLDRN_ROLE = #{chldrn_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 = #{chldrnRole</if>
</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', 'N') 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">
<!-- *************************************************************************************************************
* xit_user_info : 업무사용자 정보
* xit_author_group_info : 권한그룹 정보
************************************************************************************************************** -->
<select id="findXitAuthorGroupInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfos */
/** 권한그룹정보 다건 조회 */
SELECT GROUP_ID
,GROUP_NM
,GROUP_CREAT_DE
,GROUP_DC
,AUTHOR_CODE
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
<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(group_nm )">AND GROUP_NM = #{group_nm }</if>
<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(group_dc )">AND GROUP_DC = #{group_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
<select id="selectAuthorGroupInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/* auth-grp-mysql-mapper|selectAuthorGroupInfos-권한그룹 목록 조회|julim */
SELECT agi.group_id
, agi.group_nm
, agi.group_dc
, agi.author_code
, xai.author_nm
, agi.group_creat_de
FROM xit_author_group_info agi
LEFT OUTER JOIN xit_author_info xai
ON agi.author_code = xai.author_code
<where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">
AND agi.group_nm = #{groupNm}
</if>
</where>
</select>
<select id="findXitAuthorGroupInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfo */
/** 권한그룹정보 조회 */
SELECT GROUP_ID
,GROUP_NM
,GROUP_CREAT_DE
,GROUP_DC
,AUTHOR_CODE
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
AND GROUP_ID = #{group_id}
<select id="selectAuthorGroupInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/* auth-grp-mysql-mapper|selectAuthorGroupInfo-권한그룹 정보 조회|julim */
SELECT group_id
, group_nm
, group_dc
, author_code
, group_creat_de
FROM xit_author_group_info
WHERE group_id = #{groupId}
</select>
<insert id="addXitAuthorGroupInfo">
/** addXitAuthorGroupInfo */
/** 권한그룹정보 등록 */
INSERT INTO XIT_AUTHOR_GROUP_INFO(
GROUP_ID
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">,GROUP_NM</if>
,GROUP_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">,GROUP_DC</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code)">,AUTHOR_CODE</if>
<insert id="insertAuthorGroupInfo">
/* auth-grp-mysql-mapper|insertAuthorGroupInfo-권한그룹 등록|julim */
INSERT INTO xit_author_group_info(
group_id
, group_nm
, group_dc
, author_code
, group_creat_de
)VALUES(
#{group_id }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">,#{group_nm }</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">,#{group_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code)">,#{author_code }</if>
#{groupId}
, #{groupNm}
, #{groupDc}
, #{authorCode}
, DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="modifyXitAuthorGroupInfo">
/** modifyXitAuthorGroupInfo */
/** 권한그룹정보 수정 */
UPDATE XIT_AUTHOR_GROUP_INFO
SET
GROUP_CREAT_DE = GROUP_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_nm )">,GROUP_NM = #{group_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_dc )">,GROUP_DC = #{group_dc }</if>
<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 id="updateAuthorGroupInfo">
/* auth-grp-mysql-mapper|updateAuthorGroupInfo-권한그룹 정보 변경|julim */
UPDATE xit_author_group_info
SET group_nm = IF(group_nm = #{groupNm}, group_nm, #{groupNm})
, group_dc = IF(group_dc = #{groupDc}, group_dc, #{groupDc})
, author_code = IF(author_code = #{authorCode}, author_code, #{authorCode})
WHERE group_id = #{groupId}
</update>
<delete id="removeXitAuthorGroupInfo">
/** removeXitAuthorGroupInfo */
/** 권한그룹정보 삭제 */
DELETE FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
AND GROUP_ID = #{group_id}
<delete id="deleteAuthorGroupInfo">
/* auth-grp-mysql-mapper|deleteAuthorGroupInfo-권한그룹 삭제|julim */
DELETE
FROM xit_author_group_info
WHERE group_id = #{groupId}
</delete>
@ -77,6 +74,17 @@
<!-- SQL 페이징 코드 -->
<sql id="pageBefore">
SELECT LIST.* FROM(

@ -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>

@ -205,13 +205,14 @@
<!-- *************************************************************************************************************
* xit_entrprs_mber : 기업사용자 정보
************************************************************************************************************** -->
<delete id="delectEntrprsMber" parameterType="string">
<delete id="deleteEntrprsMber" parameterType="string">
/* user-mysql-mapper|delectEntrprsMber-기업사용자정보 삭제|julim */
DELETE
FROM xit_entrprs_mber
WHERE entrprs_mber_id = #{userId}
</delete>
<!-- *************************************************************************************************************
* 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>

@ -499,7 +499,7 @@
api: {
readData: {
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;
},
/* ========================
* 페이지 이동
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
======================== */
pageLink: function(flag, url, params){
switch (flag) {
case "move": //페이지 이동
break;
default:
break;
}
},
}
}

@ -325,6 +325,7 @@
api: {
readData: {
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>

@ -263,7 +263,7 @@ GridConfig.setOptDataSource({ //DataSource
----------------------- */
api: {
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: {}
,serializer: function(params) {
var form = document.listForm;

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

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

@ -0,0 +1,129 @@
<%@ 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">
<input name="authorCode" id="authorCode" type="text" value="<c:out value='${authorInfoVO.authorCode}'/>" readonly="isUpdate" size="40" title="권한코드" />&nbsp;
</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,12 +1,7 @@
<%@ 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="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"/>
<form:form id="frmSearch" name="frmSearch">
<div class="search r2">
<table>
@ -15,15 +10,15 @@
<col style="width: 8%;"/>
<col style="width: 20%;"/>
<col style="width: 8%;"/>
<col style="width: ;"/>
<col/>
<col style="width: 8%;"/>
<col style="width: ;"/>
<col/>
<col style="width: 7%;"/>
</colgroup>
<tbody>
<th>그룹 명</th>
<th>권한 그룹명</th>
<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 colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
@ -34,9 +29,8 @@
<!-- //검색 -->
<div class="page_btn">
<span class="fll">
<span class="flr">
<a href="#" class="btn darkgray" id="btnRegist" title="등록">등록</a>
<a href="#" class="btn red" id="btnRemove" title="삭제">삭제</a>
</span>
</div>
<!-- //버튼 및 페이지정보 -->
@ -45,309 +39,160 @@
<div id="grid"></div>
</form:form>
<script type="text/javaScript" language="javascript" defer="defer">
$(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);
});
/**
* Elements EventListener Settings
*/
//검색 Event 설정
$('#btnSearch').on({
click: function(){
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(){
}
});
},
/* ========================
* 페이지 이동
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
======================== */
pageLink: function(flag, url, params){
<script type="text/javaScript">
class Form {
constructor(grid) {
this.grid = grid;
};
search(){
grid.reloadData();
}
}
/**************************************************************************
* Global Variable
**************************************************************************/
let GRID = null;
var callbackSearch = () => fnBiz.search();
/* *******************************
* 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) {
case "move": //페이지 이동
document.listForm.searchKeyword.value = "";
document.listForm.action = url;
document.listForm.submit();
case "add": //등록
popTitle = "권한 그룹 등록";
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": //상세
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;";
popTitle = "권한 그룹 상세";
break;
default:
break;
}
window.open(popUrl, popTitle ,popOption);
},
/* ========================
* 상세 팝업 오픈 버튼 클릭
-상세 팝업을 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);
CmmPopup.open(url, params, popOption, popTitle);
}
}
,onClickGrid: function(props){
const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('detail', rowData);
}
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').bind('click', () => fnBiz.search());
$('#btnRegist').bind('click', () => {
fnBiz.pagePopup('add', null);
});
/* ******************************
* 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('checkbox'); //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/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];
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [
{
header: '그룹 ID',
name: 'groupId',
width: 120,
sortable: true,
sortingType: 'desc',
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : function(props){
const rowData = props.grid.getRow(props.rowKey);
return {
formatter: rowData.groupId
,element: "text"
}
}
,eventFunction: fnBiz.onClickGrid //function(props){XitAuthGrpMng_list.fnClickGrpBtn(props )} //function(){alert("1234")}
,eventType : "click"
}
}
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: '그룹 ID',
name: 'groupId',
width: 120,
sortable: true,
sortingType: 'desc',
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter : function(props){
var rowData = props.grid.getRow(props.rowKey);
var obj = {
formatter : rowData.groupId
,element : "text"
},
{
header: '그룹 명',
name: 'groupNm',
minWidth: 150,
sortable: false,
align: 'left'
},
{
header: '설명',
name: 'groupDc',
minWidth: 200,
sortable: false,
align: 'left'
},
{
header: '권한',
name: 'authorDetail',
width: 200,
sortable: false,
align: 'left',
renderer: {
type: XitColumnMergeRenderer,
options: {
listColumns: ['authorNm', 'authorCode'],
format: '{0}({1})'
}
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); //
}
}
}
},
{
header: '그룹 명',
name: 'groupNm',
minWidth: 150,
sortable: false,
align: 'left'
},
{
header: '설명',
name: 'groupDc',
minWidth: 200,
sortable: false,
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;
];
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/findAuthGrps.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
}
,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>

@ -2,179 +2,137 @@
<%@ 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 groupManageVO.groupId ? 'INSERT' : 'UPDATE'}"/>
<c:set var="registerFlagName" value="${empty groupManageVO.groupId ? '그룹 등록' : '그룹 수정'}"/>
<!-- 검색 필드 박스 시작 -->
<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" >
<%--@elvariable id="groupManage" type=""--%>
<form:form commandName="groupManage" name="groupManage">
<c:set var="isUpdate" value="${!empty groupManage.groupId}"/>
<c:set var="bizName" value="권한그룹"/>
<c:out value='${isUpdate}'/>
<div class="popup" style="min-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">
<caption>권한 등록</caption>
<tr>
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 ID</th>
<td nowrap="nowrap"><input name="groupId" id="groupId" type="text" readonly="readonly" value="<c:out value='${groupManage.groupId}'/>" size="40" title="그룹 ID" /></td>
<caption>
<c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/>
</caption>
<colgroup>
<col style="width: 25%;"/>
<col/>
</colgroup>
<tr>
<th class="required" scope="row" nowrap="nowrap">
<label>권한그룹 ID</label>
</th>
<td nowrap="nowrap">
<form:input path="groupId" id="groupId" cssClass="txaIpt" readonly="${isUpdate}" size="40" title="그룹 ID" />
</td>
</tr>
<tr>
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 명
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
<th class="required" scope="row" nowrap="nowrap">
<label>권한그룹 명</label>
</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;
<form:errors path="groupNm" />
</td>
</tr>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">설명</th>
<td nowrap="nowrap"><input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" /></td>
<tr>
<th scope="row" nowrap="nowrap">
<label>권한</label>
</th>
<td nowrap="nowrap">
<code:select type="AUTH_GRP" id="authorCode" name="authorCode" defaultSelect="${groupManage.authorCode}" title="권한" cls="selectBox" alt="selectBox tag"/>
</td>
</tr>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">권한</th>
<th scope="row" nowrap="nowrap">
<label>설명</label>
</th>
<td nowrap="nowrap">
<select id="authorCode" name="authorCode">
<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>
<input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" />
</td>
</tr>
<tr>
<th class="required" width="20%" scope="row" nowrap="nowrap">등록일자</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>
<th scope="row" nowrap="nowrap">
<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>
</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>
<!-- //등록버튼 -->
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
</div>
</div>
<!-- //popup -->
<!-- 검색조건 유지 -->
<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">
/**************************************************************************
* Global Variable
**************************************************************************/
$(document).ready(function(){
XitAuthGrpMng_edit.init();
});
/* *******************************
* 사용자그룹관리 수정 Functions
******************************* */
var XitAuthGrpMng_edit = {
init : function(){
//닫기 버튼 Event
$("#btnClose").click(function() {
window.close();
/* *******************************
* Biz function
******************************* */
const fnBiz = {
add: () => {
if(!fnBiz.validate()) return;
cmmBizAjax('add', {
url: '<c:url value="/framework/biz/mng/auth/addAuthGrp.do"/>'
,data: $("#groupManage").serialize()
//,contentType: 'x-www-form-url-encoded'
})
}
,modify: () => {
if(!fnBiz.validate()) return;
cmmBizAjax('modify', {
url: '<c:url value="/framework/biz/mng/auth/modifyAuthGrp.do"/>'
,data: $("#groupManage").serialize()
});
//저장 버튼 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(){
}
});
}
}
/* ========================
* 데이터 수정
======================== */
,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(){
}
});
}
, remove: () => {
cmmBizAjax('remove', {
url: '<c:url value="/framework/biz/mng/auth/removeAuthGrp.do"/>'
,data: {groupId: $('#groupId').val()}
});
}
/* ========================
* 데이터 삭제
======================== */
,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(){
}
});
,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>

@ -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,255 @@
<%@ 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;
const REG_YN = [
{code: 'Y', codeNm: '등록'},
{code: 'N', codeNm: '미등록'},
]
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
}
,add: () => {
var dataSet = GRID.getData(); //Grid에 출력된 DataSet
const arrChecks = GRID.getCheckedRows();
if(arrChecks.length==0) {
alert("등록[변경]할 목록을 선택하세요.");
return false;
}
const arrDatas = [];
arrChecks.forEach((row) => {
arrDatas.push({roleCode: row.roleCode, regYn: row.regYn})
});
const data = {
authorCode: $('#authorCode').val()
,grantData: arrDatas
}
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').bind('click', () => fnBiz.search());
$('#btnRegist').bind('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: '등록여부',
name: 'regYn',
// copyOptions: {
// useListItemText: true
// },
width: 60,
align: 'center',
sortable: true,
/* 에디터 적용 */
formatter: 'listItemText',
editor: {
type: 'radio', //select, radio, checkbox, text
options: {
listItems: [
<c:forTokens var="row" items="Y,N" delims="," varStatus="status">
<c:choose>
<c:when test="${status.first}">
{value: '${row}', text: '${"Y" eq row ? "등록" : "미등록"}' }
</c:when>
<c:otherwise>
,{value: '${row}', text: '${"Y" eq row ? "등록" : "미등록"}' }
</c:otherwise>
</c:choose>
</c:forTokens>
]
}
},
onBeforeChange: function(ev) { //변경 전(ev.value)/후(ev.nextValue)
// console.log('Grade before change:' + ev);
},
onAfterChange: function(ev) { //변경 전(ev.prevValue)/후(ev.value)
// console.log('Grade after change:' + ev);
}
/* //에디터 적용 */
},
{
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,
pageOptions: {
useClient: true,
perPage: 100
},
columnOptions: {
frozenCount: 3
},
bodyHeight: 400
};
const gridDatasource = { //DataSource
/* -----------------------
* DataSource API Setting
----------------------- */
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, (res) => {
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>

@ -58,21 +58,6 @@
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){
let url = '<c:url value="/framework/biz/mng/auth/mngAuthRoleMgtPopup.do"/>';
let popTitle;
@ -176,21 +161,15 @@
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum'],
columns: gridColumns,
columnOptions: {
frozenCount: 3 //고정컬럼 갯수
, minWidth: 80 //최소 사이즈
}
columns: gridColumns
};
const gridDatasource = { //DataSource
/* -----------------------
* DataSource API Setting
----------------------- */
//initialRequest: true, // 화면 load시 조회 안함 - default
api: {
initialRequest: true // 화면 load시 조회 안함 - default
,api: {
readData: {
url: '<c:url value="/framework/biz/mng/auth/findAuthRoles.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
}
}
};

@ -164,6 +164,7 @@
api: {
readData: {
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"%>
<%@ 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>
<validator:javascript formName="progrmMngVO" staticJavascript="false" xhtml="true" cdata="false"/>
<%--@elvariable id="progrmMngVO" type=""--%>
@ -9,19 +12,10 @@
<div class="popup" style="min-width: 700px;">
<div class="popup_inner" style="max-width:700px;">
<p class="pop_title">
<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>
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<table class="tbl03">
<caption>프로그램 정보 등록 / 변경</caption>
<caption><c:out value="${bizName}"/> 등록 / 변경</caption>
<colgroup>
<col style="width: 20%; height: 23px;">
<col style="width: 80%; height: 23px;">
@ -31,15 +25,7 @@
<th scope="row" class="required">
<label for="progrmFileNm">프로그램파일명</label>
<td nowrap="nowrap">
<c:choose>
<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:input path="progrmFileNm" size="50" maxlength="50" title="프로그램파일명" readonly="${isUpd}" />
<form:errors path="progrmFileNm"/>
</td>
</tr>
@ -73,21 +59,7 @@
</tr>
</tbody>
</table>
<div class="popup_btn">
<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>
<!-- //등록버튼 -->
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
</div>
</div>
<!-- //popup -->
@ -152,8 +124,5 @@
* initialize
**************************************************************************/
$(document).ready(function(){
$(".popup").css("position","absolute");
$(".content_header").css("display","none");
$("#cur_loc").css("display","none");
});
</script>

@ -66,21 +66,6 @@
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){
let url;
let popTitle;
@ -217,6 +202,7 @@
api: {
readData: {
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"%>
<%@ 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>
<validator:javascript formName="userInfoVO" staticJavascript="false" xhtml="true" cdata="false"/>
<%--@elvariable id="userInfoVO" type=""--%>
<form:form commandName="userInfoVO" name="userInfoVO">
<c:set var="isUpdate" value="${!empty userInfoVO.uniqId}"/>
<div class="popup" style="min-width: 1100px;">
<div class="popup_inner" style="max-width: 1100px;">
<p class="pop_title">
<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>
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
<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>
<col style="width: 20%;"/>
<col style="width: 30%;"/>
@ -77,12 +70,6 @@
</th>
<td>
<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>
<th height="23" class="required">
<label>비밀번호 정답</label>
@ -107,12 +94,6 @@
</th>
<td>
<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" />
</td>
</tr>
@ -123,12 +104,6 @@
</th>
<td>
<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" />
</td>
<th height="23">
@ -206,12 +181,6 @@
</th>
<td>
<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" />
</td>
<th height="23" class="required">
@ -219,38 +188,17 @@
</th>
<td>
<code:select type="GROUP" id="groupId" name="groupId" defaultSelect="${userInfoVO.groupId}" title="그룹아이디" cls="selectBox" alt="그룹아이디"/>
<%--
<form:select path="groupId" id="groupId" title="그룹아이디">
<form:option value="" label="--선택하세요--" />
<form:options items="${groupId_result}" itemValue="code" itemLabel="codeNm" />
</form:select>
--%>
<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>
<form:errors path="groupId" cssClass="error" />
</td>
</tr>
</tbody>
</table>
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
</span>
</div>
<!-- //popup_btn -->
</div>
</div>
<!-- //popup -->
</form:form>
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
</div>
</div>
<!-- //popup -->
</form:form>
<script type="text/javaScript">
/**************************************************************************
@ -266,20 +214,25 @@
}
,add: () => {
if(!validateUserInfoVO($('#userInfoVO'))) return;
if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return;
cmmBizAjax('add', {
url: '<c:url value="/framework/biz/mng/usr/addUser.do"/>'
,data: $("#userInfoVO").serialize()
//,contentType: 'x-www-form-url-encoded'
})
}
,modify: () => {
if(!validateUserInfoVO($('#userInfoVO'))) return;
if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return;
const data = getFormJson(document.getElementById('userInfoVO'));
console.log(data);
cmmBizAjax('modify', {
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'
});
}

@ -139,8 +139,8 @@ var XitCmmnUtil = {
* @param {Object} params json
* @returns {Object} form data + params = serialize data return
*/
const fnAddPageInfo = (formEliment, params) => {
let serializeParam = $(formEliment).serialize();
const fnAddPageInfo = (searchForm, params) => {
let serializeParam = $(searchForm).serialize();
for(var key in params){
if(key=='perPage'){
if(params[key]==undefined)
@ -196,6 +196,7 @@ const cmmAjax = (param) => {
,data: param.data
,async: nvl(param.async, true)
,dataType: nvl(param.dataType, "json")
,contentType: nvl(param.contentType, 'application/x-www-form-urlencoded')
,success: function (res) {
if (!param.showSuccessMsg || param.showSuccessMsg === true) {
alert(res.message);

@ -377,7 +377,9 @@ function setComma(n) {
return n;
}
const setDateTimeFmt = (srcDateStr, delimiter = '-') => {
function setDateTimeFmt(srcDateStr, delimiter = '-') {
if(srcDateStr == null || srcDateStr.isBlank()) return srcDateStr;
let srcDate = srcDateStr.replace(/\-|\s|\:|\./g,'');
if(srcDate.length == 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,'');
if(srcDate.length >= 8) {
return srcDate.substring(0, 4)+delimiter+srcDate.substring(4, 6)+delimiter+srcDate.substring(6, 8);
@ -398,3 +402,35 @@ const setDateFmt = (srcDateStr, delimiter = '-') => {
}
}
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));
}
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: {
contentType: 'application/json',
dataType: 'json',
method: 'get'
method: 'get',
initParams: {}
}
, createData: {url: '', method: 'POST'}
, updateData: {url: '', method: 'PUT'}
@ -118,8 +119,8 @@ const TuiGrid = {
perPage: 15
}, //[선택]한 페이지에 출력할 건수
columnOptions: { //[선택]고정 컬럼
frozenCount: 1 //고정컬럼 갯수
, frozenBorderWidth: 2 //고정컬럼 보더(border) 두께
//frozenCount: 0 //고정컬럼 갯수
frozenBorderWidth: 2 //고정컬럼 보더(border) 두께
, resizable: true
, minWidth: 100 //최소 사이즈
},
@ -145,7 +146,14 @@ const TuiGrid = {
console.log(msg);
//if($('#totCnt span')){
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())
}

Loading…
Cancel
Save