|
|
@ -22,6 +22,7 @@ import org.springframework.validation.BindingResult;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
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.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@ -32,7 +33,6 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import egovframework.rte.fdl.security.securedobject.EgovSecuredObjectService;
|
|
|
|
import egovframework.rte.fdl.security.securedobject.EgovSecuredObjectService;
|
|
|
|
import egovframework.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager;
|
|
|
|
import egovframework.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager;
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;
|
|
|
|
|
|
|
|
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
|
|
|
|
import kr.xit.framework.biz.cmm.model.XitAuthorInfoVO;
|
|
|
|
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
|
|
|
|
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
|
|
|
|
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
|
|
|
|
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
|
|
|
@ -45,9 +45,13 @@ import kr.xit.framework.core.message.XitMessageSource;
|
|
|
|
import kr.xit.framework.core.model.ResultResponse;
|
|
|
|
import kr.xit.framework.core.model.ResultResponse;
|
|
|
|
import kr.xit.framework.core.utils.XitCmmnUtil;
|
|
|
|
import kr.xit.framework.core.utils.XitCmmnUtil;
|
|
|
|
import kr.xit.framework.core.validation.XitBeanValidator;
|
|
|
|
import kr.xit.framework.core.validation.XitBeanValidator;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.exception.BizRuntimeException;
|
|
|
|
import kr.xit.framework.support.mybatis.MybatisUtils;
|
|
|
|
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.AjaxUtils;
|
|
|
|
import kr.xit.framework.support.util.Checks;
|
|
|
|
import kr.xit.framework.support.util.Checks;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.ValidationError;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.constants.MessageKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -68,12 +72,6 @@ public class AuthHierarchyMgtController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private AuthAuthorMgtService authAuthorMgtService;
|
|
|
|
private AuthAuthorMgtService authAuthorMgtService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private XitFrameCrudService xitFrameCrudService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private XitBeanValidator beanValidator;
|
|
|
|
|
|
|
|
@Resource(name = "xitMessageSource")
|
|
|
|
|
|
|
|
XitMessageSource xitMessageSource;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private EgovSecuredObjectService egovSecuredObjectService;
|
|
|
|
private EgovSecuredObjectService egovSecuredObjectService;
|
|
|
|
@Resource(name="roleHierarchy")
|
|
|
|
@Resource(name="roleHierarchy")
|
|
|
@ -93,20 +91,17 @@ public class AuthHierarchyMgtController {
|
|
|
|
public void mngAuthHierarchyMgtForm() {
|
|
|
|
public void mngAuthHierarchyMgtForm() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/mngAuthHierarchyMgtPopup")
|
|
|
|
@RequestMapping(value = "/mngAuthHierarchyMgtPopup")
|
|
|
|
public ModelAndView mngAuthHierarchyMgtPopup(XitAuthHierarchyMngVO vo){
|
|
|
|
public ModelAndView mngAuthHierarchyMgtPopup(XitAuthHierarchyMngVO vo){
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
|
|
|
|
|
|
//최하위 권한의 권한계층 조회
|
|
|
|
//최하위 권한의 권한계층 조회
|
|
|
|
XitAuthHierarchyMngVO authHierarchyMngVO = service.findView(vo);
|
|
|
|
XitAuthHierarchyMngVO authHierarchyMngVO = service.findAuthHierarchyInfo(vo);
|
|
|
|
//권한코드 Map 생성
|
|
|
|
//권한코드 Map 생성
|
|
|
|
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtService.findAuthAuthors(null);
|
|
|
|
List<XitAuthorInfoVO> authorInfoVOList = authAuthorMgtService.findAuthAuthors(null);
|
|
|
|
Map<String, String> mAuthorInfo = new HashMap<String, String>();
|
|
|
|
Map<String, String> mAuthorInfo = new HashMap<String, String>();
|
|
|
|
for(XitAuthorInfoVO item : listAuthorInfoVO) {
|
|
|
|
authorInfoVOList.forEach(infoVO -> mAuthorInfo.put(infoVO.getAuthorCode(), infoVO.getAuthorNm()));
|
|
|
|
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//권한코드 목록에서 비중복 권한만 추출
|
|
|
|
//권한코드 목록에서 비중복 권한만 추출
|
|
|
|
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
|
|
|
|
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
|
|
|
|
mNoDuplAuthorInfo.putAll(mAuthorInfo);
|
|
|
|
mNoDuplAuthorInfo.putAll(mAuthorInfo);
|
|
|
@ -121,27 +116,18 @@ public class AuthHierarchyMgtController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//권한계층 미설정 권한 목록 설정
|
|
|
|
//권한계층 미설정 권한 목록 설정
|
|
|
|
List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<XitAuthorInfoVO>();
|
|
|
|
List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<>();
|
|
|
|
Iterator<String> it = mNoDuplAuthorInfo.keySet().iterator();
|
|
|
|
for (String authorCode : mNoDuplAuthorInfo.keySet()) {
|
|
|
|
while(it.hasNext()) {
|
|
|
|
|
|
|
|
String authorCode = it.next();
|
|
|
|
|
|
|
|
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
|
|
|
|
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
|
|
|
|
authorInfo.setAuthorCode(authorCode);
|
|
|
|
authorInfo.setAuthorCode(authorCode);
|
|
|
|
authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
|
|
|
|
authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
|
|
|
|
listAuthorInfo.add(authorInfo);
|
|
|
|
listAuthorInfo.add(authorInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mav.addObject("authorList", listAuthorInfo);
|
|
|
|
mav.addObject("authorList", listAuthorInfo);
|
|
|
|
mav.addObject("mAuthorInfo", mAuthorInfo);
|
|
|
|
mav.addObject("mAuthorInfo", mAuthorInfo);
|
|
|
|
|
|
|
|
|
|
|
|
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getAuthorCode())){
|
|
|
|
|
|
|
|
mav.addObject("authHierarchyManage", new XitAuthHierarchyMngVO());
|
|
|
|
|
|
|
|
mav.addObject("pageTitle", "권한 계층 설정");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
mav.addObject("authHierarchyManage", authHierarchyMngVO);
|
|
|
|
mav.addObject("authHierarchyManage", authHierarchyMngVO);
|
|
|
|
mav.addObject("pageTitle", "권한 계층 설정");
|
|
|
|
mav.addObject("pageTitle", "권한 계층 설정");
|
|
|
|
}
|
|
|
|
|
|
|
|
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthHierarchyMgtPopup.popup");
|
|
|
|
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthHierarchyMgtPopup.popup");
|
|
|
|
return mav;
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -151,321 +137,35 @@ public class AuthHierarchyMgtController {
|
|
|
|
return ResultResponse.of(service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap)));
|
|
|
|
return ResultResponse.of(service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/saveAuthHierarchy")
|
|
|
|
|
|
|
|
public ModelAndView saveAuthHierarchy(@ModelAttribute final XitAuthHierarchyMngVO vo, final BindingResult bindingResult){
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ValidationError.of("authHierarchyManage", vo, bindingResult);
|
|
|
|
|
|
|
|
service.saveAuthHierarchy(vo);
|
|
|
|
|
|
|
|
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* <pre>메소드 설명: 권한계층관리 목록 페이지 조회</pre>
|
|
|
|
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
|
|
|
|
* @author: 김동규
|
|
|
|
|
|
|
|
* @date: 2020. 7. 30.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping(value = "AuthHierarchyMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public Map<String, Object> AuthHierarchyMng_listAjax(@ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO, ModelMap model) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** paging */
|
|
|
|
|
|
|
|
PaginationInfo paginationInfo = new PaginationInfo();
|
|
|
|
|
|
|
|
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
|
|
|
|
|
|
|
|
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
|
|
|
|
|
|
|
|
paginationInfo.setPageSize(searchVO.getPageSize());
|
|
|
|
|
|
|
|
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
|
|
|
|
|
|
|
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
|
|
|
|
|
|
|
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 조회
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int totCnt = service.findListTotCnt(searchVO);
|
|
|
|
|
|
|
|
paginationInfo.setTotalRecordCount(totCnt);
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 반환값 설정
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* ***************************
|
|
|
|
|
|
|
|
* tui Grid Response Set
|
|
|
|
|
|
|
|
*************************** */
|
|
|
|
|
|
|
|
resultMap.put("result", true); //[tui Grid] result
|
|
|
|
|
|
|
|
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
|
|
|
|
|
|
|
|
Map<String, Object> data = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
|
|
|
|
|
|
|
|
Map<String, Integer> pagination = new HashMap<String, Integer>();
|
|
|
|
|
|
|
|
pagination.put("page", searchVO.getPage());
|
|
|
|
|
|
|
|
pagination.put("totalCount", totCnt);
|
|
|
|
|
|
|
|
data.put("pagination", pagination); //[tui Grid] data-paging
|
|
|
|
|
|
|
|
resultMap.put("data", data); //[tui Grid] data
|
|
|
|
|
|
|
|
/* ***************************
|
|
|
|
|
|
|
|
* //tui Grid Response Set
|
|
|
|
|
|
|
|
*************************** */
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 반환값 설정
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
//tui Grid Response Set
|
|
|
|
|
|
|
|
resultMap.put("result", false); //[tui Grid] result
|
|
|
|
|
|
|
|
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* <pre>메소드 설명: 요청 페이지로 이동 한다.</pre>
|
|
|
|
|
|
|
|
* @param cmd
|
|
|
|
|
|
|
|
* @param tilesDef 타일즈 적용 Type(none: tiles 미적용)
|
|
|
|
|
|
|
|
* @param model
|
|
|
|
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
|
|
|
|
* @author: 박민규
|
|
|
|
|
|
|
|
* @date: 2020. 11. 2.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping(value = "AuthHierarchyMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
|
|
|
|
public String AuthHierarchyMng_page(@PathVariable String cmd
|
|
|
|
|
|
|
|
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
|
|
|
|
|
|
|
|
//, @ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO
|
|
|
|
|
|
|
|
, @ModelAttribute("vo") XitAuthHierarchyMngVO vo
|
|
|
|
|
|
|
|
, ModelMap model) {
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
|
|
|
|
// case "input": //등록 페이지
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
case "edit": //수정 페이지
|
|
|
|
|
|
|
|
// case "view": //상세 페이지
|
|
|
|
|
|
|
|
//최하위 권한의 권한계층 조회
|
|
|
|
|
|
|
|
XitAuthHierarchyMngVO result = service.findView(vo);
|
|
|
|
|
|
|
|
//권한코드 Map 생성
|
|
|
|
|
|
|
|
List<XitAuthorInfoVO> listAuthorInfoVO = xitFrameCrudService.findXitAuthorInfos(new XitAuthorInfoVO());
|
|
|
|
|
|
|
|
Map<String, String> mAuthorInfo = new HashMap<String, String>();
|
|
|
|
|
|
|
|
for(XitAuthorInfoVO item : listAuthorInfoVO) {
|
|
|
|
|
|
|
|
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//권한코드 목록에서 비중복 권한만 추출
|
|
|
|
|
|
|
|
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
|
|
|
|
|
|
|
|
mNoDuplAuthorInfo.putAll(mAuthorInfo);
|
|
|
|
|
|
|
|
String[] arrAuthorRescue = result.getAuthorRescueCode().split(">");
|
|
|
|
|
|
|
|
for(int i=0; i<arrAuthorRescue.length; i++) {
|
|
|
|
|
|
|
|
String[] arrAuthorCode = arrAuthorRescue[i].split(",");
|
|
|
|
|
|
|
|
for(int j=0; j<arrAuthorCode.length; j++) {
|
|
|
|
|
|
|
|
String authorCode = arrAuthorCode[j].trim();
|
|
|
|
|
|
|
|
if(mNoDuplAuthorInfo.containsKey(authorCode)) {
|
|
|
|
|
|
|
|
mNoDuplAuthorInfo.remove(authorCode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//권한계층 미설정 권한 목록 설정
|
|
|
|
|
|
|
|
List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<XitAuthorInfoVO>();
|
|
|
|
|
|
|
|
Iterator<String> it = mNoDuplAuthorInfo.keySet().iterator();
|
|
|
|
|
|
|
|
while(it.hasNext()) {
|
|
|
|
|
|
|
|
String authorCode = it.next();
|
|
|
|
|
|
|
|
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
|
|
|
|
|
|
|
|
authorInfo.setAuthorCode(authorCode);
|
|
|
|
|
|
|
|
authorInfo.setAuthorNm(mNoDuplAuthorInfo.get(authorCode));
|
|
|
|
|
|
|
|
listAuthorInfo.add(authorInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("authorList", listAuthorInfo);
|
|
|
|
|
|
|
|
model.addAttribute("mAuthorInfo", mAuthorInfo);
|
|
|
|
|
|
|
|
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("vo", result);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
throw new RuntimeException("유효하지 않은 요청 입니다.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!"".equals(tilesDef))
|
|
|
|
|
|
|
|
tilesDef = "."+tilesDef;
|
|
|
|
|
|
|
|
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthHierarchyMng_"+cmd+tilesDef;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* <pre>메소드 설명: 요청 팝업 페이지 이동 한다.</pre>
|
|
|
|
|
|
|
|
* @param cmd
|
|
|
|
|
|
|
|
* @param model
|
|
|
|
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
|
|
|
|
* @author: 박민규
|
|
|
|
|
|
|
|
* @date: 2020. 11. 2.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping(value = "AuthHierarchyMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
|
|
|
|
public String AuthHierarchyMng_page_popup(@PathVariable String cmd
|
|
|
|
|
|
|
|
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
|
|
|
|
|
|
|
|
, @ModelAttribute("searchVO") XitAuthHierarchyMngSearchVO searchVO
|
|
|
|
|
|
|
|
, @ModelAttribute("vo") XitAuthHierarchyMngVO vo
|
|
|
|
|
|
|
|
, ModelMap model) {
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
|
|
|
|
case "": //
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
throw new RuntimeException("유효하지 않은 요청 입니다.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/XitAuthHierarchyMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* <pre>
|
|
|
|
|
|
|
|
* 메소드 설명: 권한계층관리 CUD 처리
|
|
|
|
|
|
|
|
* </pre>
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
|
|
|
|
* @author: 박민규
|
|
|
|
|
|
|
|
* @throws IOException
|
|
|
|
|
|
|
|
* @throws ServletException
|
|
|
|
|
|
|
|
* @date: 2020. 11. 2.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@RequestMapping(value = "AuthHierarchyMng_{cmd}_proc", method=RequestMethod.POST)
|
|
|
|
|
|
|
|
public void AuthHierarchyMng_cmd_proc(@PathVariable String cmd
|
|
|
|
|
|
|
|
,@ModelAttribute("vo") XitAuthHierarchyMngVO vo
|
|
|
|
|
|
|
|
,@RequestParam(value="authorCodes", required=false, defaultValue="") String authorCodes
|
|
|
|
|
|
|
|
,BindingResult bindingResult
|
|
|
|
|
|
|
|
,SessionStatus status
|
|
|
|
|
|
|
|
,Model model
|
|
|
|
|
|
|
|
,HttpServletRequest request
|
|
|
|
|
|
|
|
,HttpServletResponse response
|
|
|
|
|
|
|
|
) throws ServletException, IOException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 처리 분기
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
String sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_list.do";
|
|
|
|
|
|
|
|
String message = null;
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
|
|
|
|
// case "insert": //등록
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// case "inserts": //다건 등록
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "update": //수정
|
|
|
|
|
|
|
|
//유효성 확인
|
|
|
|
|
|
|
|
beanValidator.validate(vo, bindingResult);
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("fail.common.update");
|
|
|
|
|
|
|
|
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//처리
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
service.modifyProc(vo);
|
|
|
|
|
|
|
|
status.setComplete();
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
|
|
|
|
message = e.getMessage();
|
|
|
|
|
|
|
|
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("fail.common.update");
|
|
|
|
|
|
|
|
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "delete": //삭제
|
|
|
|
@PostMapping(value = "/reloadAuthHierarchy")
|
|
|
|
//처리
|
|
|
|
public ModelAndView reloadAuthHierarchy(){
|
|
|
|
try {
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
service.removeProc(vo);
|
|
|
|
|
|
|
|
status.setComplete();
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
|
|
|
|
message = e.getMessage();
|
|
|
|
|
|
|
|
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("fail.common.delete");
|
|
|
|
|
|
|
|
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "reload": //롤계층정보 재적용
|
|
|
|
|
|
|
|
//처리
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 롤계층정보 reload
|
|
|
|
* 롤계층정보 reload
|
|
|
|
* -재접속 후 변경된 롤계층정보가 적용 됨.
|
|
|
|
* -재접속 후 변경된 롤계층정보가 적용 됨.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
String hierachicaRoles = null;
|
|
|
|
String hierachicaRoles = null;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
hierachicaRoles = egovSecuredObjectService.getHierarchicalRoles();
|
|
|
|
hierachicaRoles = egovSecuredObjectService.getHierarchicalRoles();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
roleHierarchyImpl.setHierarchy(hierachicaRoles);
|
|
|
|
roleHierarchyImpl.setHierarchy(hierachicaRoles);
|
|
|
|
RoleHierarchy roleHierarchy = roleHierarchyImpl;
|
|
|
|
RoleHierarchy roleHierarchy = roleHierarchyImpl;
|
|
|
|
egovJdbcUserDetailsManager.setRoleHierarchy(roleHierarchy);
|
|
|
|
egovJdbcUserDetailsManager.setRoleHierarchy(roleHierarchy);
|
|
|
|
|
|
|
|
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
|
|
|
|
// List<XitUserInfoVO> listUserInfo = xitFrameCrudService.findXitUserInfos(new XitUserInfoVO());
|
|
|
|
return mav;
|
|
|
|
// for(XitUserInfoVO userInfo : listUserInfo) {
|
|
|
|
|
|
|
|
// egovJdbcUserDetailsManager.loadUserByUsername(userInfo.getUser_id());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("success.request.msg");
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
message = xitMessageSource.getMessage("fail.request.msg");
|
|
|
|
|
|
|
|
sLocationUrl = "forward:/framework/biz/mng/auth/AuthHierarchyMng_edit.do";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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<String, Object> resultMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
resultMap.put("message", message);
|
|
|
|
|
|
|
|
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
|
|
|
|
|
|
|
|
}else { //submit 요청 시
|
|
|
|
|
|
|
|
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|