From 4b54070e97aa647a13832717a62c4b6c96d789bf Mon Sep 17 00:00:00 2001 From: jjh Date: Fri, 24 May 2024 18:29:29 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A9=EB=B6=80=EC=9E=90=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EB=B3=80=EA=B2=BD=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B8=ED=95=9C=20=EB=82=A9=EB=B6=80=EC=9E=90=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D,=20=EC=88=98=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/cmmn/CrdnPayerHstry.java | 6 + .../xit/fims/cmmn/CrdnPayerHstryQuery.java | 25 +- .../fims/cmmn/dao/CrdnPayerHstryMapper.java | 22 +- .../cmmn/service/bean/CrdnPayerHstryBean.java | 42 +- .../bean/CrdnPayerHstryServiceBean.java | 2 +- src/main/java/cokr/xit/fims/crdn/Crdn.java | 5 + .../xit/fims/crdn/service/bean/CrdnBean.java | 11 +- .../cvlc/service/bean/CrdnCvlcptSubBean.java | 2 +- src/main/java/cokr/xit/fims/payer/Payer.java | 36 +- .../java/cokr/xit/fims/payer/PayerQuery.java | 53 +- .../xit/fims/payer/dao/PayerAddrMapper.java | 89 +++ .../cokr/xit/fims/payer/dao/PayerMapper.java | 42 +- .../xit/fims/payer/service/PayerService.java | 20 +- .../fims/payer/service/bean/PayerBean.java | 163 ++++-- .../payer/service/bean/PayerServiceBean.java | 10 +- .../xit/fims/payer/web/PayerController.java | 18 +- .../fims/cmmn/crdnPayerHstry-mapper.xml | 71 ++- .../sql/mapper/fims/crdn/crdn-inst-mapper.xml | 4 +- .../sql/mapper/fims/crdn/crdn-list-mapper.xml | 5 +- .../sql/mapper/fims/levy/levy-mapper.xml | 8 +- .../sql/mapper/fims/payer-mapper.xml | 528 +++++++----------- .../sql/mapper/fims/payerAddr-mapper.xml | 162 ++++++ .../sql/mapper/fims/sprt/totalInfo-mapper.xml | 32 +- .../WEB-INF/jsp/fims/crdn/crdn05030-info.jsp | 245 ++++---- .../jsp/fims/payer/payer01020-info.jsp | 28 +- 25 files changed, 983 insertions(+), 646 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/payer/dao/PayerAddrMapper.java create mode 100644 src/main/resources/sql/mapper/fims/payerAddr-mapper.xml diff --git a/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstry.java b/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstry.java index 6aae5849..c70c13a7 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstry.java +++ b/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstry.java @@ -11,6 +11,7 @@ import lombok.Setter; @Getter @Setter public class CrdnPayerHstry extends AbstractEntity { + /** * 변경 이력 ID */ @@ -26,4 +27,9 @@ public class CrdnPayerHstry extends AbstractEntity { */ private String rtpyrId; + /** + * 주소 일련번호 + */ + private String addrSn; + } diff --git a/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstryQuery.java b/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstryQuery.java index 654b3be7..1eebe88b 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstryQuery.java +++ b/src/main/java/cokr/xit/fims/cmmn/CrdnPayerHstryQuery.java @@ -14,19 +14,9 @@ public class CrdnPayerHstryQuery extends CmmnQuery { private static final long serialVersionUID = 1L; - private String chgHstryId; // 상태 이력 ID - private String crdnId; // 단속 ID - private String rtpyrId; // 납부자 ID - - public String getChgHstryId() { - return ifEmpty(chgHstryId, () -> null); - } - - public T setChgHstryId(String chgHstryId) { - this.chgHstryId = chgHstryId; - - return self(); - } + private String crdnId; // 단속 ID + private String rtpyrId; // 납부자 ID + private String addrSn; // 주소 일련번호 public String getCrdnId() { return ifEmpty(crdnId, () -> null); @@ -34,7 +24,6 @@ public class CrdnPayerHstryQuery extends CmmnQuery { public T setCrdnId(String crdnId) { this.crdnId = crdnId; - return self(); } @@ -44,7 +33,15 @@ public class CrdnPayerHstryQuery extends CmmnQuery { public T setRtpyrId(String rtpyrId) { this.rtpyrId = rtpyrId; + return self(); + } + + public String getAddrSn() { + return ifEmpty(addrSn, () -> null); + } + public T setAddrSn(String addrSn) { + this.rtpyrId = addrSn; return self(); } diff --git a/src/main/java/cokr/xit/fims/cmmn/dao/CrdnPayerHstryMapper.java b/src/main/java/cokr/xit/fims/cmmn/dao/CrdnPayerHstryMapper.java index 83e1e97b..1f2917db 100644 --- a/src/main/java/cokr/xit/fims/cmmn/dao/CrdnPayerHstryMapper.java +++ b/src/main/java/cokr/xit/fims/cmmn/dao/CrdnPayerHstryMapper.java @@ -51,10 +51,30 @@ public interface CrdnPayerHstryMapper extends AbstractMapper { *
  • 그렇지 않으면 false
  • * */ - default boolean insert(CrdnPayerHstry crdnPayerHstry) { + default boolean insertCrdnPayerHstry(CrdnPayerHstry crdnPayerHstry) { return crdnPayerHstry != null && insertCrdnPayerHstry(params().set("crdnPayerHstry", crdnPayerHstry)) == 1; } + /**단속 납부자 주소 이력 정보를 등록한다. + * @param params 파라미터 + *
    • "crdnPayerHstry" - 단속 납부자 이력
    • + *
    • "currentUser" - 현재 접속한 사용자
    • + *
    + * @return 저장된 정보수 + */ + int insertCrdnPayerAddrHstry(Map params); + + /**단속 납부자 주소 이력 정보를 등록한다. + * @param crdnPayerHstry 단속 납부자 이력 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + default boolean insertCrdnPayerAddrHstry(CrdnPayerHstry crdnPayerHstry) { + return crdnPayerHstry != null && insertCrdnPayerAddrHstry(params().set("crdnPayerAddrHstry", crdnPayerHstry)) == 1; + } + /**단속(TB_CRDN) 대장의 납부자 ID를 수정한다. * @param params 파라미터 *
    • "crdnPayerHstry" - 단속 납부자 이력
    • diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryBean.java index 7965958b..ebb26ef0 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryBean.java +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryBean.java @@ -24,6 +24,7 @@ import cokr.xit.foundation.data.DataObject; */ @Component("crdnPayerHstryBean") public class CrdnPayerHstryBean extends AbstractComponent { + /** 단속 납부자 이력 정보 DAO */ @Resource(name = "crdnPayerHstryMapper") private CrdnPayerHstryMapper crdnPayerHstryMapper; @@ -51,8 +52,30 @@ public class CrdnPayerHstryBean extends AbstractComponent { *
    • 그렇지 않으면 false
    • *
    */ - public boolean create(CrdnPayerHstry crdnPayerHstry) { - return crdnPayerHstryMapper.insert(crdnPayerHstry); + public boolean createCrdnPayerHstry(CrdnPayerHstry crdnPayerHstry) { + return crdnPayerHstryMapper.insertCrdnPayerHstry(crdnPayerHstry); + } + + /**단속 납부자 이력 정보를 등록한다. + * @param crdnPayerHstry 단속 납부자 이력 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + public boolean createCrdnPayerAddrHstry(CrdnPayerHstry crdnPayerHstry) { + return crdnPayerHstryMapper.insertCrdnPayerAddrHstry(crdnPayerHstry); + } + + /**단속 납부자 이력 정보를 등록하고, 단속 대장의 납부자 정보를 수정한다. + * @param crdnPayerHstry 단속 납부자 이력 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + public boolean updateCrdnPayer(CrdnPayerHstry crdnPayerHstry) { + return crdnPayerHstryMapper.updateCrdnPayer(crdnPayerHstry); } /**단속 납부자 이력 정보를 등록하고, 단속 대장의 납부자 정보를 수정한다. @@ -63,22 +86,21 @@ public class CrdnPayerHstryBean extends AbstractComponent { * */ public boolean createHstryUpdateCrdnPayer(CrdnPayerHstry crdnPayerHstry) { - boolean rtnScs = false; // DB 처리 결과 + boolean rtnScs = false; // DB 처리 결과 // 단속 납부자 이력 정보를 등록한다. - rtnScs = crdnPayerHstryMapper.insert(crdnPayerHstry); + rtnScs = createCrdnPayerHstry(crdnPayerHstry); if (!rtnScs) { - // 예외를 발생시켜서 오류메세지를 보내고 Database 롤백.. - throw new RuntimeException("단속 납부자 이력 정보를 등록 중 오류가 발생하였습니다."); + throw new RuntimeException("단속 납부자 이력 정보를 등록 중 오류가 발생하였습니다."); // 예외를 발생시켜서 DB Rollback } // 단속 대장 납부자ID를 변경한다. - rtnScs = crdnPayerHstryMapper.updateCrdnPayer(crdnPayerHstry); + rtnScs = updateCrdnPayer(crdnPayerHstry); if (!rtnScs) { - // 예외를 발생시켜서 오류메세지를 보내고 Database 롤백.. - throw new RuntimeException("단속 납부자 이력 정보를 등록 중 오류가 발생하였습니다."); + throw new RuntimeException("단속 납부자 이력 정보를 등록 중 오류가 발생하였습니다."); // 예외를 발생시켜서 DB Rollback } return rtnScs; } -} \ No newline at end of file + +} diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryServiceBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryServiceBean.java index ae211e6f..cfa9c57f 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryServiceBean.java +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/CrdnPayerHstryServiceBean.java @@ -40,7 +40,7 @@ public class CrdnPayerHstryServiceBean extends AbstractServiceBean implements Cr @Override public boolean create(CrdnPayerHstry crdnPayerHstry) { - return crdnPayerHstryBean.create(crdnPayerHstry); + return crdnPayerHstryBean.createCrdnPayerHstry(crdnPayerHstry); } @Override diff --git a/src/main/java/cokr/xit/fims/crdn/Crdn.java b/src/main/java/cokr/xit/fims/crdn/Crdn.java index 5bf2246f..429603b9 100644 --- a/src/main/java/cokr/xit/fims/crdn/Crdn.java +++ b/src/main/java/cokr/xit/fims/crdn/Crdn.java @@ -52,6 +52,11 @@ public class Crdn extends AbstractEntity { */ private String rtpyrId; + /** + * 주소 일련번호 + */ + private String addrSn; + /** * 단속 일자 */ diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java index d5bcc2e9..67ed9ca7 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java @@ -165,9 +165,16 @@ public class CrdnBean extends AbstractComponent { CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry(); crdnPayerHstry.setCrdnId(crdn.getCrdnId()); crdnPayerHstry.setRtpyrId(crdn.getRtpyrId()); - result = crdnPayerHstryBean.create(crdnPayerHstry); + crdnPayerHstry.setAddrSn(crdn.getAddrSn()); + result = crdnPayerHstryBean.createCrdnPayerHstry(crdnPayerHstry); if (!result) { - throw new RuntimeException("단속자료 등록 중 단속납부자 이력 등록에 실패하였습니다."); + throw new RuntimeException("단속자료 등록 중 단속 납부자 이력 등록에 실패하였습니다."); + } + + // 단속 대장의 납부자ID 수정 및 단속 납부자 이력(TB_CRDN_PAYER_HSTRY) 대장에 등록한다. + result = crdnPayerHstryBean.createCrdnPayerAddrHstry(crdnPayerHstry); + if (!result) { + throw new RuntimeException("단속자료 등록 중 단속 납부자주소 이력 등록에 실패하였습니다."); } } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java index 300f230f..fbfb8324 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java @@ -244,7 +244,7 @@ public class CrdnCvlcptSubBean extends AbstractComponent { crdnPayerHstry.setCrdnId(crdn.getCrdnId()); crdnPayerHstry.setRtpyrId(crdn.getRtpyrId()); - boolean retSuccess = crdnPayerHstryMapper.insert(crdnPayerHstry); + boolean retSuccess = crdnPayerHstryMapper.insertCrdnPayerHstry(crdnPayerHstry); if(!retSuccess) { throw new RuntimeException("단속민원답변 수정 중 단속납부자변경 이력 등록에 실패하였습니다."); } diff --git a/src/main/java/cokr/xit/fims/payer/Payer.java b/src/main/java/cokr/xit/fims/payer/Payer.java index 8bb413f1..983ed829 100644 --- a/src/main/java/cokr/xit/fims/payer/Payer.java +++ b/src/main/java/cokr/xit/fims/payer/Payer.java @@ -12,6 +12,7 @@ import lombok.Setter; @Getter @Setter public class Payer extends AbstractEntity { + /** * 납부자 ID */ @@ -72,6 +73,21 @@ public class Payer extends AbstractEntity { */ private String rtpyrSttsCd; + /** + * 주소 일련번호 + */ + private String addrSn; + + /** + * 주소 입력 구분 코드 + */ + private String addrInptSeCd; + + /** + * 주소 조회 일자 + */ + private String addrInqYmd; + /** * 주소 구분 코드 */ @@ -82,6 +98,16 @@ public class Payer extends AbstractEntity { */ private String zip; + /** + * 주소 + */ + private String addr; + + /** + * 상세 주소 + */ + private String dtlAddr; + /** * 도로 명 코드 */ @@ -147,16 +173,6 @@ public class Payer extends AbstractEntity { */ private String spclAddr; - /** - * 주소 - */ - private String addr; - - /** - * 상세 주소 - */ - private String dtlAddr; - /** * 전체 주소 */ diff --git a/src/main/java/cokr/xit/fims/payer/PayerQuery.java b/src/main/java/cokr/xit/fims/payer/PayerQuery.java index 0586843c..e6107f92 100644 --- a/src/main/java/cokr/xit/fims/payer/PayerQuery.java +++ b/src/main/java/cokr/xit/fims/payer/PayerQuery.java @@ -21,10 +21,14 @@ public class PayerQuery extends QueryRequest { private String[] rtpyrIds; /** 차량번호 */ private String vhrno; + /** 납부자 구분 코드 */ + private String rtpyrSeCd; /** 납부자번호 */ private String rtpyrNo; /** 납부자 ID */ private String rtpyrId; + /** 주소 일련번호 */ + private String addrSn; /** 이력 일련번호 */ private String hstrySn; /** 단속 ID */ @@ -34,15 +38,15 @@ public class PayerQuery extends QueryRequest { /** 호출 용도 */ private String callPurpose; // infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정, refresh 재조회). - /**납부자 ID를 반환한다. - * @return 납부자 ID + /**납부자 IDs를 반환한다. + * @return 납부자 IDs */ public String[] getRtpyrIds() { return ifEmpty(rtpyrIds, () -> null); } - /**납부자 ID를 설정한다. - * @param rtpyrIds 납부자 ID + /**납부자 IDs를 설정한다. + * @param rtpyrIds 납부자 IDs * @return 현재 PayerQuery */ public PayerQuery setRtpyrIds(String... rtpyrIds) { @@ -54,15 +58,32 @@ public class PayerQuery extends QueryRequest { * @return 납부자 ID */ public String getRtpyrId() { - return !isEmpty(rtpyrIds) ? rtpyrIds[0] : rtpyrId; + return !isEmpty(rtpyrIds) ? rtpyrIds[0] : rtpyrId; } /**납부자 ID를 설정한다. - * @param rtpyrIds 납부자 ID + * @param rtpyrId 납부자 ID * @return 현재 PayerQuery */ public PayerQuery setRtpyrId(String rtpyrId) { - return setRtpyrIds(rtpyrId); + this.rtpyrId = rtpyrId; + return this; + } + + /**주소 일련번호를 반환한다. + * @return 주소 일련번호 + */ + public String getAddrSn() { + return ifEmpty(addrSn, () -> null); + } + + /**주소 일련번호를 설정한다. + * @param addrSn 주소 일련번호 + * @return 현재 PayerQuery + */ + public PayerQuery setAddrSn(String addrSn) { + this.addrSn = addrSn; + return self(); } /**이력 일련번호를 반환한다. @@ -97,6 +118,21 @@ public class PayerQuery extends QueryRequest { return this; } + /**납부자 구분 코드를 반환한다. + * @return 납부자 구분 코드 + */ + public String getRtpyrSeCd() { + return rtpyrSeCd; + } + + /**납부자 구분 코드를 설정한다. + * @param rtpyrSeCd 납부자 구분 코드 + * @return 현재 PayerQuery + */ + public void setRtpyrSeCd(String rtpyrSeCd) { + this.rtpyrSeCd = rtpyrSeCd; + } + /**납부자 번호를 반환한다. * @return 납부자 번호 */ @@ -123,7 +159,6 @@ public class PayerQuery extends QueryRequest { public T setCrdnId(String crdnId) { this.crdnId = crdnId; - return self(); } @@ -133,7 +168,6 @@ public class PayerQuery extends QueryRequest { public T setDelYn(String delYn) { this.delYn = delYn; - return self(); } @@ -143,7 +177,6 @@ public class PayerQuery extends QueryRequest { public T setCallPurpose(String callPurpose) { this.callPurpose = callPurpose; - return self(); } diff --git a/src/main/java/cokr/xit/fims/payer/dao/PayerAddrMapper.java b/src/main/java/cokr/xit/fims/payer/dao/PayerAddrMapper.java new file mode 100644 index 00000000..74c5cb09 --- /dev/null +++ b/src/main/java/cokr/xit/fims/payer/dao/PayerAddrMapper.java @@ -0,0 +1,89 @@ +package cokr.xit.fims.payer.dao; + +import java.util.List; +import java.util.Map; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; +import cokr.xit.fims.payer.Payer; +import cokr.xit.fims.payer.PayerQuery; + +/** 납부자 주소 정보 DAO + * + *

    상세 설명: + * + *

    + * ============ 변경 이력 ============
    + * 2024-05-23	JoJH 최초 작성
    + * ================================
    + * 
    + */ +@Mapper("payerAddrMapper") +public interface PayerAddrMapper extends AbstractMapper { + + /**지정한 조건에 따라 납부자 주소 목록을 조회하여 반환한다.
    + * @param req 납부자 주소 조회 조건 + * @return 납부자 주소 목록 + */ + List selectPayerAddrList(PayerQuery req); + + /**지정한 조건에 따라 납부자 주소 객체들을 반환한다. + * @param req 납부자 주소 조회 조건 + * @return 납부자 주소 객체 목록 + */ + List selectPayerAddrs(PayerQuery req); + + default DataObject selectPayerAddrsInfo(PayerQuery req) { + // 기본 정렬 + if (req.getOrderBy() == null) { + req.setOrderBy("PA.ADDR_SN DESC"); + } + + List payerAddrs = selectPayerAddrs(req); + + return !payerAddrs.isEmpty() ? payerAddrs.get(0) : null; + } + + /**납부자 주소 정보를 등록한다. + * @param params 파라미터 + *
    • "payerAddr" - 납부자 주소
    • + *
    • "currentUser" - 현재 접속한 사용자
    • + *
    + * @return 저장된 정보수 + */ + int insertPayerAddr(Map params); + + /**납부자 주소 정보를 등록한다. + * @param payerAddr 납부자 주소 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + default boolean insert(Payer payer) { + return payer != null && insertPayerAddr(params().set("payerAddr", payer)) == 1; + } + + /**납부자 주소 정보를 수정한다. + * @param params 파라미터 + *
    • "payerAddr" - 납부자 주소
    • + *
    • "currentUser" - 현재 접속한 사용자
    • + *
    + * @return 저장된 정보수 + */ + int updatePayerAddr(Map params); + + /**납부자 주소 정보를 수정한다. + * @param payerAddr 납부자 주소 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + default boolean update(Payer payer) { + return payer != null && updatePayerAddr(params().set("payerAddr", payer)) == 1; + } + +} diff --git a/src/main/java/cokr/xit/fims/payer/dao/PayerMapper.java b/src/main/java/cokr/xit/fims/payer/dao/PayerMapper.java index ebada0e8..95d661ce 100644 --- a/src/main/java/cokr/xit/fims/payer/dao/PayerMapper.java +++ b/src/main/java/cokr/xit/fims/payer/dao/PayerMapper.java @@ -38,15 +38,7 @@ public interface PayerMapper extends AbstractMapper { * @param payer 납부자 대장 * @return 저장된 정보수 */ - int insertPayer(Payer payer); - - /**납부자 대장 정보를 등록한다. - * @param params 파라미터 - *
    • "payer" - 납부자 대장
    • - *
    - * @return 저장된 정보수 - */ - int insertHistory(Map params); + int insertPayer(Map params); /**납부자 대장 정보를 등록한다. * @param payer 납부자 대장 @@ -56,12 +48,7 @@ public interface PayerMapper extends AbstractMapper { * */ default boolean insert(Payer payer) { - boolean saved = insertPayer(payer) > 0; - if (saved) { - DataObject params = params().set("payer", payer); - insertHistory(params); - } - return saved; + return payer != null && insertPayer(params().set("payer", payer)) == 1; } /**납부자 대장 정보를 수정한다. @@ -71,7 +58,7 @@ public interface PayerMapper extends AbstractMapper { * * @return 저장된 정보수 */ - int updatePayer(Payer payer); + int updatePayer(Map params); /**납부자 대장 정보를 수정한다. * @param payer 납부자 대장 @@ -81,28 +68,7 @@ public interface PayerMapper extends AbstractMapper { * */ default boolean update(Payer payer) { - boolean saved = updatePayer(payer) == 1; - if (saved) { - DataObject params = params().set("payer", payer); - insertHistory(params); - } - return saved; - } - - /**지정한 납부자 대장을 삭제한다. - * @param params 파라미터 - *
    • "rtpyrIds" - 납부자 아이디
    • - *
    - * @return 저장된 정보수 - */ - int deletePayer(Map params); - - /**납부자 대장 정보를 삭제한다. - * @param rtpyrIds 납부자 아이디 - * @return 저장된 정보수 - */ - default int delete(String... rtpyrIds) { - return !isEmpty(rtpyrIds) ? deletePayer(params().set("rtpyrIds", rtpyrIds)) : 0; + return payer != null && updatePayer(params().set("payer", payer)) == 1; } /**납부자 도로명 주소의 우편번호, 건물관리번호를 조회한다. 도로망 주소 연계 구현 시 이동 diff --git a/src/main/java/cokr/xit/fims/payer/service/PayerService.java b/src/main/java/cokr/xit/fims/payer/service/PayerService.java index 3cf9f3a3..9af065ce 100644 --- a/src/main/java/cokr/xit/fims/payer/service/PayerService.java +++ b/src/main/java/cokr/xit/fims/payer/service/PayerService.java @@ -48,11 +48,23 @@ public interface PayerService { */ boolean update(Payer payer); - /**납부자 대장 정보를 삭제한다. - * @param rtpyrIds 납부자 아이디 - * @return 저장된 정보수 + /**납부자 주소 정보를 등록한다. + * @param payer 납부자 대장 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + boolean createPayerAddr(Payer payer); + + /**납부자 주소 정보를 수정한다. + * @param payer 납부자 대장 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    */ - int remove(String... rtpyrIds); + boolean updatePayerAddr(Payer payer); /**주어진 조건의 차량 및 소유자(납부자) 정보를 반환한다. * @param req 자동차 기본정보 조회 조건 diff --git a/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java b/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java index 70919e77..1dfa83f6 100644 --- a/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java +++ b/src/main/java/cokr/xit/fims/payer/service/bean/PayerBean.java @@ -14,6 +14,7 @@ import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.payer.Payer; import cokr.xit.fims.payer.PayerQuery; +import cokr.xit.fims.payer.dao.PayerAddrMapper; import cokr.xit.fims.payer.dao.PayerMapper; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.data.DataObject; @@ -33,9 +34,16 @@ import cokr.xit.interfaces.lvis.service.reg.BasicInfoResponse; */ @Component("payerBean") public class PayerBean extends AbstractComponent { + /** 납부자 정보 DAO */ @Resource(name = "payerMapper") private PayerMapper payerMapper; + + /** 납부자 주소 정보 DAO */ + @Resource(name = "payerAddrMapper") + private PayerAddrMapper payerAddrMapper; + + /** 자동차 정보 DAO */ @Resource(name = "vehicleInfoBean") private VehicleInfoBean vehicleInfoBean; @@ -63,10 +71,11 @@ public class PayerBean extends AbstractComponent { return payerMapper.selectPayers(req); } - public Payer getPayer(String vhrno, String rtpyrNo) { - PayerQuery req = new PayerQuery().setVhrno(vhrno); - req.setRtpyrNo(rtpyrNo); + public Payer getPayer(PayerQuery req) { + req.setOrderBy("P.RTPYR_ID DESC, PA.ADDR_SN DESC"); + List payers = getPayers(req); + return !payers.isEmpty() ? payers.get(0) : null; } @@ -78,20 +87,14 @@ public class PayerBean extends AbstractComponent { * */ public boolean create(Payer payer) { - DataObject params = new DataObject() - .set("roadNmCd", payer.getRoadNmCd()) - .set("udgdSeCd", payer.getUdgdSeCd()) - .set("bmno", payer.getBmno()) - .set("bsno", payer.getBsno()); - DataObject info = payerMapper.selectAddrInfo(params); - if (info != null) { - payer.setAddrSeCd("02"); - payer.setZip(info.string("ZIP")); - payer.setBldgMngNo(info.string("BLDG_MNG_NO")); - payer.setStdgCd(info.string("STDG_CD")); - payer.setDongCd(info.string("DONG_CD")); + // 납부자 등록 + boolean rtnScs = payerMapper.insert(payer); + // 납부자 주소 등록 + if (rtnScs) { + createPayerAddr(payer); } - return payerMapper.insert(payer); + + return rtnScs; } /**납부자 정보를 수정한다. @@ -102,11 +105,23 @@ public class PayerBean extends AbstractComponent { * */ public boolean update(Payer payer) { + return payerMapper.update(payer); + } + + /**납부자 주소 정보를 등록한다. + * @param payer 납부자 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    + */ + public boolean createPayerAddr(Payer payer) { + // 납부자 주소 등록 DataObject params = new DataObject() - .set("roadNmCd", payer.getRoadNmCd()) - .set("udgdSeCd", payer.getUdgdSeCd()) - .set("bmno", payer.getBmno()) - .set("bsno", payer.getBsno()); + .set("roadNmCd", payer.getRoadNmCd()) + .set("udgdSeCd", payer.getUdgdSeCd()) + .set("bmno", payer.getBmno()) + .set("bsno", payer.getBsno()); DataObject info = payerMapper.selectAddrInfo(params); if (info != null) { payer.setAddrSeCd("02"); @@ -115,15 +130,19 @@ public class PayerBean extends AbstractComponent { payer.setStdgCd(info.string("STDG_CD")); payer.setDongCd(info.string("DONG_CD")); } - return payerMapper.update(payer); + + return payerAddrMapper.insert(payer); } - /**납부자 정보를 삭제한다. - * @param rtpyrIds 납부자 아이디 - * @return 저장된 정보수 + /**납부자 주소 정보를 수정한다. + * @param payer 납부자 + * @return 저장 여부 + *
    • 저장됐으면 true
    • + *
    • 그렇지 않으면 false
    • + *
    */ - public int remove(String... rtpyrIds) { - return payerMapper.delete(rtpyrIds); + public boolean updatePayerAddr(Payer payer) { + return payerAddrMapper.update(payer); } public List getVehicleOwners(List reqs) { @@ -143,9 +162,9 @@ public class PayerBean extends AbstractComponent { Payer payer = new Payer(); payer.setSggCd(basicInfo.getSggCd()); - String vhrno = basicInfo.getVhrno(); - payer.setVhrno(vhrno); + payer.setVhrno(basicInfo.getVhrno()); payer.setRtpyrInptSeCd("02"); + payer.setAddrInptSeCd("02"); payer.setRtpyrSeCd( Map.of( @@ -185,7 +204,26 @@ public class PayerBean extends AbstractComponent { payer.setDtlAddr(basicInfo.getUse_strnghld_adres_nm()); payer.setWholAddr(basicInfo.getRoad_nm_adres() + ", " + basicInfo.getUse_strnghld_adres_nm()); - Payer result = create(payer) ? payer : getPayer(vhrno, rtpyrNo); + // 납부자 조회 + PayerQuery req = new PayerQuery(); + req.setRtpyrSeCd(payer.getRtpyrSeCd()); + req.setRtpyrNo(payer.getRtpyrNo()); + req.setRtpyrId(payer.getRtpyrId()); + + Payer result = create(payer) ? payer : getPayer(req); + + // 등록된 최종 주소를 확인하여 주소+상세주소가 다르다면 주소를 신규 등록한다. + if (result.getAddr().equals(basicInfo.getRoad_nm_adres()) && result.getDtlAddr().equals(basicInfo.getUse_strnghld_adres_nm())) { + payer.setRtpyrId(result.getRtpyrId()); // 납부자 ID + // 납부자 주소의 최중 수정일자를 수정 + updatePayerAddr(payer); + } else { + payer.setRtpyrId(result.getRtpyrId()); // 납부자 ID + // 납부자 주소를 신규 등록 + createPayerAddr(payer); + + result.setAddrSn(payer.getAddrSn()); // 주소 일련번호 + } if (result != null) result.setVehicleInfo(basicInfo); @@ -206,7 +244,7 @@ public class PayerBean extends AbstractComponent { * @return 단속 정보 */ public DataObject getCrdnInfo(PayerQuery req) { - return payerMapper.selectCrdn(req); // 단속 조회 + return payerMapper.selectCrdn(req); // 단속 조회 } /**납부자 정보를 등록하고, 단속 정보에 납부자 ID를 변경한다. @@ -218,8 +256,8 @@ public class PayerBean extends AbstractComponent { */ public String createCrdnPayer(Payer payer) { // 변수 선언 - boolean rtnScs = false; // DB 처리 결과 - String rtnMsg = ""; // 처리 결과 메시지 + boolean rtnScs = false; // DB 처리 결과 + String rtnMsg = ""; // 처리 결과 메시지 String strTemp = ""; // 지하 구분 코드 @@ -233,28 +271,64 @@ public class PayerBean extends AbstractComponent { payer.setWholAddr(payer.getAddr() + ", " + payer.getDtlAddr()); } - // 납부자 대장(TB_PAYER)에 납부자 정보를 수정한다. - rtnScs = payerMapper.update(payer); - if (!rtnScs) { - throw new RuntimeException("납부자 수정에 실패하였습니다."); // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback - } - // 단속 ID로 단속 정보 조회 DataObject crdnInfo = payerMapper.selectCrdnInfo(payer.getCrdnId()); - // 단속 대장의 납부자 ID와 납부자 대장의 납부자 ID가 다르다면.. - if (!crdnInfo.string("RTPYR_ID").equals(payer.getRtpyrId())) { + // 납부자 ID로 납부자 정보 조회 + Payer payerInfo = getPayer(new PayerQuery().setRtpyrId(payer.getRtpyrId()) + .setAddrSn(payer.getAddrSn())); + + if (payer.getRtpyrNo().equals(payerInfo.getRtpyrNo())) { // 주민등록번호가 동일하다면.. + // 납부자 대장(TB_PAYER)에 납부자 정보를 수정한다. + rtnScs = update(payer); + if (!rtnScs) { + throw new RuntimeException("납부자 정보 수정에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback + } + + // 주소가 변경되었는지 확인 + if (payerInfo.getZip().equals(payer.getZip()) + && payerInfo.getAddr().equals(payer.getAddr()) + && payerInfo.getDtlAddr().equals(payer.getDtlAddr())) { + rtnScs = updatePayerAddr(payer); // 납부자 주소 수정일자만 수정 + } else { + rtnScs = createPayerAddr(payer); // 납부자 주소 등록 + + CrdnPayerHstry crdnPayerAddrHstry = new CrdnPayerHstry(); + crdnPayerAddrHstry.setCrdnId(payer.getCrdnId()); + crdnPayerAddrHstry.setRtpyrId(payer.getRtpyrId()); + crdnPayerAddrHstry.setAddrSn(payer.getAddrSn()); + + crdnPayerHstryBean.createCrdnPayerAddrHstry(crdnPayerAddrHstry); + } + + // 단속 대장의 납부자 ID 및 주소 일련번호를 수정한다. CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry(); crdnPayerHstry.setCrdnId(payer.getCrdnId()); crdnPayerHstry.setRtpyrId(payer.getRtpyrId()); + crdnPayerHstry.setAddrSn(payer.getAddrSn()); + + rtnScs = crdnPayerHstryBean.updateCrdnPayer(crdnPayerHstry); + if (!rtnScs) { + throw new RuntimeException("납부자 등록 실행중 단속 대장에 납부자ID 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback + } + } else { + // 납부자 대장(TB_PAYER)에 납부자 정보를 신규 등록한다. + rtnScs = create(payer); + if (!rtnScs) { + throw new RuntimeException("납부자 정보 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback + } // 단속 대장의 납부자ID 수정 및 단속 납부자 이력(TB_CRDN_PAYER_HSTRY) 대장에 등록한다. + CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry(); + crdnPayerHstry.setCrdnId(payer.getCrdnId()); + crdnPayerHstry.setRtpyrId(payer.getRtpyrId()); + crdnPayerHstry.setAddrSn(payer.getAddrSn()); + rtnScs = crdnPayerHstryBean.createHstryUpdateCrdnPayer(crdnPayerHstry); if (!rtnScs) { - // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback - throw new RuntimeException("납부자 등록 실행중 단속 대장에 납부자ID 등록에 실패하였습니다."); + throw new RuntimeException("납부자 등록 실행중 단속 대장에 납부자ID 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback } - } + } // 단속 상태 이력(TB_CRDN_STTS_HSTRY) 대장에 등록하고, 단속(TB_CRDN) 대장을 수정한다. if (crdnInfo.number("CRDN_STTS_CD").intValue() < 21) { // 납부자 등록 완료 @@ -266,8 +340,7 @@ public class PayerBean extends AbstractComponent { rtnScs = crdnSttsHstryBean.createHstryUpdateCrdnSttsCd(crdnSttsHstry); if (!rtnScs) { - // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback - throw new RuntimeException("납부자 등록 중 단속 대장의 단속상태 변경에 실패하였습니다."); + throw new RuntimeException("납부자 등록 중 단속 대장의 단속상태 변경에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback } } diff --git a/src/main/java/cokr/xit/fims/payer/service/bean/PayerServiceBean.java b/src/main/java/cokr/xit/fims/payer/service/bean/PayerServiceBean.java index aad2c8dc..1603da3d 100644 --- a/src/main/java/cokr/xit/fims/payer/service/bean/PayerServiceBean.java +++ b/src/main/java/cokr/xit/fims/payer/service/bean/PayerServiceBean.java @@ -25,6 +25,7 @@ import cokr.xit.interfaces.lvis.service.reg.BasicInfoRequest; */ @Service("payerService") public class PayerServiceBean extends AbstractServiceBean implements PayerService { + /** 납부자 대장 정보 Bean */ @Resource(name = "payerBean") private PayerBean payerBean; @@ -50,8 +51,13 @@ public class PayerServiceBean extends AbstractServiceBean implements PayerServic } @Override - public int remove(String... rtpyrIds) { - return payerBean.remove(rtpyrIds); + public boolean createPayerAddr(Payer payer) { + return payerBean.createPayerAddr(payer); + } + + @Override + public boolean updatePayerAddr(Payer payer) { + return payerBean.updatePayerAddr(payer); } @Override diff --git a/src/main/java/cokr/xit/fims/payer/web/PayerController.java b/src/main/java/cokr/xit/fims/payer/web/PayerController.java index 801c61dc..74da182d 100644 --- a/src/main/java/cokr/xit/fims/payer/web/PayerController.java +++ b/src/main/java/cokr/xit/fims/payer/web/PayerController.java @@ -109,23 +109,6 @@ public class PayerController extends ApplicationController { .addObject("saved", saved); } - /**지정한 납부자를 제거한다. - * @param payerIDs 납부자 아이디 - * @return jsonView - *
     {
    -	 *     "affected": 저장된 정보수
    -	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
    -	 * }
    - */ - @Task("CMN") - @PostMapping(name = "납부자 제거", value = "/remove.do") - public ModelAndView remove(String... rtpyrIds) { - int affected = payerService.remove(rtpyrIds); - return new ModelAndView("jsonView") - .addObject("affected", affected) - .addObject("saved", affected > 0); - } - @Task("CMN") @PostMapping(name = "차량/납부자 조회", value = "/vehicle.do") public ModelAndView getVehicleOwner(BasicInfoRequest req) { @@ -134,6 +117,7 @@ public class PayerController extends ApplicationController { return new ModelAndView("jsonView") .addObject("found", found) .addObject("rtpyrId", found ? payer.getRtpyrId() : null) + .addObject("addrSn", found ? payer.getAddrSn() : null) .addObject("vehicle", found ? payer.getVehicleInfo() : null); } diff --git a/src/main/resources/sql/mapper/fims/cmmn/crdnPayerHstry-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/crdnPayerHstry-mapper.xml index 188a79bf..b2449a17 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/crdnPayerHstry-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/crdnPayerHstry-mapper.xml @@ -8,15 +8,16 @@ ============================ --> - - - - - + + + + + + - SELECT CPH.CHG_HSTRY_ID /* 변경 이력 ID */ + SELECT CPH.CHG_HSTRY_ID , CPH.CRDN_ID /* 단속 ID */ , CPH.RTPYR_ID /* 납부자 ID */ , CPH.REG_DT /* 등록 일시 */ @@ -45,9 +46,6 @@ /* 납부자 대장 목록 조회(payerMapper.selectPayerList) */ - - -AND RTPYR_ID IN (#{rtpyrId}) - - + + SELECT P.RTPYR_ID + , P.SGG_CD + , P.RTPYR_INPT_SE_CD + , P.RTPYR_SE_CD + , P.RTPYR_NO + , P.RTPYR_NM + , P.RTPYR_TELNO + , P.RTPYR_MBL_TELNO + , P.RTPYR_EML + , P.RTPYR_BRDT + , P.RTPYR_STTS_CD + , P.REG_DT + , P.RGTR + , P.MDFCN_DT + , P.MDFR + , PA.ADDR_SN + , PA.ADDR_INPT_SE_CD + , PA.ADDR_INQ_YMD + , PA.ADDR_SE_CD + , PA.ZIP + , PA.ADDR + , PA.DTL_ADDR + , PA.ROAD_NM_CD + , PA.UDGD_SE_CD + , PA.BMNO + , PA.BSNO + , PA.BLDG_MNG_NO + , PA.STDG_CD + , PA.DONG_CD + , PA.MTN_SE_CD + , PA.MNO + , PA.SNO + , PA.SPCL_DONG + , PA.SPCL_HO + , PA.SPCL_ADDR + , PA.WHOL_ADDR + FROM TB_PAYER P + INNER JOIN TB_PAYER_ADDR PA ON (P.RTPYR_ID = PA.RTPYR_ID) + - + -/* 납부자 대장 등록(payerMapper.insertPayer) */ - -SELECT CONCAT(THIS_YEAR, LPAD(IFNULL(SUBSTR(MAX(RTPYR_ID), 5) + 1, 1), 16, '0')) NEW_ID - , IFNULL(#{sggCd}, '41480') SGG_CD - FROM TB_PAYER A - , (SELECT DATE_FORMAT(CURRENT_DATE, '%Y') THIS_YEAR) B - WHERE RTPYR_ID LIKE CONCAT(THIS_YEAR, '%') -INSERT INTO TB_PAYER ( - RTPYR_ID - , SGG_CD - , VHRNO - , RTPYR_INPT_SE_CD - , RTPYR_SE_CD - , RTPYR_NO - , RTPYR_NM - , RTPYR_TELNO - , RTPYR_MBL_TELNO - , RTPYR_EML - , RTPYR_BRDT - , RTPYR_STTS_CD - , ADDR_SE_CD - , ZIP - , ROAD_NM_CD - , UDGD_SE_CD - , BMNO - , BSNO - , BLDG_MNG_NO - , STDG_CD - , DONG_CD - , MTN_SE_CD - , MNO - , SNO - , SPCL_DONG - , SPCL_HO - , SPCL_ADDR - , ADDR - , DTL_ADDR - , WHOL_ADDR - , REG_DT - , RGTR - , MDFCN_DT - , MDFR -) -SELECT #{rtpyrId} - , #{sggCd} - , #{vhrno} - , #{rtpyrInptSeCd} - , #{rtpyrSeCd} - , #{rtpyrNo} - , #{rtpyrNm} - , #{rtpyrTelno} - , #{rtpyrMblTelno} - , #{rtpyrEml} - , #{rtpyrBrdt} - , #{rtpyrSttsCd} - , #{addrSeCd} - , #{zip} - , #{roadNmCd} - , #{udgdSeCd} - , #{bmno} - , #{bsno} - , #{bldgMngNo} - , #{stdgCd} - , #{dongCd} - , #{mtnSeCd} - , #{mno} - , #{sno} - , #{spclDong} - , #{spclHo} - , #{spclAddr} - , #{addr} - , #{dtlAddr} - , #{wholAddr} - , #{createdAt} - , #{createdBy} - , #{lastModified} - , #{modifiedBy} - FROM DUAL - WHERE NOT EXISTS ( - SELECT * - FROM TB_PAYER B - WHERE VHRNO = #{vhrno} - AND RTPYR_NO = #{rtpyrNo} - AND SGG_CD = #{sggCd} - ) + -/* 납부자 대장 등록(payerMapper.insertHistory) */ - -SELECT IFNULL(MAX(HSTRY_SN) + 1, 1) NEW_ID - FROM TB_PAYER_HSTRY -WHERE RTPYR_ID = #{payer.rtpyrId} -INSERT INTO TB_PAYER_HSTRY ( - RTPYR_ID - , HSTRY_SN - , SGG_CD - , VHRNO - , RTPYR_INPT_SE_CD - , RTPYR_SE_CD - , RTPYR_NO - , RTPYR_NM - , RTPYR_TELNO - , RTPYR_MBL_TELNO - , RTPYR_EML - , RTPYR_BRDT - , RTPYR_STTS_CD - , ADDR_SE_CD - , ZIP - , ROAD_NM_CD - , UDGD_SE_CD - , BMNO - , BSNO - , BLDG_MNG_NO - , STDG_CD - , DONG_CD - , MTN_SE_CD - , MNO - , SNO - , SPCL_DONG - , SPCL_HO - , SPCL_ADDR - , ADDR - , DTL_ADDR - , WHOL_ADDR - , REG_DT - , RGTR -) VALUES ( - #{payer.rtpyrId} - , #{historySeq} - , #{payer.sggCd} - , #{payer.vhrno} - , #{payer.rtpyrInptSeCd} - , #{payer.rtpyrSeCd} - , #{payer.rtpyrNo} - , #{payer.rtpyrNm} - , #{payer.rtpyrTelno} - , #{payer.rtpyrMblTelno} - , #{payer.rtpyrEml} - , #{payer.rtpyrBrdt} - , #{payer.rtpyrSttsCd} - , #{payer.addrSeCd} - , #{payer.zip} - , #{payer.roadNmCd} - , #{payer.udgdSeCd} - , #{payer.bmno} - , #{payer.bsno} - , #{payer.bldgMngNo} - , #{payer.stdgCd} - , #{payer.dongCd} - , #{payer.mtnSeCd} - , #{payer.mno} - , #{payer.sno} - , #{payer.spclDong} - , #{payer.spclHo} - , #{payer.spclAddr} - , #{payer.addr} - , #{payer.dtlAddr} - , #{payer.wholAddr} - , - , #{currentUser.id} -) + /* 납부자 대장 등록(payerMapper.insertPayer) */ + + + + + + + + INSERT + INTO TB_PAYER ( + RTPYR_ID + , SGG_CD + , RTPYR_INPT_SE_CD + , RTPYR_SE_CD + , RTPYR_NO + , RTPYR_NM + , RTPYR_TELNO + , RTPYR_MBL_TELNO + , RTPYR_EML + , RTPYR_BRDT + , RTPYR_STTS_CD + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + ) + SELECT #{payer.rtpyrId} + , #{payer.sggCd} + , #{payer.rtpyrInptSeCd} + , #{payer.rtpyrSeCd} + , #{payer.rtpyrNo} + , #{payer.rtpyrNm} + , #{payer.rtpyrTelno} + , #{payer.rtpyrMblTelno} + , #{payer.rtpyrEml} + , #{payer.rtpyrBrdt} + , #{payer.rtpyrSttsCd} + , + , #{payer.createdBy} + , + , #{payer.modifiedBy} + FROM DUAL + WHERE NOT EXISTS ( + SELECT * + FROM TB_PAYER B + WHERE RTPYR_NO = #{payer.rtpyrNo} + AND SGG_CD = #{payer.sggCd} + ) + -/* 납부자 대장 수정(payerMapper.updatePayer) */ -UPDATE TB_PAYER SET - SGG_CD = #{sggCd} - , RTPYR_INPT_SE_CD = #{rtpyrInptSeCd} - , RTPYR_SE_CD = #{rtpyrSeCd} - , RTPYR_NO = #{rtpyrNo} - , RTPYR_NM = #{rtpyrNm} - , RTPYR_TELNO = #{rtpyrTelno} - , RTPYR_MBL_TELNO = #{rtpyrMblTelno} - , RTPYR_EML = #{rtpyrEml} - , RTPYR_BRDT = #{rtpyrBrdt} - , RTPYR_STTS_CD = #{rtpyrSttsCd} - , ADDR_SE_CD = #{addrSeCd} - , ZIP = #{zip} - , ROAD_NM_CD = #{roadNmCd} - , UDGD_SE_CD = #{udgdSeCd} - , BMNO = #{bmno} - , BSNO = #{bsno} - , BLDG_MNG_NO = #{bldgMngNo} - , STDG_CD = #{stdgCd} - , DONG_CD = #{dongCd} - , MTN_SE_CD = #{mtnSeCd} - , MNO = #{mno} - , SNO = #{sno} - , SPCL_DONG = #{spclDong} - , SPCL_HO = #{spclHo} - , SPCL_ADDR = #{spclAddr} - , ADDR = #{addr} - , DTL_ADDR = #{dtlAddr} - , WHOL_ADDR = #{wholAddr} - , VHRNO = #{vhrno} - , MDFCN_DT = #{lastModified} - , MDFR = #{modifiedBy} - WHERE RTPYR_ID = #{rtpyrId} + /* 납부자 대장 수정(payerMapper.updatePayer) */ + UPDATE TB_PAYER + SET RTPYR_INPT_SE_CD = #{payer.rtpyrInptSeCd} + , RTPYR_SE_CD = #{payer.rtpyrSeCd} + , RTPYR_NO = #{payer.rtpyrNo} + , RTPYR_NM = #{payer.rtpyrNm} + , RTPYR_TELNO = #{payer.rtpyrTelno} + , RTPYR_MBL_TELNO = #{payer.rtpyrMblTelno} + , RTPYR_EML = #{payer.rtpyrEml} + , RTPYR_BRDT = #{payer.rtpyrBrdt} + , RTPYR_STTS_CD = #{payer.rtpyrSttsCd} + , MDFCN_DT = + , MDFR = #{payer.modifiedBy} + WHERE RTPYR_ID = #{payer.rtpyrId} + - /* 납부자 대장 삭제(payerMapper.deletePayer) */ - UPDATE TB_PAYER - SET USE_YN = 'N' - , MDFCN_DT = - , MDFR = #{currentUser.id} - WHERE RTPYR_ID IN (#{rtpyrId}) - - - SELECT P.RTPYR_ID - , P.SGG_CD + SELECT C.CRDN_ID + , C.SGG_CD + , C.TASK_SE_CD + , C.CRDN_YMD + , (CONCAT(C.CRDN_YMD, C.CRDN_TM)) AS CRDN_YMD_TM + , C.VHRNO + , C.CRDN_STTS_CD + , (SELECT GET_CODE_NM('FIM010', C.CRDN_STTS_CD) FROM DUAL) AS CRDN_STTS_NM + , P.RTPYR_ID , P.RTPYR_INPT_SE_CD + , (SELECT GET_CODE_NM('FIM015', P.RTPYR_INPT_SE_CD) FROM DUAL) AS RTPYR_INPT_SE_NM , P.RTPYR_SE_CD + , (SELECT GET_CODE_NM('FIM011', P.RTPYR_SE_CD) FROM DUAL) AS RTPYR_SE_NM , P.RTPYR_NO , P.RTPYR_NM , P.RTPYR_TELNO @@ -329,41 +224,34 @@ UPDATE TB_PAYER SET , P.RTPYR_EML , P.RTPYR_BRDT , P.RTPYR_STTS_CD - , P.ADDR_SE_CD - , P.ZIP - , P.ROAD_NM_CD - , P.UDGD_SE_CD - , P.BMNO - , P.BSNO - , P.BLDG_MNG_NO - , P.STDG_CD - , P.DONG_CD - , P.MTN_SE_CD - , P.MNO - , P.SNO - , P.SPCL_DONG - , P.SPCL_HO - , P.SPCL_ADDR - , P.ADDR - , P.DTL_ADDR - , P.WHOL_ADDR + , (SELECT GET_CODE_NM('FIM014', P.RTPYR_STTS_CD) FROM DUAL) AS RTPYR_STTS_NM , P.REG_DT , P.RGTR , P.MDFCN_DT , P.MDFR - , (CASE WHEN (P.VHRNO IS NULL OR P.VHRNO='') THEN C.VHRNO ELSE P.VHRNO END) AS VHRNO - , (SELECT GET_CODE_NM('FIM015', P.RTPYR_INPT_SE_CD) FROM DUAL) AS RTPYR_INPT_SE_NM - , (SELECT GET_CODE_NM('FIM011', P.RTPYR_SE_CD) FROM DUAL) AS RTPYR_SE_NM - , (SELECT GET_CODE_NM('FIM014', P.RTPYR_STTS_CD) FROM DUAL) AS RTPYR_STTS_NM - , C.CRDN_ID - , C.SGG_CD - , C.TASK_SE_CD - , C.CRDN_YMD - , C.CRDN_STTS_CD - , (CONCAT(C.CRDN_YMD, C.CRDN_TM)) AS CRDN_YMD_TM - , (SELECT GET_CODE_NM('FIM010', C.CRDN_STTS_CD) FROM DUAL) AS CRDN_STTS_NM - FROM TB_PAYER P - LEFT OUTER JOIN TB_CRDN C ON (P.RTPYR_ID = C.RTPYR_ID) + , PA.ADDR_SN + , PA.ADDR_SE_CD + , PA.ADDR_INPT_SE_CD + , PA.ZIP + , PA.ROAD_NM_CD + , PA.UDGD_SE_CD + , PA.BMNO + , PA.BSNO + , PA.BLDG_MNG_NO + , PA.STDG_CD + , PA.DONG_CD + , PA.MTN_SE_CD + , PA.MNO + , PA.SNO + , PA.SPCL_DONG + , PA.SPCL_HO + , PA.SPCL_ADDR + , PA.ADDR + , PA.DTL_ADDR + , PA.WHOL_ADDR + FROM TB_CRDN C + LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) + LEFT OUTER JOIN TB_PAYER_ADDR PA ON (C.RTPYR_ID = PA.RTPYR_ID AND C.ADDR_SN = PA.ADDR_SN) /* 납부자 변경 이력 대장 객체 가져오기(payerMapper.selectPayerHstrys) */ - WHERE RTPYR_ID = #{rtpyrId} + WHERE RTPYR_ID = #{rtpyrId} diff --git a/src/main/resources/sql/mapper/fims/payerAddr-mapper.xml b/src/main/resources/sql/mapper/fims/payerAddr-mapper.xml new file mode 100644 index 00000000..2c012ca3 --- /dev/null +++ b/src/main/resources/sql/mapper/fims/payerAddr-mapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT PA.RTPYR_ID + , PA.ADDR_SN + , PA.ADDR_INPT_SE_CD + , PA.ADDR_INQ_YMD + , PA.ADDR_SE_CD + , PA.ZIP + , PA.ADDR + , PA.DTL_ADDR + , PA.ROAD_NM_CD + , PA.UDGD_SE_CD + , PA.BMNO + , PA.BSNO + , PA.BLDG_MNG_NO + , PA.STDG_CD + , PA.DONG_CD + , PA.MTN_SE_CD + , PA.MNO + , PA.SNO + , PA.SPCL_DONG + , PA.SPCL_HO + , PA.SPCL_ADDR + , PA.WHOL_ADDR + , PA.REG_DT + , PA.RGTR + , PA.MDFCN_DT + , PA.MDFR + FROM TB_PAYER_ADDR PA + + + + + + + /* 납부자 주소 등록(payerAddrMapper.insertPayerAddr) */ + + SELECT LPAD(CAST(IFNULL(MAX(ADDR_SN) + 1, 1) AS INT), 5, '0') AS NEW_ID + FROM TB_PAYER_ADDR + WHERE RTPYR_ID = #{payerAddr.rtpyrId} + + INSERT + INTO TB_PAYER_ADDR ( + RTPYR_ID + , ADDR_SN + , ADDR_INPT_SE_CD + , ADDR_INQ_YMD + , ADDR_SE_CD + , ZIP + , ADDR + , DTL_ADDR + , ROAD_NM_CD + , UDGD_SE_CD + , BMNO + , BSNO + , BLDG_MNG_NO + , STDG_CD + , DONG_CD + , MTN_SE_CD + , MNO + , SNO + , SPCL_DONG + , SPCL_HO + , SPCL_ADDR + , WHOL_ADDR + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + ) + VALUES ( + #{payerAddr.rtpyrId} + , #{payerAddr.addrSn} + , #{payerAddr.addrInptSeCd} + , #{payerAddr.addrInqYmd} + , #{payerAddr.addrSeCd} + , #{payerAddr.zip} + , #{payerAddr.addr} + , #{payerAddr.dtlAddr} + , #{payerAddr.roadNmCd} + , #{payerAddr.udgdSeCd} + , #{payerAddr.bmno} + , #{payerAddr.bsno} + , #{payerAddr.bldgMngNo} + , #{payerAddr.stdgCd} + , #{payerAddr.dongCd} + , #{payerAddr.mtnSeCd} + , #{payerAddr.mno} + , #{payerAddr.sno} + , #{payerAddr.spclDong} + , #{payerAddr.spclHo} + , #{payerAddr.spclAddr} + , #{payerAddr.wholAddr} + , + , #{payerAddr.createdBy} + , + , #{payerAddr.modifiedBy} + ) + + + /* 납부자 주소 수정(payerAddrMapper.updatePayerAddr) */ + UPDATE TB_PAYER_ADDR + SET MDFCN_DT = + , MDFR = #{payerAddr.modifiedBy} + WHERE RTPYR_ID = #{payerAddr.rtpyrId} + AND ADDR_SN = #{payerAddr.addrSn} + + + diff --git a/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml index 0800835e..d1dd202d 100644 --- a/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/totalInfo-mapper.xml @@ -92,34 +92,35 @@ , CA.VLTN_NMTM , CA.OVTIME_YN , CA.OVTIME_PRTTN_YN - , (SELECT GET_CODE_NM('FIM002', CA.CRDN_SE_CD) FROM DUAL) AS CRDN_SE_NM - , (SELECT GET_CODE_NM('FIM007', CA.CRDN_SPAREA_CD) FROM DUAL) AS CRDN_SPAREA_NM - , (SELECT GET_CODE_NM('FIM006', CA.TOWNG_YN) FROM DUAL) AS TOWNG_YN_NM - , (SELECT GET_CODE_NM('LVS005', CA.USE_FUEL_CD) FROM DUAL) AS USE_FUEL_NM - , (SELECT GET_CODE_NM('FIM009', CA.FFNLG_CARMDL_CD) FROM DUAL) AS FFNLG_CARMDL_NM + , (SELECT GET_CODE_NM('FIM002', CA.CRDN_SE_CD) FROM DUAL) AS CRDN_SE_NM + , (SELECT GET_CODE_NM('FIM007', CA.CRDN_SPAREA_CD) FROM DUAL) AS CRDN_SPAREA_NM + , (SELECT GET_CODE_NM('FIM006', CA.TOWNG_YN) FROM DUAL) AS TOWNG_YN_NM + , (SELECT GET_CODE_NM('LVS005', CA.USE_FUEL_CD) FROM DUAL) AS USE_FUEL_NM + , (SELECT GET_CODE_NM('FIM009', CA.FFNLG_CARMDL_CD) FROM DUAL) AS FFNLG_CARMDL_NM , (SELECT GET_CODE_NM('FIM034', CA.PARKNG_PSBLTY_RSLT_CD) FROM DUAL) AS PARKNG_PSBLTY_RSLT_NM - , (SELECT GET_CODE_NM('FIM006', CA.OVTIME_YN) FROM DUAL) AS OVTIME_YN_NM - , (SELECT GET_CODE_NM('FIM006', CA.OVTIME_PRTTN_YN) FROM DUAL) AS OVTIME_PRTTN_YN_NM + , (SELECT GET_CODE_NM('FIM006', CA.OVTIME_YN) FROM DUAL) AS OVTIME_YN_NM + , (SELECT GET_CODE_NM('FIM006', CA.OVTIME_PRTTN_YN) FROM DUAL) AS OVTIME_PRTTN_YN_NM , V.TXITM_NM , V.OPER_ITEM_NM , P.RTPYR_ID , P.RTPYR_INPT_SE_CD + , (SELECT GET_CODE_NM('FIM015', P.RTPYR_INPT_SE_CD) FROM DUAL) AS RTPYR_INPT_SE_NM , P.RTPYR_SE_CD + , (SELECT GET_CODE_NM('FIM011', P.RTPYR_SE_CD) FROM DUAL) AS RTPYR_SE_NM , P.RTPYR_NO , P.RTPYR_NM , P.RTPYR_TELNO , P.RTPYR_MBL_TELNO , P.RTPYR_EML , P.RTPYR_STTS_CD - , P.ADDR_SE_CD - , P.ZIP - , P.ADDR - , P.DTL_ADDR - , P.WHOL_ADDR - , (SELECT GET_CODE_NM('FIM015', P.RTPYR_INPT_SE_CD) FROM DUAL) AS RTPYR_INPT_SE_NM - , (SELECT GET_CODE_NM('FIM011', P.RTPYR_SE_CD) FROM DUAL) AS RTPYR_SE_NM , (SELECT GET_CODE_NM('FIM014', P.RTPYR_STTS_CD) FROM DUAL) AS RTPYR_STTS_NM - , (SELECT GET_CODE_NM('FIM013', P.ADDR_SE_CD) FROM DUAL) AS ADDR_SE_NM + , PA.ADDR_SN + , PA.ADDR_SE_CD + , (SELECT GET_CODE_NM('FIM013', PA.ADDR_SE_CD) FROM DUAL) AS ADDR_SE_NM + , PA.ZIP + , PA.ADDR + , PA.DTL_ADDR + , PA.WHOL_ADDR , P.MDFCN_DT AS P_MDFCN_DT , (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = P.MDFR) AS P_MDFR_NM , CC.CVLCPT_LINK_ID @@ -166,6 +167,7 @@ INNER JOIN TB_CRDN_ADI CA ON (C.CRDN_ID = CA.CRDN_ID) INNER JOIN TB_VLTN V ON (C.VLTN_ID = V.VLTN_ID) LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) + LEFT OUTER JOIN TB_PAYER_ADDR PA ON (C.RTPYR_ID = PA.RTPYR_ID AND C.ADDR_SN = PA.ADDR_SN) LEFT OUTER JOIN TB_CRDN_CVLCPT CC ON (C.LINK_ID = CC.CVLCPT_LINK_ID AND C.CVLCPT_LINK_YN = 'Y' AND CC.DEL_YN = 'N') LEFT OUTER JOIN TB_LEVY L ON (C.CRDN_ID = L.CRDN_ID AND L.DEL_YN = 'N') diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp index 63074791..c194a0fb 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp @@ -6,17 +6,18 @@
    +
    - @@ -35,24 +36,24 @@
    -
    - -
    - @@ -63,11 +64,11 @@
    - - @@ -76,15 +77,15 @@
    - -
    - @@ -94,22 +95,22 @@
    - -
    - -
    - -
    - - -
    -
    -
    - -
    - -
    - -
    - -