コード例 #1
0
  /**
   * 연계시스템을 등록한다.
   *
   * @param loginVO
   * @param cntcSystem
   * @param bindingResult
   * @param model
   * @return "egovframework/com/ssi/syi/iis/EgovCntcSystemRegist"
   * @throws Exception
   */
  @RequestMapping(value = "/ssi/syi/iis/addCntcSystem.do")
  public String insertCntcSystem(
      @ModelAttribute("cntcSystem") CntcSystem cntcSystem,
      BindingResult bindingResult,
      @RequestParam Map<?, ?> commandMap,
      ModelMap model)
      throws Exception {
    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    if (sCmd.equals("")) {
      // 연계기관 리스트박스 데이터
      CntcInsttVO searchCntcInsttVO;
      searchCntcInsttVO = new CntcInsttVO();
      searchCntcInsttVO.setRecordCountPerPage(999999);
      searchCntcInsttVO.setFirstIndex(0);
      searchCntcInsttVO.setSearchCondition("CodeList");
      List<?> cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
      model.addAttribute("cntcInsttList", cntcInsttList);

      return "egovframework/com/ssi/syi/iis/EgovCntcSystemRegist";
    } else if (sCmd.equals("Regist")) {

      beanValidator.validate(cntcSystem, bindingResult);
      if (bindingResult.hasErrors()) {
        // 연계기관 리스트박스 데이터
        CntcInsttVO searchCntcInsttVO;
        searchCntcInsttVO = new CntcInsttVO();
        searchCntcInsttVO.setRecordCountPerPage(999999);
        searchCntcInsttVO.setFirstIndex(0);
        searchCntcInsttVO.setSearchCondition("CodeList");
        List<?> cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
        model.addAttribute("cntcInsttList", cntcInsttList);

        return "egovframework/com/ssi/syi/iis/EgovCntcSystemRegist";
      }

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

      // ID Generation
      String sSysId = idgenServiceSys.getNextStringId();
      cntcSystem.setSysId(sSysId);

      cntcInsttService.insertCntcSystem(cntcSystem);
      return "forward:/ssi/syi/iis/getCntcInsttDetail.do";
    } else {
      return "forward:/ssi/syi/iis/getCntcInsttDetail.do";
    }
  }
コード例 #2
0
  /**
   * 연계시스템을 수정한다.
   *
   * @param loginVO
   * @param cntcInstt
   * @param bindingResult
   * @param commandMap
   * @param model
   * @return "egovframework/com/ssi/syi/iis/EgovCntcSystemModify"
   * @throws Exception
   */
  @RequestMapping(value = "/ssi/syi/iis/updateCntcSystem.do")
  public String updateCntcSystem(
      @ModelAttribute("cntcSystem") CntcSystem cntcSystem,
      BindingResult bindingResult,
      @RequestParam Map<?, ?> commandMap,
      ModelMap model)
      throws Exception {
    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    if (sCmd.equals("")) {
      // 연계기관 리스트박스 데이터
      CntcInsttVO searchCntcInsttVO;
      searchCntcInsttVO = new CntcInsttVO();
      searchCntcInsttVO.setRecordCountPerPage(999999);
      searchCntcInsttVO.setFirstIndex(0);
      searchCntcInsttVO.setSearchCondition("CodeList");
      List<?> cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
      model.addAttribute("cntcInsttList", cntcInsttList);

      // 연계시스템 리스트박스 데이터 2011.09.14
      CntcSystemVO searchCntcSystemVO;
      searchCntcSystemVO = new CntcSystemVO();
      searchCntcSystemVO.setRecordCountPerPage(999999);
      searchCntcSystemVO.setFirstIndex(0);
      searchCntcSystemVO.setSearchCondition("CodeList");
      if (cntcSystem.getInsttId().equals("")) {
        if (cntcInsttList.size() > 0) {
          EgovMap emp = (EgovMap) cntcInsttList.get(0);
          cntcSystem.setInsttId(emp.get("insttId").toString());
        }
      }
      searchCntcSystemVO.setInsttId(cntcSystem.getInsttId());
      List<?> cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
      model.addAttribute("cntcSystemList", cntcSystemList);

      // 연계메시지 리스트박스 데이터 2011.09.14
      CntcMessageVO searchCntcMessageVO;
      searchCntcMessageVO = new CntcMessageVO();
      searchCntcMessageVO.setRecordCountPerPage(999999);
      searchCntcMessageVO.setFirstIndex(0);
      searchCntcMessageVO.setSearchCondition("CodeList");
      List<?> cntcMessageList = cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
      model.addAttribute("cntcMessageList", cntcMessageList);

      CntcSystem vo = cntcInsttService.selectCntcSystemDetail(cntcSystem);
      model.addAttribute("cntcSystem", vo);

      return "egovframework/com/ssi/syi/iis/EgovCntcSystemUpdt";
    } else if (sCmd.equals("Modify")) {
      beanValidator.validate(cntcSystem, bindingResult);
      if (bindingResult.hasErrors()) {
        // 연계기관 리스트박스 데이터
        CntcInsttVO searchCntcInsttVO;
        searchCntcInsttVO = new CntcInsttVO();
        searchCntcInsttVO.setRecordCountPerPage(999999);
        searchCntcInsttVO.setFirstIndex(0);
        searchCntcInsttVO.setSearchCondition("CodeList");
        List<?> cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
        model.addAttribute("cntcInsttList", cntcInsttList);

        // 연계시스템 리스트박스 데이터 2011.09.14
        CntcSystemVO searchCntcSystemVO;
        searchCntcSystemVO = new CntcSystemVO();
        searchCntcSystemVO.setRecordCountPerPage(999999);
        searchCntcSystemVO.setFirstIndex(0);
        searchCntcSystemVO.setSearchCondition("CodeList");
        if (cntcSystem.getInsttId().equals("")) {
          if (cntcInsttList.size() > 0) {
            EgovMap emp = (EgovMap) cntcInsttList.get(0);
            cntcSystem.setInsttId(emp.get("insttId").toString());
          }
        }
        searchCntcSystemVO.setInsttId(cntcSystem.getInsttId());
        List<?> cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
        model.addAttribute("cntcSystemList", cntcSystemList);

        // 연계메시지 리스트박스 데이터 2011.09.14
        CntcMessageVO searchCntcMessageVO;
        searchCntcMessageVO = new CntcMessageVO();
        searchCntcMessageVO.setRecordCountPerPage(999999);
        searchCntcMessageVO.setFirstIndex(0);
        searchCntcMessageVO.setSearchCondition("CodeList");
        List<?> cntcMessageList = cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
        model.addAttribute("cntcMessageList", cntcMessageList);

        CntcSystem vo = cntcInsttService.selectCntcSystemDetail(cntcSystem);
        model.addAttribute("cntcSystem", vo);

        return "egovframework/com/ssi/syi/iis/EgovCntcSystemUpdt";
      }

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

      cntcSystem.setLastUpdusrId(uniqId);
      cntcInsttService.updateCntcSystem(cntcSystem);
      return "forward:/ssi/syi/iis/getCntcInsttList.do";
    } else {
      return "forward:/ssi/syi/iis/getCntcInsttList.do";
    }
  }