/** * 공통분류코드를 등록한다. * * @param loginVO * @param cmmnClCode * @param bindingResult * @return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeRegist" * @throws Exception */ @RequestMapping(value = "/sym/ccm/ccc/EgovCcmCmmnClCodeRegist.do") public String insertCmmnClCode( @ModelAttribute("loginVO") LoginVO loginVO, @ModelAttribute("cmmnClCode") CmmnClCode cmmnClCode, BindingResult bindingResult, ModelMap model) throws Exception { if (cmmnClCode.getClCode() == null || cmmnClCode.getClCode().equals("")) { return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeRegist"; } beanValidator.validate(cmmnClCode, bindingResult); if (bindingResult.hasErrors()) { return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeRegist"; } if (cmmnClCode.getClCode() != null) { CmmnClCode vo = cmmnClCodeManageService.selectCmmnClCodeDetail(cmmnClCode); if (vo != null) { model.addAttribute("message", "이미 등록된 분류코드가 존재합니다."); return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeRegist"; } } cmmnClCode.setFrstRegisterId(loginVO.getUniqId()); cmmnClCodeManageService.insertCmmnClCode(cmmnClCode); return "forward:/sym/ccm/ccc/EgovCcmCmmnClCodeList.do"; }
/** * 공통분류코드를 수정한다. * * @param loginVO * @param cmmnClCode * @param bindingResult * @param commandMap * @param model * @return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeModify" * @throws Exception */ @RequestMapping(value = "/sym/ccm/ccc/EgovCcmCmmnClCodeModify.do") public String updateCmmnClCode( @ModelAttribute("loginVO") LoginVO loginVO, @ModelAttribute("administCode") CmmnClCode cmmnClCode, BindingResult bindingResult, @RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception { String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd"); if (sCmd.equals("")) { CmmnClCode vo = cmmnClCodeManageService.selectCmmnClCodeDetail(cmmnClCode); model.addAttribute("cmmnClCode", vo); return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeModify"; } else if (sCmd.equals("Modify")) { beanValidator.validate(cmmnClCode, bindingResult); if (bindingResult.hasErrors()) { CmmnClCode vo = cmmnClCodeManageService.selectCmmnClCodeDetail(cmmnClCode); model.addAttribute("cmmnClCode", vo); return "egovframework/com/sym/ccm/ccc/EgovCcmCmmnClCodeModify"; } cmmnClCode.setLastUpdusrId(loginVO.getUniqId()); cmmnClCodeManageService.updateCmmnClCode(cmmnClCode); return "forward:/sym/ccm/ccc/EgovCcmCmmnClCodeList.do"; } else { return "forward:/sym/ccm/ccc/EgovCcmCmmnClCodeList.do"; } }