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