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 0677ab60..64b395c7 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java @@ -56,6 +56,10 @@ public interface CrdnUpdtMapper extends AbstractMapper { */ int deleteCrdn(Map map); - + /** 단속 자료를 삭제한다. + * @param map 삭제 요청 파라미터 + * @return 저장된 정보수 + */ + int deleteCrdnAdi(Map map); } 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 52dd5074..ac2e946f 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -49,4 +49,10 @@ public interface CrdnService { */ boolean updateTagInfo(Crdn crdn); + /** 단속 자료를 삭제한다. + * @param crdn 단속정보 + * @return 저장 메시지 + */ + public String removeCrackdown(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 3027df28..a88dcf93 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 @@ -18,12 +18,14 @@ 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.dao.CrdnInfoMapper; import cokr.xit.fims.crdn.dao.CrdnInstMapper; import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.excl.LevyExcl; import cokr.xit.fims.excl.service.bean.Excl01Bean; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.UserInfo; +import cokr.xit.foundation.data.DataObject; /** 단속 관리 Bean * @author leebj @@ -46,13 +48,15 @@ public class CrdnBean extends AbstractComponent { @Resource(name = "fileBean") private FileBean fileBean; + @Resource(name = "crdnInfoMapper") + private CrdnInfoMapper crdnInfoMapper; + @Resource(name = "crdnInstMapper") private CrdnInstMapper crdnInstMapper; @Resource(name = "crdnUpdtMapper") private CrdnUpdtMapper crdnUpdtMapper; - public boolean create(Map nonQueryRequest, Crdn crdn, List fileInfoList) { if(fileInfoList != null && !fileInfoList.isEmpty()) { crdn.setAtchFileCnt(fileInfoList.size()); @@ -212,5 +216,59 @@ public class CrdnBean extends AbstractComponent { return crdnUpdtMapper.deleteCrdn(paramMap) >= 1 ? true : false; } + /**단속 정보를 삭제한다. + * @param crdnIDs 단속아이디 목록 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public String removeCrackdown(Crdn crdn) { + // 변수 선언 + boolean retSuccess = false; // DB 처리 결과 + String retMessage = ""; // 처리 결과 메시지 + int effected = 0; + + // 단속 ID로 단속, 부과제외 정보 조회 + DataObject infoCrdn = crdnInfoMapper.selectCrdnInfo(crdn.getCrdnId()); + + // 단속상태이력(TB_CRDN_STTS_HSTRY) + CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry(); + + crdnSttsHstry.setCrdnId(infoCrdn.string("CRDN_ID")); + crdnSttsHstry.setBfrSttsCd(infoCrdn.string("CRDN_STTS_CD")); + crdnSttsHstry.setBfrSttsChgDt(infoCrdn.string("CRDN_STTS_CHG_DT")); + crdnSttsHstry.setCrdnSttsCd("99"); + + // 단속 상태 이력(TB_CRDN_STTS_HSTRY) 대장에 등록 한다. + retSuccess = crdnSttsHstryBean.createHstryUpdateCrdnSttsCd(crdnSttsHstry); + if (!retSuccess) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("단속 삭제 중 단속 대장의 단속상태코드 변경에 실패하였습니다."); + } + + Map paramMap = new HashMap(); + List crdnIdList = Arrays.asList(crdn.getCrdnId()); + paramMap.put("crdnIDs", crdnIdList); + paramMap.put("removedBy", UserInfo.current().getId()); + + // 단속(TB_CRDN) 대장을 삭제 한다. + effected = crdnUpdtMapper.deleteCrdn(paramMap); + if (effected != 1) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("단속 대장 삭제에 실패하였습니다."); + } + + // 단속(TB_CRDN) 대장을 삭제 한다. + effected = crdnUpdtMapper.deleteCrdnAdi(paramMap); + if (effected != 1) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("단속 부가 정보 삭제에 실패하였습니다."); + } + + retMessage = "[S] 작업이 정상 처리 되었습니다."; + + return retMessage; + } } 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 3324b642..f406ce50 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 @@ -212,4 +212,9 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService return crdnUpdtMapper.updateTagInfo(crdn) == 1 ? true : false; } + @Override + public String removeCrackdown(Crdn crdn) { + return crdnBean.removeCrackdown(crdn); + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java index ce1274cc..23a68146 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java @@ -5,10 +5,12 @@ import java.util.Map; import javax.annotation.Resource; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.code.CommonCode; import cokr.xit.base.web.ApplicationController; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnStngService; @@ -62,4 +64,28 @@ public class Crdn06Controller extends ApplicationController { return setCollectionInfo(new ModelAndView("jsonView"), crdnService.getCrackdownList(query),""); } + /**지정한 단속 ID에 해당하는 단속 대장를 제거한다. + * @param crdnID 단속 ID + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + @PostMapping(name = "단속 대장 제거", value = "/010/remove.do") + public ModelAndView removeCrackdown(Crdn crdn) { + boolean saved = false; + String retMessage = crdnService.removeCrackdown(crdn); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } + + return new ModelAndView("jsonView") + .addObject("saved", saved) + .addObject("retMessage", retMessage); + } + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java index 00207e70..f8998a6c 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02Bean.java @@ -1,7 +1,6 @@ package cokr.xit.fims.sprt.service.bean; import java.util.List; -import java.util.Map; import javax.annotation.Resource; diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java index 32de83a5..649014b3 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt02ServiceBean.java @@ -1,7 +1,6 @@ package cokr.xit.fims.sprt.service.bean; import java.util.List; -import java.util.Map; import javax.annotation.Resource; diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java index 501f61bd..120de6e2 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt02Controller.java @@ -1,13 +1,9 @@ package cokr.xit.fims.sprt.web; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.stream.Stream; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; 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 6cadf3fb..bc93eedd 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 @@ -25,9 +25,9 @@ , CRDN_STDG_NM = #{crdnStdgNm} , CRDN_ROAD_NM = #{crdnRoadNm} , CRDN_PLC = #{crdnPlc} - , VLTN_ID = (SELECT A.VLTN_ID + , VLTN_ID = (SELECT A.VLTN_ID FROM TB_VLTN_INFO A - WHERE A.SGG_CD = #{sggCd} + WHERE A.SGG_CD = #{sggCd} AND A.TASK_SE_CD = #{taskSeCd} AND A.VLTN_CD = #{vltnCd}) , GPS_X = #{gpsX} @@ -112,15 +112,26 @@ WHERE CRDN_ID = #{crdnId} /* 단속 ID */ - - /* 단속자료 삭제(crdnUpdtMapper.deleteCrdn) */ - UPDATE TB_CRDN - SET DEL_YN = 'Y' - , DEL_DT = /* 삭제일시 */ - , DLTR = #{removedBy} /* 삭제자 */ - WHERE CRDN_ID IN ( - #{crdnId} - ) - + /* 단속 자료 삭제(crdnUpdtMapper.deleteCrdn) */ + UPDATE TB_CRDN + SET DEL_YN = 'Y' + , DEL_DT = /* 삭제일시 */ + , DLTR = #{removedBy} /* 삭제자 */ + , DEL_RSN = #{delRsn} /* 삭제 사유 */ + WHERE CRDN_ID IN ( + #{crdnId} + ) + + + /* 단속 부가 자료 삭제(crdnUpdtMapper.deleteCrdn) */ + UPDATE TB_CRDN_ADI + SET DEL_YN = 'Y' + , DEL_DT = /* 삭제일시 */ + , DLTR = #{removedBy} /* 삭제자 */ + , DEL_RSN = #{delRsn} /* 삭제 사유 */ + WHERE CRDN_ID IN ( + #{crdnId} + ) + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml b/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml index 72927959..3ef2a144 100644 --- a/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml @@ -63,28 +63,31 @@ /* 부과제외 대장 목록 조회(levyExclMapper.selectLevyExclList) */ - WHERE C.SGG_CD = #{sggCd} /* 시군구 코드 */ - - AND C.TASK_SE_CD = #{taskSeCd} /* 업무 구분 코드 */ - - - AND LE.DEL_YN = #{delYn} /* 삭제 여부 */ - - + + AND LE.LEVY_EXCL_YMD = ]]> #{schLevyExclYmdFrom} /* 부과제외 일자 시작 */ - - + + AND LE.LEVY_EXCL_YMD #{schLevyExclYmdTo} /* 부과제외 일자 종료 */ - - + + AND LE.LEVY_EXCL_SE_CD = #{schLevyExclSeCd} /* 부과 제외 구분 코드 */ - - + + AND C.CRDN_YMD = ]]> #{schCrdnYmdFrom} /* 단속 일자 시작 */ - - + + AND C.CRDN_YMD #{schCrdnYmdTo} /* 단속 일자 종료 */ - - + + AND C.VHRNO = #{schVhrno} /* 차량번호 */ - - + + AND P.RTPYR_NM = #{schRtpyrNm} /* 납부자 명 */ - - - - + + + + AND SUBSTR(LE.REG_DT,1,8) = ]]> #{schRegDateFrom} /* 등록 일자 시작 */ - - + + AND SUBSTR(LE.REG_DT,1,8) #{schRegDateTo} /* 등록 일자 종료 */ - - - - + + + + AND SUBSTR(LE.MDFCN_DT,1,8) = ]]> #{schRegDateFrom} /* 수정 일자 시작 */ - - + + AND SUBSTR(LE.MDFCN_DT,1,8) #{schRegDateTo} /* 수정 일자 종료 */ - - - - - - - - + + + + + + + + AND LE.RGTR = #{schDetailUserCd} /* 등록자 코드 */ - - - - + + + + AND LE.MDFR = #{schDetailUserCd} /* 수정자 코드 */ - - - - - + + + + + + + AND LE.DEL_YN = #{delYn} /* 삭제 여부 */ + + + AND C.SGG_CD = #{sggCd} /* 시군구 코드 */ + AND C.DEL_YN = #{delYn} /* 삭제 여부 */ + + AND C.TASK_SE_CD = #{taskSeCd} /* 업무 구분 코드 */ + diff --git a/src/main/resources/sql/mapper/fims/excl/opnnSbmsn-mapper.xml b/src/main/resources/sql/mapper/fims/excl/opnnSbmsn-mapper.xml index bf36d0cc..429e1391 100644 --- a/src/main/resources/sql/mapper/fims/excl/opnnSbmsn-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/opnnSbmsn-mapper.xml @@ -133,74 +133,77 @@