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 f4791658..2b6addbb 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 @@ -13,7 +13,9 @@ import org.springframework.stereotype.Service; import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.service.bean.FileBean; +import cokr.xit.fims.cmmn.CrdnPayerHstry; import cokr.xit.fims.cmmn.CrdnSttsHstry; +import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; @@ -69,6 +71,9 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Resource(name="crdnSttsHstryBean") protected CrdnSttsHstryBean crdnSttsHstryBean; + @Resource(name="crdnPayerHstryBean") + protected CrdnPayerHstryBean crdnPayerHstryBean; + @Override public List getCrackdownList(CrdnQuery query) { @@ -165,10 +170,6 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService crdn.setFfnlgAmt(basicAmt[0]); crdn.setAdvntceAmt(basicAmt[1]); - //TODO : 납부자 저장 - //pyrId = 납부자Bean.save(pyrInfoMap); - //crdn.setRtpyrId(pyrId); - //TODO : 단속팀 저장 //if(!ifEmpty(crdn.getTeamId(), () -> "").equals("")) { //} @@ -184,6 +185,9 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService String currentSggCd = globalStngMapper.selectSggCdForCurrentUser(); crdn.setSggCd(currentSggCd); boolean result = crdnBean.create(crdn); + if (!result) { + throw new RuntimeException("단속자료 수기 등록 중 단속자료 등록에 실패하였습니다."); + } SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); Date curTime = new Date(); @@ -204,12 +208,23 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService result = excl01Bean.createLevyExcl(excl01); if (!result) { - return false; + throw new RuntimeException("단속자료 수기 등록 중 부과제외 자료 등록에 실패하였습니다."); } taskDtlId = excl01.getLevyExclId(); } + //단속납부자이력(TB_CRDN_PAYER_HSTRY) 대장 등록 + if(!ifEmpty(crdn.getRtpyrId(), () -> "").equals("")) { + CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry(); + crdnPayerHstry.setCrdnId(crdn.getCrdnId()); + crdnPayerHstry.setRtpyrId(crdn.getRtpyrId()); + result = crdnPayerHstryBean.create(crdnPayerHstry); + if (!result) { + throw new RuntimeException("단속자료 수기 등록 중 단속납부자 이력 등록에 실패하였습니다."); + } + } + // 단속상태이력(TB_CRDN_STTS_HSTRY) 대장 등록 CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry(); crdnSttsHstry.setCrdnId(crdn.getCrdnId()); @@ -221,13 +236,16 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService result = crdnSttsHstryBean.create(crdnSttsHstry); if (!result) { - return false; + throw new RuntimeException("단속자료 수기 등록 중 단속상태 이력 등록에 실패하였습니다."); } - + //파일 등록 if(fileInfoList != null && !fileInfoList.isEmpty()) { fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId())); - fileBean.create(fileInfoList); + int effected = fileBean.create(fileInfoList); + if(effected == 0) { + throw new RuntimeException("단속자료 수기 등록 중 파일 등록에 실패하였습니다."); + } } return result; diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java index c7d03ca4..f1b8c61b 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java @@ -367,22 +367,17 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } - - - int fileInsertEffected = 0; - int fileDeleteEffected = 0; - + //첨수파일 수 변경 + int fileInsertCnt = 0; + int fileDeleteCnt = 0; if(newFileInfoList != null && !newFileInfoList.isEmpty()) { - fileInsertEffected = fileBean.create(newFileInfoList); + fileInsertCnt = newFileInfoList.size(); } - String[] deleteFileKeyList = (String[])ifEmpty(nonQueryRequest.get("deleteFileKeyList"), new String[] {}); - if(deleteFileKeyList.length > 0) { - fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList")); + fileDeleteCnt = deleteFileKeyList.length; } - - int changeFileCnt = (fileInsertEffected - fileDeleteEffected); + int changeFileCnt = (fileInsertCnt - fileDeleteCnt); nonQueryRequest.put("changeFileCnt", changeFileCnt); //금액 변경 @@ -402,14 +397,12 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } } - //TODO : 납부자 저장 - //String pyrId = ""; - - //if(!crdnInfo.string("RTPYR_ID").equals(crdn.getRtpyrId())) { - //nonQueryRequest.put("changePayerYn","Y"); - //} else { + //납부자 변경 + if(!crdnInfo.string("RTPYR_ID").equals(crdn.getRtpyrId())) { + nonQueryRequest.put("changePayerYn","Y"); + } else { nonQueryRequest.put("changePayerYn","N"); - //} + } //단속상태값 변경 nonQueryRequest.put("changeStatusYn","Y"); @@ -429,6 +422,15 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv throw new RuntimeException("단속민원답변 수정에 실패하였습니다."); } + + + + //단속정보변경 + saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn); + if(!saved) { + throw new RuntimeException("단속민원답변 수정 중 단속정보변경에 실패하였습니다."); + } + //부과 제외 대장 등록 String dtlTaskId = ""; if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용 @@ -453,13 +455,6 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv dtlTaskId = crdn.getCrdnId(); } - - //단속정보변경 - saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn); - if(!saved) { - throw new RuntimeException("단속민원답변 수정 중 단속정보변경에 실패하였습니다."); - } - //단속 납부자 변경 이력 등록 if(((String)nonQueryRequest.get("changePayerYn")).equals("Y")) { CrdnPayerHstry crdnPayerHstry = new CrdnPayerHstry(); @@ -494,6 +489,20 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } } + //파일 처리 + if(newFileInfoList != null && !newFileInfoList.isEmpty()) { + int fileInsertEffected = fileBean.create(newFileInfoList); + if(fileInsertCnt != fileInsertEffected) { + throw new RuntimeException("단속민원답변 수정 중 파일 등록에 실패하였습니다."); + } + } + if(deleteFileKeyList.length > 0) { + int fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList")); + if(fileDeleteCnt != fileDeleteEffected) { + throw new RuntimeException("단속민원답변 수정 중 파일 삭제에 실패하였습니다."); + } + } + return saved; } diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp index 262bfbb0..e7c62522 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01020-info.jsp @@ -598,7 +598,6 @@ $(document).ready(function(){ }); return; } - return; } var crdnId = $("#crdnId--${pageName}").val();