feat: 업무사용자 등록 진행

main
Jonguk. Lim 2 years ago
parent 53c83ccb05
commit 6ad73d8464

@ -33,6 +33,7 @@ public class XitUserInfoVO extends XitUserEtcOptionVO{
protected String orgnztId; //조직 id protected String orgnztId; //조직 id
protected String userNm; //사용자 명 protected String userNm; //사용자 명
protected String password; //비밀번호 protected String password; //비밀번호
protected String password2; //비밀번호
protected String emplNo; //사원 번호 protected String emplNo; //사원 번호
protected String ihidnum; //주민등록번호 protected String ihidnum; //주민등록번호
protected String sexdstnCode; //성별 코드 protected String sexdstnCode; //성별 코드

@ -73,7 +73,6 @@ public class ProgramMgtController {
mav.addObject("progrmMngVO", programMngService.findProgram(progrmFileNm)); mav.addObject("progrmMngVO", programMngService.findProgram(progrmFileNm));
mav.addObject("pageTitle", "프로그램 정보 변경"); mav.addObject("pageTitle", "프로그램 정보 변경");
} }
return mav; return mav;
} }

@ -59,26 +59,35 @@ public class UserMgtServiceImpl implements UserMgtService {
try { try {
vo.setUniqId(idgenService.getNextStringId()); vo.setUniqId(idgenService.getNextStringId());
} catch (FdlException e) { } catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CMM_INSERT_FAIL); throw BizRuntimeException.message(e.getMessage());
} }
vo.setUniqId(vo.getUniqId()); //고유식별키
vo.setUserId(vo.getEmplyrId()); //사용자 id
vo.setUserNm(vo.getEmplyrNm()); //사용자 명
try {
vo.setPassword(XitScrtyUtil.encryptPassword(vo.getPassword(), vo.getEmplyrId()));
} catch (Exception e) {
throw BizRuntimeException.message(String.format("비밀번호 암호화 실패:: %s", e.getMessage()));
}
vo.setEsntlId(vo.getUniqId());
/* //XitUserInfoVO userInfoVO = convertToCrudVO(vo);
XitUserInfoVO userInfoVO = convertToCrudVO(vo);
//그룹의 기본권한 조회 및 설정 //그룹의 기본권한 조회 및 설정
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setScrtySetupTrgetId(userInfoVO.getEsntlId()); userScrtySetupVO.setScrtySetupTrgetId(vo.getEsntlId());
userScrtySetupVO.setMberTyCode("USR03"); userScrtySetupVO.setMberTyCode("USR03");
String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(userInfoVO.getGroupId()); String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(vo.getGroupId());
userScrtySetupVO.setAuthorCode(defaultAuthorCode); userScrtySetupVO.setAuthorCode(defaultAuthorCode);
//사용자 기타옵션 기본값 설정 //사용자 기타옵션 기본값 설정
XitUserEtcOptionVO userEtcOptionVO = new XitUserEtcOptionVO(); XitUserEtcOptionVO userEtcOptionVO = new XitUserEtcOptionVO();
userEtcOptionVO.setUserId(userInfoVO.getUserId()); userEtcOptionVO.setUserId(vo.getUserId());
userEtcOptionVO.setJobDataAuthor("ONESELF"); //업무 데이터 권한 userEtcOptionVO.setJobDataAuthor("ONESELF"); //업무 데이터 권한
userEtcOptionVO.setUserManageAuthor("ONESELF"); //사용자 관리 권한 userEtcOptionVO.setUserManageAuthor("ONESELF"); //사용자 관리 권한
/*
//사용자정보 등록 //사용자정보 등록
xitFrameCrudService.addXitUserInfo(userInfoVO); xitFrameCrudService.addXitUserInfo(vo);
//사용자의 권한 등록 //사용자의 권한 등록
xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO); xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO);
//사용자 기타 옵션 관리 //사용자 기타 옵션 관리

@ -86,7 +86,6 @@ public class UserMgtController {
mav.addObject("userInfoVO", service.findUser(uniqId)); mav.addObject("userInfoVO", service.findUser(uniqId));
mav.addObject("pageTitle", "사용자 정보 변정"); mav.addObject("pageTitle", "사용자 정보 변정");
} }
return mav; return mav;
} }
@ -104,26 +103,26 @@ public class UserMgtController {
@PostMapping(value = "/addUser") @PostMapping(value = "/addUser")
public ModelAndView addUser( public ModelAndView addUser(
@ModelAttribute final XitUserInfoVO userInfoVO @ModelAttribute final XitUserInfoVO vo
,final BindingResult bindingResult){ ,final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("userInfoVO", userInfoVO, bindingResult); ValidationError.of("userInfoVO", vo, bindingResult);
service.addUser(vo);
//service.addUser(userManageVO);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav; return mav;
} }
@PostMapping(value = "/modifyUser") @PostMapping(value = "/modifyUser")
public ModelAndView modifyUser( public ModelAndView modifyUser(
@ModelAttribute final XitUserInfoVO userInfoVO @ModelAttribute final XitUserInfoVO vo
,final BindingResult bindingResult){ ,final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("userInfoVO", userInfoVO, bindingResult); ValidationError.of("userInfoVO", vo, bindingResult);
service.modifyUser(userInfoVO); service.modifyUser(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav; return mav;
} }

@ -7,6 +7,7 @@ import org.springframework.validation.BindingResult;
import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.JBeanRegistry; import kr.xit.framework.support.util.JBeanRegistry;
import kr.xit.framework.support.util.constants.MessageKey;
/** /**
* *
@ -61,6 +62,14 @@ public class BizRuntimeException extends RuntimeException {
return ex; return ex;
} }
public static BizRuntimeException message(String message) {
BizRuntimeException ex = new BizRuntimeException();
ex.setCode(MessageKey.CMM_FAIL);
ex.setMessage(message);
ex.setArguments(null);
return ex;
}
public static BizRuntimeException create(String errorCode, String message) { public static BizRuntimeException create(String errorCode, String message) {
BizRuntimeException ex = new BizRuntimeException(); BizRuntimeException ex = new BizRuntimeException();
ex.setCode(errorCode); ex.setCode(errorCode);

@ -252,8 +252,8 @@ sym.ems.content = \uBC1C\uC2E0\uB0B4\uC6A9
errors.prefix=<div class="error"> errors.prefix=<div class="error">
errors.suffix=</div><br/> errors.suffix=</div><br/>
errors.required=[[{0}] ]\uC740(\uB294) \uD544\uC218 \uC785\uB825\uAC12\uC785\uB2C8\uB2E4. errors.required=[{0}]\uC740(\uB294) \uD544\uC218 \uC785\uB825\uAC12\uC785\uB2C8\uB2E4.
errors.minlength=[[{0}] ]\uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4. errors.minlength=[{0}]\uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4.
errors.maxlength=[{0}] \uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD560\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. errors.maxlength=[{0}] \uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD560\uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
errors.invalid=[{0}] \uC740(\uB294) \uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uAC12\uC785\uB2C8\uB2E4. errors.invalid=[{0}] \uC740(\uB294) \uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uAC12\uC785\uB2C8\uB2E4.
errors.minInteger=[{0}] \uC740(\uB294) \uC720\uD6A8\uD55C \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4. 1 \uC774\uC0C1\uC758 \uAC12\uC744 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4. errors.minInteger=[{0}] \uC740(\uB294) \uC720\uD6A8\uD55C \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4. 1 \uC774\uC0C1\uC758 \uAC12\uC744 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4.

@ -26,10 +26,11 @@
<var-value>50</var-value> <var-value>50</var-value>
</var> </var>
</field> </field>
<!--
<!-- <field property="password" depends="required, password1, password2, password3, password4"> <field property="password" depends="required, password1, password2, password3, password4">
<arg0 key="비밀번호" resource="false"/> <arg0 key="비밀번호" resource="false"/>
</field> --> </field>
-->
<field property="passwordHint" depends="required"> <field property="passwordHint" depends="required">
<arg0 key="비밀번호힌트" resource="false"/> <arg0 key="비밀번호힌트" resource="false"/>

@ -1,5 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script> <script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="progrmMngVO" staticJavascript="false" xhtml="true" cdata="false"/> <validator:javascript formName="progrmMngVO" staticJavascript="false" xhtml="true" cdata="false"/>
@ -64,7 +65,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="required" scope="row"><label for="progrmDc">프로그램설명</label></th> <th scope="row"><label for="progrmDc">프로그램설명</label></th>
<td> <td>
<form:textarea path="progrmDc" rows="14" cols="75" title="프로그램설명"/> <form:textarea path="progrmDc" rows="14" cols="75" title="프로그램설명"/>
<form:errors path="progrmDc"/> <form:errors path="progrmDc"/>

@ -56,7 +56,7 @@
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
let GRID = null; let GRID = null;
var callBackSearch = () => fnProgramMgt.search(); var callBackSearch = () => fnUserMgt.search();
/* ******************************* /* *******************************
@ -173,29 +173,6 @@
GRID.reloadData(); GRID.reloadData();
} }
,add : function(){
}
,modify : function(){
}
,remove : function(){
$.ajax({
url : "/framework/biz/mng/usr/UserRegMng_deletes_proc.do",
data : $("#frmSearch").serialize(),
type : "post",
dataType : "json",
success : function(data) {
alert(data.resp.message);
fnUserMgt.search();
window.close();
},
error: function(){
}
});
}
,validate : function(flag){ ,validate : function(flag){
switch(flag){ switch(flag){
case 'delete' : case 'delete' :

@ -1,11 +1,12 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script> <script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
<validator:javascript formName="userInfoVO" staticJavascript="false" xhtml="true" cdata="false"/> <validator:javascript formName="userInfoVO" staticJavascript="true" xhtml="true" cdata="false"/>
<%--@elvariable id="userInfoVO" type=""--%> <%--@elvariable id="userInfoVO" type=""--%>
<form:form commandName="userInfoVO" name="userInfoVO"> <form:form commandName="userInfoVO" name="userInfoVO">
<input type="hidden" name="zip_url" value="<c:url value='/framework/biz/cmm/popup/ZipSearchList.do'/>" /> <%-- <input type="hidden" name="zip_url" value="<c:url value='/framework/biz/cmm/popup/ZipSearchList.do'/>" />--%>
<!-- 상세정보 사용자 삭제시 prameter 전달용 input --> <!-- 상세정보 사용자 삭제시 prameter 전달용 input -->
<input type="hidden" name="checkedIdForDel" id="checkedIdForDel" value="<c:out value='${userInfoVO.userTy}'/>:<c:out value='${userInfoVO.emplyrId}'/>"> <input type="hidden" name="checkedIdForDel" id="checkedIdForDel" value="<c:out value='${userInfoVO.userTy}'/>:<c:out value='${userInfoVO.emplyrId}'/>">
<!-- 사용자유형정보 : password 수정화면으로 이동시 타겟 유형정보 확인용, 만약검색조건으로 유형이 포함될경우 혼란을 피하기위해 userTy명칭을 쓰지 않음--> <!-- 사용자유형정보 : password 수정화면으로 이동시 타겟 유형정보 확인용, 만약검색조건으로 유형이 포함될경우 혼란을 피하기위해 userTy명칭을 쓰지 않음-->
@ -35,14 +36,14 @@
<tbody> <tbody>
<tr> <tr>
<th height="23" class="required"> <th height="23" class="required">
<label>사용자아이디</label> <label>사용자 아이디</label>
</th> </th>
<td > <td >
<form:input path="emplyrId" id="emplyrId" cssClass="txaIpt" size="20" maxlength="20" readonly="readonly" /> <form:input path="emplyrId" id="emplyrId" cssClass="txaIpt" size="20" maxlength="20" readonly="readonly" />
<form:errors path="emplyrId" cssClass="error"/> <form:errors path="emplyrId" cssClass="error"/>
<form:hidden path="uniqId" /> <form:hidden path="uniqId" />
</td> </td>
<th height="23" class="required"> <th height="23">
<label>핸드폰번호</label> <label>핸드폰번호</label>
</th> </th>
<td > <td >
@ -52,7 +53,24 @@
</tr> </tr>
<tr> <tr>
<th height="23" class="required"> <th height="23" class="required">
<label>비밀번호힌트</label> <label>비밀번호</label>
</th>
<td >
<form:input path="password" id="password" title="비밀번호" cssClass="txaIpt" size="20" maxlength="20" />
<form:errors path="password" cssClass="error" />
</td>
<th height="23" class="required">
<label>비밀번호 확인</label>
</th>
<td >
<%-- <input name="password2" id="password2" title="비밀번호확인" type="password" size="20" maxlength="20" />--%>
<form:input path="password2" id="password2" title="비밀번호" cssClass="txaIpt" size="20" maxlength="20" />
<form:errors path="password2" cssClass="error" />
</td>
</tr>
<tr>
<th height="23" class="required">
<label>비밀번호 힌트</label>
</th> </th>
<td> <td>
<code:select id="passwordHint" name="passwordHint" codeId="XIT022" title="비밀번호힌트" cls="selectBox" alt="비밀번호힌트"/> <code:select id="passwordHint" name="passwordHint" codeId="XIT022" title="비밀번호힌트" cls="selectBox" alt="비밀번호힌트"/>
@ -64,7 +82,7 @@
--%> --%>
<form:errors path="passwordHint" cssClass="error" /></td> <form:errors path="passwordHint" cssClass="error" /></td>
<th height="23" class="required"> <th height="23" class="required">
<label>비밀번호정답</label> <label>비밀번호 정답</label>
</th> </th>
<td> <td>
<form:input path="passwordCnsr" id="passwordCnsr" title="비밀번호정답" cssClass="txaIpt" size="50" maxlength="100" /> <form:input path="passwordCnsr" id="passwordCnsr" title="비밀번호정답" cssClass="txaIpt" size="50" maxlength="100" />
@ -74,13 +92,13 @@
<tr> <tr>
<th height="23" class="required"> <th height="23" class="required">
<label>이름</label> <label>사용자 이름</label>
</th> </th>
<td> <td>
<form:input path="emplyrNm" id="emplyrNm" cssClass="txaIpt" size="20" maxlength="60" /> <form:input path="emplyrNm" id="emplyrNm" cssClass="txaIpt" size="20" maxlength="60" />
<form:errors path="emplyrNm" cssClass="error" /> <form:errors path="emplyrNm" cssClass="error" />
</td> </td>
<th height="23" class="required"> <th height="23">
<label>소속기관</label> <label>소속기관</label>
</th> </th>
<td> <td>
@ -109,7 +127,7 @@
--%> --%>
<form:errors path="orgnztId" cssClass="error" /> <form:errors path="orgnztId" cssClass="error" />
</td> </td>
<th height="23" class="required"> <th height="23">
<label>직위명</label> <label>직위명</label>
</th> </th>
<td> <td>
@ -118,15 +136,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th height="23" class="required"> <th height="23">
<label>이메일주소</label> <label>이메일 주소</label>
</th> </th>
<td> <td>
<form:input path="emailAdres" id="emailAdres" title="이메일주소" cssClass="txaIpt" size="20" maxlength="50" /> <form:input path="emailAdres" id="emailAdres" title="이메일주소" cssClass="txaIpt" size="20" maxlength="50" />
<form:errors path="emailAdres" cssClass="error" /> <form:errors path="emailAdres" cssClass="error" />
</td> </td>
<th height="23" class="required"> <th height="23">
<label>집전화지역번호</label> <label>지역번호(집전화)</label>
</th> </th>
<td> <td>
<form:input path="areaNo" id="areaNo" style="width : 20%" title="areaNo" cssClass="txaIpt" size="5" maxlength="5" /> <form:input path="areaNo" id="areaNo" style="width : 20%" title="areaNo" cssClass="txaIpt" size="5" maxlength="5" />
@ -139,14 +157,14 @@
</tr> </tr>
<tr> <tr>
<th height="23" class="required"> <th height="23">
<label>사무실전화번호</label> <label>전화번호(사무실)</label>
</th> </th>
<td> <td>
<form:input path="offmTelno" id="offmTelno" title="사무실전화번호" cssClass="txaIpt" size="20" maxlength="15" /> <form:input path="offmTelno" id="offmTelno" title="사무실전화번호" cssClass="txaIpt" size="20" maxlength="15" />
<form:errors path="offmTelno" cssClass="error" /> <form:errors path="offmTelno" cssClass="error" />
</td> </td>
<th height="23" class="required"> <th height="23">
<label>팩스번호</label> <label>팩스번호</label>
</th> </th>
<td> <td>
@ -156,20 +174,20 @@
</tr> </tr>
<tr> <tr>
<th height="23" class="required"> <th height="23">
주소 <label>주소</label>
</th> </th>
<td> <td>
<form:input path="houseAdres" id="houseAdres" title="주소" style="width: 50%" cssClass="txaIpt" size="40" maxlength="100" readonly="true" /> <form:input path="houseAdres" id="houseAdres" title="주소" style="width: 50%" cssClass="txaIpt" size="40" maxlength="100" readonly="true" />
<form:errors path="houseAdres" cssClass="error" /> <form:errors path="houseAdres" cssClass="error" />
<form:hidden path="zip" /> <form:hidden path="zip" />
<a id ="addrSearch"> <a id ="addrSearch">
<img src="<c:url value='/resources/images/btn/icon_zip_search.gif'/>" alt="" />(우편번호 검색) <img src="<c:url value='/resources/images/btn/icon_zip_search.gif'/>" alt="우편번호검색" style="cursor: hand"/>(우편번호 검색)
</a> </a>
<form:errors path="zip" cssClass="error" /> <form:errors path="zip" cssClass="error" />
<input name="zip_view" id="zip_view" type="hidden" title="우편번호" size="20" value="<c:out value='${userInfoVO.zip}'/>" maxlength="8" readonly="readonly" /> <input name="zip_view" id="zip_view" type="hidden" title="우편번호" size="20" value="<c:out value='${userInfoVO.zip}'/>" maxlength="8" readonly="readonly" />
</td> </td>
<th height="23" class="required"> <th height="23">
<label>상세주소</label> <label>상세주소</label>
</th> </th>
<td> <td>
@ -179,8 +197,8 @@
</tr> </tr>
<tr> <tr>
<th height="23" class="required"> <th height="23">
<label>사용자상태코드</label> <label>사용자 상태</label>
</th> </th>
<td> <td>
<code:select id="userSttusCode" name="userSttusCode" codeId="XIT013" title="사용자상태" cls="selectBox" alt="사용자상태"/> <code:select id="userSttusCode" name="userSttusCode" codeId="XIT013" title="사용자상태" cls="selectBox" alt="사용자상태"/>
@ -193,10 +211,10 @@
<form:errors path="userSttusCode" cssClass="error" /> <form:errors path="userSttusCode" cssClass="error" />
</td> </td>
<th height="23" class="required"> <th height="23" class="required">
<label>그룹아이디</label> <label>그룹 아이디</label>
</th> </th>
<td> <td>
<code:select type="GROUP" id="groupId" name="grupId" title="그룹아이디" cls="selectBox" alt="그룹아이디"/> <code:select type="GROUP" id="groupId" name="groupId" title="그룹아이디" cls="selectBox" alt="그룹아이디"/>
<%-- <%--
<form:select path="groupId" id="groupId" title="그룹아이디"> <form:select path="groupId" id="groupId" title="그룹아이디">
<form:option value="" label="--선택하세요--" /> <form:option value="" label="--선택하세요--" />
@ -245,7 +263,7 @@
} }
,add: () => { ,add: () => {
if(validateUserInfoVO(document.getElementById('userInfoVO'))) return; if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return;
if(confirm("등록 하시겠습니까?")){ if(confirm("등록 하시겠습니까?")){
cmmAjax({ cmmAjax({
@ -260,7 +278,7 @@
} }
,modify: () => { ,modify: () => {
if(validateUserInfoVO(document.getElementById('userInfoVO'))) return; if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return;
if(confirm("변경 하시겠습니까?")){ if(confirm("변경 하시겠습니까?")){
cmmAjax({ cmmAjax({
@ -307,9 +325,11 @@
$('#addrSearch').on('click', () => CmmPopup.zipPopup()); $('#addrSearch').on('click', () => CmmPopup.zipPopup());
$('#btnSave').on('click', () => fnUserMgtPopup.modify()); $('#btnRegist').on('click', () => fnUserMgtPopup.add());
$('#btnModify').on('click', () => fnUserMgtPopup.modify());
$('#btnRemove').on('click', () => fnUserMgtPopup.removeData()); $('#btnRemove').on('click', () => fnUserMgtPopup.remove());
$('#btnPwdChg').on('click', () => { $('#btnPwdChg').on('click', () => {
var params = ""; var params = "";

Loading…
Cancel
Save