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 d66d9cbc..32136ad2 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 @@ -27,7 +27,7 @@ public class Crdn06Bean extends AbstractComponent { * */ public boolean update(Map nonQueryRequest, Crdn crdn) { - String updateInfomation = (String)nonQueryRequest.get("updateInfomation"); + String updateInfomation = (String)ifEmpty(nonQueryRequest.get("updateInfomation"), "") ; switch (ifEmpty(updateInfomation, () -> "")) { case "tagInformationUndefinedData": diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java index f66feae2..f8215aa2 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java @@ -84,7 +84,11 @@ public class CrdnCvlcptBean extends AbstractComponent { for(String key : nonQueryRequest.keySet()){ params.set(key, nonQueryRequest.get(key)); } - return crdnCvlcptMapper.updateCrdn(params) == 1 ? true : false; + + if(crdnCvlcptMapper.updateCrdn(params) != 1) { + return false; + } + return crdnCvlcptMapper.updateCrdnAddition(params) == 1 ? true : false; } /**답변 내용을 초기화한다. 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 7f0822d0..f1339627 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 @@ -2,9 +2,8 @@ package cokr.xit.fims.cvlc.service.bean; import java.io.File; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; @@ -12,7 +11,6 @@ import java.util.stream.Collectors; import javax.annotation.Resource; -import org.assertj.core.util.Arrays; import org.springframework.stereotype.Service; import org.springframework.util.ResourceUtils; @@ -30,7 +28,6 @@ import cokr.xit.fims.crdn.dao.CrdnInfoMapper; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.service.CrdnCvlcptService; -import cokr.xit.fims.excl.Excl01; import cokr.xit.fims.excl.service.bean.Excl01Bean; import cokr.xit.fims.sprt.Sprt; import cokr.xit.foundation.UserInfo; @@ -251,26 +248,22 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Override public boolean updateCvlcptPrcsSe(Map nonQueryRequest, CrdnCvlcpt crdnCvlcpt, Crdn crdn, List newFileInfoList) { boolean saved = false; + crdn.setSggCd(crdn05Mapper.selectSggCdForCurrentUser()); DataObject crdnInfo = crdnInfoMapper.getCrdnInfo(crdn.getCrdnId()); crdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID")); - String acceptType = (String)nonQueryRequest.get("acceptType"); - + String acceptType = (String)ifEmpty(nonQueryRequest.get("acceptType"), ""); if (crdnInfo.string("CRDN_REG_SE_CD").equals("02")) { - if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용 - - // 단속민원(TB_CRDN_CVLCPT) 대장 - Excl01 updtCrdnCvlcpt = new Excl01(); - boolean retSuccess = false; - String newCvlcptPrcsCd = ""; - String newCvlcptTrsmCd = ""; + // 전송 처리 전 자료에 대해서 업데이트한다. + if (!Arrays.asList(new String[]{"04","05","06"}).contains(crdnInfo.string("CVLCPT_TRSM_CD"))) { - updtCrdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID")); // 민원 연계 ID + crdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID")); // 민원 연계 ID + boolean retSuccess = false; // 답변내용 초기화 retSuccess = crdnCvlcptBean.initCvlcptPrcsRsltCn(crdnCvlcpt.getCvlcptLinkId()); if (!retSuccess) { @@ -278,14 +271,22 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv throw new RuntimeException("부과제외 등록 중 단속민원 대장의 민원처리결과내용 초기화에 실패하였습니다."); } - // 답변완료 후 서손처리에 대해서는 답변 상태를 업데이트 하지 않는다 - // 전송대상, 전송 미대상 자료에 대해서 업데이트한다. - if (crdnInfo.string("CVLCPT_TRSM_CD").equals("01") - || crdnInfo.string("CVLCPT_TRSM_CD").equals("02") - || crdnInfo.string("CVLCPT_TRSM_CD").equals("03")) { - // 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장 조회 - DataObject infoCvlcptAnsWords = crdnCvlcptBean.selectCvlcptAnsWordsInfo(crdn.getTaskSeCd(), crdn.getLevyExclRsnCd()); + String newCvlcptPrcsCd = ""; + String newCvlcptTrsmCd = ""; + + + // 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장 조회 + String ansRsnCd = ""; + if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용 + ansRsnCd = crdn.getLevyExclRsnCd(); + } else { + ansRsnCd = "3"+crdn.getVltnCd(); + } + + DataObject infoCvlcptAnsWords = crdnCvlcptBean.selectCvlcptAnsWordsInfo(crdn.getTaskSeCd(), ansRsnCd); + + if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용 // 비부과(서손)사유가 민원 답변대상인가? 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장에 답변 사유 코드가 존재한다면.. if (!infoCvlcptAnsWords.string("ANS_WORDS_ID").equals("")) { newCvlcptPrcsCd = "04"; // 민원 처리 코드 - 불수용(과태료 부과제외) @@ -294,46 +295,26 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv newCvlcptPrcsCd = "07"; // 민원 처리 코드 - 비부과(서손)사유가 답변 미대상 newCvlcptTrsmCd = "03"; // 민원 전송 코드 - 비부과(서손)사유가 전송 미대상 } - - // 현재 날짜 구하기 - LocalDate now = LocalDate.now(); - // 포맷 정의 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); // yyyy년 MM월 dd일 HH시 mm분 ss초 - // 포맷 적용 - String formatedNow = now.format(formatter); - - // 단속민원(TB_CRDN_CVLCPT) 대장을 수정 한다. - updtCrdnCvlcpt.setCvlcptPrcsCd(newCvlcptPrcsCd); // 민원 처리 코드 - updtCrdnCvlcpt.setCvlcptPrcsSumry(infoCvlcptAnsWords.string("PRCS_SUMRY")); // 민원 처리 요약 - updtCrdnCvlcpt.setCvlcptPrcsRsltCn(infoCvlcptAnsWords.string("PRCS_RSLT_CN")); // 민원 처리 결과 내용 - updtCrdnCvlcpt.setCvlcptPrcsCmptnDt(formatedNow); // 민원 처리 완료 일시 - updtCrdnCvlcpt.setCvlcptPrcsPic(UserInfo.current().getId()); // 민원 처리 담당자 - updtCrdnCvlcpt.setCvlcptTrsmCd(newCvlcptTrsmCd); // 민원 전송 코드 - - // 단속민원 민원처리코드 수정 - retSuccess = excl01Bean.updateCrdnCvlcpt(updtCrdnCvlcpt); - if (!retSuccess) { - // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback - throw new RuntimeException("부과제외 등록 중 단속민원답변 수정에 실패하였습니다."); - } + } else { //수용일 때 + newCvlcptPrcsCd = "02"; // 민원 처리 코드 - 수용 + newCvlcptTrsmCd = "01"; // 민원 전송 코드 - 전송 대상 } - - } else { //수용일 때 - - //TODO : 전송코드,처리코드 결정 - crdnCvlcpt.setCvlcptPrcsCd(""); - crdnCvlcpt.setCvlcptTrsmCd("02"); - - //TODO : 전송문구 조회 - crdnCvlcpt.setCvlcptPrcsSumry("요약요약요약"); - crdnCvlcpt.setCvlcptPrcsRsltCn("결과결과결과"); - - + crdnCvlcpt.setCvlcptPrcsCd(newCvlcptPrcsCd); // 민원 처리 코드 + crdnCvlcpt.setCvlcptPrcsSumry(infoCvlcptAnsWords.string("PRCS_SUMRY")); // 민원 처리 요약 + crdnCvlcpt.setCvlcptPrcsRsltCn(infoCvlcptAnsWords.string("PRCS_RSLT_CN")); // 민원 처리 결과 내용 + crdnCvlcpt.setCvlcptPrcsPic(UserInfo.current().getId()); // 민원 처리 담당자 + crdnCvlcpt.setCvlcptTrsmCd(newCvlcptTrsmCd); // 민원 전송 코드 //민원정보변경 - saved = crdnCvlcptBean.updateCvlcptPrcsSe(crdnCvlcpt); + retSuccess = crdnCvlcptBean.updateCvlcptPrcsSe(crdnCvlcpt); + + if (!retSuccess) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("부과제외 등록 중 단속민원답변 수정에 실패하였습니다."); + } } + } @@ -344,13 +325,40 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv fileInsertEffected = fileBean.create(newFileInfoList); } - if((String[])nonQueryRequest.get("deleteFileKeyList") != null) { + String[] deleteFileKeyList = (String[])ifEmpty(nonQueryRequest.get("deleteFileKeyList"), new String[] {}); + + if(deleteFileKeyList.length > 0) { fileDeleteEffected = fileBean.remove((String[])nonQueryRequest.get("deleteFileKeyList")); } int changeFileCnt = (fileInsertEffected - fileDeleteEffected); - //단속정보변경 nonQueryRequest.put("changeFileCnt", changeFileCnt); + + //TODO : 금액 변경 + nonQueryRequest.put("changeAmountYn","N"); + //if(){ + //nonQueryRequest.put("changeAmountYn","Y"); + //} + + //단속상태 변경 + nonQueryRequest.put("changeAmountYn","Y"); + if(acceptType.equals("accept")) { + if(!crdnInfo.string("CRDN_REG_SE_CD").equals("02") + || Arrays.asList(new String[]{"04","05","06"}).contains(crdnInfo.string("CVLCPT_TRSM_CD"))) { + crdn.setCrdnSttsCd("22"); + } else { + crdn.setCrdnSttsCd("21"); + } + + } else if(acceptType.equals("someAccept")){ + crdn.setCrdnSttsCd("83"); + } else if(acceptType.equals("nonAccept")) { + crdn.setCrdnSttsCd("81"); + } else { + throw new RuntimeException("단속민원답변 수정에 실패하였습니다."); + } + + //단속정보변경 saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn); return saved; 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 b986a914..590fdd73 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml @@ -24,7 +24,11 @@ , CRDN_STDG_NM = #{crdnStdgNm} , CRDN_ROAD_NM = #{crdnRoadNm} , CRDN_PLC = #{crdnPlc} - , VLTN_ID = #{vltnId} + , VLTN_ID = (SELECT A.VLTN_ID + FROM TB_VLTN_INFO A + WHERE A.SGG_CD = #{sggCd} + AND A.TASK_SE_CD = #{taskSeCd} + AND A.VLTN_CD = #{vltnCd}) , GPS_X = #{gpsX} , GPS_Y = #{gpsY} , VIN = #{vin} diff --git a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml index 8ee6a30b..303a4fe9 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml @@ -422,7 +422,11 @@ SELECT A.ANS_WORDS_ID , VHRNO = #{crdn.vhrno} /* 차량번호 */ , CRDN_STDG_NM = #{crdn.crdnStdgNm} /* 단속 법정동 명 */ , CRDN_PLC = #{crdn.crdnPlc} /* 단속 장소 */ - , VLTN_ID = #{crdn.vltnId} /* 위반 ID */ + , VLTN_ID = (SELECT A.VLTN_ID + FROM TB_VLTN_INFO A + WHERE A.SGG_CD = #{crdn.sggCd} + AND A.TASK_SE_CD = #{crdn.taskSeCd} + AND A.VLTN_CD = #{crdn.vltnCd}) /* 위반 ID */ , VIN = #{crdn.vin} /* 차대번호 */ , VHCL_NM = #{crdn.vhclNm} /* 차량 명 */ , VHCL_COLOR = #{crdn.vhclColor} /* 차량 색상 */ @@ -445,6 +449,35 @@ SELECT A.ANS_WORDS_ID UPDATE TB_CRDN_ADDITION SET MDFCN_DT = /* 수정일시 */ , MDFR = #{currentUser.modifiedBy} /* 수정자 */ + + , OVTIME_YN = #{crdn.ovtimeYn} + , CRDN_SPAREA_CD = #{crdn.crdnSpareaCd} + + + , DTL_CRDN_PLC = #{crdn.dtlCrdnPlc} + , MOSC_X = #{crdn.moscX} + , MOSC_Y = #{crdn.moscY} + + + , USE_FUEL_CD = #{crdn.useFuelCd} + + + , PARKNG_PSBLTY_RSLT_CD = #{crdn.parkngBsbltyRsltCd} + + + , VLTN_NMTM = #{crdn.vltnNmtm} + + + , CRDN_SE_CD = #{crdn.crdnSeCd} + , TEAM_ID = #{crdn.teamId} + , CRDN_BGNG_TM = #{crdn.crdnBgngTm} + , CRDN_END_TM = #{crdn.crdnEndTm} + , FFNLG_CARMDL_CD = #{crdn.ffnlglCarmdlCd} + + + , CRDN_SN = #{crdn.crdnSn} + , TOWNG_YN = #{crdn.towngYn} + WHERE CRDN_ID = #{crdn.crdnId} /* 단속 ID */ 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 c83dd3e5..c9b4f2fb 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 @@ -63,12 +63,12 @@ -
+
- +
-
+