コード例 #1
0
  /**
   * 부서업무함 정보의 표시순서를 수정한다.
   *
   * @param DeptJobBx
   * @return String
   * @param deptJobBx
   */
  @RequestMapping("/cop/smt/djm/updateDeptJobBxOrdr.do")
  public String updateDeptJobBxOrdr(
      @ModelAttribute("searchVO") DeptJobBxVO deptJobBxVO, ModelMap model) throws Exception {
    LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    boolean changed = false;

    if (isAuthenticated) {
      deptJobBxVO.setLastUpdusrId(user.getUniqId());
      changed = deptJobService.updateDeptJobBxOrdr(deptJobBxVO);
    }

    if (!changed) {
      model.addAttribute("indictOrdrChanged", "false");
    }

    return "forward:/cop/smt/djm/selectDeptJobBxList.do";
  }
コード例 #2
0
  /**
   * 부서업무함 정보를 등록한다.
   *
   * @param DeptJobBxVO
   * @return String
   * @param deptJobBxVO
   */
  @RequestMapping("/cop/smt/djm/insertDeptJobBx.do")
  public String insertDeptJobBx(
      @ModelAttribute("deptJobBxVO") DeptJobBxVO deptJobBxVO,
      BindingResult bindingResult,
      ModelMap model)
      throws Exception {
    // 0. Spring Security 사용자권한 처리
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    if (!isAuthenticated) {
      model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
      return "egovframework/com/uat/uia/EgovLoginUsr";
    }

    // 로그인 객체 선언
    LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    String sLocationUrl = "egovframework/com/cop/smt/djm/EgovDeptJobBxRegist";

    // 서버  validate 체크
    beanValidator.validate(deptJobBxVO, bindingResult);
    if (bindingResult.hasErrors()) {
      return sLocationUrl;
    }

    // 아이디 설정
    deptJobBxVO.setFrstRegisterId((String) loginVO.getUniqId());
    deptJobBxVO.setLastUpdusrId((String) loginVO.getUniqId());

    // 부서내 부서업무함명 중복체크
    if (deptJobService.selectDeptJobBxCheck(deptJobBxVO) > 0) {
      model.addAttribute("deptJobBxNmDuplicated", "true");
      sLocationUrl = "forward:/cop/smt/djm/addDeptJobBx.do";
    } else {
      deptJobService.insertDeptJobBx(deptJobBxVO);
      sLocationUrl = "forward:/cop/smt/djm/selectDeptJobBxList.do";
    }
    return sLocationUrl;
  }
コード例 #3
0
  /**
   * 부서업무함 정보를 수정한다.
   *
   * @param DeptJobBxVO
   * @return String
   * @param deptJobBxVO
   */
  @RequestMapping("/cop/smt/djm/updateDeptJobBx.do")
  public String updateDeptJobBx(
      @ModelAttribute("deptJobBxVO") DeptJobBxVO deptJobBxVO,
      BindingResult bindingResult,
      ModelMap model)
      throws Exception {
    LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

    beanValidator.validate(deptJobBxVO, bindingResult);
    if (bindingResult.hasErrors()) {
      // DeptJobBx result = deptJobService.selectDeptJobBx(deptJobBxVO);
      // model.addAttribute("deptJobBx", result);
      return "egovframework/com/cop/smt/djm/EgovDeptJobBxUpdt";
    }

    if (isAuthenticated) {
      deptJobBxVO.setLastUpdusrId(user.getUniqId());
      deptJobService.updateDeptJobBx(deptJobBxVO);
    }

    return "forward:/cop/smt/djm/selectDeptJobBxList.do";
  }