From a6007896512e88e63464e8f46539d13300ad7207 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 13 Jul 2023 10:32:11 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=BC=ED=83=9C=EB=A3=8C=20=EA=B0=90?= =?UTF-8?q?=EA=B2=BD=20=EC=9E=90=EB=A3=8C=20=ED=99=94=EB=A9=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fims/crdn/service/bean/Crdn06Bean.java | 38 +++++++-- .../crdn/service/bean/Crdn06ServiceBean.java | 79 ++++++++++++------- .../sql/mapper/fims/crdn/crdn06-mapper.xml | 28 ++++--- .../WEB-INF/jsp/fims/crdn/crdn06030-main.jsp | 7 +- .../WEB-INF/jsp/fims/crdn/crdn06040-main.jsp | 13 +-- 5 files changed, 112 insertions(+), 53 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java index f90670a0..90d3f3b2 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06Bean.java @@ -1,17 +1,12 @@ package cokr.xit.fims.crdn.service.bean; -import java.util.List; - import javax.annotation.Resource; -import org.egovframe.rte.fdl.string.EgovStringUtil; import org.springframework.stereotype.Component; import cokr.xit.fims.crdn.Crdn; -import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.Crdn06Mapper; import cokr.xit.foundation.AbstractComponent; -import cokr.xit.foundation.data.DataObject; /** 단속 관리 Bean * @author leebj @@ -38,4 +33,37 @@ public class Crdn06Bean extends AbstractComponent { } } + /**잔액을 계산한다. + * @param state 대장 자료 상태 + * @param advntceLevyAmt 사전통지부과금액 + * @param levyAmt 부과금액 + * @param minusAmt 감경금액 + * @param adtnAmt 가산금액 + * @param rcvmtAmt 수납금액 + * @return 잔액 + */ + public int getBalance(String state, int advntceLevyAmt, int levyAmt, int minusAmt, int adtnAmt, int rcvmtAmt) { + int result = 0; + if(Integer.parseInt(state) < Integer.parseInt("51")) { + result = advntceLevyAmt - rcvmtAmt - minusAmt; + } else if(state.equals("71") || + state.equals("72") || + state.equals("73") || + state.equals("74") || + state.equals("75") || + state.equals("76") || + state.equals("80") || + state.equals("81") || + state.equals("82") || + state.equals("83") || + state.equals("84") || + state.equals("85")) { + + } else { + result = levyAmt - rcvmtAmt - minusAmt + adtnAmt; + } + + return result; + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java index e671fbe2..d4f1b8d5 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java @@ -1,5 +1,6 @@ package cokr.xit.fims.crdn.service.bean; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -34,42 +35,66 @@ public class Crdn06ServiceBean extends AbstractServiceBean implements Crdn06Serv @Override public List getCrackdownList(CrdnQuery req) { - + List dataObjectList = new ArrayList(); switch (ifEmpty(req.getGrid(), () -> "")) { case "tagInformationUndefinedData": - return crdn06Mapper.selectTagInformationUndefinedDataList(req.setOrderBy("CRDN_ID")); + dataObjectList = crdn06Mapper.selectTagInformationUndefinedDataList(req.setOrderBy("CRDN_ID")); + break; case "fineReductionData": - return crdn06Mapper.selectFineReductionDataList(req.setOrderBy("CRDN_ID")); + dataObjectList = crdn06Mapper.selectFineReductionDataList(req.setOrderBy("CRDN_ID")); + break; case "photo": - List dataObjectList = crdn06Mapper.selectPhotoInspectionDataList(req.setOrderBy("VHRNO, CRDN_PLC")); - Iterator iterator = dataObjectList.iterator(); - while(iterator.hasNext()) { - DataObject dataObject = iterator.next(); - - if(dataObject.number("ATCH_FILE_CNT").intValue() < 1) { - dataObject.set("INSP_RSLT", "사진없음"); - dataObject.set("PRCS_MTHD", "해당자료에 사진을 등록하시기 바랍니다."); - } else if(dataObject.number("CRDN_CNT").intValue() > 1) { - dataObject.set("INSP_RSLT", "중복자료"); - if(req.getTaskSeCd().equals("PVS")) { - dataObject.set("PRCS_MTHD", "한건을 시간초과로 처리하십시요."); - } else { - dataObject.set("PRCS_MTHD", "한건을 서손으로 처리하십시요."); - } - } else { - dataObject.set("INSP_RSLT", "정상자료"); - dataObject.set("PRCS_MTHD", "정상자료"); - } - } - return dataObjectList; + dataObjectList = crdn06Mapper.selectPhotoInspectionDataList(req.setOrderBy("VHRNO, CRDN_PLC")); + break; case "sameVehicleMain": - return crdn06Mapper.selectSameVehicleMainList(req.setOrderBy("VHRNO")); + dataObjectList = crdn06Mapper.selectSameVehicleMainList(req.setOrderBy("VHRNO")); + break; case "sameVehicleSub": - return crdn06Mapper.selectSameVehicleSubList(req.setOrderBy("CRDN_ID")); + dataObjectList = crdn06Mapper.selectSameVehicleSubList(req.setOrderBy("CRDN_ID")); + break; default: - return crdn06Mapper.selectCrackdownList(req.setOrderBy("CRDN_ID")); + dataObjectList = crdn06Mapper.selectCrackdownList(req.setOrderBy("CRDN_ID")); + break; } + if(ifEmpty(req.getGrid(), () -> "").equals("tagInformationUndefinedData") + || ifEmpty(req.getGrid(), () -> "").equals("fineReductionData")) { + Iterator iterator = dataObjectList.iterator(); + while(iterator.hasNext()) { + DataObject dataObject = iterator.next(); + String state = dataObject.string("CRDN_STTS_CD"); + int advntceLevyAmt = dataObject.number("ADVNTCE_LEVY_AMT").intValue(); + int levyAmt = dataObject.number("LEVY_AMT").intValue(); + int minusAmt = dataObject.number("MINUS_AMT").intValue(); + int adtnAmt = dataObject.number("ADTN_AMT").intValue(); + int rcvmtAmt = dataObject.number("RCVMT_AMT").intValue(); + + dataObject.set("BLNC", crdn06Bean.getBalance(state,advntceLevyAmt,levyAmt,minusAmt,adtnAmt,rcvmtAmt)); + } + } else if(ifEmpty(req.getGrid(), () -> "").equals("photo")) { + Iterator iterator = dataObjectList.iterator(); + while(iterator.hasNext()) { + DataObject dataObject = iterator.next(); + + if(dataObject.number("ATCH_FILE_CNT").intValue() < 1) { + dataObject.set("INSP_RSLT", "사진없음"); + dataObject.set("PRCS_MTHD", "해당자료에 사진을 등록하시기 바랍니다."); + } else if(dataObject.number("CRDN_CNT").intValue() > 1) { + dataObject.set("INSP_RSLT", "중복자료"); + if(req.getTaskSeCd().equals("PVS")) { + dataObject.set("PRCS_MTHD", "한건을 시간초과로 처리하십시요."); + } else { + dataObject.set("PRCS_MTHD", "한건을 서손으로 처리하십시요."); + } + } else { + dataObject.set("INSP_RSLT", "정상자료"); + dataObject.set("PRCS_MTHD", "정상자료"); + } + } + } + + + return dataObjectList; } } diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml index 5cc3107b..1cfd5d27 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml @@ -363,7 +363,13 @@ SELECT C.CRDN_ID IF(TI.TEAMER_2 != '', TI.TEAMER_2, IF(TI.TEAMER_3 != '', TI.TEAMER_3, TI.TEAMER_4)))) AS APLCNT_CRDN_NM - , C.FFNLG_AMT + , C.CRDN_STTS_CD + , C.LEVY_AMT + , C.ADVNTCE_LEVY_AMT + , C.MINUS_AMT + , C.ADTN_AMT + , C.RCVMT_AMT + , 0 AS BLNC , C.ATCH_FILE_CNT , C.CRDN_SN FROM TB_CRDN C @@ -393,9 +399,6 @@ AND IF(CC.CVLCPT_APLCNT_NM != '', CC.CVLCPT_APLCNT_NM, IF(TI.TEAMER_2 != '', TI.TEAMER_2, IF(TI.TEAMER_3 != '', TI.TEAMER_3, TI.TEAMER_4)))) LIKE CONCAT('%', #{term}, '%') - - -AND C.FFNLG_AMT = REPLACE(#{term},',','') AND C.ATCH_FILE_CNT = #{term} @@ -433,12 +436,16 @@ SELECT C.CRDN_ID , RD.RDUCT_RSN_CD , CONCAT(C.CRDN_YMD,'',C.CRDN_TM) AS CRDN_YMD_TM , C.VHRNO - , L.RDCAMT_PCPTAX - , L.SUM_AMT + , RD.RDUCT_AMT + , C.LEVY_AMT + , C.ADVNTCE_LEVY_AMT + , C.MINUS_AMT + , C.ADTN_AMT + , C.RCVMT_AMT + , 0 AS BLNC , RD.ETC_CN AS RDUCT_ETC_CN , C.CRDN_STTS_CD FROM TB_CRDN C - LEFT OUTER JOIN TB_LEVY L ON (C.LEVY_ID = L.LEVY_ID) INNER JOIN TB_RDUCT RD ON (C.CRDN_ID = RD.CRDN_ID) WHERE C.DEL_YN = 'N' AND C.TASK_SE_CD = #{taskSeCd} @@ -456,11 +463,8 @@ AND C.CRDN_YMD = REPLACE(#{term},'-','') AND C.VHRNO = REPLACE(#{term},'-','') - -AND L.RDCAMT_PCPTAX = REPLACE(#{term},',','') - - -AND L.SUM_AMT = REPLACE(#{term},',','') + +AND RD.RDUCT_AMT = REPLACE(#{term},',','') AND RD.ETC_CN LIKE CONCAT('%', #{term}, '%') diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp index fda9b82f..2ac3bafb 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp @@ -64,7 +64,7 @@ 차량번호 법정동 신고/단속자 - 잔액 + 잔액 사진건수 발행번호 @@ -79,7 +79,7 @@ {VHRNO} {CRDN_STDG_NM} {APLCNT_CRDN_NM} - {FFNLG_AMT} + {BLNC} {ATCH_FILE_CNT} {CRDN_SN} @@ -133,7 +133,8 @@ $(document).ready(function(){ CRDN_INPT_SE_CD : FIM003, CRDN_YMD_TM : datetimeFormat, FFNLG_AMT : numberFormat, - CRDN_STTS_CD : FIM010 + CRDN_STTS_CD : FIM010, + BLNC : numberFormat }, keymapper:info => info ? info.CRDN_ID : "", dataGetter:obj => obj.crdnList, appendData:true }); diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp index f73b467d..8f28e7b5 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp @@ -76,8 +76,8 @@ 감액사유 접수(위반)일시 차량번호 - 감액금액 - 잔액 + 감액금액 + 잔액 감액특기사항 처리상태 @@ -90,8 +90,8 @@ {RDUCT_RSN_CD} {CRDN_YMD_TM} {VHRNO} - {RDCAMT_PCPTAX} - {SUM_AMT} + {RDUCT_AMT} + {BLNC} {RDUCT_ETC_CN} {CRDN_STTS_CD} @@ -139,9 +139,10 @@ $(document).ready(function(){ formats: { RDUCT_YMD : dateFormat, CRDN_YMD_TM : datetimeFormat, - RDCAMT_PCPTAX : numberFormat, + RDUCT_AMT : numberFormat, SUM_AMT : numberFormat, - CRDN_STTS_CD : FIM010 + CRDN_STTS_CD : FIM010, + BLNC : numberFormat }, keymapper:info => info ? info.CRDN_ID : "", dataGetter:obj => obj.crdnList, appendData:true });