From 336b2f9856703a91dfe69c518690ce39074855d3 Mon Sep 17 00:00:00 2001 From: JoJH Date: Thu, 24 Oct 2024 14:16:36 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=80=EA=B3=BC=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=EC=97=90=20insert=20=EC=B6=94=EA=B0=80.=20=20=20-=20?= =?UTF-8?q?=EC=A0=84=EC=9E=90=EB=82=A9=EB=B6=80=EB=B2=88=ED=98=B8,=20?= =?UTF-8?q?=EA=B0=80=EC=83=81=EA=B3=84=EC=A2=8C=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fims/rent/service/bean/LsctMpngBean.java | 108 +++++++++++++++++- .../sql/mapper/fims/rent/lsctMpng-mapper.xml | 36 +++++- 2 files changed, 138 insertions(+), 6 deletions(-) diff --git a/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java b/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java index 5727fd41..e0889555 100644 --- a/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java +++ b/src/main/java/cokr/xit/fims/rent/service/bean/LsctMpngBean.java @@ -22,6 +22,8 @@ import cokr.xit.fims.cmmn.ftp.RemoteSystemInfo; import cokr.xit.fims.cmmn.ftp.SFTPUtil; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.service.bean.CrdnBean; +import cokr.xit.fims.levy.Levy; +import cokr.xit.fims.levy.dao.LevyMapper; import cokr.xit.fims.payer.Payer; import cokr.xit.fims.payer.service.bean.PayerBean; import cokr.xit.fims.rent.Lsct; @@ -77,6 +79,10 @@ public class LsctMpngBean extends AbstractBean { @Resource(name = "payerBean") private PayerBean payerBean; + /** 부과 대장 정보 DAO */ + @Resource(name = "levyMapper") + private LevyMapper levyMapper; + @Resource(name = "finSysFtpMapper") private FinSysFtpMapper finSysFtpMapper; @@ -90,6 +96,10 @@ public class LsctMpngBean extends AbstractBean { * @throws SftpException */ public String saveFfnlgMainList(RentQuery req) { + // 변수 선언 + int rtnNocs = -1; // 처리 결과 건수 + String rtnMsg = ""; // 처리 결과 메시지 + // 기존 과태료 시스템에서 사용하던 암/복호화 함수 사용을 위해서.. XitAria crypto = new XitAria("xit-aria"); @@ -246,7 +256,7 @@ public class LsctMpngBean extends AbstractBean { crdn.setOvtmPrttnYn("N"); // 시간외 분할 여부 // 단속 대장 Insert - int rtnNocs = lsctMpngMapper.insertMainToCrdn(crdn); + rtnNocs = lsctMpngMapper.insertMainToCrdn(crdn); if (rtnNocs == 0) { throw new RuntimeException("[F] 단속 대장 등록 작업에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback } @@ -431,7 +441,7 @@ public class LsctMpngBean extends AbstractBean { crdn.setOvtmPrttnYn("N"); // 시간외 분할 여부 // 단속 대장 Insert - int rtnNocs = lsctMpngMapper.updateMainToCrdn(crdn); + rtnNocs = lsctMpngMapper.updateMainToCrdn(crdn); if (rtnNocs == 0) { throw new RuntimeException("[F] 단속 대장 수정 작업에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback } @@ -446,6 +456,96 @@ public class LsctMpngBean extends AbstractBean { //FTP 서버 정보 조회 + + } + + // 부과 정보 insert + if (mainList.get(iLoop).string("NIS_LINK_YN").equals("Y")) { + Levy levy = new Levy(); // 부과 TB_LEVY + + // insert + if (isCrdnInfo.string("LEVY_ID").equals("")) { + levy.setSggCd(isCrdnInfo.string("SGG_CD")); // 시군구 코드 + levy.setTaskSeCd(isCrdnInfo.string("TASK_SE_CD")); // 업무 구분 코드 + levy.setCrdnId(isCrdnInfo.string("CRDN_ID")); // CRDN_ID + levy.setFyr(mainList.get(iLoop).string("MC_ACC_YEAR")); // 회계연도 + levy.setLevyNo(mainList.get(iLoop).string("MC_LVY_NO")); // 부과 번호 + levy.setEpayno(mainList.get(iLoop).string("MC_ERC_NO")); // 전자납부번호 + levy.setBankNm(mainList.get(iLoop).string("MC_BANK_NM")); // 은행 명 + levy.setVrActno(mainList.get(iLoop).string("MC_ACCOUNT_NO")); // 가상 계좌번호 + levy.setBankNm2(mainList.get(iLoop).string("MC_BANK_NM2")); // 은행 명2 + levy.setVrActno2(mainList.get(iLoop).string("MC_ACCOUNT_NO2")); // 가상 계좌번호2 + levy.setBankNm3(mainList.get(iLoop).string("MC_BANK_NM3")); // 은행 명3 + levy.setVrActno3(mainList.get(iLoop).string("MC_ACCOUNT_NO3")); // 가상 계좌번호3 + levy.setBankNm4(mainList.get(iLoop).string("MC_BANK_NM4")); // 은행 명4 + levy.setVrActno4(mainList.get(iLoop).string("MC_ACCOUNT_NO4")); // 가상 계좌번호4 + levy.setBankNm5(mainList.get(iLoop).string("MC_BANK_NM5")); // 은행 명5 + levy.setVrActno5(mainList.get(iLoop).string("MC_ACCOUNT_NO5")); // 가상 계좌번호5 + levy.setBankNm6(mainList.get(iLoop).string("MC_BANK_NM6")); // 은행 명6 + levy.setVrActno6(mainList.get(iLoop).string("MC_ACCOUNT_NO6")); // 가상 계좌번호6 + levy.setBankNm7(mainList.get(iLoop).string("MC_BANK_NM7")); // 은행 명7 + levy.setVrActno7(mainList.get(iLoop).string("MC_ACCOUNT_NO7")); // 가상 계좌번호7 + levy.setBankNm8(mainList.get(iLoop).string("MC_BANK_NM8")); // 은행 명8 + levy.setVrActno8(mainList.get(iLoop).string("MC_ACCOUNT_NO8")); // 가상 계좌번호8 + levy.setBankNm9(mainList.get(iLoop).string("MC_BANK_NM9")); // 은행 명9 + levy.setVrActno9(mainList.get(iLoop).string("MC_ACCOUNT_NO9")); // 가상 계좌번호9 + levy.setBankNm10(mainList.get(iLoop).string("MC_BANK_NM10")); // 은행 명10 + levy.setVrActno10(mainList.get(iLoop).string("MC_ACCOUNT_NO10")); // 가상 계좌번호10 + levy.setBankNm11(mainList.get(iLoop).string("MC_BANK_NM11")); // 은행 명11 + levy.setVrActno11(mainList.get(iLoop).string("MC_ACCOUNT_NO11")); // 가상 계좌번호11 + if (mainList.get(iLoop).string("MC_LVY_KEY").length() == 20) { + levy.setNxrpLevyKey(mainList.get(iLoop).string("MC_LVY_KEY")); // 세외수입 부과 키 + } else { + levy.setNxrpLevyKey(null); + } + + // 부과(TB_LEVY) 대장을 등록한다. + rtnNocs = levyMapper.insertLevy(levy); + if (rtnNocs != 1) { + throw new RuntimeException("부과 대장 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback + } + } else { + levy.setLevyId(isCrdnInfo.string("LEVY_ID")); // 부과 ID + levy.setSggCd(isCrdnInfo.string("SGG_CD")); // 시군구 코드 + levy.setTaskSeCd(isCrdnInfo.string("TASK_SE_CD")); // 업무 구분 코드 + levy.setCrdnId(isCrdnInfo.string("CRDN_ID")); // CRDN_ID + levy.setFyr(mainList.get(iLoop).string("MC_ACC_YEAR")); // 회계연도 + levy.setLevyNo(mainList.get(iLoop).string("MC_LVY_NO")); // 부과 번호 + levy.setEpayno(mainList.get(iLoop).string("MC_ERC_NO")); // 전자납부번호 + levy.setBankNm(mainList.get(iLoop).string("MC_BANK_NM")); // 은행 명 + levy.setVrActno(mainList.get(iLoop).string("MC_ACCOUNT_NO")); // 가상 계좌번호 + levy.setBankNm2(mainList.get(iLoop).string("MC_BANK_NM2")); // 은행 명2 + levy.setVrActno2(mainList.get(iLoop).string("MC_ACCOUNT_NO2")); // 가상 계좌번호2 + levy.setBankNm3(mainList.get(iLoop).string("MC_BANK_NM3")); // 은행 명3 + levy.setVrActno3(mainList.get(iLoop).string("MC_ACCOUNT_NO3")); // 가상 계좌번호3 + levy.setBankNm4(mainList.get(iLoop).string("MC_BANK_NM4")); // 은행 명4 + levy.setVrActno4(mainList.get(iLoop).string("MC_ACCOUNT_NO4")); // 가상 계좌번호4 + levy.setBankNm5(mainList.get(iLoop).string("MC_BANK_NM5")); // 은행 명5 + levy.setVrActno5(mainList.get(iLoop).string("MC_ACCOUNT_NO5")); // 가상 계좌번호5 + levy.setBankNm6(mainList.get(iLoop).string("MC_BANK_NM6")); // 은행 명6 + levy.setVrActno6(mainList.get(iLoop).string("MC_ACCOUNT_NO6")); // 가상 계좌번호6 + levy.setBankNm7(mainList.get(iLoop).string("MC_BANK_NM7")); // 은행 명7 + levy.setVrActno7(mainList.get(iLoop).string("MC_ACCOUNT_NO7")); // 가상 계좌번호7 + levy.setBankNm8(mainList.get(iLoop).string("MC_BANK_NM8")); // 은행 명8 + levy.setVrActno8(mainList.get(iLoop).string("MC_ACCOUNT_NO8")); // 가상 계좌번호8 + levy.setBankNm9(mainList.get(iLoop).string("MC_BANK_NM9")); // 은행 명9 + levy.setVrActno9(mainList.get(iLoop).string("MC_ACCOUNT_NO9")); // 가상 계좌번호9 + levy.setBankNm10(mainList.get(iLoop).string("MC_BANK_NM10")); // 은행 명10 + levy.setVrActno10(mainList.get(iLoop).string("MC_ACCOUNT_NO10")); // 가상 계좌번호10 + levy.setBankNm11(mainList.get(iLoop).string("MC_BANK_NM11")); // 은행 명11 + levy.setVrActno11(mainList.get(iLoop).string("MC_ACCOUNT_NO11")); // 가상 계좌번호11 + if (mainList.get(iLoop).string("MC_LVY_KEY").length() == 20) { + levy.setNxrpLevyKey(mainList.get(iLoop).string("MC_LVY_KEY")); // 세외수입 부과 키 + } else { + levy.setNxrpLevyKey(null); + } + + // 부과(TB_LEVY) 대장의 전자납부번호, 가상계좌번호 정보를 수정한다. + rtnNocs = levyMapper.updateEpaynoVrActnoLevy(levy); + if (rtnNocs != 1) { + throw new RuntimeException("부과 대장 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback + } + } } } } @@ -806,8 +906,8 @@ public class LsctMpngBean extends AbstractBean { // 임차인 ID로 파일(TB_FILE) 정보 조회 List fileList = fileBean.getFileList(new FileQuery().setInfoType(Lsct.INF_TYPE) - .setInfoKeys(lsctMpngInfo.string("LSCT_ID")) - .setOrderBy("FILE_ID")); + .setInfoKeys(lsctMpngInfo.string("LSCT_ID")) + .setOrderBy("FILE_ID")); if (fileList != null && fileList.size() > 0) { for (int iLoop = 0; iLoop < fileList.size(); iLoop++) { diff --git a/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml b/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml index ad305e7c..e43433cb 100644 --- a/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml @@ -95,7 +95,9 @@ , MM_VIDEOFILENM , MM_SAFEZONE , MM_VIORCNT - , (CASE WHEN LENGTH(MM_TIME2) = 4 THEN CONCAT(MM_TIME2, '00') ELSE MM_TIME2 END) AS MM_TIME2 + , (CASE WHEN LENGTH(MM_TIME2) = 4 THEN CONCAT(MM_TIME2, '00') + ELSE MM_TIME2 + END) AS MM_TIME2 , MM_CARNAME , MM_CARCOLOR , MM_CARFUEL @@ -119,7 +121,35 @@ , OM_INDT , OM_BDCODE , MC_LVY_KEY - , (CASE WHEN MC_LVY_KEY IS NOT NULL THEN 'Y' ELSE 'N' END) AS NIS_LINK_YN + , (CASE WHEN MC_LVY_KEY IS NULL THEN 'N' + WHEN LENGTH(MC_LVY_KEY) 11 THEN 'N' + ELSE 'Y' + END) AS NIS_LINK_YN + , MC_ACC_YEAR + , MC_LVY_NO + , MC_ERC_NO + , MC_BANK_NM + , MC_ACCOUNT_NO + , MC_BANK_NM2 + , MC_ACCOUNT_NO2 + , MC_BANK_NM3 + , MC_ACCOUNT_NO3 + , MC_BANK_NM4 + , MC_ACCOUNT_NO4 + , MC_BANK_NM5 + , MC_ACCOUNT_NO5 + , MC_BANK_NM6 + , MC_ACCOUNT_NO6 + , MC_BANK_NM7 + , MC_ACCOUNT_NO7 + , MC_BANK_NM8 + , MC_ACCOUNT_NO8 + , MC_BANK_NM9 + , MC_ACCOUNT_NO9 + , MC_BANK_NM10 + , MC_ACCOUNT_NO10 + , MC_BANK_NM11 + , MC_ACCOUNT_NO11 FROM VW_CP_MAIN @@ -160,7 +190,9 @@ , C.CRDN_TM , C.VHRNO , C.MM_CODE + , L.LEVY_ID FROM TB_CRDN C + LEFT OUTER JOIN TB_LEVY L ON (C.CRDN_ID = L.CRDN_ID)