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