diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMngMapper.java b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMngMapper.java index b4e1d259..bfb4da5a 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMngMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMngMapper.java @@ -37,7 +37,7 @@ public interface ProgramMngMapper { * @author: 박민규 * @date: 2020. 3. 26. */ - ProgramMngVO selectProgram(final ProgramMngVO vo); + ProgramMngVO selectProgram(final String progrmFileName); int updateProgram(final ProgramMngVO vo); @@ -46,6 +46,5 @@ public interface ProgramMngMapper { *
메소드 설명: 프로그램 정보 삭제
* @date: 2020. 3. 27. */ - int deleteProgram(final ProgramMngVO vo); - + int deleteProgram(final String programFileNm); } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMngService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMngService.java index 5147afad..bcdd018d 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMngService.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMngService.java @@ -20,7 +20,7 @@ import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; public interface ProgramMngService { /** - *
메소드 설명: 프로그램관리 목록 조회
+ *
메소드 설명: 프로그램 목록 조회
* @param map * @return List 요청처리 후 응답객체 * @author: 박민규 @@ -29,16 +29,16 @@ public interface ProgramMngService { List findPrograms(final Map paramMap, final RowBounds rowBounds); /** - *
메소드 설명: 프로그램관리 상세정보 조회
+ *
메소드 설명: 프로그램 상세정보 조회
* @param vo * @return XitProgramMngVO 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 3. 26. */ - ProgramMngVO findProgram(final ProgramMngVO vo); + ProgramMngVO findProgram(final String progrmFileNm); /** - *
메소드 설명: 프로그램관리 등록
+ *
메소드 설명: 프로그램 등록
* @param vo void 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 3. 26. @@ -46,7 +46,7 @@ public interface ProgramMngService { int addProgram(final ProgramMngVO vo); /** - *
메소드 설명: 프로그램관리 수정
+ *
메소드 설명: 프로그램 변경
* @param vo void 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 3. 26. @@ -54,19 +54,10 @@ public interface ProgramMngService { int modifyProgram(final ProgramMngVO vo); /** - *
메소드 설명: 프로그램관리 삭제
+ *
메소드 설명: 프로그램 삭제
* @param vo void 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 3. 26. */ - int removeProgram(final ProgramMngVO vo); - - /** - *
메소드 설명: 프로그램관리 다건 삭제
- * @param progrmFileNms void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 27. - */ - void removePrograms(final String progrmFileNms); - + int removeProgram(final String programFileNm); } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMngServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMngServiceImpl.java index 313e2301..991fc4f2 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMngServiceImpl.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMngServiceImpl.java @@ -30,8 +30,8 @@ public class ProgramMngServiceImpl implements ProgramMngService { } @Override - public ProgramMngVO findProgram(final ProgramMngVO vo) { - return programMngMapper.selectProgram(vo); + public ProgramMngVO findProgram(final String progrmFileNm) { + return programMngMapper.selectProgram(progrmFileNm); } @Override @@ -62,24 +62,8 @@ public class ProgramMngServiceImpl implements ProgramMngService { } @Override - public int removeProgram(final ProgramMngVO vo) { - return programMngMapper.deleteProgram(vo); + public int removeProgram(final String programFileNm) { + return programMngMapper.deleteProgram(programFileNm); } - - @Override - public void removePrograms(final String progrmFileNms) { - String[] delProgrmFileNm = progrmFileNms.split(","); - if (delProgrmFileNm == null || (delProgrmFileNm.length == 0)) { - throw BizRuntimeException.create(MessageKey.CMM_UPDATE_FAIL); - } - - String [] arrProgrmFileNm = progrmFileNms.split(","); - for (int i=0; i메소드 설명: 요청 페이지로 이동 한다. - * @param cmd - * @param tilesDef 타일즈 적용 Type(none: tiles 미적용) - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - @RequestMapping(value = "/program_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) - public String ProgramMng_page(@PathVariable final String cmd - , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef - , @ModelAttribute("progrmMngVO") ProgramMngVO vo - , ModelMap model) { - switch (cmd) { - case "input": //등록 페이지 - break; - case "edit": //수정 페이지 - case "view": //상세 페이지 - ProgramMngVO programMngVO = programMngService.findProgram(vo); - model.addAttribute("progrmMngVO", programMngVO); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - if(!"".equals(tilesDef)) - tilesDef = "."+tilesDef; - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngProgramMgt_"+cmd+tilesDef; - - } - - /** - *
메소드 설명: 요청 팝업 페이지 이동 한다.
- * @param cmd - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. + * 프로그램 삭제 + * @param progrmFileNm + * @return ModelAndView */ - @RequestMapping(value = "/program_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) - public String ProgramMng_page_popup(@PathVariable String cmd - , @ModelAttribute("searchVO") ProgramMngSearchVO searchVO - , @ModelAttribute("progrmMngVO") ProgramMngVO vo, ModelMap model) { - switch (cmd) { - case "FileNmSearch": //프로그램 파일명 조회 페이지 - // 내역 조회 - - searchVO.setPageUnit(PAGE_UNIT); - searchVO.setPageSize(PAGE_SIZE); - - /** 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 = programMngService.findListTotCnt(searchVO); - //paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - break; - case "input" : - break; - case "edit" : - ProgramMngVO xitProgramMngVO = programMngService.findProgram(vo); - model.addAttribute("progrmMngVO", xitProgramMngVO); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngProgramMgt_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); - } - - - - /** - *
메소드 설명: 프로그램관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 3. 25. - */ - @RequestMapping(value = {"/program_{cmd}_proc"}, method=RequestMethod.POST) - public void ProgramMng_cmd_proc(@PathVariable String cmd - ,@ModelAttribute("progrmMngVO") ProgramMngVO vo - ,@RequestParam(value="checkedProgrmFileNmForDel", required=false, defaultValue="") String checkedProgrmFileNmForDel - ,BindingResult bindingResult - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - String sLocationUrl = "forward:/framework/biz/mng/menu/programList.do"; - String message = null; - switch (cmd) { - case "insert": //등록 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("progrmMngVO", vo, bindingResult); - if (bindingResult.hasErrors()) { -// throw new RuntimeException(xitMessageSource.getMessage("fail.common.insert")); - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/menu/program_input.do"; - break; - } - if (vo.getProgrmDc() == null || vo.getProgrmDc().equals("")) { - vo.setProgrmDc(" "); - } - //처리 - programMngService.addProgram(vo); - message = xitMessageSource.getMessage("success.common.insert"); - break; - -// case "inserts": //다건 등록 -// break; - - case "update": //수정 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("progrmMngVO", vo, bindingResult); - if (bindingResult.hasErrors()) { -// throw new RuntimeException(xitMessageSource.getMessage("fail.common.update")); - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/menu/program_edit.do"; - break; - } - if (vo.getProgrmDc() == null || vo.getProgrmDc().equals("")) { - vo.setProgrmDc(" "); - } - //처리 - programMngService.modifyProgram(vo); - message = xitMessageSource.getMessage("success.common.update"); - break; - - case "delete": //삭제 - //처리 - try { - programMngService.removeProgram(vo); - message = xitMessageSource.getMessage("success.common.delete"); - break; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/menu/program_edit.do"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - sLocationUrl = "forward:/framework/biz/mng/menu/program_edit.do"; - } - break; - - // case "deletes": //다건 삭제 - // //처리 - // try { - // programMngService.removesProgram(checkedProgrmFileNmForDel); - // message = xitMessageSource.getMessage("success.common.delete"); - // } catch (RuntimeException e) { - // message = e.getMessage(); - // } catch (Exception e) { - // message = xitMessageSource.getMessage("fail.common.delete"); - // } - // break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 - // model.addAttribute("message", message); - // return sLocationUrl; - model.addAttribute("message", message); - - if (AjaxUtils.isAjaxRequest(request)) { //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - } else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } - } - - @PostMapping(value = "/updateProgram2") - public void updateProgram2(@ModelAttribute("progrmMngVO") ProgramMngVO vo - ,@RequestParam(value="checkedProgrmFileNmForDel", required=false, defaultValue="") String checkedProgrmFileNmForDel - ,BindingResult bindingResult - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - String sLocationUrl = "forward:/framework/biz/mng/menu/programList.do"; - String message = null; - - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); - // beanValidator.validate("progrmMngVO", vo, bindingResult); - if (bindingResult.hasErrors()) { - // throw new RuntimeException(xitMessageSource.getMessage("fail.common.update")); - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/menu/program_edit.do"; - }else { - if (vo.getProgrmDc() == null || vo.getProgrmDc().equals("")) { - vo.setProgrmDc(" "); - } - } - //처리 - programMngService.modifyProgram(vo); - message = xitMessageSource.getMessage("success.common.update"); - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 - // model.addAttribute("message", message); - // return sLocationUrl; - model.addAttribute("message", message); - - if (AjaxUtils.isAjaxRequest(request)) { //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - } else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } + @PostMapping(value = "/removeProgram") + public ModelAndView removeProgram( + final String progrmFileNm + ) { + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + programMngService.removeProgram(progrmFileNm); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS); + return mav; } - - - } 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 11621bf8..0c3eade9 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 @@ -9,11 +9,12 @@ 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_DELETE_SUCCESS = "success.common.delete"; 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"; + public static final String CMM_DELETE_FAIL = "fail.common.delete"; public static final String WARN_SESSION_END = "warn.session.end";//세션이 종료 되었습니다.. } diff --git a/src/main/resources/spring/service/context-common.xml b/src/main/resources/spring/service/context-common.xml index a871e5f6..3dffe8a3 100644 --- a/src/main/resources/spring/service/context-common.xml +++ b/src/main/resources/spring/service/context-common.xml @@ -34,11 +34,11 @@ - + 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 e9930653..cabf6d95 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 @@ -20,7 +20,7 @@ - /* program-mysql-mapper|selectProgram-프로그램 정보 조회|julim */ SELECT progrm_file_nm , progrm_stre_cours @@ -45,8 +45,8 @@ , progrm_dc , url ) VALUES ( - #{progrm_file_nm} - , #{progrmStreCours} + #{progrmFileNm} + , #{progrmStrePath} , #{progrmKoreanNm} , #{progrmDc} , #{URL} @@ -62,19 +62,11 @@ , url = #{URL} WHERE progrm_file_nm = #{progrmFileNm} + - /* program-mysql-mapper|deleteProgram-프로그램 정보 변경|julim */ + /* program-mysql-mapper|deleteProgram-프로그램 정보 삭제|julim */ DELETE FROM xit_progrm_list WHERE progrm_file_nm = #{progrmFileNm} - - - - - /** XitMenuListMngMapper.deleteAllProgrmDtls */ - /** 프로그램변경내역 정보 전체데이터 삭제 */ - - DELETE FROM LETTHPROGRMCHANGEDTLS - diff --git a/src/main/resources/validator/framework/mng/menu/XitProgramMng.xml b/src/main/resources/validator/framework/mng/menu/XitProgramMng.xml index 7b1b0c35..c9a61586 100644 --- a/src/main/resources/validator/framework/mng/menu/XitProgramMng.xml +++ b/src/main/resources/validator/framework/mng/menu/XitProgramMng.xml @@ -5,6 +5,7 @@
+ @@ -12,7 +13,8 @@ maxlength 50 - + + diff --git a/src/main/webapp/WEB-INF/jsp/framework/XitIncludeBase.jsp b/src/main/webapp/WEB-INF/jsp/framework/XitIncludeBase.jsp index af60a428..3164b867 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/XitIncludeBase.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/XitIncludeBase.jsp @@ -134,14 +134,15 @@ alert(msg); }else if(settings.dataType=='json'){ console.log('====XitIncludeBase::ajaxError====json text data ==>>', jqxhr.responseText); - const jsonData = JSON.parse(jqxhr.responseText); - console.log('====XitIncludeBase::ajaxError====json data ==>>', jsonData); - if(jsonData){ - jsonData.message ? alert(jsonData.message): ''; - }else{ - alert(jqxhr.responseText); + if(jqxhr.responseText) { + const jsonData = JSON.parse(jqxhr.responseText); + console.log('====XitIncludeBase::ajaxError====json data ==>>', jsonData); + if (jsonData) { + jsonData.message ? alert(jsonData.message) : ''; + } else { + alert(jqxhr.responseText); + } } - }else{ console.log('====XitIncludeBase::ajaxError====') alert(jqxhr.responseText); diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtFrom.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtFrom.jsp index fcd496ce..065a490c 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtFrom.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtFrom.jsp @@ -50,7 +50,7 @@ @@ -63,7 +63,6 @@ + +<%--@elvariable id="progrmMngVO" type=""--%> + + + + + + + + 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 deleted file mode 100644 index 25e0873f..00000000 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_edit.jsp +++ /dev/null @@ -1,185 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> - - - - -<%--@elvariable id="progrmMngVO" type=""--%> - - - - - - - - diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_input.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_input.jsp deleted file mode 100644 index 81fbbaca..00000000 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgt_input.jsp +++ /dev/null @@ -1,215 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> -<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> - - - - - - - - - - - - - -