시군구 기관/부서 관련 수정

master
mjkhan21 5 months ago
parent 13d701f391
commit 896719ba27

@ -69,14 +69,14 @@ public interface UserMapper extends AbstractMapper {
/** . /** .
* @param account * @param account
* @param institute * @param orgID
* @return * @return
*/ */
default <T extends User> T getUser(String account, String institute) { default <T extends User> T getUser(String account, String orgID) {
return getUser( return getUser(
params() params()
.set("account", notEmpty(account, "사용자 계정")) .set("account", notEmpty(account, "사용자 계정"))
.set("institute", notEmpty(institute, "소속 기관 코드")) .set("orgID", notEmpty(orgID, "사용자 조직코드"))
); );
} }

@ -67,11 +67,11 @@ public class UserBean extends AbstractBean {
/** . /** .
* @param <T> * @param <T>
* @param account * @param account
* @param institute * @param orgID
* @return * @return
*/ */
public <T extends User> T getUser(String account, String institute) { public <T extends User> T getUser(String account, String orgID) {
return userMapper.getUser(account, institute); return userMapper.getUser(account, orgID);
} }
/** . {@link cokr.xit.foundation.util.CharsEncoder } . /** . {@link cokr.xit.foundation.util.CharsEncoder } .
@ -89,8 +89,8 @@ public class UserBean extends AbstractBean {
throw applicationException(null) throw applicationException(null)
.setMessage(message("duplicate.object", "사용자")); .setMessage(message("duplicate.object", "사용자"));
if (isEmpty(user.getInstitute())) if (isEmpty(user.getOrgID()))
user.setInstitute(currentUser().getInstitute()); user.setOrgID(currentUser().getOrgID());
String password = user.getPassword(); String password = user.getPassword();
user.setPassword(passwordEncoder.encode(password)); user.setPassword(passwordEncoder.encode(password));
@ -100,8 +100,8 @@ public class UserBean extends AbstractBean {
private User getExistingUser(User user) { private User getExistingUser(User user) {
String account = user.getAccount(), String account = user.getAccount(),
institute = user.getInstitute(); orgID = user.getOrgID();
return getUser(account, institute); return getUser(account, orgID);
} }
/** . /** .

@ -104,10 +104,15 @@ public class UserController<U extends User> extends AbstractController {
boolean json = !isEmpty(userID) && jsonResponse(); boolean json = !isEmpty(userID) && jsonResponse();
String String
viewName = json ? "jsonView" : "base/user/user-info", viewName = json ? "jsonView" : "base/user/user-info",
orgID = currentUser().getOrgID(),
institute = currentUser().getInstitute(); institute = currentUser().getInstitute();
List<DataObject> List<DataObject>
sggs = sggDeptService.getSigunguList(new SigunguQuery()), sggs = sggDeptService.getSigunguList(new SigunguQuery()),
depts = sggDeptService.getDepartmentList(new DepartmentQuery().setInstCode(institute)); depts = sggDeptService.getDepartmentList(
new DepartmentQuery()
.setSggID(orgID)
.setInstCode(institute)
);
if (!isEmpty(userID)) { if (!isEmpty(userID)) {
DataObject userInfo = userService.getUserInfo(userID); DataObject userInfo = userService.getUserInfo(userID);
@ -115,11 +120,13 @@ public class UserController<U extends User> extends AbstractController {
.addObject("userInfo", json ? userInfo : toJson(userInfo)) .addObject("userInfo", json ? userInfo : toJson(userInfo))
.addObject("sggs", json ? sggs : toJson(sggs)) .addObject("sggs", json ? sggs : toJson(sggs))
.addObject("depts", json ? depts : toJson(depts)) .addObject("depts", json ? depts : toJson(depts))
.addObject("orgID", orgID)
.addObject("institute", institute); .addObject("institute", institute);
} else { } else {
return new ModelAndView("base/user/user-info") return new ModelAndView("base/user/user-info")
.addObject("sggs", toJson(sggs)) .addObject("sggs", toJson(sggs))
.addObject("depts", toJson(depts)) .addObject("depts", toJson(depts))
.addObject("orgID", orgID)
.addObject("institute", institute); .addObject("institute", institute);
} }
} }

@ -68,6 +68,7 @@ SELECT USER_ID
, LOCK_DT , LOCK_DT
, REG_DT , REG_DT
, STTS , STTS
, SGG_NM
, INST_NM , INST_NM
, DEPT_NM , DEPT_NM
FROM TB_USER A FROM TB_USER A
@ -77,7 +78,7 @@ SELECT USER_ID
ON A.SGG_CD = B.SGG_CD ON A.SGG_CD = B.SGG_CD
AND A.INST_CD = B.INST_CD AND A.INST_CD = B.INST_CD
AND A.USE_YN = 'Y' AND B.USE_YN = 'Y' AND A.USE_YN = 'Y' AND B.USE_YN = 'Y'
) B ON A.NSTT_CD = B.INST_CD AND A.DEPT_CD = B.DEPT_CD ) B ON ORG_ID = B.SGG_CD AND A.NSTT_CD = B.INST_CD AND A.DEPT_CD = B.DEPT_CD
<where><if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if> <where><if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if>
<if test="userIDs != null">USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if> <if test="userIDs != null">USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
<if test="status == null and userIDs == null">AND STTS != 'D'</if> <if test="status == null and userIDs == null">AND STTS != 'D'</if>
@ -96,7 +97,7 @@ SELECT *
FROM TB_USER FROM TB_USER
<where><if test="userID != null">AND USER_ID = #{userID}</if> <where><if test="userID != null">AND USER_ID = #{userID}</if>
<if test="account != null">AND USER_ACNT = #{account}</if> <if test="account != null">AND USER_ACNT = #{account}</if>
<if test="institute != null"> AND NSTT_CD = #{institute}</if></where></select> <if test="orgID != null"> AND ORG_ID = #{orgID}</if></where></select>
<insert id="insertUser" parameterType="cokr.xit.base.user.ManagedUser">/* 사용자 정보 등록(userMapper.insertUser) */ <insert id="insertUser" parameterType="cokr.xit.base.user.ManagedUser">/* 사용자 정보 등록(userMapper.insertUser) */
<selectKey resultType="string" keyProperty="id" keyColumn="NEW_ID" order="BEFORE">SELECT LPAD(NVL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER</selectKey> <selectKey resultType="string" keyProperty="id" keyColumn="NEW_ID" order="BEFORE">SELECT LPAD(NVL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER</selectKey>

Loading…
Cancel
Save