fix: 사용자 정보 관련 PARKNOT DB 추가 처리

- 장애인,거주자 의견진술 심사 처리 시 GN_RECALL_SC 업데이트 추가 처리
main
sjh88 2 years ago
parent bc55ad973a
commit 5e5d10b993

@ -21,6 +21,8 @@ public class CtgyConstants {
RESULT_JUDGE_PRE("0", "심의전"),
RESULT_JUDGE_NON_IMPOSE("1", "미부과"),
RESULT_JUDGE_IMPOSE("2", "부과"),
RESULT_STATE_NON_IMPOSE("3", "과태료 부과여부 ‘과태료 부과하지 않음’으로 결정되었음을 알려드리며 향후 동일한 내용으로 진술시 부과 될 수 있음을 알려드립니다."),
RESULT_STATE_IMPOSE("4", "귀하께서 제출하신 의견진술 심의요청에 대하여 강남구 불법주정차 의견진술 심의위원회의 심의결과 ‘과태료 부과’로 결정되었음을 알려드립니다."),
// 데이타구분
DATAGB_RESIDENT("1", "거주자"),
DATAGB_DISABLED("2", "장애인")

@ -3,6 +3,7 @@ package com.xit.biz.ctgy.auth.service.impl;
import com.xit.biz.ctgy.auth.UserMinPrincipal;
import com.xit.biz.ctgy.entity.MinUserinfo;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.repository.UserSubDao;
import com.xit.core.oauth2.oauth.entity.ProviderType;
import com.xit.core.oauth2.oauth.info.AbstractOAuth2UserInfo;
import com.xit.core.oauth2.oauth.info.OAuth2UserInfoFactory;
@ -22,6 +23,7 @@ import java.util.Optional;
public class CustomMinOAuth2UserService extends DefaultOAuth2UserService {
private final UserDao userDao;
private final UserSubDao userSubDao;
@Override
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
@ -81,6 +83,7 @@ public class CustomMinOAuth2UserService extends DefaultOAuth2UserService {
.email(userInfo.getEmail())
.build();
userDao.insertMinUserinfo(user);
userSubDao.insertMinUserinfo(user);
return userDao.findByUseridUseAuth(userInfo.getId()).get();
}

@ -168,6 +168,17 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
update(sql);
}
public void updateState(@NotNull final Long scCode, @NotNull final String scSeq, @NotNull final String scState, @NotNull final String scAnswer) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateState")
.setParameter("scCode", scCode)
.setParameter("scSeq", scSeq)
.setParameter("scState", scState)
.setParameter("scAnswer", scAnswer)
.getQueryString();
update(sql);
}
public List<JudgeTargetDto> findJudgeTargets(@NotNull final JudgeTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeTarget")
.setParameter("scDatagb", dto.getScDatagb())

@ -0,0 +1,93 @@
package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.entity.MinUserinfo;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.SlaveDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Optional;
@Repository
@Slf4j
public class UserSubDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "userSub";
public UserSubDao(SlaveDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public void insertMinUserinfoDto(@NotNull final MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("isenable", dto.getIsenable())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("regdate", dto.getRegdate())
.setParameter("team", dto.getTeam())
.setParameter("gu", dto.getGu())
.getQueryString();
insert(sql);
}
public void updateMinUserinfoDto(MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
//.setParameter("passwd", dto.getPasswd())
.setParameter("team", dto.getTeam())
.getQueryString();
update(sql);
}
public void insertMinUserinfo(@NotNull final MinUserinfo dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("isenable", dto.getIsenable())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("regdate", dto.getRegdate())
.setParameter("team", dto.getTeam())
.setParameter("gu", dto.getGu())
.getQueryString();
insert(sql);
}
public void updateMinUserinfo(MinUserinfo dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("team", dto.getTeam())
.getQueryString();
update(sql);
}
public void removeMinUserinfo(@NotNull final MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfoIsenable")
.setParameter("userid", dto.getUserid())
.setParameter("isenable", dto.getIsenable())
.getQueryString();
update(sql);
}
}

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.repository.UserSubDao;
import com.xit.biz.ctgy.v2.service.IMinUserService;
import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException;
@ -21,6 +22,7 @@ public class MinUserService implements IMinUserService {
private final PasswordEncoder passwordEncoder;
private final UserDao userDao;
private final UserSubDao userSubDao;
//@Transactional(readOnly = true)
public Page<MinUserinfoDto> findMinUsers(final MinUserinfoDto dto, Pageable pageable) {
@ -49,10 +51,12 @@ public class MinUserService implements IMinUserService {
if(opUser.isPresent() && !Checks.isEmpty(opUser.get().getUserid())) throw new CustomBaseException(ErrorCode.MEMBER_EXISTS);
dto.setSaveInit();
userDao.insertMinUserinfoDto(dto);
userSubDao.insertMinUserinfoDto(dto);
}else{
// 비밀번호가 다른 경우
//if(!savedDto.get().getPasswd().equals(encPasswd)) dto.setPasswd(encPasswd);
userDao.updateMinUserinfoDto(dto);
userSubDao.updateMinUserinfoDto(dto);
}
}
@ -61,5 +65,6 @@ public class MinUserService implements IMinUserService {
public void removeMinUser(MinUserinfoDto dto) {
dto.setIsenable("0");
userDao.removeMinUserinfo(dto);
userSubDao.removeMinUserinfo(dto);
}
}

@ -271,6 +271,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
residentAndDisabledDao.updateMsResult(msMaincode, msSeq, msResult);
String scState = "";
String scAnswer = "";
if("1".equals(msResult)){
scState = CtgyConstants.Judge.RESULT_STATE_NON_IMPOSE.getCode();
scAnswer = CtgyConstants.Judge.RESULT_STATE_NON_IMPOSE.getDesc();
}else if("2".equals(msResult)){
scState = CtgyConstants.Judge.RESULT_STATE_IMPOSE.getCode();
scAnswer = CtgyConstants.Judge.RESULT_STATE_IMPOSE.getDesc();
}
residentAndDisabledDao.updateState(msMaincode, msSeq, scState, scAnswer);
}
});
}

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings namespace="userSub">
<native-query id="insertMinUserinfo">
/* minusersubinfo-mapper|insertMinUserinfo|julim */
INSERT
INTO min_userinfo (
userid
, accesstype
, email
, gu
, isenable
, mphone
, name
, passwd
, regdate
, team
) VALUES (
#{userid}
, #{accesstype}
, #{email}
, #{gu}
, #{isenable}
, #{mphone}
, #{name}
, #{passwd}
, #{regdate}
, #{team}
)
</native-query>
<native-query id="updateMinUserinfo">
/* minusersubinfo-mapper|updateMinUserinfo|julim */
UPDATE min_userinfo
SET accesstype = #{accesstype}
, team = #{team}
, name = #{name}
, mphone = #{mphone}
, email = #{email}
WHERE userid= #{userid}
</native-query>
<native-query id="updateMinUserinfoIsenable">
/* minusersubinfo-mapper|updateMinUserinfoIsenable|julim */
UPDATE min_userinfo
SET isenable = #{isenable}
WHERE userid= #{userid}
</native-query>
</entity-mappings>

@ -385,6 +385,15 @@
WHERE sc_code = #{scCode}
</native-query>
<native-query id="updateState">
/* residentAndDisabled-mapper|updateState|jhseo */
UPDATE gn_recall_sc
SET sc_state = #{scState},
sc_answer = #{scAnswer}
WHERE sc_code = #{scCode}
AND sc_seq = #{scSeq}
</native-query>
<native-query id="insertJudgeUser">
/* minuserinfo-mapper|insertJudgeUser|julim */
INSERT

Loading…
Cancel
Save