From 45ed9e42a8802345c300ca9531287defc632c456 Mon Sep 17 00:00:00 2001 From: Kurt92 Date: Fri, 18 Nov 2022 17:04:10 +0900 Subject: [PATCH] feat : bottom sheet --- .../fims/biz/rt/mapper/IRt100MgtMapper.java | 20 ++ .../fims/biz/rt/service/IRt100MgtService.java | 34 ++++ .../fims/biz/rt/service/Rt100MgtService.java | 46 +++++ .../fims/biz/rt/web/Rt100MgtController.java | 78 ++++++++ .../sqlmapper/biz/rt/rt-100-mysql-mapper.xml | 109 +++++++++++ .../biz/sample/sample2-mysql-mapper.xml | 2 +- .../WEB-INF/jsp/fims/biz/rt/rt100MgtForm.jsp | 171 ++++++++++++++++++ .../WEB-INF/jsp/fims/biz/rt/rt100MgtPopup.jsp | 140 ++++++++++++++ .../jsp/fims/biz/sample/sampleForm2.jsp | 115 +++++++++++- .../framework/js/cmm/cmmBottomSheet.js | 25 +++ 10 files changed, 731 insertions(+), 9 deletions(-) create mode 100644 src/main/java/kr/xit/fims/biz/rt/mapper/IRt100MgtMapper.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/IRt100MgtService.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/Rt100MgtService.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/web/Rt100MgtController.java create mode 100644 src/main/resources/sqlmapper/biz/rt/rt-100-mysql-mapper.xml create mode 100644 src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtForm.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtPopup.jsp create mode 100644 src/main/webapp/resources/framework/js/cmm/cmmBottomSheet.js diff --git a/src/main/java/kr/xit/fims/biz/rt/mapper/IRt100MgtMapper.java b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt100MgtMapper.java new file mode 100644 index 00000000..19373cfa --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt100MgtMapper.java @@ -0,0 +1,20 @@ +package kr.xit.fims.biz.rt.mapper; + +import egovframework.rte.psl.dataaccess.mapper.Mapper; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; +import org.apache.ibatis.session.RowBounds; + +import java.util.List; +import java.util.Map; + + +@Mapper +public interface IRt100MgtMapper { + + List selectCmmnClCodes(final Map paraMap, final RowBounds rowBounds); + XitClCodeMngVO selectCmmnClCode(final String clCode); + + int insertCmmnClCode(final XitClCodeMngVO vo); + int updateCmmnClCode(final XitClCodeMngVO vo); + int deleteCmmnClCode(final String clCode); +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/IRt100MgtService.java b/src/main/java/kr/xit/fims/biz/rt/service/IRt100MgtService.java new file mode 100644 index 00000000..68c09558 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/IRt100MgtService.java @@ -0,0 +1,34 @@ +package kr.xit.fims.biz.rt.service; + +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; +import kr.xit.framework.core.utils.XitCmmnUtil; +import org.apache.ibatis.session.RowBounds; + +import java.util.List; +import java.util.Map; + +/** + * + * @업무그룹명: 분류코드관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IRt100MgtService { + + + List findCodeCfns(final Map paraMap, final RowBounds rowBounds); + + void addCodeCfn(final XitClCodeMngVO vo); + + void modifyCodeCfn(final XitClCodeMngVO vo); + + void removeCodeCfn(final String clCode); + + default String getUserUniqId(){ + return XitCmmnUtil.getUserUniqId(); + } +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/Rt100MgtService.java b/src/main/java/kr/xit/fims/biz/rt/service/Rt100MgtService.java new file mode 100644 index 00000000..4e6d0aff --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/Rt100MgtService.java @@ -0,0 +1,46 @@ +package kr.xit.fims.biz.rt.service; + +import kr.xit.fims.biz.rt.mapper.IRt100MgtMapper; +import kr.xit.framework.biz.cache.service.ICacheService; +import kr.xit.framework.biz.mng.code.mapper.ICodeCfnMgtMapper; +import kr.xit.framework.biz.mng.code.mapper.ICodeGrpMgtMapper; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; +import kr.xit.framework.biz.mng.code.service.ICodeCfnMgtService; +import kr.xit.framework.support.exception.BizRuntimeException; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.RequiredArgsConstructor; +import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +//TODO : 캐쉬 반영 +@RequiredArgsConstructor +@Service +public class Rt100MgtService implements IRt100MgtService { + + private final IRt100MgtMapper mapper; + + @Override + public List findCodeCfns(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectCmmnClCodes(paraMap, rowBounds); + } + + @Override + public void addCodeCfn(final XitClCodeMngVO vo) { + vo.setFrstRegisterId(getUserUniqId()); + mapper.insertCmmnClCode(vo); + } + + @Override + public void modifyCodeCfn(final XitClCodeMngVO vo) { + vo.setLastUpdusrId(getUserUniqId()); + mapper.updateCmmnClCode(vo); + } + + @Override + public void removeCodeCfn(final String clCode) { + mapper.deleteCmmnClCode(clCode); + } +} diff --git a/src/main/java/kr/xit/fims/biz/rt/web/Rt100MgtController.java b/src/main/java/kr/xit/fims/biz/rt/web/Rt100MgtController.java new file mode 100644 index 00000000..cb718641 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/web/Rt100MgtController.java @@ -0,0 +1,78 @@ +package kr.xit.fims.biz.rt.web; + +import kr.xit.fims.biz.cmm.FimsConst; +import kr.xit.fims.biz.rt.service.IRt100MgtService; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; +import kr.xit.framework.biz.mng.code.service.ICodeCfnMgtService; +import kr.xit.framework.core.constants.FrameworkConstants; +import kr.xit.framework.core.model.ResultResponse; +import kr.xit.framework.support.mybatis.MybatisUtils; +import kr.xit.framework.support.util.AjaxMessageMapRenderer; +import kr.xit.framework.support.util.ValidationError; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; + +import java.util.Map; + +@RequiredArgsConstructor +@Controller +@RequestMapping("/fims/biz/rt") +public class Rt100MgtController { + + private final IRt100MgtService service; + + @RequestMapping(value = "/rt100MgtForm") + public void mngCodeCfnMgtForm() { + } + + @RequestMapping(value = "/rt100MgtPopup") + public ModelAndView mngCodeCfnMgtPopup(final XitClCodeMngVO vo) { + ModelAndView mav = new ModelAndView(); + + mav.addObject("cmmnClCode", vo); + mav.addObject("pageTitle", "RT100 등록 / 변경"); + mav.setViewName(FimsConst.FIMS_JSP_BASE_PATH + "rt/rt100MgtPopup.popup"); + return mav; + } + + @GetMapping(value = "/findRt100s") + public ModelAndView findRt100s(@RequestParam final Map paraMap){ + return ResultResponse.of(service.findCodeCfns(paraMap, MybatisUtils.getPagingInfo(paraMap))); + } + + @PostMapping(value = "/addRt100") + public ModelAndView addRt100(final XitClCodeMngVO vo, final BindingResult bindingResult){ + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + ValidationError.of("cmmnClCode", vo, bindingResult); + service.addCodeCfn(vo); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); + return mav; + } + + @PostMapping(value = "/modifyRt100") + public ModelAndView modifyRt1000(final XitClCodeMngVO vo, final BindingResult bindingResult){ + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + ValidationError.of("cmmnClCode", vo, bindingResult); + service.modifyCodeCfn(vo); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS); + return mav; + } + + @PostMapping(value = "/removeRt100") + public ModelAndView removeRt100(final String clCode){ + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + service.removeCodeCfn(clCode); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS); + return mav; + } +} diff --git a/src/main/resources/sqlmapper/biz/rt/rt-100-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/rt/rt-100-mysql-mapper.xml new file mode 100644 index 00000000..54ceeb71 --- /dev/null +++ b/src/main/resources/sqlmapper/biz/rt/rt-100-mysql-mapper.xml @@ -0,0 +1,109 @@ + + + + + + + + SELECT cl_code + , cl_code_nm + , cl_code_dc + , use_at + , frst_regist_pnttm + , frst_register_id + , last_updt_pnttm + , last_updusr_id + FROM xit_cmmn_cl_code + + + AND INSTR(cl_code, #{clCode}) > 0 + + + AND INSTR(cl_code_nm, #{clCodeNm}) > 0 + + + + + + + + + + /* code-cfn-mysql-mapper|insertCmmnClCode-분류코드 정보 등록|julim */ + INSERT + INTO xit_cmmn_cl_code ( + cl_code + , cl_code_nm + , cl_code_dc + , use_at + , frst_regist_pnttm + , frst_register_id + ) VALUE ( + #{clCode} + , #{clCodeNm} + , #{clCodeDc} + , #{useAt} + , NOW() + , #{frstRegisterId} + ) + + + + /* code-cfn-mysql-mapper|updateCmmnClCode-분류코드 정보 변경|julim */ + UPDATE xit_cmmn_cl_code + SET cl_code_nm = IF(cl_code_nm = #{clCodeNm}, cl_code_nm, #{clCodeNm}) + , cl_code_dc = IF(cl_code_dc = #{clCodeDc}, cl_code_dc, #{clCodeDc}) + , use_at = #{useAt} + , last_updt_pnttm = NOW() + , last_updusr_id = #{lastUpdusrId} + WHERE cl_code = #{clCode} + + + + /* code-cfn-mysql-mapper|deleteCmmnClCode-분류코드 정보 삭제|julim */ + DELETE + FROM xit_cmmn_cl_code + WHERE cl_code = #{clCode} + + + diff --git a/src/main/resources/sqlmapper/biz/sample/sample2-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/sample/sample2-mysql-mapper.xml index 2fe2320a..dac31da2 100644 --- a/src/main/resources/sqlmapper/biz/sample/sample2-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/sample/sample2-mysql-mapper.xml @@ -14,7 +14,7 @@ , col_no4 from tb_sample where 1=1 - + and col_nm = #{sch_word} diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtForm.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtForm.jsp new file mode 100644 index 00000000..82e8b269 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtForm.jsp @@ -0,0 +1,171 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %> + + + + +
+ +
전체 ㅣ 0
+
+ + 등록 + +
+ + + +
+ + + diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtPopup.jsp new file mode 100644 index 00000000..c9d7c9c2 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rt100MgtPopup.jsp @@ -0,0 +1,140 @@ +<%@ 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" %> + + + + + + +<%--@elvariable id="cmmnClCode" type="validator"--%> + + + + diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/sample/sampleForm2.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/sample/sampleForm2.jsp index b5adb965..00f43048 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/biz/sample/sampleForm2.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/sample/sampleForm2.jsp @@ -66,7 +66,22 @@
- + +