사용자 계정 저장,중복체크,로그인,조회시 대문자로 변경

main
이범준 4 months ago
parent e8277af1cc
commit 81c55e8c48

@ -11,6 +11,20 @@ public class FimsUser extends GenericUser {
return "USR00";
}
@Override
public String getAccount() {
String account = super.getAccount();
return account != null ? account.toUpperCase() : null;
}
@Override
public void setAccount(String account) {
if(account != null) {
account = account.toUpperCase();
}
super.setAccount(account);
}
/**
*
*/

@ -143,7 +143,7 @@ public class MainController extends cokr.xit.base.web.MainController {
@RequestMapping(name="회원가입", value="/signup.do")
public ModelAndView signup(FimsUser user) {
ModelAndView mav = new ModelAndView("jsonView");
user.setAccount(user.getAccount().toUpperCase());
boolean saved = userService.create(user);
if(user.getUserSeCd() != null && user.getUserSeCd().equals("21")) {
@ -156,6 +156,7 @@ public class MainController extends cokr.xit.base.web.MainController {
@RequestMapping(name="중복 확인", value="/duplicate.do")
public ModelAndView isDuplicate(String account, String sggCd) {
account = account.toUpperCase();
FimsUser user = userService.getUser(account, sggCd);
return new ModelAndView("jsonView")
.addObject("duplicate", user != null);

@ -77,6 +77,18 @@ public class UserController extends cokr.xit.base.user.web.UserController<FimsUs
return mav;
}
@Override
public ModelAndView create(FimsUser user) {
user.setAccount(user.getAccount().toUpperCase());
return super.create(user);
}
@Override
public ModelAndView isDuplicate(String account, String institute) {
account = account.toUpperCase();
return super.isDuplicate(account, institute);
}
@RequestMapping(name="내 정보 조회",value="/myInfo.do")
public ModelAndView myInfo() {
ModelAndView mav = new ModelAndView("jsonView");

@ -159,7 +159,7 @@ SELECT A.AUTH_ID
SELECT A.AUTH_ID
, A.USER_ID
, A.REG_DT
, B.USER_ACNT
, UPPER(B.USER_ACNT) AS USER_ACNT
, B.USER_NM
, B.ORG_ID
, (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = B.ORG_ID) AS SGG_NM

@ -35,7 +35,7 @@ SELECT LOG_ID
, DATA_NM
, PSNL_INFO
, A.USER_ID
, USER_ACNT
, UPPER(USER_ACNT) AS USER_ACNT
, USER_NM
, NSTT_CD
, IP_ADDR
@ -52,7 +52,7 @@ SELECT LOG_ID
<if test="toDate != null"> AND LOG_ID &lt;= CONCAT(#{toDate}, LPAD(9, 16, '9'))</if>
<if test="logTypes != null"> AND A.LOG_TYPE IN (<foreach collection="logTypes" item="logType" separator=",">#{logType}</foreach>)</if>
<if test="userIDs != null"> AND USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
<if test="userAccounts != null"> AND USER_ACNT IN (<foreach collection="userAccounts" item="userAccount" separator=",">#{userAccount}</foreach>)</if>
<if test="userAccounts != null"> AND UPPER(USER_ACNT) IN (<foreach collection="userAccounts" item="userAccount" separator=",">UPPER(#{userAccount})</foreach>)</if>
<if test="userName != null"> AND USER_NM LIKE CONCAT('%', #{userName}, '%')</if>
AND A.LOG_TYPE = C.LOG_TYPE
</where>

@ -39,7 +39,7 @@
<sql id="selectUsers">
<include refid="utility.paging-prefix" />
SELECT A.USER_ID
, A.USER_ACNT
, UPPER(A.USER_ACNT) AS USER_ACNT
, A.USER_NM
, A.USER_SE_CD
, GET_CODE_NM('CMN008', A.USER_SE_CD) AS USER_SE_NM
@ -100,7 +100,7 @@ SELECT A.USER_ID
<select id="getUser" parameterType="map" resultMap="userRow">
/* 사용자 계정 가져오기(userMapper.getUser) */
SELECT USER_ID
, USER_ACNT
, UPPER(USER_ACNT) AS USER_ACNT
, USER_NM
, USER_SE_CD
, GET_CODE_NM('CMN008', USER_SE_CD) AS USER_SE_NM
@ -134,7 +134,7 @@ SELECT USER_ID
FROM TB_USER
<where>
<if test="userID != null">AND USER_ID = #{userID}</if>
<if test="account != null">AND USER_ACNT = #{account}</if>
<if test="account != null">AND UPPER(USER_ACNT) = UPPER(#{account})</if>
<if test="institute != null">AND NSTT_CD = #{institute}</if>
<if test="orgID != null">AND ORG_ID = #{orgID}</if>
<if test="cntnSeCd != null">AND CNTN_SE_CD = #{cntnSeCd}</if>
@ -184,7 +184,7 @@ INSERT INTO TB_USER (
, #{deptCode}
, #{cntnSeCd}
, #{userSeCd}
, #{account}
, UPPER(#{account})
, #{name}
, #{password}
, #{passwordHint}

@ -310,6 +310,8 @@ function save(info){
info.userSeCd = "21";
}
info.account = info.account.toUpperCase();
ajax.post({
url:!create ? wctx.url("/user/updateMyInfo.do") : wctx.url("/signup.do"),
data:info,

@ -127,7 +127,7 @@ function login() {
if (!$("#formAuthentication input,select").validInputs()) return;
var params = {
account:$("#userId").val(),
account: $("#userId").val().toUpperCase(),
password:$("#password").val(),
orgID: $("#orgID").val(),
cntnSeCd: $("#cntnSeCd").val(),

Loading…
Cancel
Save