diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/CctvBusOnlyCrackDownFactory.java b/src/main/java/kr/xit/fims/biz/cmm/extr/CctvBusOnlyCrackDownFactory.java new file mode 100644 index 00000000..9b46bab3 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/CctvBusOnlyCrackDownFactory.java @@ -0,0 +1,30 @@ +package kr.xit.fims.biz.cmm.extr; + +import kr.xit.fims.biz.ec.model.CctvCrackdownDTO; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class CctvBusOnlyCrackDownFactory extends ExtrInterfaceDataFactory{ + private CctvCrackdownDTO.BusOnly dto; + + @Override + public CctvCrackdownDTO.BusOnly parseData(CctvCrackdownDTO.Request reqDto) { + return CctvCrackdownDTO.BusOnly.builder() + .carModel("dkkdkd").build(); + } + + // @Override + // public CctvCrackdownDTO.BusOnly createDTO() { + // return CctvCrackdownDTO.BusOnly.builder() + // .carModel("dkkdkd").build(); + // } + +} diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/CctvBusOnlyCrackDownService.java b/src/main/java/kr/xit/fims/biz/cmm/extr/CctvBusOnlyCrackDownService.java new file mode 100644 index 00000000..8ca43a6f --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/CctvBusOnlyCrackDownService.java @@ -0,0 +1,93 @@ +package kr.xit.fims.biz.cmm.extr; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.io.IOUtils; +import org.springframework.web.multipart.MultipartFile; + +import kr.xit.fims.biz.ec.model.CctvCrackdownDTO; +import kr.xit.framework.support.exception.BizRuntimeException; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.Builder; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Builder +public class CctvBusOnlyCrackDownService implements IExtrStrategyService { + + // private final IEcCctvCrackdownMapper mapper; + // private final IEcCtznSttemntMapper ctznSttemntMapper; + // + // private final ICmmFileService cmmFileService; + + private final CctvCrackdownDTO.Request reqDTO; + private final CctvCrackdownDTO.BusOnly dto; + + @Override + public void saveInterfaceData() { + // 단속정보메타 1 + 이미지파일 4 = 5개로 구성 + if(reqDTO.getFiles().size() % 5 != 0){ + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "단속정보[파일]가 부정확 합니다\n다시 확인해 주세요."); + } + final Comparator comp = (mf1, mf2) -> String.CASE_INSENSITIVE_ORDER.compare(mf1.getOriginalFilename(), mf2.getOriginalFilename()); + List sortedFileList = reqDTO.getFiles().stream() + .sorted(comp) + .collect(Collectors.toList()); + + //Arrays.copyOfRange(sortedFileList.toArray(), 0, 4); + + List> listByMd = ListUtils.partition(sortedFileList, 5); + + for(int idx = 0; idx < listByMd.size(); idx++){ + List mfList = listByMd.get(idx); + + MultipartFile mf = mfList.get(0); + String[] txtNames = mf.getOriginalFilename().split("[.]"); + if(txtNames.length != 2 || !Objects.equals("txt", txtNames[1].toLowerCase())) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, String.format("[%s]%s", txtNames[0], "의 단속정보[파일]가 없습니다.")); + + //String[] mdInfos = txtNames[0].split("_"); + + // meta정보 read + List records = new ArrayList<>(); + try(InputStream inputStream = mf.getInputStream();){ + records.addAll(IOUtils.readLines(inputStream, "euc-kr")); + } catch (IOException e) { + // handle exception + } + // data set + // CctvCrackdownDTO.ExtrlRegltCntc extrRegltDTO = getExtrlRegltCntcDTO(txtNames[0], records); + // extrRegltDTO.setSysCode(getUserInfo().getOrgnztId()); + // extrRegltDTO.setInsttCode(getUserInfo().getPstinstCode()); + // + // if(records.size() >= 3){ + // extrRegltDTO.setRegltSeCode(FimsConst.RegltSeCode.CCTV_DRV.getCode()); + // }else{ + // extrRegltDTO.setRegltSeCode(FimsConst.RegltSeCode.CCTV_FIX.getCode()); + // } + // // 외부연계 데이타 생성 + // //mapper.insertEcExtrlRegltCntc(extrRegltDTO); + // + // // CCTV image 저장 + // List cpListMf = new ArrayList<>(mfList); + // cpListMf.remove(0); + // cmmFileService.saveFiles(getFileMst(extrRegltDTO.getRegltSeCode(), extrRegltDTO.getExtrlRegltCntcId()), cpListMf); + } + } + + @Override + public void saveReglt() { + dto.setGpsX("xxxxxxxxx");; + } + + public void saveErpp() { + dto.setGpsY("yyyyyyyyyyy"); + } +} diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/ExtrInterfaceDataFactory.java b/src/main/java/kr/xit/fims/biz/cmm/extr/ExtrInterfaceDataFactory.java new file mode 100644 index 00000000..981a4ba0 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/ExtrInterfaceDataFactory.java @@ -0,0 +1,14 @@ +package kr.xit.fims.biz.cmm.extr; + +public abstract class ExtrInterfaceDataFactory { + //private T t; + + public T parseInterfaceData(E e){ + return this.parseData(e); + //return this.createDTO(); + } + + public abstract T parseData(E e); + + //public abstract T createDTO(); +} diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/ExtrInterfaceService.java b/src/main/java/kr/xit/fims/biz/cmm/extr/ExtrInterfaceService.java new file mode 100644 index 00000000..812a9a8a --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/ExtrInterfaceService.java @@ -0,0 +1,43 @@ +package kr.xit.fims.biz.cmm.extr; + +import kr.xit.fims.biz.ec.model.CctvCrackdownDTO; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class ExtrInterfaceService implements IExtrInterfaceService{ + + @Override + public void processSave(IExtrStrategyService service){ + service.saveInterfaceData(); + } + + @Override + public void processReglt(IExtrStrategyService service){ + service.saveReglt(); + } + + @Override + public void processErpp(IExtrStrategyService service){ + service.saveErpp(); + } + + public static void main(String[] args) { + ExtrInterfaceDataFactory factory = new CctvBusOnlyCrackDownFactory(); + CctvCrackdownDTO.BusOnly dto = factory.parseInterfaceData(CctvCrackdownDTO.Request.builder().build()); + log.debug("{}", dto); + + ExtrInterfaceService eds = new ExtrInterfaceService(); + + + IExtrStrategyService strategy = new CctvBusOnlyCrackDownService(CctvCrackdownDTO.Request.builder().build(), dto); + + +eds.processSave(strategy); + log.debug("{}", dto); + + eds.processReglt(strategy); + log.debug("{}", dto); + eds.processErpp(strategy); + log.debug("{}", dto); + } +} diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/IExtrInterfaceService.java b/src/main/java/kr/xit/fims/biz/cmm/extr/IExtrInterfaceService.java new file mode 100644 index 00000000..5a7edd6b --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/IExtrInterfaceService.java @@ -0,0 +1,18 @@ +package kr.xit.fims.biz.cmm.extr; + +import kr.xit.framework.biz.cmm.model.XitLoginVO; +import kr.xit.framework.core.utils.XitCmmnUtil; + +public interface IExtrInterfaceService { + + void processSave(IExtrStrategyService service); + + void processReglt(IExtrStrategyService service); + + + void processErpp(IExtrStrategyService service); + + default XitLoginVO getUserInfo(){ + return XitCmmnUtil.getUserInfo(); + } +} diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/IExtrStrategyService.java b/src/main/java/kr/xit/fims/biz/cmm/extr/IExtrStrategyService.java new file mode 100644 index 00000000..c2d6252b --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/IExtrStrategyService.java @@ -0,0 +1,14 @@ +package kr.xit.fims.biz.cmm.extr; + +import kr.xit.framework.biz.cmm.model.XitLoginVO; +import kr.xit.framework.core.utils.XitCmmnUtil; + +public interface IExtrStrategyService { + void saveInterfaceData(); + void saveReglt(); + void saveErpp(); + + default XitLoginVO getUserInfo(){ + return XitCmmnUtil.getUserInfo(); + } +} diff --git a/src/main/java/kr/xit/fims/biz/cmm/extr/strategypattern.drawio b/src/main/java/kr/xit/fims/biz/cmm/extr/strategypattern.drawio new file mode 100644 index 00000000..c8a7c02a --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/cmm/extr/strategypattern.drawio @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java index 6a89e968..8adfb634 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java @@ -22,7 +22,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; public interface IAuthGrpMgtMapper { List selectAuthorGroupInfos(final Map paraMap, final RowBounds rowBounds); - XitAuthorGroupInfoVO selectAuthorGroupInfo(final String groupId); + XitAuthorGroupInfoVO selectAuthorGroupInfo(final T t); int insertAuthorGroupInfo(final XitAuthorGroupInfoVO vo); int updateAuthorGroupInfo(final XitAuthorGroupInfoVO vo); int deleteAuthorGroupInfo(final String groupId); diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java index d3580447..a7cbd1af 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java @@ -42,8 +42,8 @@ public class AuthAuthorMgtService implements IAuthAuthorMgtService { @Override @Transactional(readOnly = true) - public XitAuthorInfoVO findAuthAuthor(final String authorCode) { - return mapper.selectAuthorInfo(authorCode); + public XitAuthorInfoVO findAuthAuthor(final T t) { + return mapper.selectAuthorInfo(t); } /* ===================================================== diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java index 6c6f4b54..69e700c1 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java @@ -42,8 +42,8 @@ public class AuthGrpMgtService implements IAuthGrpMgtService { @Override @Transactional(readOnly = true) - public XitAuthorGroupInfoVO findAuthGrp(final String groupId) { - return mapper.selectAuthorGroupInfo(groupId); + public XitAuthorGroupInfoVO findAuthGrp(final T t) { + return mapper.selectAuthorGroupInfo(t); } @Override diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthRoleMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthRoleMgtService.java index 68ba0c03..561395b6 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthRoleMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthRoleMgtService.java @@ -33,8 +33,8 @@ public class AuthRoleMgtService implements IAuthRoleMgtService { @Override @Transactional(readOnly = true) - public XitRoleInfoVO findAuthRole(final String roleCode) { - return mapper.selectAuthRole(roleCode); + public XitRoleInfoVO findAuthRole(final T t) { + return mapper.selectAuthRole(t); } @Override diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java index 4c04e4a7..fc9cef9b 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java @@ -23,7 +23,7 @@ public interface IAuthAuthorMgtService { /** *
메소드 설명: 권한관리 목록 조회
- * @param searchVO + * @param paraMap * @return List 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 4. 16. @@ -31,7 +31,7 @@ public interface IAuthAuthorMgtService { List findAuthAuthors(final Map paraMap, final RowBounds rowBounds); List findAuthAuthors(final Map paraMap); - XitAuthorInfoVO findAuthAuthor(final String authorCode); + XitAuthorInfoVO findAuthAuthor(final T t); void addAuthAuthor(final XitAuthorInfoVO vo); void modifyAuthAuthor(final XitAuthorInfoVO vo); void removeAuthAuthor(final String authorCode); diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java index 1cd47331..e117f8e5 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java @@ -20,7 +20,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; public interface IAuthGrpMgtService { List findAuthGrps(final Map paraMap, final RowBounds rowBounds); - XitAuthorGroupInfoVO findAuthGrp(final String groupId); + XitAuthorGroupInfoVO findAuthGrp(final T t); void addAuthGrp(final XitAuthorGroupInfoVO vo); void modifyAuthGrp(final XitAuthorGroupInfoVO vo); void removeAuthGrp(final String authorCode); diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java index 67ac9c6f..79c84386 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java @@ -22,7 +22,7 @@ public interface IAuthRoleMgtService { /** *
메소드 설명: 롤관리 목록 조회
- * @param searchVO + * @param paraMap * @return List 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 4. 16. @@ -31,12 +31,12 @@ public interface IAuthRoleMgtService { /** *
메소드 설명: 롤관리 상세정보 조회
- * @param vo + * @param t * @return XitAuthRuleMngVO 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 4. 16. */ - XitRoleInfoVO findAuthRole(final String roleCode); + XitRoleInfoVO findAuthRole(final T t); /** *
메소드 설명: 롤관리 등록
diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java index 0532f391..e697ba5c 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java @@ -50,14 +50,14 @@ public class AuthAuthorMgtController { } @RequestMapping(value = "/mngAuthAuthorMgtPopup") - public ModelAndView mngAuthAuthorMgtPopup(@ModelAttribute final XitAuthorInfoVO vo){ + public ModelAndView mngAuthAuthorMgtPopup(final XitAuthorInfoVO vo){ ModelAndView mav = new ModelAndView(); if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getAuthorCode())){ mav.addObject("authorInfoVO", new XitAuthorInfoVO()); mav.addObject("pageTitle", "권한 등록"); } else { - mav.addObject("authorInfoVO", vo); + mav.addObject("authorInfoVO", service.findAuthAuthor(vo)); mav.addObject("pageTitle", "권한 변경"); } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthAuthorMgtPopup.popup"); diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java index 8e00abed..55038351 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java @@ -57,7 +57,7 @@ public class AuthGrpMgtController { mav.addObject("groupManage", new XitAuthorGroupInfoVO()); mav.addObject("pageTitle", "권한그룹 등록"); } else { - mav.addObject("groupManage", vo); + mav.addObject("groupManage", service.findAuthGrp(vo)); mav.addObject("pageTitle", "권한그룹 변경"); } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthGrpMgtPopup.popup"); diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java index 74a03775..af6c9c9b 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java @@ -57,7 +57,7 @@ public class AuthRoleMgtController { mav.addObject("roleManage", new XitRoleInfoVO()); mav.addObject("pageTitle", "롤 등록"); } else { - mav.addObject("roleManage", vo); + mav.addObject("roleManage", service.findAuthRole(vo)); mav.addObject("pageTitle", "롤 정보 변경"); } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthRoleMgtPopup.popup"); diff --git a/src/main/java/kr/xit/framework/biz/mng/bbs/model/XitBbsTmplateMngVO.java b/src/main/java/kr/xit/framework/biz/mng/bbs/model/XitBbsTmplateMngVO.java index f27b743f..3a29a691 100644 --- a/src/main/java/kr/xit/framework/biz/mng/bbs/model/XitBbsTmplateMngVO.java +++ b/src/main/java/kr/xit/framework/biz/mng/bbs/model/XitBbsTmplateMngVO.java @@ -70,4 +70,7 @@ public class XitBbsTmplateMngVO { /** 사용여부 */ private String useAt; + /** 코드 명 */ + private String codeNm; + } diff --git a/src/main/java/kr/xit/framework/biz/mng/bbs/web/BoardTmplMgtController.java b/src/main/java/kr/xit/framework/biz/mng/bbs/web/BoardTmplMgtController.java index bee4912a..c4283955 100644 --- a/src/main/java/kr/xit/framework/biz/mng/bbs/web/BoardTmplMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/bbs/web/BoardTmplMgtController.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import kr.xit.framework.support.util.Checks; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; @@ -56,8 +57,13 @@ public class BoardTmplMgtController { ModelAndView mav = new ModelAndView(); - mav.addObject("templateInf", vo); - mav.addObject("pageTitle", "게시판 템플릿 등록 / 변경"); + if(Checks.isEmpty(vo.getTmplatId())){ + mav.addObject("templateInf", vo); + mav.addObject("pageTitle", "게시판 템플릿 등록"); + } else { + mav.addObject("templateInf", service.findBoardTmpl(vo)); + mav.addObject("pageTitle", "게시판 템플릿 변경"); + } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardTmplMgtPopup.popup"); return mav; } diff --git a/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeCfnMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeCfnMgtMapper.java index 18b44c68..80fe5656 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeCfnMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeCfnMgtMapper.java @@ -12,7 +12,7 @@ import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; public interface ICodeCfnMgtMapper { List selectCmmnClCodes(final Map paraMap, final RowBounds rowBounds); - XitClCodeMngVO selectCmmnClCode(final String clCode); + XitClCodeMngVO selectCmmnClCode(final T t); int insertCmmnClCode(final XitClCodeMngVO vo); int updateCmmnClCode(final XitClCodeMngVO vo); diff --git a/src/main/java/kr/xit/framework/biz/mng/code/model/XitDetailCodeMngVO.java b/src/main/java/kr/xit/framework/biz/mng/code/model/XitDetailCodeMngVO.java index 8fe5f82e..ac125748 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/model/XitDetailCodeMngVO.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/model/XitDetailCodeMngVO.java @@ -79,4 +79,9 @@ public class XitDetailCodeMngVO { */ private String lastUpdusrId; + /* + * 분류 코드 + */ + private String clCode; + } diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeCfnMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeCfnMgtService.java index 020853fe..a6c65df1 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeCfnMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeCfnMgtService.java @@ -30,6 +30,10 @@ public class CodeCfnMgtService implements ICodeCfnMgtService { return mapper.selectCmmnClCodes(paraMap, rowBounds); } + @Override + @Transactional(readOnly = true) + public XitClCodeMngVO findCodeCfn(final T t){return mapper.selectCmmnClCode(t);} + @Override @Transactional public void addCodeCfn(final XitClCodeMngVO vo) { diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeDtlMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeDtlMgtService.java index ef846829..99623e59 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeDtlMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeDtlMgtService.java @@ -26,6 +26,10 @@ public class CodeDtlMgtService implements ICodeDtlMgtService { return mapper.selectCmmnDtlCodes(paraMap, rowBounds); } + @Override + @Transactional(readOnly = true) + public XitDetailCodeMngVO findCodeDtl(final T t){return mapper.selectCmmnDtlCode(t);} + @Override @Transactional public void addCodeDtl(final XitDetailCodeMngVO vo) { diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeGrpMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeGrpMgtService.java index d92171db..15a94686 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeGrpMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeGrpMgtService.java @@ -30,6 +30,10 @@ public class CodeGrpMgtService implements ICodeGrpMgtService { return mapper.selectCmmnGrpCodes(paraMap, rowBounds); } + @Override + @Transactional(readOnly = true) + public XitCmmnCodeMngVO findCodeGrp(final T t){return mapper.selectCmmnGrpCode(t);} + @Override @Transactional(readOnly = true) public void addCodeGrp(final XitCmmnCodeMngVO vo) { diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeCfnMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeCfnMgtService.java index 8e04fb7d..0f7d28bb 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeCfnMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeCfnMgtService.java @@ -22,6 +22,8 @@ public interface ICodeCfnMgtService { List findCodeCfns(final Map paraMap, final RowBounds rowBounds); + + XitClCodeMngVO findCodeCfn(final T t); void addCodeCfn(final XitClCodeMngVO vo); diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeDtlMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeDtlMgtService.java index df6e2572..eae62344 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeDtlMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeDtlMgtService.java @@ -23,6 +23,8 @@ public interface ICodeDtlMgtService { List findCodeDtls(final Map paraMap, final RowBounds rowBounds); + XitDetailCodeMngVO findCodeDtl(final T t); + void addCodeDtl(final XitDetailCodeMngVO vo); void modifyCodeDtl(final XitDetailCodeMngVO vo); diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeGrpMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeGrpMgtService.java index 02a87e07..0ef5ef40 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeGrpMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeGrpMgtService.java @@ -23,6 +23,8 @@ public interface ICodeGrpMgtService { List findCodeGrps(final Map paraMap, final RowBounds rowBounds); + XitCmmnCodeMngVO findCodeGrp(final T t); + void addCodeGrp(final XitCmmnCodeMngVO vo); void modifyCodeGrp(final XitCmmnCodeMngVO vo); diff --git a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeCfnMgtController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeCfnMgtController.java index 94b2d26f..4d004273 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeCfnMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeCfnMgtController.java @@ -2,9 +2,7 @@ package kr.xit.framework.biz.mng.code.web; import java.util.Map; -import javax.annotation.Resource; - -import org.springframework.beans.factory.annotation.Autowired; +import kr.xit.framework.support.util.Checks; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -15,11 +13,8 @@ import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; import kr.xit.framework.biz.mng.code.service.ICodeCfnMgtService; -import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; import kr.xit.framework.core.constants.FrameworkConstants; -import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.model.ResultResponse; -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.ValidationError; @@ -41,8 +36,13 @@ public class CodeCfnMgtController { public ModelAndView mngCodeCfnMgtPopup(final XitClCodeMngVO vo) { ModelAndView mav = new ModelAndView(); - mav.addObject("cmmnClCode", vo); - mav.addObject("pageTitle", "분류 코드 등록 / 변경"); + if(Checks.isEmpty(vo.getClCode())){ + mav.addObject("cmmnClCode", vo); + mav.addObject("pageTitle", "분류 코드 등록"); + } else { + mav.addObject("cmmnClCode", service.findCodeCfn(vo)); + mav.addObject("pageTitle", "분류 코드 변경"); + } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/code/mngCodeCfnMgtPopup.popup"); return mav; } diff --git a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeDtlMgtController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeDtlMgtController.java index 0bb19214..b9827935 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeDtlMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeDtlMgtController.java @@ -2,6 +2,7 @@ package kr.xit.framework.biz.mng.code.web; import java.util.Map; +import kr.xit.framework.support.util.Checks; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -37,8 +38,14 @@ public class CodeDtlMgtController { ModelAndView mav = new ModelAndView(); mav.addObject("cfnCodeList", CacheServiceUtils.getComboCodes(null, "CMM_CFN")); - mav.addObject("cmmnDetailCode", vo); - mav.addObject("pageTitle", "공통 코드 등록 / 변경"); + + if(Checks.isEmpty(vo.getCodeId())){ + mav.addObject("cmmnDetailCode", vo); + mav.addObject("pageTitle", "공통 코드 등록"); + } else { + mav.addObject("cmmnDetailCode", service.findCodeDtl(vo)); + mav.addObject("pageTitle", "공통 코드 변경"); + } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/code/mngCodeDtlMgtPopup.popup"); return mav; } diff --git a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeGrpMgtController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeGrpMgtController.java index 4412292b..33cd2eae 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeGrpMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeGrpMgtController.java @@ -2,6 +2,7 @@ package kr.xit.framework.biz.mng.code.web; import java.util.Map; +import kr.xit.framework.support.util.Checks; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -35,8 +36,13 @@ public class CodeGrpMgtController { public ModelAndView mngCodeGrpMgtPopup(final XitCmmnCodeMngVO vo) { ModelAndView mav = new ModelAndView(); - mav.addObject("cmmnCode", vo); - mav.addObject("pageTitle", "공통 코드 그룹 등록 / 변경"); + if(Checks.isEmpty(vo.getCodeId())){ + mav.addObject("cmmnCode", vo); + mav.addObject("pageTitle", "공통 코드 그룹 등록"); + } else { + mav.addObject("cmmnCode", service.findCodeGrp(vo)); + mav.addObject("pageTitle", "공통 코드 그룹 변경"); + } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/code/mngCodeGrpMgtPopup.popup"); return mav; } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java index 60f7fab6..a06aa138 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java @@ -26,10 +26,12 @@ public interface IMenuMgtMapper { List selectMenuInfos(final T t, final RowBounds rowBounds); List selectMenuInfos(final T t); XitMenuInfoVO selectMenuInfo(final T t); + List selectMenuCreatDtls(final T t); int insertMenuInfo(final XitMenuInfoVO vo); int updateMenuInfo(final XitMenuInfoVO vo); int deleteMenuInfo(final String menuNo); + int deleteMenuCreatDtlsList(final String menuNo); diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java index 5e28c1ba..b37be59b 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java @@ -29,6 +29,7 @@ public interface IMenuMgtService { * @date: 2022. 10. 18. */ List findMenus(final Map paraMap, final RowBounds rowBounds); + XitMenuInfoVO findMenu(final T t); void addMenu(final XitMenuInfoVO vo); void modifyMenu(final XitMenuInfoVO vo); diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java index 9a6525da..e521a8af 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java @@ -45,6 +45,10 @@ public class MenuMgtService implements IMenuMgtService { return mapper.selectMenuInfos(paraMap, rowBounds); } + @Override + @Transactional(readOnly = true) + public XitMenuInfoVO findMenu(final T t){return mapper.selectMenuInfo(t); } + @Override @Transactional public void addMenu(final XitMenuInfoVO vo) { @@ -78,8 +82,10 @@ public class MenuMgtService implements IMenuMgtService { if(mapper.selectMenuInfos(XitMenuInfoVO.builder().upperMenuNo(menuNo).build()).size() > 0) throw BizRuntimeException.create("fail.common.delete.upperMenuExist"); + //권한별 메뉴 관리 조회 후 삭제 + if(mapper.selectMenuCreatDtls(XitMenuInfoVO.builder().menuNo(menuNo).build()).size() > 0) + mapper.deleteMenuCreatDtlsList(menuNo); - //TODO: xit_menu_creat_dtls 해당 정보 삭제후 실행??? mapper.deleteMenuInfo(menuNo); cacheService.evictAllMenuCache(); } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java b/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java index a76bc18b..cd39185c 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java @@ -12,6 +12,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import kr.xit.framework.support.util.Checks; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -71,8 +72,14 @@ public class MenuMgtController { public ModelAndView mngMenuMgtPopup(final XitMenuInfoVO vo) { ModelAndView mav = new ModelAndView(); - mav.addObject("menuManageVO", vo); - mav.addObject("pageTitle", "메뉴 정보 등록 / 변경"); + + if(Checks.isEmpty(vo.getMenuNm())){ + mav.addObject("menuManageVO", vo); + mav.addObject("pageTitle", "메뉴 정보 등록"); + } else { + mav.addObject("menuManageVO", service.findMenu(vo)); + mav.addObject("pageTitle", "메뉴 정보 변경"); + } mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngMenuMgtPopup.popup"); return mav; } diff --git a/src/main/resources/sqlmapper/framework/mng/auth/auth-role-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/auth/auth-role-mysql-mapper.xml index 9837e299..4c2e4557 100644 --- a/src/main/resources/sqlmapper/framework/mng/auth/auth-role-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/auth/auth-role-mysql-mapper.xml @@ -16,7 +16,7 @@ , role_creat_de FROM xit_role_info - + AND role_code = #{roleCode} diff --git a/src/main/resources/sqlmapper/framework/mng/bbs/board-tmpl-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/bbs/board-tmpl-mysql-mapper.xml index d67e624f..8e61c86c 100644 --- a/src/main/resources/sqlmapper/framework/mng/bbs/board-tmpl-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/bbs/board-tmpl-mysql-mapper.xml @@ -26,9 +26,6 @@ AND xti.tmplat_se_code = #{tmplatSeCode} - - - AND INSTR(xti.tmplat_nm, #{tmplatNm}) > 0 AND INSTR(cdc.code_nm #{codeNm}) > 0 @@ -39,12 +36,18 @@ diff --git a/src/main/resources/sqlmapper/framework/mng/code/code-dtl-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/code/code-dtl-mysql-mapper.xml index 0aea6908..8a5a913b 100644 --- a/src/main/resources/sqlmapper/framework/mng/code/code-dtl-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/code/code-dtl-mysql-mapper.xml @@ -94,7 +94,9 @@ , etc_1 = IF(etc_1 = #{etc1}, etc_1, #{etc1}) , etc_2 = IF(etc_2 = #{etc2}, etc_2, #{etc2}) , etc_3 = IF(etc_3 = #{etc3}, etc_3, #{etc3}) - , ordr = IF(ordr = #{ordr}, ordr, #{ordr}) + + , ordr = IF(ordr = #{ordr}, ordr, #{ordr}) + , use_at = IF(use_at = #{useAt}, use_at, #{useAt}) , last_updt_pnttm = NOW() , last_updusr_id = #{lastUpdusrId} diff --git a/src/main/resources/sqlmapper/framework/mng/menu/menu-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/menu/menu-mysql-mapper.xml index 84a66cc5..361b6a3a 100644 --- a/src/main/resources/sqlmapper/framework/mng/menu/menu-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/menu/menu-mysql-mapper.xml @@ -39,6 +39,15 @@ + + /* menu-mysql-mapper|insertMenuInfo-메뉴 정보 등록|julim */ INSERT @@ -90,6 +99,14 @@ + + /* menu-mysql-mapper|deleteMenuCreatDtlsList-메뉴생성내역 권한 데이터 삭제|julim */ + DELETE + FROM xit_menu_creat_dtls + WHERE menu_no = #{menuNo} + + + /* menu-mysql-mapper|deleteAllMenuCreatDtlsList-메뉴생성내역 전체데이터 삭제|julim */ DELETE diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.jsp index 588e1e1d..eb5c086f 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.jsp @@ -156,17 +156,11 @@ alert('변경된 내역이 없습니다.'); return false; } - data = $(document.authHierarchyManage).serialize(); - - if(data.indexOf('%2C') > 0){ - data = decodeURIComponent(data); - data = data.split(',').join('&authorCode=') - } if(confirm("저장 하시겠습니까?")) { cmmAjax({ url: '' - , data: $(document.authHierarchyManage).serialize() + , data: data ,success: () => { //$('#btnReload').css('display', 'inline-block'); } @@ -197,15 +191,13 @@ if($(this).hasClass('separator')){ //구분자 일때 //배열에 담기 if(sb.length>0) - arrAuthorCode.push(sb); + // arrAuthorCode.push(sb); + arrAuthorCode.push(sb.join(';')); //StringBuffer 초기화 sb = []; - console.log(arrAuthorCode) }else{ //구분자가 아닐때 - const authorCode = $(this).find('#authorCode').val(); - console.log(arrAuthorCode, arrAuthorCode.length) sb.push($(this).find('#authorCode').val()); }