Exemplo n.º 1
0
  /**
   * Q&A정보를 등록하기 위한 전 처리(인증체크)
   *
   * @param searchVO
   * @param qnaManageVO
   * @param model
   * @return "/uss/olh/qna/EgovQnaCnRegist"
   * @throws Exception
   */
  @RequestMapping("/uss/olh/qna/QnaCnRegistView.do")
  public String insertQnaCnView(
      @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, QnaManageVO qnaManageVO, Model model)
      throws Exception {

    // 인증여부 체크
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

    // isAuthenticated = false;

    if (!isAuthenticated) {

      model.addAttribute("result", qnaManageVO);
      model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
      return "uat/uia/EgovLoginUsr";
      // return "/uss/olh/qna/EgovQnaCnRegist";

    }

    // 로그인VO에서  사용자 정보 가져오기
    LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    String wrterNm = loginVO.getName(); // 사용자명
    String emailAdres = loginVO.getEmail(); // email 주소

    qnaManageVO.setWrterNm(wrterNm); // 작성자명
    qnaManageVO.setEmailAdres(emailAdres); // email 주소

    model.addAttribute("result", qnaManageVO);
    model.addAttribute("qnaManageVO", qnaManageVO);

    return "/uss/olh/qna/EgovQnaCnRegist";
  }
