From 00ea9180c852551944e29e6c45cc7c6f1a097510 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 17 Aug 2023 09:08:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=EC=A0=95=EC=B0=A8=202=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EC=B4=88=EA=B3=BC=20=EC=B2=98=EB=A6=AC=20=EB=A9=94?= =?UTF-8?q?=EC=86=8C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/crdn/dao/CrdnUpdtMapper.java | 12 ++++++++++ .../xit/fims/crdn/service/CrdnService.java | 12 ++++++++++ .../xit/fims/crdn/service/bean/CrdnBean.java | 2 -- .../crdn/service/bean/CrdnServiceBean.java | 23 +++++++++++++++++-- .../cokr/xit/fims/task/web/DpvController.java | 2 +- .../sql/mapper/fims/crdn/crdn-updt-mapper.xml | 21 +++++++++++++++++ 6 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java index 97c03eb5..36ab7c6c 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java @@ -19,6 +19,18 @@ public interface CrdnUpdtMapper extends AbstractMapper { */ int updateTagInfo(Crdn crdn); + /** 2시간 초과 여부를 변경한다. + * @param crdn 단속 대장 + * @return 저장된 정보수 + */ + int updateOverTimeInfo(Crdn crdn); + + /** 단속 자료의 금액을 변경한다. + * @param crdn 단속 대장 + * @return 저장된 정보수 + */ + int updateCrdnAmt(Crdn crdn); + /**단속정보를 변경한다.
* {@link cokr.xit.fims.crdn.service.bean.CrdnBean#update(Crdn)} 참고 * @param crdn 단속정보 diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java index fd935387..ef7fcc3e 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -37,4 +37,16 @@ public interface CrdnService { */ boolean update(Map nonQueryRequest, Crdn crdn, List newFileInfoList); + /** 시간초과 여부를 변경하고, 금액을 증가 또는 감소시킨다. + * @param crdn 단속정보 + * @return 저장여부 + */ + boolean updateOverTimeInfo(Crdn crdn); + + /** 표지정보 미확인 자료를 확인 자료로 수정한다. + * @param crdn 단속정보 + * @return 저장여부 + */ + boolean updateTagInfo(Crdn crdn); + } 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 8666e4a7..c1f92cb5 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 @@ -61,8 +61,6 @@ public class CrdnBean extends AbstractComponent { String updateInfomationType = (String)ifEmpty(nonQueryRequest.get("updateInfomationType"), "") ; switch (ifEmpty(updateInfomationType, () -> "")) { - case "tagInformationUndefinedData": - return crdnUpdtMapper.updateTagInfo(crdn) == 1 ? true : false; default: if(crdnUpdtMapper.updateCrdnAddition(crdn) != 1) { return false; diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java index 9b70086a..bf04b737 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java @@ -226,13 +226,32 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Override public boolean update(Map nonQueryRequest, Crdn crdn, List newFileInfoList) { - if(crdnBean.update(nonQueryRequest, crdn) == false) { + boolean result = crdnBean.update(nonQueryRequest, crdn); + if(!result) { throw new RuntimeException("단속 정보 수정 중 오류가 발생하였습니다."); } - return true; + return true; } + @Override + public boolean updateOverTimeInfo(Crdn crdn) { + + if(crdnUpdtMapper.updateOverTimeInfo(crdn) != 1) { + return false; + } + int[] basicAmt = crdnStngBean.getBasicAmt(crdn); + crdn.setFfnlgAmt(basicAmt[0]); + crdn.setLevyAmt(basicAmt[0]); + crdn.setAdvntceLevyAmt(basicAmt[1]); + + return crdnUpdtMapper.updateCrdnAmt(crdn) == 1 ? true : false; + } + + @Override + public boolean updateTagInfo(Crdn crdn) { + return crdnUpdtMapper.updateTagInfo(crdn) == 1 ? true : false; + } } diff --git a/src/main/java/cokr/xit/fims/task/web/DpvController.java b/src/main/java/cokr/xit/fims/task/web/DpvController.java index 5e1f3ddd..a9181e31 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -64,7 +64,7 @@ public class DpvController { public ModelAndView update(Crdn crdn) { Map nonQueryRequest = new HashMap(); nonQueryRequest.put("updateInfomationType", "tagInformationUndefinedData"); - boolean saved = crdnService.update(nonQueryRequest, crdn, null); + boolean saved = crdnService.updateTagInfo(crdn); return new ModelAndView("jsonView") .addObject("saved", saved); } diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml index 49883b1b..31749e35 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml @@ -81,6 +81,27 @@ , MDFR = #{modifiedBy} /* 수정자 */ WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + + + /* 시간초과 여부 수정(crdnUpdtMapper.overTimeInfo) */ + UPDATE TB_CRDN_ADI + SET OVTIME_YN = #{ovtimeYn} + , MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + + + + /* 단속 금액 수정(crdnUpdtMapper.updateCrdnAmt) */ + UPDATE TB_CRDN + SET MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + , FFNLG_AMT = #{ffnlgAmt} + , LEVY_AMT = #{levyAmt} + , ADVNTCE_LEVY_AMT = #{advntceLevyAmt} + WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + + /* 단속자료 삭제(crdnUpdtMapper.removeCrdn) */ UPDATE TB_CRDN