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 deleteMenu(MenuManageVO menuManageVO) throws Exception;
void insertMenu(MenuManageVO menuManageVO) throws Exception;
}

View File

@ -142,6 +142,25 @@ public class EgovMenuCreateManageServiceImpl extends EgovAbstractServiceImpl imp
menuCreatVO.setUseYn("Y");//insert 시는 무조건 사용으로
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
public List<MenuManageJTreeVO> selectMenuListJtreeWeb(MenuManageJTreeVO menuManageVO) throws Exception {

View File

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

View File

@ -297,15 +297,16 @@
) AS SORT1
, AA1.MENU_NO
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#
AND B.AUTHOR_CODE = #authorCode#) Subquery
<!-- AND B.AUTHOR_CODE = #authorCode# -->
) Subquery
WHERE Subquery.MENU_NO = A.MENU_NO)
WHERE EXISTS ( SELECT 1
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#
AND B.AUTHOR_CODE = #authorCode#
<!-- AND B.AUTHOR_CODE = #authorCode# -->
AND AA1.MENU_NO = A.MENU_NO)
</update>

View File

@ -496,6 +496,9 @@ function fn_save_menuInfo(menuNo) {
}else if(returnData.status == "duplProNm"){
alert("이미 사용하고 있는 프로그램파일명이 있습니다.");
}else if(returnData.status == "authorFail"){
alert("메뉴권한등록에 실패했습니다.");
}else{
alert("ERROR");
}
@ -744,15 +747,15 @@ function set_bbs(){
<div class="cont">
<div class="menu_select">
<%-- <div class="menu_select">
<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_ADMIN' <c:if test="${menuCreatVO.authorCode == 'ROLE_ADMIN' }">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>
<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>
</c:forEach>
</select>
</div>
</div> --%>
<div class="menu_wrap">
<div class="menu_area">

View File

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