Exemplo n.º 2
0
  /**
   * Head메뉴를 조회한다.
   *
   * @param menuManageVO MenuManageVO
   * @return 출력페이지정보 "main_headG", "main_head"
   * @exception Exception
   */
  @RequestMapping(value = "/sym/mms/EgovMainMenuHead.do")
  public String selectMainMenuHead(
      // @ModelAttribute("menuManageVO") MenuManageVO menuManageVO,
      @RequestParam(value = "flag", required = false) String flag, ModelMap model)
      throws Exception {

    MenuManageVO menuManageVO = new MenuManageVO();

    LoginVO user =
        EgovUserDetailsHelper.isAuthenticated()
            ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser()
            : null;
    if (EgovUserDetailsHelper.isAuthenticated() && user != null) {
      menuManageVO.setTmp_Id(user.getId());
      menuManageVO.setTmp_Password(user.getPassword());
      menuManageVO.setTmp_UserSe(user.getUserSe());
      menuManageVO.setTmp_Name(user.getName());
      menuManageVO.setTmp_Email(user.getEmail());
      menuManageVO.setTmp_OrgnztId(user.getOrgnztId());
      menuManageVO.setTmp_UniqId(user.getUniqId());
      model.addAttribute("list_headmenu", menuManageService.selectMainMenuHead(menuManageVO));
      model.addAttribute("list_menulist", menuManageService.selectMainMenuLeft(menuManageVO));
    } else {
      menuManageVO.setAuthorCode("ROLE_ANONYMOUS");
      model.addAttribute(
          "list_headmenu", menuManageService.selectMainMenuHeadByAuthor(menuManageVO));
      model.addAttribute(
          "list_menulist", menuManageService.selectMainMenuLeftByAuthor(menuManageVO));
    }

    if (flag == null) {
      return "main/inc/EgovIncSubHeader"; // 업무화면의 상단메뉴 화면
    } else if (flag.equals("MAIN")) {
      return "main/inc/EgovIncHeader"; // 메인화면의 상단메뉴 화면
    } else {
      return "main/inc/EgovIncSubHeader"; // 업무화면의 상단메뉴 화면
    }
  }
  /**
   * 휴가관리 등록 화면으로 이동한다.
   *
   * @return String - 리턴 Url
   */
  @RequestMapping(value = "/uss/ion/vct/EgovVcatnRegist.do")
  public String insertViewVcatnManage(
      @ModelAttribute("vcatnManage") VcatnManage vcatnManage,
      @ModelAttribute("vcatnManageVO") VcatnManageVO vcatnManageVO,
      ModelMap model)
      throws Exception {
    List<?> vcatnSeCodeList = null;
    LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    VcatnManageVO vcatnManageVO1 = egovVcatnManageService.selectIndvdlYrycManage(user.getUniqId());
    vcatnManageVO1.setApplcntId(user.getUniqId());
    vcatnManageVO1.setApplcntNm(user.getName());
    vcatnManageVO1.setOrgnztNm(user.getOrgnztNm());

    ComDefaultCodeVO vo = new ComDefaultCodeVO();
    vo.setCodeId("COM056");
    vcatnSeCodeList = cmmUseService.selectCmmCodeDetail(vo);

    model.addAttribute("vcatnSeCode", vcatnSeCodeList);
    model.addAttribute("vcatnManageVO", vcatnManageVO1);

    return "egovframework/com/uss/ion/vct/EgovVcatnRegist";
  }
  /**
   * 기 등록된 휴가관리정보를 수정한다.
   *
   * @param vcatnManage - 휴가관리 model
   * @return String - 리턴 Url
   */
  @RequestMapping(value = "/uss/ion/vct/updtVcatnManage.do")
  public String updtVcatnManage(
      @ModelAttribute("vcatnManage") VcatnManage vcatnManage,
      @ModelAttribute("vcatnManageVO") VcatnManageVO vcatnManageVO,
      BindingResult bindingResult,
      SessionStatus status,
      ModelMap model)
      throws Exception {
    String sTemp = null;
    String sTempMessage = null;
    int iTemp = 0;
    /*
    		beanValidator.validate(vcatnManage, bindingResult); //validation 수행

        	if (bindingResult.hasErrors()) {
        		model.addAttribute("vcatnManageVO", vcatnManageVO);
    			return "egovframework/com/uss/ion/vct/EgovVcatnUpdt";
    		} else {

    	    	vcatnManage.setBgnde(EgovStringUtil.removeMinusChar(vcatnManage.getBgnde()));
    	    	vcatnManage.setEndde(EgovStringUtil.removeMinusChar(vcatnManage.getEndde()));
    	    	sTempMessage = egovVcatnManageService.updtVcatnManage(vcatnManage, vcatnManageVO);
    	    	return "forward:/uss/ion/vct/EgovVcatnManageList.do";
    		}
    */
    LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
    vcatnManage.setFrstRegisterId(user.getUniqId());
    sTemp = egovVcatnManageService.updtVcatnManage(vcatnManage, vcatnManageVO);
    if (iTemp != 10) {
      status.setComplete();
      // sTemp = egovVcatnManageService.insertVcatnManage(vcatnManage, vcatnManageVO);

      if (sTemp.equals("01")) {
        sTempMessage = "입력성공";
        model.addAttribute("message", sTempMessage);
        return "forward:/uss/ion/vct/EgovVcatnManageList.do";
      } else {
        if (sTemp.equals("99")) sTempMessage = "휴가일자 지정 오류 - 휴가시작일자/종료일자를 확인하세요.";
        if (sTemp.equals("09")) sTempMessage = "연차사용시 휴가는 당해연도만 가능합니다.";
        if (sTemp.equals("02")) sTempMessage = "연차휴가 등록실패(잔여연차 부족)";
        if (sTemp.equals("03")) sTempMessage = "반차휴가 등록실패(잔여연차 부족)";
        model.addAttribute("errorMessage", sTempMessage);

        VcatnManageVO vcatnManageVO1 =
            egovVcatnManageService.selectIndvdlYrycManage(user.getUniqId());
        vcatnManageVO1.setApplcntId(user.getUniqId());
        vcatnManageVO1.setApplcntNm(user.getName());
        vcatnManageVO1.setOrgnztNm(user.getOrgnztNm());
        vcatnManageVO1.setTempBgnde(EgovDateUtil.formatDate(vcatnManage.getBgnde(), "-"));
        vcatnManageVO1.setTempEndde(EgovDateUtil.formatDate(vcatnManage.getEndde(), "-"));

        model.addAttribute("vcatnManageVO", vcatnManageVO1);
        ComDefaultCodeVO vo = new ComDefaultCodeVO();
        vo.setCodeId("COM056");
        List<?> vcatnSeCodeList = cmmUseService.selectCmmCodeDetail(vo);
        model.addAttribute("vcatnSeCode", vcatnSeCodeList);

        return "egovframework/com/uss/ion/vct/EgovVcatnUpdt";
      }
    } else {

      sTempMessage = "휴가일자가 중복되었습니다. 휴가일자를 확인해 주세요.";
      model.addAttribute("errorMessage", sTempMessage);

      VcatnManageVO vcatnManageVO1 =
          egovVcatnManageService.selectIndvdlYrycManage(user.getUniqId());
      vcatnManageVO1.setApplcntId(user.getUniqId());
      vcatnManageVO1.setApplcntNm(user.getName());
      vcatnManageVO1.setOrgnztNm(user.getOrgnztNm());
      model.addAttribute("vcatnManageVO", vcatnManageVO1);

      ComDefaultCodeVO vo = new ComDefaultCodeVO();
      vo.setCodeId("COM056");
      List<?> vcatnSeCodeList = cmmUseService.selectCmmCodeDetail(vo);
      model.addAttribute("vcatnSeCode", vcatnSeCodeList);

      return "egovframework/com/uss/ion/vct/EgovVcatnUpdt";
    }
  }
  /**
   * 휴가관리정보를 신규로 등록한다.
   *
   * @param vcatnManage - 휴가관리 model
   * @return String - 리턴 Url
   */
  @RequestMapping(value = "/uss/ion/vct/insertVcatnManage.do")
  public String insertVcatnManage(
      @ModelAttribute("vcatnManage") VcatnManage vcatnManage,
      @ModelAttribute("vcatnManageVO") VcatnManageVO vcatnManageVO,
      BindingResult bindingResult,
      SessionStatus status,
      @RequestParam Map<?, ?> commandMap,
      ModelMap model)
      throws Exception {
    // 승인권자 소속명, 성명   유지
    model.addAttribute(
        "infSanctnDtNm",
        commandMap.get("sanctnDtNm") == null ? "" : (String) commandMap.get("sanctnDtNm"));
    model.addAttribute(
        "infOrgnztNm",
        commandMap.get("orgnztNm") == null ? "" : (String) commandMap.get("orgnztNm"));

    String sEnddeView =
        commandMap.get("enddeView") == null ? "" : (String) commandMap.get("enddeView"); // 종료일자 구분
    if (!sEnddeView.equals("")) vcatnManage.setEndde(sEnddeView);

    String sTemp = null;
    String sTempMessage = null;
    int iTemp = 0;

    beanValidator.validate(vcatnManage, bindingResult); // validation 수행

    if (bindingResult.hasErrors()) {
      model.addAttribute("vcatnManageVO", vcatnManageVO);
      return "egovframework/com/uss/ion/vct/EgovVcatnRegist";
    } else {
      LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
      if (vcatnManage.getSanctnerId() != null) vcatnManage.setConfmAt("A");
      vcatnManage.setApplcntId(user.getUniqId());
      vcatnManage.setFrstRegisterId(user.getUniqId());

      vcatnManageVO.setApplcntId(user.getUniqId());
      vcatnManageVO.setSearchKeyword(EgovStringUtil.removeMinusChar(vcatnManage.getBgnde()));
      // 시작일자  포함여부
      iTemp = egovVcatnManageService.selectVcatnManageDplctAt(vcatnManageVO);
      vcatnManageVO.setSearchKeyword(EgovStringUtil.removeMinusChar(vcatnManage.getEndde()));
      // 종료일자  포함여부
      iTemp += egovVcatnManageService.selectVcatnManageDplctAt(vcatnManageVO);

      if (iTemp == 0) {
        status.setComplete();
        sTemp = egovVcatnManageService.insertVcatnManage(vcatnManage, vcatnManageVO);

        if (sTemp.equals("01")) {
          sTempMessage = "입력성공";
          model.addAttribute("message", sTempMessage);
          return "forward:/uss/ion/vct/EgovVcatnManageList.do";
        } else {
          if (sTemp.equals("99")) sTempMessage = "휴가일자 지정 오류 - 휴가시작일자/종료일자를 확인하세요.";
          if (sTemp.equals("09")) sTempMessage = "연차사용시 휴가는 당해연도만 가능합니다.";
          if (sTemp.equals("02")) sTempMessage = "연차휴가 등록실패(잔여연차 부족)";
          if (sTemp.equals("03")) sTempMessage = "반차휴가 등록실패(잔여연차 부족)";
          model.addAttribute("errorMessage", sTempMessage);

          VcatnManageVO vcatnManageVO1 =
              egovVcatnManageService.selectIndvdlYrycManage(user.getUniqId());
          vcatnManageVO1.setApplcntId(user.getUniqId());
          vcatnManageVO1.setApplcntNm(user.getName());
          vcatnManageVO1.setOrgnztNm(user.getOrgnztNm());
          vcatnManageVO1.setTempBgnde(EgovDateUtil.formatDate(vcatnManage.getBgnde(), "-"));
          vcatnManageVO1.setTempEndde(EgovDateUtil.formatDate(vcatnManage.getEndde(), "-"));

          model.addAttribute("vcatnManageVO", vcatnManageVO1);
          ComDefaultCodeVO vo = new ComDefaultCodeVO();
          vo.setCodeId("COM056");
          List<?> vcatnSeCodeList = cmmUseService.selectCmmCodeDetail(vo);
          model.addAttribute("vcatnSeCode", vcatnSeCodeList);

          return "egovframework/com/uss/ion/vct/EgovVcatnRegist";
        }
      } else {

        sTempMessage = "휴가일자가 중복되었습니다. 휴가일자를 확인해 주세요.";
        model.addAttribute("errorMessage", sTempMessage);

        VcatnManageVO vcatnManageVO1 =
            egovVcatnManageService.selectIndvdlYrycManage(user.getUniqId());
        vcatnManageVO1.setApplcntId(user.getUniqId());
        vcatnManageVO1.setApplcntNm(user.getName());
        vcatnManageVO1.setOrgnztNm(user.getOrgnztNm());
        model.addAttribute("vcatnManageVO", vcatnManageVO1);

        ComDefaultCodeVO vo = new ComDefaultCodeVO();
        vo.setCodeId("COM056");
        List<?> vcatnSeCodeList = cmmUseService.selectCmmCodeDetail(vo);
        model.addAttribute("vcatnSeCode", vcatnSeCodeList);

        return "egovframework/com/uss/ion/vct/EgovVcatnRegist";
      }
    }
  }