fix : 유저 관련 수정

main
이범준 1 year ago
parent 1b0cdde227
commit 1a6edff6a1

@ -57,4 +57,7 @@ public class XitUserInfoVO extends XitUserEtcOptionVO {
protected String uniqId;
protected String userTy;
protected String sttsNm;
protected String rgtr;
protected String mdfr;
}

@ -145,5 +145,6 @@ public class XitUserRegMngVO extends BaseVO {
* select
========================*/
private String userId;
private String userAcnt;
private String userNm;
}

@ -59,33 +59,35 @@ public class UserMgtServiceBean extends AbstractServiceBean implements UserMgtSe
@Override
@Transactional
public void addUser(final XitUserInfoVO vo) {
vo.setRgtr(XitCmmnUtil.getUserInfo().getUniqId());
vo.setMdfr(XitCmmnUtil.getUserInfo().getUniqId());
try {
vo.setUniqId(usrEsntlIdGnrService.getNextStringId());
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
vo.setUniqId(vo.getUniqId()); //고유식별키
vo.setUserId(vo.getEmplyrId()); //사용자 id
vo.setUserNm(vo.getEmplyrNm()); //사용자 명
vo.setUserId(vo.getUniqId());
vo.setUserAcnt(vo.getEmplyrId()); //처리대상 사용자 id
vo.setUserNm(vo.getEmplyrNm()); //처리대상 사용자 명
try {
vo.setPasswd(XitScrtyUtil.encryptPassword(vo.getPasswd(), vo.getEmplyrId()));
vo.setPasswd(XitScrtyUtil.encryptPassword(vo.getPasswd(), vo.getUserAcnt()));
} catch (Exception e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, String.format("비밀번호 암호화 실패:: %s", e.getMessage()));
}
vo.setUserKey(vo.getUniqId());
mapper.insertUserInfo(vo);
// 사용자 권한
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setScrtySetupTrgetId(vo.getUserKey());
userScrtySetupVO.setScrtySetupTrgetId(vo.getUserId());
userScrtySetupVO.setMberTyCode("USR03");
userScrtySetupVO.setAuthorCode(this.getDefaultAuthorCode(vo.getGrpId()));
mapper.insertUserScrtySetup(userScrtySetupVO);
// 기타 option
XitUserEtcOptionVO userEtcOptionVO = new XitUserEtcOptionVO();
userEtcOptionVO.setUserId(vo.getUserId());
userEtcOptionVO.setUserId(vo.getUniqId());
userEtcOptionVO.setJobDataAuthor("ONESELF"); //업무 데이터 권한
userEtcOptionVO.setUserManageAuthor("ONESELF"); //사용자 관리 권한
mapper.insertUserEtcOption(userEtcOptionVO);
@ -95,16 +97,18 @@ public class UserMgtServiceBean extends AbstractServiceBean implements UserMgtSe
@Transactional
public void modifyUser(final XitUserInfoVO vo) {
vo.setMdfr(XitCmmnUtil.getUserInfo().getUniqId());
// TODO : 적용 체크
if(!this.isUserModifyAuth(vo.getUniqId()))
throw new RuntimeException("대상에 대한 수정 권한이 없습니다.");
vo.setUserId(vo.getEmplyrId()); //사용자 id
vo.setUserAcnt(vo.getEmplyrId()); //사용자 id
vo.setUserNm(vo.getEmplyrNm()); //사용자 명
vo.setUserKey(vo.getUniqId());
vo.setUserId(vo.getUniqId());
Map<String,Object> userInfoCheckMap = mapper.selectCheckUserInfo(vo.getUserId());
if(Checks.isEmpty(userInfoCheckMap) || !Objects.equals(vo.getUserKey(), userInfoCheckMap.get("user_key")))
Map<String,Object> userInfoCheckMap = mapper.selectCheckUserInfo(vo.getUserAcnt());
if(Checks.isEmpty(userInfoCheckMap) || !Objects.equals(vo.getUserId(), userInfoCheckMap.get("user_id")))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "사용자 고유식별값이 일치하지 않습니다.");
// 변경이력 등록 and 사용자 정보 변경
@ -273,7 +277,7 @@ public class UserMgtServiceBean extends AbstractServiceBean implements UserMgtSe
@Override
public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2) {
public void modifyPwdProc(String uniqId, String accountId, String oldPassword, String newPassword, String newPassword2) {
/**
*
@ -306,7 +310,7 @@ public class UserMgtServiceBean extends AbstractServiceBean implements UserMgtSe
*
*/
XitUserInfoVO xitUserInfoVO = new XitUserInfoVO();
xitUserInfoVO.setUserId(id);
xitUserInfoVO.setUserId(uniqId);
xitUserInfoVO.setPasswd(encryptNewPass);

Loading…
Cancel
Save