Merge branch 'tolag3'

This commit is contained in:
leejunho 2024-08-09 11:24:02 +09:00
commit e6202b11f5
6 changed files with 69 additions and 24 deletions

View File

@ -102,4 +102,8 @@ public interface EgovMenuCreateManageService {
void updateQuickList(MenuManageJTreeVO menuManageVO) throws Exception; void updateQuickList(MenuManageJTreeVO menuManageVO) throws Exception;
void deleteMenu(MenuManageVO menuManageVO) throws Exception;
void insertMenu(MenuManageVO menuManageVO) throws Exception;
} }

View File

@ -143,6 +143,25 @@ public class EgovMenuCreateManageServiceImpl extends EgovAbstractServiceImpl imp
menuCreateManageDAO.insertMenuCreat(menuCreatVO); menuCreateManageDAO.insertMenuCreat(menuCreatVO);
} }
@Override
public void deleteMenu(MenuManageVO menuManageVO) throws Exception {
MenuCreatVO menuCreatVO = new MenuCreatVO();
menuCreatVO.setAuthorCode(menuManageVO.getAuthorCode());
menuCreatVO.setMenuNo(menuManageVO.getMenuNo());
menuCreatVO.setSiteId(menuManageVO.getSiteId());
menuCreateManageDAO.deleteMenuCreatAuthNo(menuCreatVO);
}
@Override
public void insertMenu(MenuManageVO menuManageVO) throws Exception {
MenuCreatVO menuCreatVO = new MenuCreatVO();
menuCreatVO.setAuthorCode(menuManageVO.getAuthorCode());
menuCreatVO.setMenuNo(menuManageVO.getMenuNo());
menuCreatVO.setSiteId(menuManageVO.getSiteId());
menuCreatVO.setUseYn("Y");//insert 시는 무조건 사용으로
menuCreateManageDAO.insertMenuCreat(menuCreatVO);
}
@Override @Override
public List<MenuManageJTreeVO> selectMenuListJtreeWeb(MenuManageJTreeVO menuManageVO) throws Exception { public List<MenuManageJTreeVO> selectMenuListJtreeWeb(MenuManageJTreeVO menuManageVO) throws Exception {
return menuCreateManageDAO.selectMenuListJtreeWeb(menuManageVO); return menuCreateManageDAO.selectMenuListJtreeWeb(menuManageVO);

View File

@ -339,7 +339,8 @@ public class EgovMenuCreateManageController {
*/ */
@RequestMapping("/sym/mnu/mcm/EgovMenuInfoAjax.do") @RequestMapping("/sym/mnu/mcm/EgovMenuInfoAjax.do")
public ModelAndView EgovMenuInfoAjax(@ModelAttribute("menuManageVO") MenuManageJTreeVO menuManageVO, @RequestParam("menuNo") String menuNo , public ModelAndView EgovMenuInfoAjax(@ModelAttribute("menuManageVO") MenuManageJTreeVO menuManageVO, @RequestParam("menuNo") String menuNo ,
@ModelAttribute("searchVO") ComDefaultVO searchVO , ModelMap model) throws Exception { @ModelAttribute("searchVO") ComDefaultVO searchVO , ModelMap model
,HttpServletResponse response , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
@ -389,7 +390,8 @@ public class EgovMenuCreateManageController {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@RequestMapping("/sym/mnu/mcm/EgovMenuInfoInsertAjax.do") @RequestMapping("/sym/mnu/mcm/EgovMenuInfoInsertAjax.do")
public ModelAndView insertEgovMenuInfoAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, ProgrmManageVO progrmManageVO , ModelMap model) throws Exception { public ModelAndView insertEgovMenuInfoAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, ProgrmManageVO progrmManageVO , ModelMap model
, HttpServletResponse response , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
try{//최초 들어올때 임의의 menuManageVO 생성 try{//최초 들어올때 임의의 menuManageVO 생성
@ -478,7 +480,8 @@ public class EgovMenuCreateManageController {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@RequestMapping(value = "/sym/mnu/mcm/EgovMenuInfoDeleteAjax.do") @RequestMapping(value = "/sym/mnu/mcm/EgovMenuInfoDeleteAjax.do")
public ModelAndView deleteEgovMenuInfoDeleteAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, ProgrmManageVO progrmManageVO , MenuCreatVO menuCreatVO, ModelMap model) throws Exception { public ModelAndView deleteEgovMenuInfoDeleteAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, ProgrmManageVO progrmManageVO , MenuCreatVO menuCreatVO, ModelMap model
, HttpServletResponse response , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
try{ try{
@ -537,12 +540,11 @@ public class EgovMenuCreateManageController {
MenuCreatVO menuCreatVO , MenuCreatVO menuCreatVO ,
ProgrmManageVO progrmManageVO , ProgrmManageVO progrmManageVO ,
@ModelAttribute("searchVO") ComDefaultVO searchVO , @ModelAttribute("searchVO") ComDefaultVO searchVO ,
ModelMap model) throws Exception { ModelMap model
, HttpServletResponse response , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
int cnt = 0; int cnt = 0;
try{ try{
try{ try{
if(!menuManageVO.getTmp_Id().equals(menuManageVO.getMenuNo()+"")){ //매뉴번호 변경시 if(!menuManageVO.getTmp_Id().equals(menuManageVO.getMenuNo()+"")){ //매뉴번호 변경시
@ -605,7 +607,7 @@ public class EgovMenuCreateManageController {
menuManageVO.setProgrmFileNm(progrmManageVO.getProgrmFileNm()); menuManageVO.setProgrmFileNm(progrmManageVO.getProgrmFileNm());
progrmManageVO.setProgrmFileNm(menuManageVO.getProgrmFileNm()); progrmManageVO.setProgrmFileNm(menuManageVO.getProgrmFileNm());
progrmManageService.updateProgrm(progrmManageVO); progrmManageService.updateProgrm(progrmManageVO);
menuCreateManageDAO.updateMenuNo(menuCreatVO); // menuCreateManageDAO.updateMenuNo(menuCreatVO);
}else{ //중복프로그램 조회 > del > insert }else{ //중복프로그램 조회 > del > insert
if(menuManageVO.getMenuType().equals("M")){ //프로그램에서 매뉴로 바꿀시 lettnmenuinfo 업데이트 / lettnprogrmlist 삭제 if(menuManageVO.getMenuType().equals("M")){ //프로그램에서 매뉴로 바꿀시 lettnmenuinfo 업데이트 / lettnprogrmlist 삭제
menuManageService.updateMenuManageJtree(menuManageVO); menuManageService.updateMenuManageJtree(menuManageVO);
@ -660,14 +662,14 @@ public class EgovMenuCreateManageController {
menuManageVO.setTmp_Id(menuCreatVO.getMenuNo()+""); menuManageVO.setTmp_Id(menuCreatVO.getMenuNo()+"");
menuManageService.deleteMenuManageBef(menuManageVO); //이전 메뉴 삭제 menuManageService.deleteMenuManageBef(menuManageVO); //이전 메뉴 삭제
}else{ }else{
menuCreateManageDAO.deleteMenuCreatAuthNo(menuCreatVO); // menuCreateManageDAO.deleteMenuCreatAuthNo(menuCreatVO);
cnt = menuManageService.updateMenuManageJtree(menuManageVO); cnt = menuManageService.updateMenuManageJtree(menuManageVO);
menuCreatVO.setMenuNo(menuManageVO.getMenuNo()); menuCreatVO.setMenuNo(menuManageVO.getMenuNo());
menuCreateManageDAO.insertMenuCreat(menuCreatVO); // menuCreateManageDAO.insertMenuCreat(menuCreatVO);
} }
} }
if(menuManageVO.getUpperMenuId()!=0){ //최상위는 제외 if(menuManageVO.getUpperMenuId()!=0 || menuManageVO.getUpperMenuId()!=1){ //최상위는 제외(관리자메뉴, 사용자메뉴)
menuManageService.resortMenuManage(menuManageVO); menuManageService.resortMenuManage(menuManageVO);
} }
if(delFlag){ if(delFlag){
@ -712,6 +714,20 @@ public class EgovMenuCreateManageController {
modelAndView.addObject("status", "fail"); modelAndView.addObject("status", "fail");
} }
try {
//선택한 menuNo 모든 권한을 삭제
menuCreateManageService.deleteMenu(menuManageVO);
for(String author : menuManageVO.getAuthorChkList()) {
menuManageVO.setAuthorCode(author);
menuCreateManageService.insertMenu(menuManageVO);
}
} catch (Exception e) {
modelAndView.addObject("status", "authorFail");
return modelAndView;
}
return modelAndView; return modelAndView;
} }
@ -724,7 +740,8 @@ public class EgovMenuCreateManageController {
* @throws Exception * @throws Exception
*/ */
@RequestMapping("/sym/mnu/mcm/EgovMenuInfoNmUpdateAjax.do") @RequestMapping("/sym/mnu/mcm/EgovMenuInfoNmUpdateAjax.do")
public ModelAndView EgovMenuInfoNmUpdateAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, ModelMap model) throws Exception { public ModelAndView EgovMenuInfoNmUpdateAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, ModelMap model
, HttpServletResponse response , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
try{ try{
@ -739,7 +756,8 @@ public class EgovMenuCreateManageController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@RequestMapping("/sym/mnu/mcm/EgovMenuInfoMoveAjax.do") @RequestMapping("/sym/mnu/mcm/EgovMenuInfoMoveAjax.do")
public ModelAndView EgovMenuInfoMoveAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, public ModelAndView EgovMenuInfoMoveAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO,
@ModelAttribute("searchVO") ComDefaultVO searchVO ,ModelMap model) throws Exception { @ModelAttribute("searchVO") ComDefaultVO searchVO ,ModelMap model
, HttpServletResponse response , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
try{ try{
@ -804,6 +822,7 @@ public class EgovMenuCreateManageController {
public ModelAndView updateQuickMenuMngUpdateAjax(@RequestParam Map<?, ?> commandMap, public ModelAndView updateQuickMenuMngUpdateAjax(@RequestParam Map<?, ?> commandMap,
@ModelAttribute("menuManageVO") MenuManageJTreeVO menuManageVO, @ModelAttribute("menuManageVO") MenuManageJTreeVO menuManageVO,
@ModelAttribute("searchVO") CmmnDetailCodeVO searchVO @ModelAttribute("searchVO") CmmnDetailCodeVO searchVO
, HttpServletResponse response , HttpServletRequest request
)throws Exception { )throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
@ -828,7 +847,7 @@ public class EgovMenuCreateManageController {
@RequestMapping("/sym/mnu/mcm/MenuBbsSelectAjax.do") @RequestMapping("/sym/mnu/mcm/MenuBbsSelectAjax.do")
public ModelAndView MenuAddBbsInsertAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, public ModelAndView MenuAddBbsInsertAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO,
BoardMasterVO boardMasterVO, BoardMasterVO boardMasterVO,
HttpServletResponse response , HttpServletRequest request,
ModelMap model) throws Exception { ModelMap model) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
@ -849,7 +868,7 @@ public class EgovMenuCreateManageController {
@RequestMapping("/sym/mnu/mcm/MenuBbsInsertAjax.do") @RequestMapping("/sym/mnu/mcm/MenuBbsInsertAjax.do")
public ModelAndView MenuBbsInsertAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, public ModelAndView MenuBbsInsertAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO,
BoardMasterVO boardMasterVO, BoardMasterVO boardMasterVO,
HttpServletResponse response , HttpServletRequest request,
ModelMap model) throws Exception { ModelMap model) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");
@ -869,6 +888,7 @@ public class EgovMenuCreateManageController {
@RequestMapping("/sym/mnu/mcm/HtmlComfirmAjax.do") @RequestMapping("/sym/mnu/mcm/HtmlComfirmAjax.do")
public ModelAndView HtmlComfirmAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, public ModelAndView HtmlComfirmAjax(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO,
@ModelAttribute("cntManageVO") CntManageVO cntManageVO, @ModelAttribute("cntManageVO") CntManageVO cntManageVO,
HttpServletResponse response , HttpServletRequest request,
ModelMap model) throws Exception { ModelMap model) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView"); modelAndView.setViewName("jsonView");

View File

@ -297,15 +297,16 @@
) AS SORT1 ) AS SORT1
, AA1.MENU_NO , AA1.MENU_NO
FROM LETTNMENUINFO AA1 FROM LETTNMENUINFO AA1
LEFT JOIN LETTNMENUCREATDTLS B ON AA1.MENU_NO = B.MENU_NO LEFT JOIN (SELECT AAA1.MENU_NO FROM LETTNMENUCREATDTLS AAA1 GROUP BY AAA1.MENU_NO) B ON AA1.MENU_NO = B.MENU_NO
WHERE AA1.UPPER_MENU_NO = #upperMenuId# WHERE AA1.UPPER_MENU_NO = #upperMenuId#
AND B.AUTHOR_CODE = #authorCode#) Subquery <!-- AND B.AUTHOR_CODE = #authorCode# -->
) Subquery
WHERE Subquery.MENU_NO = A.MENU_NO) WHERE Subquery.MENU_NO = A.MENU_NO)
WHERE EXISTS ( SELECT 1 WHERE EXISTS ( SELECT 1
FROM LETTNMENUINFO AA1 FROM LETTNMENUINFO AA1
LEFT JOIN LETTNMENUCREATDTLS B ON AA1.MENU_NO = B.MENU_NO LEFT JOIN (SELECT AAA1.MENU_NO FROM LETTNMENUCREATDTLS AAA1 GROUP BY AAA1.MENU_NO) B ON AA1.MENU_NO = B.MENU_NO
WHERE AA1.UPPER_MENU_NO = #upperMenuId# WHERE AA1.UPPER_MENU_NO = #upperMenuId#
AND B.AUTHOR_CODE = #authorCode# <!-- AND B.AUTHOR_CODE = #authorCode# -->
AND AA1.MENU_NO = A.MENU_NO) AND AA1.MENU_NO = A.MENU_NO)
</update> </update>

View File

@ -496,6 +496,9 @@ function fn_save_menuInfo(menuNo) {
}else if(returnData.status == "duplProNm"){ }else if(returnData.status == "duplProNm"){
alert("이미 사용하고 있는 프로그램파일명이 있습니다."); alert("이미 사용하고 있는 프로그램파일명이 있습니다.");
}else if(returnData.status == "authorFail"){
alert("메뉴권한등록에 실패했습니다.");
}else{ }else{
alert("ERROR"); alert("ERROR");
} }
@ -744,15 +747,15 @@ function set_bbs(){
<div class="cont"> <div class="cont">
<div class="menu_select"> <%-- <div class="menu_select">
<select name="authorCode" id="authorCode" class="select" onchange="jstreeRefresh(); return false;" title="검색조건선택"> <select name="authorCode" id="authorCode" class="select" onchange="jstreeRefresh(); return false;" title="검색조건선택">
<%-- <option value='ROLE_ANONYMOUS' <c:if test="${menuCreatVO.authorCode == 'ROLE_ANONYMOUS' || empty menuCreatVO.authorCode }">selected</c:if>>사용자</option> <option value='ROLE_ANONYMOUS' <c:if test="${menuCreatVO.authorCode == 'ROLE_ANONYMOUS' || empty menuCreatVO.authorCode }">selected</c:if>>사용자</option>
<option value='ROLE_ADMIN' <c:if test="${menuCreatVO.authorCode == 'ROLE_ADMIN' }">selected</c:if>>관리자</option> --%> <option value='ROLE_ADMIN' <c:if test="${menuCreatVO.authorCode == 'ROLE_ADMIN' }">selected</c:if>>관리자</option>
<c:forEach var="authorList" items="${authorList}" varStatus="status"> <c:forEach var="authorList" items="${authorList}" varStatus="status">
<option value='${authorList.authorCode}' <c:if test="${menuCreatVO.authorCode == authorList.authorCode}">selected</c:if>>${authorList.authorCode}</option> <option value='${authorList.authorCode}' <c:if test="${menuCreatVO.authorCode == authorList.authorCode}">selected</c:if>>${authorList.authorCode}</option>
</c:forEach> </c:forEach>
</select> </select>
</div> </div> --%>
<div class="menu_wrap"> <div class="menu_wrap">
<div class="menu_area"> <div class="menu_area">

View File

@ -139,6 +139,4 @@
<auth-constraint></auth-constraint> <auth-constraint></auth-constraint>
</security-constraint> </security-constraint>
<!-- tomcat clustering setting -->
<distributable/>
</web-app> </web-app>