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 babf03ca..0c1fe495 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -97,4 +97,10 @@ public interface CrdnService { */ int countCrdn(CrdnQuery crdnQuery); + /** 단속자료를 압축파일로 생성하여 세외수입으로 전송한다. + * @param crdnIDs 단속ID 목록 + * @return 결과메시지 + */ + String sendCrdn(String[] crdnIDs); + } 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 acdbdfb1..ae4d2b4d 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 @@ -12,6 +12,7 @@ import org.springframework.stereotype.Service; import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.bean.FileBean; +import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; @@ -27,6 +28,7 @@ import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptMainBean; import cokr.xit.fims.excl.service.bean.LevyExclBean; +import cokr.xit.fims.mngt.dao.TaskMapper; import cokr.xit.fims.sprt.dao.TotalInfoMapper; import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.foundation.component.AbstractServiceBean; @@ -56,6 +58,9 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Resource(name="totalInfoMapper") private TotalInfoMapper totalInfoMapper; + @Resource(name="taskMapper") + private TaskMapper taskMapper; + @Resource(name="fileBean") private FileBean fileBean; @@ -342,4 +347,44 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService public int countCrdn(CrdnQuery crdnQuery) { return crdnListMapper.countCrdn(crdnQuery); } + + @Override + public String sendCrdn(String[] crdnIDs) { + String rtnMsg = "[F]"; + + for(String crdnID : crdnIDs) { + DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdnID); + + String taskSeCd = crdnInfo.string("TASK_SE_CD"); + + if(!taskSeCd.equals("PVS") && !taskSeCd.equals("BPV")) { + rtnMsg += "주정차위반 또는 전용차로위반 자료만 처리 가능합니다."; + throw new RuntimeException(rtnMsg); + } + + CmmnQuery cmmnQuery = new CmmnQuery(); + cmmnQuery.setUseYN("Y"); + cmmnQuery.setSggCd(crdnInfo.string("SGG_CD")); + cmmnQuery.setTaskSeCd(taskSeCd); + DataObject nxrpLinkInfo = taskMapper.selectTaskInfo(cmmnQuery); + + String nxrpLinkSeCd = nxrpLinkInfo.string("NXRP_LINK_SE_CD"); + String nxrpLinkSeDtlSn = nxrpLinkInfo.string("NXRP_LINK_SE_DTL_SN"); + + if(nxrpLinkSeDtlSn.equals("01")) { + //TODO + } else if(nxrpLinkSeDtlSn.equals("02")){ + //TODO + } else { + rtnMsg += "세외수입 연계 설정 오류"; + throw new RuntimeException(rtnMsg); + } + + //TODO + } + + rtnMsg = "[S]"; + + return rtnMsg; + } } 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 e1828d7c..104318a1 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java @@ -209,10 +209,12 @@ public class Crdn06Controller extends ApplicationController { */ public ModelAndView sendCrdn(String... crdnIDs) { ModelAndView mav = new ModelAndView("jsonView"); - - //TODO : - - mav.addObject("saved", true); + boolean saved = false; + String rtnMsg = crdnService.sendCrdn(crdnIDs); + if(rtnMsg.contains("[S]")) { + saved = true; + } + mav.addObject("saved", saved); return mav; } diff --git a/src/main/java/cokr/xit/fims/mngt/Task.java b/src/main/java/cokr/xit/fims/mngt/Task.java index b65c26de..dffd7083 100644 --- a/src/main/java/cokr/xit/fims/mngt/Task.java +++ b/src/main/java/cokr/xit/fims/mngt/Task.java @@ -62,4 +62,14 @@ public class Task extends AbstractEntity { */ private Integer ffnlgInadtnMxmmCnt; + /** + * 세외수입 연계 구분 코드 + */ + private String nxrpLinkSeCd; + + /** + * 세외수입 연계 구분 상세 순번 + */ + private String nxrpLinkSeDtlSn; + } 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 a13f5a61..f79f5cd8 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -337,13 +337,6 @@ public class DpvController { return super.countCrdn(query); } - @Override - @RequestMapping(name="장애인과태료업무 단속자료압축파일 세외수입 전송", value=METHOD_URL.sendCrdn) - public ModelAndView sendCrdn(String... crdnIDs) { - return super.sendCrdn(crdnIDs); - } - - @Override @RequestMapping(name="장애인과태료업무 단속자료 조회", value=METHOD_URL.getCrackdownStatusInfo) public ModelAndView getCrackdownStatusInfo(CrdnQuery query) { diff --git a/src/main/java/cokr/xit/fims/task/web/EcaController.java b/src/main/java/cokr/xit/fims/task/web/EcaController.java index b3f14e41..6187327c 100644 --- a/src/main/java/cokr/xit/fims/task/web/EcaController.java +++ b/src/main/java/cokr/xit/fims/task/web/EcaController.java @@ -296,12 +296,6 @@ public class EcaController { return super.countCrdn(query); } - @Override - @RequestMapping(name="전기차과태료업무 단속자료압축파일 세외수입 전송", value=METHOD_URL.sendCrdn) - public ModelAndView sendCrdn(String... crdnIDs) { - return super.sendCrdn(crdnIDs); - } - @Override @RequestMapping(name="전기차과태료업무 단속자료 조회", value=METHOD_URL.getCrackdownStatusInfo) public ModelAndView getCrackdownStatusInfo(CrdnQuery query) { diff --git a/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml b/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml index 02dc25a0..58432722 100644 --- a/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cmmn/stng-mapper.xml @@ -22,6 +22,7 @@ SELECT USER_ID