diff --git a/src/main/java/cokr/xit/fims/crdn/dao/CrdnMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/CrdnMapper.java index 6030634c..e7d87bc0 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnMapper.java @@ -23,5 +23,14 @@ public interface CrdnMapper extends AbstractMapper { List getCrdnList(CrdnQuery req); List getCrdns(CrdnQuery req); + + /**지정하는 단속 아이디의 단속 정보를 반환한다. + * @param crdnId 단속 아이디 + * @return 단속 정보 + */ + default DataObject getCrdnInfo(String crdnId) { + List list = getCrdnList(new CrdnQuery().setCrdnId(crdnId)); + return !list.isEmpty() ? list.get(0) : null; + } } diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnQuery.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnQuery.java index 95e5a65c..a0f1f208 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnQuery.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnQuery.java @@ -6,8 +6,18 @@ public class CrdnQuery extends QueryRequest { private static final long serialVersionUID = 1L; + private String crdnId; private String schVhrno; + public String getCrdnId() { + return ifEmpty(crdnId, () -> null); + } + + public T setCrdnId(String crdnId) { + this.crdnId = crdnId; + return self(); + } + public String getSchVhrno() { return ifEmpty(schVhrno, () -> null); } @@ -16,5 +26,7 @@ public class CrdnQuery extends QueryRequest { this.schVhrno = schVhrno; return self(); } - + + + } 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 bd1d3b5e..2ff77734 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -20,5 +20,11 @@ public interface CrdnService { * @return 단속자료 목록 */ List getCrdnList(CrdnQuery req); + + /**지정하는 단속아이디의 단속 정보를 반환한다. + * @param crdnId 단속 아이디 + * @return 단속 정보 + */ + DataObject getCrdnInfo(String crdnId); } 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 4e5b8997..14de857f 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 @@ -29,4 +29,12 @@ public class CrdnBean extends AbstractComponent { public List getCrdnList(CrdnQuery req) { return crdnMapper.getCrdnList(req.setOrderBy("CRDN_ID")); } + + /**지정하는 단속아이디의 단속 정보를 반환한다. + * @param crdnId 단속 아이디 + * @return 단속 정보 + */ + public DataObject getCrdnInfo(String crdnId) { + return crdnMapper.getCrdnInfo(crdnId); + } } 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 efe8b0ce..1a7aca17 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 @@ -26,5 +26,10 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService public List getCrdnList(CrdnQuery req) { return crdnBean.getCrdnList(req); } - + + @Override + public DataObject getCrdnInfo(String crdnId) { + return crdnBean.getCrdnInfo(crdnId); + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/web/AbstractCrdnController.java b/src/main/java/cokr/xit/fims/crdn/web/AbstractCrdnController.java index 6f37c08a..76c5db0e 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/AbstractCrdnController.java +++ b/src/main/java/cokr/xit/fims/crdn/web/AbstractCrdnController.java @@ -32,4 +32,19 @@ public class AbstractCrdnController extends AbstractController { "crdn" ); } + + /**지정하는 단속아이디의 단속 정보를 반환한다. + * @param crdnId 단속 아이디 + * @return fims/crdn/initData-info + *
 {
+	 *     "crdnInfo": {...}
+	 * }
+ */ + public ModelAndView getCrdnInfo(String crdnId) { + ModelAndView mav = new ModelAndView("fims/crdn/initData-info"); + if (!isEmpty(crdnId)) { + mav.addObject("crdnInfo", crdnService.getCrdnInfo(crdnId)); + } + return mav; + } } diff --git a/src/main/java/cokr/xit/fims/crdn/web/CrdnController.java b/src/main/java/cokr/xit/fims/crdn/web/CrdnController.java index aab830d6..a6f25798 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/CrdnController.java +++ b/src/main/java/cokr/xit/fims/crdn/web/CrdnController.java @@ -1,5 +1,8 @@ package cokr.xit.fims.crdn.web; +import java.util.List; +import java.util.Map; + import javax.annotation.Resource; import org.springframework.stereotype.Controller; @@ -7,6 +10,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.base.code.CommonCode; +import cokr.xit.base.code.service.CodeService; import cokr.xit.fims.crdn.service.CrdnQuery; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.foundation.web.AbstractController; @@ -18,6 +23,9 @@ import cokr.xit.foundation.web.AbstractController; @Controller @RequestMapping(name="단속관리", value="/crdn") public class CrdnController extends AbstractCrdnController { + + @Resource(name = "codeService") + private CodeService codeService; /** 단속 초기자료 관리 메인화면을 연다. * @return fims/crdn/initData-main @@ -27,9 +35,24 @@ public class CrdnController extends AbstractCrdnController { ModelAndView mav = new ModelAndView(); mav.setViewName("fims/crdn/initData-main"); mav.addObject("pageSuffix","initData-main"); + setCommonCodes(mav); return mav; } + private void setCommonCodes(ModelAndView mav) { + Map> byGroups = codeService.getCodesOf( + "FIM001" + , "FIM002" + ); + if ("jsonView".equals(mav.getViewName())) { + mav.addAllObjects(byGroups); + } else { + byGroups.forEach((k, v) -> { + mav.addObject(k, toJson(v)); + }); + } + } + @RequestMapping(name="주정차과태료업무 단속자료 목록", value="/PVS/list.do") public ModelAndView getPvsCrdnList(CrdnQuery req) { return getCrdnList(req); @@ -46,5 +69,21 @@ public class CrdnController extends AbstractCrdnController { public ModelAndView getEcaCrdnList(CrdnQuery req) { return getCrdnList(req); } - + + @RequestMapping(name="주정차과태료업무 단속자료 정보", value="/PVS/info.do") + public ModelAndView getPvsCrdnInfo(String crdnId) { + return getCrdnInfo(crdnId); + } + @RequestMapping(name="전용차로과태료업무 단속자료 정보", value="/BPV/info.do") + public ModelAndView getBpvCrdnInfo(String crdnId) { + return getCrdnInfo(crdnId); + } + @RequestMapping(name="장애인과태료업무 단속자료 정보", value="/DPV/info.do") + public ModelAndView getDpvCrdnInfo(String crdnId) { + return getCrdnInfo(crdnId); + } + @RequestMapping(name="전기차과태료업무 단속자료 정보", value="/ECA/info.do") + public ModelAndView getEcaCrdnInfo(String crdnId) { + return getCrdnInfo(crdnId); + } } diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-mapper.xml index b7b03d9f..43fceaf0 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-mapper.xml @@ -85,6 +85,7 @@ FROM TB_CRDN A WHERE DEL_YN = 'N' AND A.${by} LIKE CONCAT('%', #{term}, '%') + AND A.CRDN_ID = #{crdnId} AND A.VHRNO LIKE CONCAT('%', #{schVhrno}, '%')