diff --git a/src/main/java/kr/xit/framework/biz/mng/code/mapper/IZipCodeMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/code/mapper/IZipCodeMgtMapper.java new file mode 100644 index 00000000..37797b96 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/mapper/IZipCodeMgtMapper.java @@ -0,0 +1,30 @@ +package kr.xit.framework.biz.mng.code.mapper; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import egovframework.rte.psl.dataaccess.mapper.Mapper; +import kr.xit.framework.biz.mng.code.model.XitZipCodeMngVO; + +/** + * + * @업무그룹명: 우편번호관리 Mapper + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:07 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +@SuppressWarnings("MybatisXMapperMethodInspection") +@Mapper +public interface IZipCodeMgtMapper { + + List selectZips(Map paraMap, RowBounds rowBounds); + XitZipCodeMngVO selectZip(T t); + int insertZip(final XitZipCodeMngVO vo); + int updateZip(final XitZipCodeMngVO vo); + int deleteZip(final XitZipCodeMngVO vo); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/code/model/XitZipCodeMngVO.java b/src/main/java/kr/xit/framework/biz/mng/code/model/XitZipCodeMngVO.java index a6bb3012..9442f067 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/model/XitZipCodeMngVO.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/model/XitZipCodeMngVO.java @@ -1,18 +1,21 @@ package kr.xit.framework.biz.mng.code.model; -import kr.xit.framework.core.model.BaseVO; - -/** - * - * @업무그룹명: 우편번호관리 VO - * @설명: - * @최초작성일: 2020. 4. 16. 오전 9:40:44 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitZipCodeMngVO extends BaseVO { +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +@Builder +@ToString +public class XitZipCodeMngVO { /** * serialVersionUID @@ -22,190 +25,45 @@ public class XitZipCodeMngVO extends BaseVO { /* * 우편번호 */ - private String zip = ""; + private String zip; /* * 일련번호 */ - private int sn = 0; + private int sn; /* * 시도명 */ - private String ctprvnNm = ""; + private String ctprvnNm; /* * 시군구명 */ - private String signguNm = ""; + private String signguNm; /* * 읍면동명 */ - private String emdNm = ""; + private String emdNm; /* * 리건물명 */ - private String liBuldNm = ""; + private String liBuldNm; /* * 번지동호 */ - private String lnbrDongHo = ""; + private String lnbrDongHo; /* * 최초등록자ID */ - private String frstRegisterId = ""; + private String frstRegisterId; /* * 최종수정자ID */ - private String lastUpdusrId = ""; - - /** - * zip attribute 를 리턴한다. - * @return String - */ - public String getZip() { - return zip; - } - - /** - * zip attribute 값을 설정한다. - * @param zip String - */ - public void setZip(String zip) { - this.zip = zip; - } - - /** - * sn attribute 를 리턴한다. - * @return int - */ - public int getSn() { - return sn; - } - - /** - * sn attribute 값을 설정한다. - * @param sn int - */ - public void setSn(int sn) { - this.sn = sn; - } - - /** - * ctprvnNm attribute 를 리턴한다. - * @return String - */ - public String getCtprvnNm() { - return ctprvnNm; - } - - /** - * ctprvnNm attribute 값을 설정한다. - * @param ctprvnNm String - */ - public void setCtprvnNm(String ctprvnNm) { - this.ctprvnNm = ctprvnNm; - } - - /** - * signguNm attribute 를 리턴한다. - * @return String - */ - public String getSignguNm() { - return signguNm; - } - - /** - * signguNm attribute 값을 설정한다. - * @param signguNm String - */ - public void setSignguNm(String signguNm) { - this.signguNm = signguNm; - } - - /** - * emdNm attribute 를 리턴한다. - * @return String - */ - public String getEmdNm() { - return emdNm; - } - - /** - * emdNm attribute 값을 설정한다. - * @param emdNm String - */ - public void setEmdNm(String emdNm) { - this.emdNm = emdNm; - } - - /** - * liBuldNm attribute 를 리턴한다. - * @return String - */ - public String getLiBuldNm() { - return liBuldNm; - } - - /** - * liBuldNm attribute 값을 설정한다. - * @param liBuldNm String - */ - public void setLiBuldNm(String liBuldNm) { - this.liBuldNm = liBuldNm; - } - - /** - * lnbrDongHo attribute 를 리턴한다. - * @return String - */ - public String getLnbrDongHo() { - return lnbrDongHo; - } - - /** - * lnbrDongHo attribute 값을 설정한다. - * @param lnbrDongHo String - */ - public void setLnbrDongHo(String lnbrDongHo) { - this.lnbrDongHo = lnbrDongHo; - } - - /** - * frstRegisterId attribute 를 리턴한다. - * @return String - */ - public String getFrstRegisterId() { - return frstRegisterId; - } - - /** - * frstRegisterId attribute 값을 설정한다. - * @param frstRegisterId String - */ - public void setFrstRegisterId(String frstRegisterId) { - this.frstRegisterId = frstRegisterId; - } - - /** - * lastUpdusrId attribute 를 리턴한다. - * @return String - */ - public String getLastUpdusrId() { - return lastUpdusrId; - } - - /** - * lastUpdusrId attribute 값을 설정한다. - * @param lastUpdusrId String - */ - public void setLastUpdusrId(String lastUpdusrId) { - this.lastUpdusrId = lastUpdusrId; - } - + private String lastUpdusrId; } diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/IZipCodeMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/IZipCodeMgtService.java new file mode 100644 index 00000000..3322d5a3 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/IZipCodeMgtService.java @@ -0,0 +1,87 @@ +package kr.xit.framework.biz.mng.code.service; + +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.code.model.XitZipCodeMngVO; + +/** + * + * @업무그룹명: 우편번호관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IZipCodeMgtService { + + List findZipCodes(final Map paraMap, final RowBounds rowBounds); + XitZipCodeMngVO findZipCode(T t); + void addZipCode(final XitZipCodeMngVO vo); + void modifyZipCode(final XitZipCodeMngVO vo); + void removeZipcode(final XitZipCodeMngVO vo); + + + + + + + + + + + + + + + + + /** + *
메소드 설명: 우편번호관리 등록
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void addProc(XitZipCodeMngVO vo); + + /** + *
메소드 설명: 우편번호관리 일괄 등록
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void addsProc(InputStream fis) throws Exception; + + /** + *
메소드 설명: 우편번호관리 수정
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void modifyProc(XitZipCodeMngVO vo); + + /** + *
메소드 설명: 우편번호관리 삭제
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void removeProc(XitZipCodeMngVO vo); + + /** + *
메소드 설명: 우편번호관리 다건 삭제
+ * @param zips + * @param sns + * @return void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void removesProc(String zips, String sns); + + +} diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/ZipCodeMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/ZipCodeMgtService.java new file mode 100644 index 00000000..733d34e6 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/ZipCodeMgtService.java @@ -0,0 +1,151 @@ +package kr.xit.framework.biz.mng.code.service; + +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; + +import egovframework.rte.fdl.excel.EgovExcelService; +import egovframework.rte.fdl.idgnr.EgovIdGnrService; +import kr.xit.framework.biz.cmm.model.XitZipVO; +import kr.xit.framework.biz.cmm.service.XitFrameCrudService; +import kr.xit.framework.biz.mng.code.mapper.IZipCodeMgtMapper; +import kr.xit.framework.biz.mng.code.model.XitZipCodeMngVO; +import kr.xit.framework.core.message.XitMessageSource; + +@Service +public class ZipCodeMgtService implements IZipCodeMgtService { + + @Resource + private IZipCodeMgtMapper mapper; + @Resource + private XitFrameCrudService xitFrameCrudService; + @Resource(name="groupIdGnrService") + private EgovIdGnrService idgenService; + @Resource + private XitMessageSource xitMessageSource; + @Resource(name = "egovExcelService") + private EgovExcelService excelZipService; + + @Override + public List findZipCodes(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectZips(paraMap, rowBounds); + } + + @Override + public XitZipCodeMngVO findZipCode(T t) { + return mapper.selectZip(t); + } + + @Override + public void addZipCode(final XitZipCodeMngVO vo) { + mapper.insertZip(vo); + } + + @Override + public void modifyZipCode(final XitZipCodeMngVO vo) { + mapper.updateZip(vo); + } + + @Override + public void removeZipcode(final XitZipCodeMngVO vo) { + mapper.deleteZip(vo); + } + + + + @Override + public void addProc(XitZipCodeMngVO vo) { + /** + * 필수값 설정 + */ + XitZipVO zipVO = convertToCrudVO(vo); + zipVO.setFrst_register_id(vo.getFrstRegisterId()); + + + /** + * 처리 + */ + xitFrameCrudService.addXitZip(zipVO); + + } + + @Override + public void addsProc(InputStream fis) throws Exception { + /** + * 처리 + */ + xitFrameCrudService.removesXitZip(new XitZipVO()); + excelZipService.uploadExcel("kr.xit.framework.biz.cmm.dao.XitFrameCrudMapper.addXitZip", fis, 2, 5000); + } + + @Override + public void modifyProc(XitZipCodeMngVO vo) { + /** + * 필수값 설정 + */ + XitZipVO zipVO = convertToCrudVO(vo); + zipVO.setLast_updusr_id(vo.getLastUpdusrId()); + + + /** + * 처리 + */ + xitFrameCrudService.modifyXitZip(zipVO); + } + + @Override + public void removeProc(XitZipCodeMngVO vo) { + /** + * 필수값 설정 + */ + XitZipVO zipVO = convertToCrudVO(vo); + + + /** + * 처리 + */ + xitFrameCrudService.removeXitZip(zipVO); + } + + @Override + public void removesProc(String zips, String sns) { + /** + * 처리 + */ + String [] arrZip = zips.split(";"); + String [] arrSn = sns.split(";"); + for(int i=0; i + * 메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. + * + * + * @return XitZipVO 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + private XitZipVO convertToCrudVO(XitZipCodeMngVO vo) { + XitZipVO crudVO = new XitZipVO(); + crudVO.setZip (vo.getZip()); //우편번호 + crudVO.setSn (String.valueOf(vo.getSn())); //순번 + crudVO.setCtprvn_nm (vo.getCtprvnNm()); //시도 명 + crudVO.setSigngu_nm (vo.getSignguNm()); //시군구 명 + crudVO.setEmd_nm (vo.getEmdNm()); //읍면동 명 + crudVO.setLi_buld_nm (vo.getLiBuldNm()); //리 건물 명 + crudVO.setLnbr_dong_ho (vo.getLnbrDongHo()); //번지 동 호 + + return crudVO; + } +} diff --git a/src/main/java/kr/xit/framework/biz/mng/code/web/XitZipCodeMngController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/XitZipCodeMngController.java index b063aa58..e2d2b733 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/web/XitZipCodeMngController.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/XitZipCodeMngController.java @@ -54,7 +54,7 @@ import kr.xit.framework.support.util.AjaxUtils; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Controller -@RequestMapping("/framework/biz/mng/code/") +@RequestMapping("/framework/biz/mng/ccode/") public class XitZipCodeMngController { private static final Logger logger = LoggerFactory.getLogger(XitZipCodeMngController.class); diff --git a/src/main/java/kr/xit/framework/biz/mng/code/web/ZipCodeMgtController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/ZipCodeMgtController.java new file mode 100644 index 00000000..969a4c7c --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/ZipCodeMgtController.java @@ -0,0 +1,327 @@ +package kr.xit.framework.biz.mng.code.web; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.ui.ModelMap; +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.PathVariable; +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.bind.support.SessionStatus; +import org.springframework.web.servlet.ModelAndView; + +import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; +import kr.xit.framework.biz.cmm.model.XitLoginVO; +import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO; +import kr.xit.framework.biz.mng.code.model.XitZipCodeMngSearchVO; +import kr.xit.framework.biz.mng.code.model.XitZipCodeMngVO; +import kr.xit.framework.biz.mng.code.service.IZipCodeMgtService; +import kr.xit.framework.core.constants.FrameworkConstants; +import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; +import kr.xit.framework.core.message.XitMessageSource; +import kr.xit.framework.core.model.ResultResponse; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.core.utils.attachfile.XitAttachFileUtil; +import kr.xit.framework.core.utils.attachfile.XitAttachFileVO; +import kr.xit.framework.core.validation.XitBeanValidator; +import kr.xit.framework.support.mybatis.MybatisUtils; +import kr.xit.framework.support.util.AjaxMessageMapRenderer; +import kr.xit.framework.support.util.AjaxUtils; +import kr.xit.framework.support.util.Checks; +import kr.xit.framework.support.util.ValidationError; +import kr.xit.framework.support.util.constants.MessageKey; + +@Controller +@RequestMapping("/framework/biz/mng/code") +public class ZipCodeMgtController { + @Resource + private IZipCodeMgtService service; + @Autowired + private XitBeanValidator beanValidator; + @Resource(name = "xitMessageSource") + XitMessageSource xitMessageSource; + + + @RequestMapping(value = "/mngZipCodeMgtForm") + public void mngZipCodeMgtForm() { + } + + @RequestMapping(value = "/mngZipCodeMgtPopup") + public ModelAndView mngZipCodeMgtPopup(final XitZipCodeMngVO vo) { + ModelAndView mav = new ModelAndView(); + + mav.addObject("zip", Checks.isEmpty(vo.getZip())? new XitAuthRuleMngVO(): service.findZipCode(vo)); + mav.addObject("pageTitle", "우편번호 등록 / 변경"); + mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/code/mngZipCodeMgtPopup.popup"); + return mav; + } + + @GetMapping(value = "/findZipCodes") + public ModelAndView findZipCodes(final Map paraMap){ + return ResultResponse.of(service.findZipCodes(paraMap, MybatisUtils.getPagingInfo(paraMap))); + } + + @GetMapping(value = "/findZipCode") + public ModelAndView findZipCode(final XitZipCodeMngVO vo){ + return ResultResponse.of(service.findZipCode(vo)); + } + + @PostMapping(value = "/addZipCode") + public ModelAndView addZipCode(final XitZipCodeMngVO vo, final BindingResult bindingResult){ + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + ValidationError.of("zip", vo, bindingResult); + service.addZipCode(vo); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); + return mav; + } + + @PostMapping(value = "/modifyZipCode") + public ModelAndView modifyZipCode(final XitZipCodeMngVO vo, final BindingResult bindingResult){ + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + ValidationError.of("zip", vo, bindingResult); + service.modifyZipCode(vo); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS); + return mav; + } + + @PostMapping(value = "/removeZipCode") + public ModelAndView removeZipCode(final XitZipCodeMngVO vo){ + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + service.removeZipcode(vo); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS); + return mav; + } + + + + + + + + + + + + + + + @RequestMapping(value = "ZipCodeMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) + public String ZipCodeMng_page_popup(@PathVariable String cmd + , @ModelAttribute("zip") XitZipCodeMngVO vo + , @ModelAttribute XitZipCodeMngSearchVO searchVO + , ModelMap model) { + switch (cmd) { + case "": // + break; + default: + throw new RuntimeException("유효하지 않은 요청 입니다."); + } + + + return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitZipCodeMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); + } + + + + /** + *
메소드 설명: 우편번호관리 CUD 처리
+ * @return String 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + @RequestMapping(value = "ZipCodeMng_{cmd}_proc", method=RequestMethod.POST) + public void ZipCodeMng_cmd_proc(@PathVariable String cmd + ,@ModelAttribute("vo") XitZipCodeMngVO vo + ,@ModelAttribute("searchVO") XitZipCodeMngSearchVO searchVO + ,@RequestParam(value="zips", required=false, defaultValue="") String zips + ,@RequestParam(value="sns", required=false, defaultValue="") String sns + ,BindingResult bindingResult + ,SessionStatus status + ,Model model + ,HttpServletRequest request + ,HttpServletResponse response + ) throws ServletException, IOException { + + /** + * 처리 분기 + */ + XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); + String sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_list"; + String message = null; + switch (cmd) { + case "insert": //등록 + //유효성 확인 + //2020.11.24. 주석처리 + beanValidator.validate(vo, bindingResult); +// beanValidator.validate("zip", vo, bindingResult); + if (bindingResult.hasErrors()) { + message = xitMessageSource.getMessage("fail.common.insert"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_input"; + break; + } + //처리 + try { + vo.setFrstRegisterId(loginVO.getUniqId()); + service.addProc(vo); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.insert"); + } catch (RuntimeException e) { + message = e.getMessage(); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_input"; + } catch (Exception e) { + message = xitMessageSource.getMessage("fail.common.insert"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_input"; + } + break; + + case "inserts": //다건 등록 + List listAttchFile = null; + try { + listAttchFile = XitAttachFileUtil.fileUpload(request, XitCmmnUtil.setOsPath("/home/tempUpload"), true, 5); + } catch (RuntimeException | IOException e1) { + message = xitMessageSource.getMessage("fail.common.msg"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_inputs"; + } + + if(XitCmmnUtil.isEmpty(listAttchFile)) { + message = xitMessageSource.getMessage("fail.common.msg"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_inputs"; + }else { + FileInputStream fis = null; + try { + XitAttachFileVO fileVO = listAttchFile.get(0); + File file = new File(fileVO.getFileFullPath()); + fis = new FileInputStream(file); + if (!"".equals(fileVO.getFileName())) { + // 2011.10.07 업로드 파일에 대한 확장자를 체크 + if (fileVO.getFileName().toLowerCase().endsWith(".xls") || fileVO.getFileName().toLowerCase().endsWith(".xlsx")) { + service.addsProc(fis); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.insert"); + } else { + //log.info("xls, xlsx 파일 타입만 등록이 가능합니다."); + message = xitMessageSource.getMessage("fail.common.msg"); + model.addAttribute("message", message); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_inputs"; + } + + } else { + message = xitMessageSource.getMessage("fail.common.msg"); + } + } catch (Exception e) { + } finally { + try { + if (fis != null) { + fis.close(); + } + } catch (IOException ee) { + } + } + } + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_inputs"; + break; + + case "update": //수정 + //유효성 확인 + //2020.11.24. 주석처리 + beanValidator.validate(vo, bindingResult); +// beanValidator.validate("zip", vo, bindingResult); + if (bindingResult.hasErrors()) { + message = xitMessageSource.getMessage("fail.common.update"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_edit"; + break; + } + //처리 + try { + vo.setLastUpdusrId(loginVO.getUniqId()); + service.modifyProc(vo); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.update"); + } catch (RuntimeException e) { + message = e.getMessage(); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_edit"; + } catch (Exception e) { + message = xitMessageSource.getMessage("fail.common.update"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_edit"; + } + break; + + case "delete": //삭제 + //처리 + try { + service.removeProc(vo); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.delete"); + break; + } catch (RuntimeException e) { + message = e.getMessage(); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_edit"; + } catch (Exception e) { + message = xitMessageSource.getMessage("fail.common.delete"); + sLocationUrl = "forward:/framework/biz/mng/code/ZipCodeMng_edit"; + } + break; + + case "deletes": //다건 삭제 + //처리 + try { + service.removesProc(zips, sns); + status.setComplete(); + 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()); + } + } +} diff --git a/src/main/resources/sqlmapper/framework/mng/code/zip-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/code/zip-mysql-mapper.xml index 5925b886..55cd87b3 100644 --- a/src/main/resources/sqlmapper/framework/mng/code/zip-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/code/zip-mysql-mapper.xml @@ -1,6 +1,6 @@ - + + +
+ + 등록 + 엑셀등록 + +
+ + + +
+ + + diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/code/mngZipCodeMgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/code/mngZipCodeMgtPopup.jsp new file mode 100644 index 00000000..14f6ad9e --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/code/mngZipCodeMgtPopup.jsp @@ -0,0 +1,156 @@ +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %> +<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> + + + + + + + + + + + + +