reactor: rt0200

main
Jonguk. Lim 2 years ago
parent c7440414ce
commit 1cdcb1b906

@ -1,15 +1,15 @@
package kr.xit.fims.biz.rt.mapper; package kr.xit.fims.biz.rt.mapper;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.model.Rt0200VO; import kr.xit.fims.biz.rt.model.Rt0200VO;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
@Mapper @Mapper
//public interface Rt0200Mapper extends FimsMapperStrategy<Rt0200VO, Rt0200SearchVO> {
public interface Rt0200Mapper { public interface Rt0200Mapper {
// 목록조회 // 목록조회
@ -17,6 +17,7 @@ public interface Rt0200Mapper {
// 목록조회 (페이징) // 목록조회 (페이징)
List<Map<String,Object>> selectRt0200List(Map<String, Object> map, RowBounds rowBounds); List<Map<String,Object>> selectRt0200List(Map<String, Object> map, RowBounds rowBounds);
List<Map<String,Object>> selectRt0200List(Rt0200SearchVO vo, RowBounds rowBounds);
List<Rt0200VO> findSndngProcessSttus(); List<Rt0200VO> findSndngProcessSttus();

@ -1,6 +1,7 @@
package kr.xit.fims.biz.rt.service; package kr.xit.fims.biz.rt.service;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.model.Rt0200VO; import kr.xit.fims.biz.rt.model.Rt0200VO;
import java.util.List; import java.util.List;
@ -10,6 +11,7 @@ import org.apache.ibatis.session.RowBounds;
public interface Rt0200Service { public interface Rt0200Service {
public List<Map<String,Object>> findRt0200List(Map<String, Object> paramMap, RowBounds rowBounds); public List<Map<String,Object>> findRt0200List(Map<String, Object> paramMap, RowBounds rowBounds);
public List<Map<String,Object>> findRt0200List(Rt0200SearchVO vo, RowBounds rowBounds);
public List<Rt0200VO> findSndngProcessSttus(); public List<Rt0200VO> findSndngProcessSttus();
Rt0200VO findRt0200(String reglt_id); Rt0200VO findRt0200(String reglt_id);

@ -1,6 +1,7 @@
package kr.xit.fims.biz.rt.service.impl; package kr.xit.fims.biz.rt.service.impl;
import kr.xit.fims.biz.rt.mapper.Rt0200Mapper; import kr.xit.fims.biz.rt.mapper.Rt0200Mapper;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.model.Rt0200VO; import kr.xit.fims.biz.rt.model.Rt0200VO;
import kr.xit.fims.biz.rt.service.Rt0200Service; import kr.xit.fims.biz.rt.service.Rt0200Service;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -22,6 +23,11 @@ public class Rt0200ServiceImpl implements Rt0200Service {
return rt0200Mapper.selectRt0200List(paramMap, rowBounds); return rt0200Mapper.selectRt0200List(paramMap, rowBounds);
} }
@Override
public List<Map<String,Object>> findRt0200List(Rt0200SearchVO vo, RowBounds rowBounds) {
return rt0200Mapper.selectRt0200List(vo, rowBounds);
}
@Override @Override
public Rt0200VO findRt0200(String reglt_id) { public Rt0200VO findRt0200(String reglt_id) {
return rt0200Mapper.selectRt0200(reglt_id); return rt0200Mapper.selectRt0200(reglt_id);

@ -1,5 +1,6 @@
package kr.xit.fims.biz.rt.web; package kr.xit.fims.biz.rt.web;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.service.Rt0200Service; import kr.xit.fims.biz.rt.service.Rt0200Service;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.core.model.ResultResponse;
@ -9,6 +10,7 @@ import kr.xit.framework.support.mybatis.MybatisUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -51,8 +53,8 @@ public class Rt0200Controller {
* @author: * @author:
* @date: 2022. 09. 14. * @date: 2022. 09. 14.
*/ */
@GetMapping(value = "/rtRt0200Sel") @GetMapping(value = "/rt0200Sel")
public ModelAndView rtRt0200Sel(HttpServletRequest req, Model model){ public ModelAndView rt0200Sel(HttpServletRequest req, Model model){
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
mav.addObject("searchCodeList", rt0200Service.findSndngProcessSttus()); mav.addObject("searchCodeList", rt0200Service.findSndngProcessSttus());
return mav; return mav;
@ -71,39 +73,20 @@ public class Rt0200Controller {
*/ */
//@GetMapping(value = "finds") //@GetMapping(value = "finds")
//@GetMapping(value = "finds", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) //@GetMapping(value = "finds", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/findRt0200List", method = {RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "/findRt0200List")
public ModelAndView findRt0200List(@RequestParam Map<String,Object> paramMap) { public ModelAndView findRt0200List(@RequestParam Map<String,Object> paramMap) {
return ResultResponse.of(rt0200Service.findRt0200List(paramMap, MybatisUtils.getPagingInfo(paramMap))); return ResultResponse.of(rt0200Service.findRt0200List(paramMap, MybatisUtils.getPagingInfo(paramMap)));
} }
/*
@GetMapping(value = "/findRt0200List2", method = {RequestMethod.GET, RequestMethod.POST})
public ModelAndView findRt0200List2(@ModelAttribute Rt0200SearchVO vo) {
return ResultResponse.of(rt0200Service.findRt0200List(vo, MybatisUtils.getPagingInfo(vo)));
}
*/
@GetMapping(value = "/findRt0200") @GetMapping(value = "/findRt0200")
public ModelAndView findRt0200(final String reglt_id) { public ModelAndView findRt0200(final String reglt_id) {
return ResultResponse.of(rt0200Service.findRt0200(reglt_id)); return ResultResponse.of(rt0200Service.findRt0200(reglt_id));
} }
// /**
// * <pre>메소드 설명: 단건 자료 검색</pre>
// * @param req
// * @return String 요청처리 후 응답객체
// * @author: 최정민
// * @date: 2022. 9. 20.
// */
// @GetMapping(value = "detail")
// public String detail(HttpServletRequest req, Rt0200VO vo, Model model){
//
// String reglt_id = req.getParameter("selectedId");
// vo.setReglt_id(reglt_id);
//
// vo = rt0200Service.findView(vo);
//
// model.addAttribute("contents",vo);
//
// return FimsConst.JSP_BASE_PATH
// +"rt/rt0200/Rt0200"
// +"_"+new Object() {}.getClass().getEnclosingMethod().getName()
// +".fims-pop"; //메소드명
// }
} }

@ -4,14 +4,13 @@ import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -19,14 +18,11 @@ import kr.xit.framework.biz.mng.menu.model.ProgramMngVO;
import kr.xit.framework.biz.mng.menu.service.ProgramMngService; import kr.xit.framework.biz.mng.menu.service.ProgramMngService;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.core.validation.XitBeanValidator;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.mybatis.MybatisUtils; import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.AjaxMessageMapRenderer; import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.ValidationError; import kr.xit.framework.support.util.ValidationError;
import kr.xit.framework.support.util.constants.MessageKey; import kr.xit.framework.support.util.constants.MessageKey;
import kr.xit.framework.support.util.model.FieldErrorDtl;
/** /**
* *
@ -42,11 +38,8 @@ import kr.xit.framework.support.util.model.FieldErrorDtl;
//@RequestMapping(value = "/_mng_/menu/program/") //@RequestMapping(value = "/_mng_/menu/program/")
@RequestMapping(value = "/framework/biz/mng/menu") @RequestMapping(value = "/framework/biz/mng/menu")
public class ProgramMngController { public class ProgramMngController {
@Resource @Resource
private ProgramMngService programMngService; private ProgramMngService programMngService;
@Autowired
private XitBeanValidator beanValidator;
@Value("#{prop['Globals.Xit.Pagination.PageUnit']}") @Value("#{prop['Globals.Xit.Pagination.PageUnit']}")
private int PAGE_UNIT; private int PAGE_UNIT;
@ -59,7 +52,7 @@ public class ProgramMngController {
* @author: * @author:
* @date: 2020. 3. 25. * @date: 2020. 3. 25.
*/ */
@RequestMapping(value = "/mngProgramMgtForm", method={RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "/mngProgramMgtForm")
public void mngProgramMgtForm() { public void mngProgramMgtForm() {
} }
@ -68,7 +61,7 @@ public class ProgramMngController {
* @param progrmFileNm : * @param progrmFileNm :
* @return ModelAndView * @return ModelAndView
*/ */
@RequestMapping(value = "/mngProgramMgtPopup", method={RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "/mngProgramMgtPopup")
public ModelAndView mngProgramMgtPopup(@RequestParam(required = false) String progrmFileNm) { public ModelAndView mngProgramMgtPopup(@RequestParam(required = false) String progrmFileNm) {
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
@ -90,7 +83,7 @@ public class ProgramMngController {
*/ */
/*@PostMapping(value = "ProgramMng_list.ajax")*/ /*@PostMapping(value = "ProgramMng_list.ajax")*/
@RequestMapping(value = "/programList", method = {RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "/programList")
public ModelAndView findPrograms(@RequestParam final Map<String,Object> paramMap) { public ModelAndView findPrograms(@RequestParam final Map<String,Object> paramMap) {
return ResultResponse.of(programMngService.findPrograms(paramMap, MybatisUtils.getPagingInfo(paramMap))); return ResultResponse.of(programMngService.findPrograms(paramMap, MybatisUtils.getPagingInfo(paramMap)));
@ -110,11 +103,8 @@ public class ProgramMngController {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//유효성 확인 //유효성 확인
beanValidator.validate("progrmMngVO", programMngVO, bindingResult); ValidationError.of("progrmMngVO", programMngVO, bindingResult);
if (bindingResult.hasErrors()) {
FieldErrorDtl fieldErrorDtl = ValidationError.errorList(bindingResult.getFieldErrors()).get(0);
throw BizRuntimeException.create(fieldErrorDtl.getCode(), fieldErrorDtl.getArguments());
}
programMngService.addProgram(programMngVO); programMngService.addProgram(programMngVO);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
@ -123,25 +113,21 @@ public class ProgramMngController {
/** /**
* *
* @param progrmMngVO * @param programMngVO
* @param bindingResult * @param bindingResult
* @return ModelAndView * @return ModelAndView
*/ */
@PostMapping(value = "/modifyProgram") @PostMapping(value = "/modifyProgram")
public ModelAndView modifyProgram( public ModelAndView modifyProgram(
@ModelAttribute final ProgramMngVO progrmMngVO @ModelAttribute final ProgramMngVO programMngVO
, final BindingResult bindingResult , final BindingResult bindingResult
) { ) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//유효성 확인 //유효성 확인
beanValidator.validate(progrmMngVO, bindingResult); ValidationError.of("progrmMngVO", programMngVO, bindingResult);
// beanValidator.validate("progrmMngVO", vo, bindingResult);
if (bindingResult.hasErrors()) { programMngService.modifyProgram(programMngVO);
FieldErrorDtl fieldErrorDtl = ValidationError.errorList(bindingResult.getFieldErrors()).get(0);
throw BizRuntimeException.create(fieldErrorDtl.getCode(), fieldErrorDtl.getArguments());
}
programMngService.modifyProgram(progrmMngVO);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav; return mav;

@ -2,9 +2,9 @@ package kr.xit.framework.support.util;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
import org.springframework.context.support.MessageSourceAccessor; import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.validation.Validator;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.validation.XitBeanValidator;
/** /**
* . * .
@ -12,8 +12,8 @@ import kr.xit.framework.core.message.XitMessageSource;
*/ */
public class JBeanRegistry { public class JBeanRegistry {
public static final Validator getValidator() { public static final XitBeanValidator getValidator() {
return (Validator)SpringUtils.getBean(Validator.class); return (XitBeanValidator)SpringUtils.getBean(XitBeanValidator.class);
} }
/** /**

@ -3,9 +3,11 @@ package kr.xit.framework.support.util;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.validation.Errors; import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError; import org.springframework.validation.FieldError;
import kr.xit.framework.core.validation.XitBeanValidator;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.model.FieldErrorDtl; import kr.xit.framework.support.util.model.FieldErrorDtl;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -15,7 +17,7 @@ import lombok.Setter;
@Setter @Setter
@AllArgsConstructor @AllArgsConstructor
public class ValidationError { public class ValidationError {
private List<FieldErrorDtl> errors; private final List<FieldErrorDtl> errors;
public static ValidationError create(List<FieldError> errors){ public static ValidationError create(List<FieldError> errors){
List<FieldErrorDtl> dtls = errors.stream() List<FieldErrorDtl> dtls = errors.stream()
@ -30,4 +32,14 @@ public class ValidationError {
.map(FieldErrorDtl::create) .map(FieldErrorDtl::create)
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
public static void of(String voName, Object o, BindingResult bindingResult){
XitBeanValidator validator = JBeanRegistry.getValidator();
validator.validate(voName, o, bindingResult);
if (bindingResult.hasErrors()) {
FieldErrorDtl fieldErrorDtl = ValidationError.errorList(bindingResult.getFieldErrors()).get(0);
throw BizRuntimeException.create(fieldErrorDtl.getCode(), fieldErrorDtl.getArguments());
}
}
} }

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.fims.biz.rt.mapper.Rt0200Mapper"> <mapper namespace="kr.xit.fims.biz.rt.mapper.Rt0200Mapper">
<select id="selectRt0200List" parameterType="map" resultType="caseMap"> <select id="selectRt0200List" parameterType="map" resultType="caseMap">
/* Rt0200-mysql-mapper|selectRt0200List-단속자료현황 조회|julim */ /* rt0200-mysql-mapper|selectRt0200List-단속자료현황 조회|julim */
SELECT TR.vhcle_no SELECT TR.vhcle_no
, TON.owner_nm , TON.owner_nm
, TR.violt_place , TR.violt_place
@ -68,7 +69,7 @@
</select> </select>
<select id="selectRt0200" parameterType="string" resultType="kr.xit.fims.biz.rt.model.Rt0200VO"> <select id="selectRt0200" parameterType="string" resultType="kr.xit.fims.biz.rt.model.Rt0200VO">
/* Rt0200-mysql-mapper|selectRt0200-단속자료정보조회|julim */ /* rt0200-mysql-mapper|selectRt0200-단속자료정보조회|julim */
SELECT TR.* SELECT TR.*
FROM tb_reglt TR FROM tb_reglt TR
INNER JOIN tb_owner TON INNER JOIN tb_owner TON
@ -82,6 +83,14 @@
<select id="findSndngProcessSttus" resultType="kr.xit.fims.biz.rt.model.Rt0200VO"> <select id="findSndngProcessSttus" resultType="kr.xit.fims.biz.rt.model.Rt0200VO">
SELECT CODE AS SEARCH_CODE SELECT CODE AS SEARCH_CODE
, CODE_NM AS SEARCH_CODE_NM , CODE_NM AS SEARCH_CODE_NM
Loading…
Cancel
Save