사용자 등록,수정 화면 수정(기관,부서 항목 추가)

main
이범준 1 year ago
parent c20623fe7f
commit 62a81f8509

@ -19,17 +19,42 @@ import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.fims.cmmn.DirectoryStructureToJson;
import cokr.xit.fims.cmmn.DirectoryStructureToJson.Node;
import cokr.xit.fims.cmmn.dao.FactionMapper;
import cokr.xit.fims.crdn.service.bean.ImportServiceBean;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.smg.service.bean.SmgServiceBean;
@Controller
public class UserController extends cokr.xit.base.user.web.UserController<ManagedUser> {
@Resource(name="factionMapper")
FactionMapper factionMapper;
@Resource
SmgServiceBean smgServiceBean;
@Resource
ImportServiceBean importServiceBean;
@Override
public ModelAndView main() {
ModelAndView mav = super.main();
return mav;
}
@Override
public ModelAndView getInfo(String userID) {
ModelAndView mav = super.getInfo(userID);
mav.addObject("allFactionList", factionMapper.selectAllFactionList());
DataObject params = new DataObject().set("currentUser", currentUser());
List<DataObject> ableFactionList = factionMapper.selectAbleFactionList(params);
mav.addObject("ableFactionList", ableFactionList);
return mav;
}
@RequestMapping(name="최고관리자 메인",value="/superUser/main.do")
public ModelAndView superUserMain() {
ModelAndView mav = new ModelAndView();

@ -0,0 +1,37 @@
package cokr.xit.fims.cmmn.dao;
import java.util.List;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/** DAO
*
* <p> :
*
* <pre>
* ============ ============
* 2023-09-15 leebj
* ================================
* </pre>
*/
@Mapper("factionMapper")
public interface FactionMapper extends AbstractMapper {
/** , .<br />
* @param
* @return ,
*/
List<DataObject> selectAllFactionList();
/** , .<br />
* @param stringMap
* @param
* @return ,
*/
List<DataObject> selectAbleFactionList(Map<String, Object> params);
}

@ -180,6 +180,7 @@ UPDATE TB_USER SET
, GRP_ID = #{groupID}
, ORG_ID = #{orgID}
, NSTT_CD = #{institute}
, DEPT_CD = #{deptCode}
, CRTFC_DN = #{certificateDn}
, MDFCN_DT =<include refid="utility.now" />
, MDFR = #{modifiedBy}

@ -0,0 +1,50 @@
<?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="cokr.xit.fims.cmmn.dao.FactionMapper">
<select id="selectAllFactionList" resultType="dataobject">
/* 전체 기관,부서 목록 조회(factionMapper.selectAllFactionList) */
SELECT CONCAT(A.INST_CD,'/',B.DEPT_CD) AS FACTION_CD
, CONCAT(A.INST_NM,' / ',B.DEPT_NM) AS FACTION_NM
, A.INST_CD
, A.INST_NM
, B.DEPT_CD
, B.DEPT_NM
FROM TB_SGG_INFO A
LEFT OUTER JOIN TB_DEPT_INFO B ON (A.INST_CD = B.INST_CD)
UNION
SELECT 'default/default' AS FACTION_CD
, CONCAT('기본 기관',' / ','기본 부서') AS FACTION_NM
, 'default' AS INST_CD
, '기본 기관' AS INST_NM
, 'default' AS DEPT_CD
, '기본 부서' AS DEPT_NM
FROM DUAL
</select>
<select id="selectAbleFactionList" parameterType="map" resultType="dataobject">
/* 사용가능한 기관,부서 목록 조회(factionMapper.selectAbleFactionList) */
SELECT CONCAT(A.INST_CD,'/',B.DEPT_CD) AS FACTION_CD
, CONCAT(A.INST_NM,' / ',B.DEPT_NM) AS FACTION_NM
, A.INST_CD
, A.INST_NM
, B.DEPT_CD
, B.DEPT_NM
FROM TB_SGG_INFO A
LEFT OUTER JOIN TB_DEPT_INFO B ON (A.INST_CD = B.INST_CD)
<if test="currentUser.institute != 'default'">
WHERE A.INST_CD = #{currentUser.institute}
</if>
<if test="currentUser.institute == 'default'">
UNION
SELECT 'default/default' AS FACTION_CD
, CONCAT('기본 기관',' / ','기본 부서') AS FACTION_NM
, 'default' AS INST_CD
, '기본 기관' AS INST_NM
, 'default' AS DEPT_CD
, '기본 부서' AS DEPT_NM
FROM DUAL
</if>
</select>
</mapper>

@ -4,19 +4,58 @@
<div class="row g-3">
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="account"
<div class="col-sm-3 text-sm-end">
<label class="col-form-label required">
기관 / 부서
</label>
<br/>
<div class="dropdown">
<button type="button"
class="btn btn-md btn-secondary dropdown-toggle"
data-bs-toggle="dropdown"
>선택</button>
<ul class="dropdown-menu" style="max-height: 300px;overflow-y:auto;">
<c:forEach items="${ableFactionList}" var="item">
<li>
<a class="dropdown-item"
onclick="setFactionCodeValues('${item.INST_CD}','${item.DEPT_CD}')">${item.FACTION_NM}</a>
</li>
</c:forEach>
</ul>
</div>
</div>
<div class="col-sm-9">
<select name="institute" class="form-select" data-map="NSTT_CD"
required title="기관/부서" disabled style="background-image:none;">
<c:forEach items="${allFactionList}" var="item">
<option value="${item.INST_CD}">${item.INST_NM}</option>
</c:forEach>
</select>
<br/>
<select name="deptCode" class="form-select" data-map="DEPT_CD"
required title="기관/부서" disabled style="background-image:none;">
<c:forEach items="${allFactionList}" var="item">
<option value="${item.DEPT_CD}">${item.DEPT_NM}</option>
</c:forEach>
</select>
</div>
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end required" for="account"
>계정</label
>
<div class="col-sm-9">
<input name="id" type="hidden" data-map="USER_ID" />
<input name="institute" type="hidden" data-map="NSTT_CD" />
<input name="account" type="text" required data-map="USER_ACNT" class="form-control" placeholder="prefixName 계정" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="name"
<label class="col-sm-3 col-form-label text-sm-end required" for="name"
>이름</label
>
<div class="col-sm-9">
@ -26,7 +65,7 @@
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="password"
<label class="col-sm-3 col-form-label text-sm-end required" for="password"
>비밀번호</label
>
<div class="col-sm-9">
@ -36,7 +75,7 @@
</div>
<div class="col-md-6 hidden">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="confirmPassword"
<label class="col-sm-3 col-form-label text-sm-end required" for="confirmPassword"
>비밀번호 확인</label
>
<div class="col-sm-9">
@ -60,20 +99,22 @@
>성별</label
>
<div class="col-sm-9">
<div class="form-check form-check-inline mt-3">
<input name="gender" value="M" type="radio" data-map="GENDER" class="form-check-input"/>
<label class="form-check-label" for="male">남자</label>
</div>
<div class="form-check form-check-inline">
<input name="gender" value="F" type="radio" data-map="GENDER" class="form-check-input"/>
<label class="form-check-label" for="female">여자</label>
</div>
<span class="d-inline-flex" style="flex-wrap: wrap;width: 100%;height: 100%;align-content: center;">
<div class="form-check form-check-inline">
<input name="gender" value="M" type="radio" data-map="GENDER" class="form-check-input"/>
<label class="form-check-label" for="male">남자</label>
</div>
<div class="form-check form-check-inline">
<input name="gender" value="F" type="radio" data-map="GENDER" class="form-check-input"/>
<label class="form-check-label" for="female">여자</label>
</div>
</span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-3 col-form-label text-sm-end" for="emailAddress"
<label class="col-sm-3 col-form-label text-sm-end required" for="emailAddress"
>이메일 주소</label
>
<div class="col-sm-9">
@ -136,24 +177,31 @@
</div>
</div>
</form>
<script type="text/javascript">
<datalist id="allFactionList">
<c:forEach items="${allFactionList}" var="item">
<option value="${item.FACTION_CD}">${item.FACTION_NM}</option>
</c:forEach>
</datalist>
<script type="text/javascript">
var infoPrefixFields = new FormFields("#infoPrefix-form");
infoPrefixControl.setInfo = obj => {
infoPrefixFields.set(obj);
let create = isEmpty(obj.data.USER_ACNT);
$("input[name='account']").prop("readonly", !create);
$("input[type='password']").each(function(){
let password = $(this).prop("required", create);
let div = password.parent().parent().parent();
if (create) {
$("input[name='institute']").val("default");
div.show();
} else
div.hide();
});
$("#infoPrefix-form input")
$("#infoPrefix-form").find("input,select")
.change(function() {
let input = $(this),
name = input.attr("data-map"),
@ -174,7 +222,7 @@ infoPrefixControl.onModify = (changed) => {
}
function saveinfoPrefix() {
if (!$("#infoPrefix-form input").validInputs()) return;
if (!$("#infoPrefix-form").find("input,select").validInputs()) return;
let match = Array.from(document.querySelectorAll("input[type='password']"))
.map(input => input.value)
@ -196,5 +244,11 @@ function saveinfoPrefix() {
}
});
}
function setFactionCodeValues(institute, deptCode){
$("#infoPrefix-form [name='institute']").val(institute).trigger("change")
$("#infoPrefix-form [name='deptCode']").val(deptCode).trigger("change")
}
//# sourceURL=user-info.jsp
</script>

@ -10901,6 +10901,10 @@ button.list-group-item-gray.active {
width: 150px !important;
}
.w-px-190 {
width: 190px !important;
}
.w-px-200 {
width: 200px !important;
}

Loading…
Cancel
Save