diff --git a/src/main/java/kr/xit/framework/biz/mng/web/ProgramMngController.java b/src/main/java/kr/xit/framework/biz/mng/web/ProgramMngController.java index 4d971c90..f3b963fd 100644 --- a/src/main/java/kr/xit/framework/biz/mng/web/ProgramMngController.java +++ b/src/main/java/kr/xit/framework/biz/mng/web/ProgramMngController.java @@ -74,28 +74,6 @@ public class ProgramMngController { */ @RequestMapping(value = "/mngProgramMgtFrom", method={RequestMethod.GET, RequestMethod.POST}) public void mngProgramMgtFrom() { - // 내역 조회 - - //searchVO.setPageUnit(Integer.parseInt(XitProperties.getProperty("Globals.Xit.Pagination.PageUnit"))); - //searchVO.setPageSize(Integer.parseInt(XitProperties.getProperty("Globals.Xit.Pagination.PageSize"))); - - /** pageing */ - //PaginationInfo paginationInfo = new PaginationInfo(); - //paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); - //paginationInfo.setRecordCountPerPage(searchVO.getPageUnit()); - //paginationInfo.setPageSize(searchVO.getPageSize()); - - //searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - //searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - //searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - //model.addAttribute("list_progrmmanage", xitProgramMngService.findList(searchVO)); - //model.addAttribute("searchVO", searchVO); - - //int totCnt = xitProgramMngService.findListTotCnt(searchVO); - //paginationInfo.setTotalRecordCount(totCnt); - //model.addAttribute("paginationInfo", paginationInfo); - } /* @@ -124,10 +102,34 @@ public class ProgramMngController { return ResultResponse.of(programMngService.findPrograms(paramMap, MybatisUtils.getPagingInfo(paramMap))); } - @PostMapping(value = "/updateProgram") + @PostMapping(value = "/addProgram") + public ModelAndView addProgram( + @ModelAttribute("progrmMngVO") final ProgramMngVO vo + , final BindingResult bindingResult + ) { + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + //유효성 확인 + //2020.11.24. 주석처리 + beanValidator.validate(vo, bindingResult); + // beanValidator.validate("progrmMngVO", vo, bindingResult); + if (bindingResult.hasErrors()) { + throw BizRuntimeException.create(MessageKey.CMM_INSERT_FAIL); + + }else { + if (vo.getProgrmDc() == null || vo.getProgrmDc().equals("")) { + vo.setProgrmDc(" "); + } + } + programMngService.addProgram(vo); + + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); + return mav; + } + + @PostMapping(value = "/modifyProgram") public ModelAndView modifyProgram( @ModelAttribute("progrmMngVO") final ProgramMngVO vo - , @RequestParam(value="checkedProgrmFileNmForDel", required=false, defaultValue="") String checkedProgrmFileNmForDel , final BindingResult bindingResult ) { ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); @@ -151,7 +153,6 @@ public class ProgramMngController { } - /** *
메소드 설명: 요청 페이지로 이동 한다.
* @param cmd diff --git a/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java b/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java index 384d402c..11621bf8 100644 --- a/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java +++ b/src/main/java/kr/xit/framework/support/util/constants/MessageKey.java @@ -8,8 +8,10 @@ public abstract class MessageKey { public static final String CMM_SUCCESS = "success.request.msg";//정상적으로 수행되었습니다. (재정의 필요) public static final String CMM_UPDATE_SUCCESS = "success.common.update"; + public static final String CMM_INSERT_SUCCESS = "success.common.insert"; public static final String CMM_FAIL = "fail.request.msg";//요청처리를 실패하였습니다.. + public static final String CMM_INSERT_FAIL = "fail.common.insert"; public static final String CMM_UPDATE_FAIL = "fail.common.update"; public static final String CMM_REMOVE_FAIL = "fail.common.delete"; diff --git a/src/main/resources/sqlmapper/framework/mng/menu/program-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/menu/program-mysql-mapper.xml index c69b56b9..55ac4410 100644 --- a/src/main/resources/sqlmapper/framework/mng/menu/program-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/menu/program-mysql-mapper.xml @@ -62,12 +62,11 @@ , url = #{URL} WHERE progrm_file_nm = #{progrmFileNm} - - /** removeXitProgrmList */ - /** 프로그램목록 삭제 */ - DELETE FROM XIT_PROGRM_LIST - WHERE 1=1 - AND PROGRM_FILE_NM = #{progrm_file_nm} + + /* program-mysql-mapper|deleteProgram-프로그램 정보 변경|julim */ + DELETE + FROM xit_progrm_list + WHERE progrm_file_nm = #{progrmFileNm} diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_edit.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_edit.jsp index 8534c2e7..922b79a9 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_edit.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_edit.jsp @@ -143,7 +143,7 @@ var param = $(varFrom).serialize(); $.ajax({ <%--url : "framework/biz/mng/menu/program_update_proc.do",--%> - url : "framework/biz/mng/menu/updateProgram.do", + url : "framework/biz/mng/menu/modifyProgram.do", data : param, type : "post", dataType : "json",