|
|
@ -14,25 +14,35 @@ import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
|
|
|
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;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.support.SessionStatus;
|
|
|
|
import org.springframework.web.bind.support.SessionStatus;
|
|
|
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
import kr.xit.framework.biz.cmm.service.XitFrameCodeService;
|
|
|
|
import kr.xit.framework.biz.cmm.service.XitFrameCodeService;
|
|
|
|
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO;
|
|
|
|
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO;
|
|
|
|
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO;
|
|
|
|
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO;
|
|
|
|
import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService;
|
|
|
|
import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService;
|
|
|
|
|
|
|
|
import kr.xit.framework.biz.mng.menu.model.ProgramMngVO;
|
|
|
|
import kr.xit.framework.core.constants.FrameworkConstants;
|
|
|
|
import kr.xit.framework.core.constants.FrameworkConstants;
|
|
|
|
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
|
|
|
|
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
|
|
|
|
import kr.xit.framework.core.message.XitMessageSource;
|
|
|
|
import kr.xit.framework.core.message.XitMessageSource;
|
|
|
|
|
|
|
|
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.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.ValidationError;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.constants.MessageKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -49,7 +59,7 @@ import kr.xit.framework.support.util.AjaxUtils;
|
|
|
|
public class AuthRoleMgtController {
|
|
|
|
public class AuthRoleMgtController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private AuthRoleMgtService xitAuthRuleMngService;
|
|
|
|
private AuthRoleMgtService service;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private XitFrameCodeService xitFrameCodeService;
|
|
|
|
private XitFrameCodeService xitFrameCodeService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
@ -68,66 +78,70 @@ public class AuthRoleMgtController {
|
|
|
|
@RequestMapping(value = "mngAuthRoleMgtForm", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "mngAuthRoleMgtForm", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
public void mngAuthRoleMgtForm() {
|
|
|
|
public void mngAuthRoleMgtForm() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "mnuAuthRoleMgtPopup")
|
|
|
|
|
|
|
|
public ModelAndView mngAuthRoleMgtPopup(final XitAuthRuleMngVO vo){
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Checks.isEmpty(vo)){
|
|
|
|
|
|
|
|
mav.addObject("roleManage", new ProgramMngVO());
|
|
|
|
|
|
|
|
mav.addObject("pageTitle", "롤 등록");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
mav.addObject("roleManage", vo);
|
|
|
|
|
|
|
|
mav.addObject("pageTitle", "롤 정보 변경");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngAuthRoleMgtPopup.popup");
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <pre>메소드 설명: 롤 관리 목록 페이지 조회</pre>
|
|
|
|
* <pre>메소드 설명: 롤 관리 목록 페이지 조회</pre>
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
* @author: 김동규
|
|
|
|
* @author: 김동규
|
|
|
|
* @date: 2020. 7. 31.
|
|
|
|
* @date: 2020. 7. 31.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "AuthRuleMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
@GetMapping(value = "findAuthRoles")
|
|
|
|
@ResponseBody
|
|
|
|
public ModelAndView findAuthRoles(final Map<String,Object> paraMap) {
|
|
|
|
public Map<String, Object> AuthRuleMng_listAjax(@ModelAttribute("roleManageVO") XitAuthRuleMngSearchVO searchVO, ModelMap model) {
|
|
|
|
return ResultResponse.of(service.findAuthRoles(paraMap, MybatisUtils.getPagingInfo(paraMap)));
|
|
|
|
|
|
|
|
|
|
|
|
/** 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 = xitAuthRuleMngService.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", xitAuthRuleMngService.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;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/addAuthRole")
|
|
|
|
|
|
|
|
public ModelAndView addAuthRole(@ModelAttribute final XitAuthRuleMngVO vo, final BindingResult bindingResult) {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//유효성 확인
|
|
|
|
|
|
|
|
ValidationError.of("roleManage", vo, bindingResult);
|
|
|
|
|
|
|
|
service.addAuthRole(vo);
|
|
|
|
|
|
|
|
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/modifyAuthRole")
|
|
|
|
|
|
|
|
public ModelAndView modifyAuthRole(@ModelAttribute final XitAuthRuleMngVO vo, final BindingResult bindingResult) {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//유효성 확인
|
|
|
|
|
|
|
|
ValidationError.of("roleManage", vo, bindingResult);
|
|
|
|
|
|
|
|
service.modifyAuthRole(vo);
|
|
|
|
|
|
|
|
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/removeAuthRole")
|
|
|
|
|
|
|
|
public ModelAndView removeAuthRole(final String roleCode) {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
service.removeAuthRole(roleCode);
|
|
|
|
|
|
|
|
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <pre>메소드 설명: 요청 페이지로 이동 한다.</pre>
|
|
|
|
* <pre>메소드 설명: 요청 페이지로 이동 한다.</pre>
|
|
|
|
* @param page
|
|
|
|
|
|
|
|
* @param tilesDef 타일즈 적용 Type(none: tiles 미적용)
|
|
|
|
* @param tilesDef 타일즈 적용 Type(none: tiles 미적용)
|
|
|
|
* @param model
|
|
|
|
* @param model
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
@ -155,7 +169,7 @@ public class AuthRoleMgtController {
|
|
|
|
================*/
|
|
|
|
================*/
|
|
|
|
model.addAttribute("cmmCodeDetailList" , xitFrameCodeService.findCmmnDetailCodes("XIT029")); //롤유형코드 목록
|
|
|
|
model.addAttribute("cmmCodeDetailList" , xitFrameCodeService.findCmmnDetailCodes("XIT029")); //롤유형코드 목록
|
|
|
|
|
|
|
|
|
|
|
|
model.addAttribute("roleManage", xitAuthRuleMngService.findView(vo));
|
|
|
|
model.addAttribute("roleManage", service.findAuthRole(null));
|
|
|
|
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
|
|
|
|
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -172,7 +186,6 @@ public class AuthRoleMgtController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <pre>메소드 설명: 요청 팝업 페이지 이동 한다.</pre>
|
|
|
|
* <pre>메소드 설명: 요청 팝업 페이지 이동 한다.</pre>
|
|
|
|
* @param page
|
|
|
|
|
|
|
|
* @param model
|
|
|
|
* @param model
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
* @return String 요청처리 후 응답객체
|
|
|
|
* @author: 박민규
|
|
|
|
* @author: 박민규
|
|
|
@ -233,7 +246,7 @@ public class AuthRoleMgtController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xitAuthRuleMngService.addProc(vo);
|
|
|
|
service.addAuthRole(vo);
|
|
|
|
status.setComplete();
|
|
|
|
status.setComplete();
|
|
|
|
message = xitMessageSource.getMessage("success.common.insert");
|
|
|
|
message = xitMessageSource.getMessage("success.common.insert");
|
|
|
|
model.addAttribute("roleCode", vo.getRoleCode());
|
|
|
|
model.addAttribute("roleCode", vo.getRoleCode());
|
|
|
@ -260,7 +273,7 @@ public class AuthRoleMgtController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xitAuthRuleMngService.modifyProc(vo);
|
|
|
|
service.modifyAuthRole(vo);
|
|
|
|
status.setComplete();
|
|
|
|
status.setComplete();
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
@ -275,7 +288,7 @@ public class AuthRoleMgtController {
|
|
|
|
case "delete": //삭제
|
|
|
|
case "delete": //삭제
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xitAuthRuleMngService.removeProc(vo);
|
|
|
|
service.removeAuthRole(null);
|
|
|
|
status.setComplete();
|
|
|
|
status.setComplete();
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -291,7 +304,7 @@ public class AuthRoleMgtController {
|
|
|
|
case "deletes": //다건 삭제
|
|
|
|
case "deletes": //다건 삭제
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
xitAuthRuleMngService.removesProc(roleCodes);
|
|
|
|
//service.removesProc();
|
|
|
|
status.setComplete();
|
|
|
|
status.setComplete();
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|