From 5e5d10b993201575f94eed043221bbe9bc09e969 Mon Sep 17 00:00:00 2001 From: sjh88 Date: Tue, 7 Mar 2023 15:56:19 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EA=B4=80=EB=A0=A8=20PARKNOT=20DB=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EC=B2=98=EB=A6=AC=20=20=20=20-=20=EC=9E=A5?= =?UTF-8?q?=EC=95=A0=EC=9D=B8,=EA=B1=B0=EC=A3=BC=EC=9E=90=20=EC=9D=98?= =?UTF-8?q?=EA=B2=AC=EC=A7=84=EC=88=A0=20=EC=8B=AC=EC=82=AC=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=8B=9C=20GN=5FRECALL=5FSC=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=20=EC=B6=94=EA=B0=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xit/biz/ctgy/CtgyConstants.java | 2 + .../impl/CustomMinOAuth2UserService.java | 3 + .../v2/repository/ResidentAndDisabledDao.java | 11 +++ .../biz/ctgy/v2/repository/UserSubDao.java | 93 +++++++++++++++++++ .../ctgy/v2/service/impl/MinUserService.java | 5 + .../impl/ResidentAndDisabledService.java | 10 ++ .../resources/sql/minusersubinfo-mapper.xml | 50 ++++++++++ .../sql/residentAndDisabled-mapper.xml | 9 ++ 8 files changed, 183 insertions(+) create mode 100644 src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java create mode 100644 src/main/resources/sql/minusersubinfo-mapper.xml diff --git a/src/main/java/com/xit/biz/ctgy/CtgyConstants.java b/src/main/java/com/xit/biz/ctgy/CtgyConstants.java index 9dda1f2..13c1771 100644 --- a/src/main/java/com/xit/biz/ctgy/CtgyConstants.java +++ b/src/main/java/com/xit/biz/ctgy/CtgyConstants.java @@ -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", "장애인") diff --git a/src/main/java/com/xit/biz/ctgy/auth/service/impl/CustomMinOAuth2UserService.java b/src/main/java/com/xit/biz/ctgy/auth/service/impl/CustomMinOAuth2UserService.java index 975b336..0a3d22a 100644 --- a/src/main/java/com/xit/biz/ctgy/auth/service/impl/CustomMinOAuth2UserService.java +++ b/src/main/java/com/xit/biz/ctgy/auth/service/impl/CustomMinOAuth2UserService.java @@ -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(); } diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java index effe389..64ecf71 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java @@ -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 findJudgeTargets(@NotNull final JudgeTargetDto dto) { final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeTarget") .setParameter("scDatagb", dto.getScDatagb()) diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java new file mode 100644 index 0000000..861f173 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/UserSubDao.java @@ -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); + } + + +} diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java index 9166c98..32e524d 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/MinUserService.java @@ -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 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); } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java index 74743ee..c320f6c 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java @@ -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); } }); } diff --git a/src/main/resources/sql/minusersubinfo-mapper.xml b/src/main/resources/sql/minusersubinfo-mapper.xml new file mode 100644 index 0000000..3a7d3c4 --- /dev/null +++ b/src/main/resources/sql/minusersubinfo-mapper.xml @@ -0,0 +1,50 @@ + + + + + /* 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} + ) + + + + /* minusersubinfo-mapper|updateMinUserinfo|julim */ + UPDATE min_userinfo + SET accesstype = #{accesstype} + , team = #{team} + , name = #{name} + , mphone = #{mphone} + , email = #{email} + WHERE userid= #{userid} + + + + /* minusersubinfo-mapper|updateMinUserinfoIsenable|julim */ + UPDATE min_userinfo + SET isenable = #{isenable} + WHERE userid= #{userid} + + + \ No newline at end of file diff --git a/src/main/resources/sql/residentAndDisabled-mapper.xml b/src/main/resources/sql/residentAndDisabled-mapper.xml index b4e0d8e..ab3fa7e 100644 --- a/src/main/resources/sql/residentAndDisabled-mapper.xml +++ b/src/main/resources/sql/residentAndDisabled-mapper.xml @@ -385,6 +385,15 @@ WHERE sc_code = #{scCode} + + /* residentAndDisabled-mapper|updateState|jhseo */ + UPDATE gn_recall_sc + SET sc_state = #{scState}, + sc_answer = #{scAnswer} + WHERE sc_code = #{scCode} + AND sc_seq = #{scSeq} + + /* minuserinfo-mapper|insertJudgeUser|julim */ INSERT