Esempio n. 1
0
  // 커뮤니티 상세보기의 정보 수정
  @RequestMapping(value = "/insertUserComtBasicInfo")
  public void setInsertUserComtBasicInfo(
      @RequestParam Map<String, Object> paramMap,
      HttpServletResponse response,
      Authentication authentication)
      throws IOException {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();
    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());
    String txtMastGubun = (String) paramMap.get("txtMastGubun");
    String[] mg_arr = ((String) paramMap.get("txtMastGubun")).split(",");

    int rows = 0;
    int cntRw = 0;
    cntRw = communityService.getInserComtBasicInfoNm(paramMap);

    if (cntRw > 0) {
      rows = 99;
    } else {
      rows = communityService.setInsertUserComtBasicInfo(paramMap);
    }

    try {
      ObjectMapper mapper = new ObjectMapper();
      response.setContentType("application/json");
      mapper.writeValue(response.getOutputStream(), rows);
    } catch (Exception e) {
      throw e;
    }
  }
Esempio n. 2
0
  @RequestMapping(value = "/comtMain")
  public String getCumtMain(
      @RequestParam Map<String, Object> paramMap, ModelMap model, Authentication authentication)
      throws Throwable {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();

    // cumt left 메뉴 조회
    List<ComtVo> list = getCumntUserJoinList(memberInfo);
    model.addAttribute("comtlist", list);
    model.addAttribute("memberInfo", memberInfo);

    model.put("compId", memberInfo.getCompId());

    // 커뮤니티내의 게시글 조회(전체)
    paramMap.put("allYn", "");
    paramMap.put("compId", memberInfo.getCompId());
    int total = 0;
    List<ComtBoardVo> boardList = communityService.getComtBoardNewList(paramMap);
    if (boardList != null && boardList.size() > 0) {
      total = boardList.size();
    }

    model.put("comtBdList", boardList);
    model.put("total", total);

    return "/cumtMainLayout/left_community/comtMain";
  }
Esempio n. 3
0
  // 커뮤니티 가입신청 처리
  @RequestMapping(value = "/insertComtAllInfoUserAdd")
  public void setInsertComtAllInfoUserAdd(
      @RequestParam Map<String, Object> paramMap,
      HttpServletResponse response,
      Authentication authentication)
      throws IOException {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();
    paramMap.put("userId", memberInfo.getUserId());
    paramMap.put("deptId", memberInfo.getDeptId());
    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("typeGubun", "C");
    paramMap.put("mastGubun", "U");
    paramMap.put("inviteYn", "40");
    paramMap.put("joinYn", "N");

    int rows = 0;
    rows = communityService.setInsertComtAllInfoUserAdd(paramMap);

    try {
      ObjectMapper mapper = new ObjectMapper();
      response.setContentType("application/json");
      mapper.writeValue(response.getOutputStream(), rows);
    } catch (Exception e) {
      throw e;
    }
  }
Esempio n. 4
0
  @RequestMapping(value = "/writeComtMainBasic")
  public void setWriteComtMainBasic(
      @ModelAttribute ComtVo comtVo, HttpServletResponse response, Authentication authentication)
      throws Throwable {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();

    Map<String, Object> paramMap = getComtBasic(memberInfo);
    String admActYn = (String) paramMap.get("CUMT_TYPE");
    comtVo.setRegUserId(memberInfo.getUserId());
    comtVo.setCompId(memberInfo.getCompId());
    comtVo.setDeptId(memberInfo.getDeptId());
    comtVo.setAdmActYn(admActYn);
    comtVo.setTypeGubun("C");
    comtVo.setMastGubun("M");
    comtVo.setJoinYn("Y");
    comtVo.setInviteYn("40");
    comtVo.setFcComtId(DateTimeUniqueConverter.UNIQUEKEY15());

    int addRow = communityService.insertNewComtInfo(comtVo);

    try {
      ObjectMapper mapper = new ObjectMapper();
      response.setContentType("application/json");
      mapper.writeValue(response.getOutputStream(), addRow);
    } catch (Exception e) {
      throw e;
    }
    //		return "redirect:/cumnity/comtMain";
  }
Esempio n. 5
0
  // 커뮤니티 가입여부 조회
  public int getComtJoinYn(MemberInfo memberInfo, Map<String, Object> paramMap) {
    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());

    int joinYn = communityService.getComtJoinCnt(paramMap);

    return joinYn;
  }
Esempio n. 6
0
  // 내가 가입한 커뮤니티 리스트(가입대기 포함)
  public List<ComtVo> getCumntUserJoinList(MemberInfo memberInfo) {
    Map<String, Object> paramMap = new HashMap<String, Object>();

    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());
    paramMap.put("admActYn", "Y");

    List<ComtVo> list = communityService.getComntUserJoinList(paramMap);

    return list;
  }
Esempio n. 7
0
  // 커뮤니티 게시판 기본 메인화면 - comtLayout/*
  @RequestMapping(value = "/comtView")
  public String getComtViewInfo(
      HttpServletRequest request,
      @RequestParam Map<String, Object> paramMap,
      ModelMap model,
      Authentication authentication)
      throws Throwable {
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();

    // 현재 커뮤니티의 가입 여부 확인
    int joinCnt = getComtJoinYn(memberInfo, paramMap);
    if (joinCnt == 0) {
      model.put("errorType", "1");
    }

    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());
    paramMap.put("admActYn", "Y");

    // left 커뮤니티 조회(해당)
    Map<String, Object> comtInfo = communityService.getUsersComtInfoNm(paramMap);

    // left 커뮤니티 조회(해당제외)
    List<ComtVo> list = communityService.getComntUserJoinList(paramMap);

    // 생성된 게시판 리스트 조회
    List<ComtBoardInfoVo> boardInfoList = communityService.getComtBoardInfoList(paramMap);

    // 해당 커뮤니티의 최신글 조회
    paramMap.put("allYn", "Y");
    int total = 0;
    List<ComtBoardVo> boardList = communityService.getComtBoardNewList(paramMap);
    if (boardList != null && boardList.size() > 0) {
      total = boardList.size();
    }

    model.put("compId", memberInfo.getCompId());
    model.put("joinCnt", joinCnt);
    model.put("comtInfo", comtInfo);
    model.put("comtList", list);
    model.put("comtBdList", boardList);
    model.put("boardInfoList", boardInfoList);
    model.put("fcComtId", paramMap.get("fcComtId"));
    model.put("total", total);

    return "/comtLayout/comtBoardMain";
  }
Esempio n. 8
0
  // 커뮤니티 관리자 설정 기본 정보조회
  public Map<String, Object> getComtBasic(MemberInfo memberInfo) {
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("compId", memberInfo.getCompId());

    Map<String, Object> comtInfo = null;
    comtInfo = communityService.getBasicComtInfo(paramMap);

    return comtInfo;
  }
Esempio n. 9
0
  @RequestMapping(value = "/getComtAddUsrAllList")
  public void getComtAddUsrAllListData(
      @RequestParam Map<String, Object> paramMap,
      HttpServletResponse response,
      Authentication authentication)
      throws IOException {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();
    paramMap.put("compId", memberInfo.getCompId());

    List<Map<String, Object>> memList = comtInfoMemberList(paramMap);

    try {
      ObjectMapper mapper = new ObjectMapper();
      response.setContentType("application/json");
      mapper.writeValue(response.getOutputStream(), memList);
    } catch (Exception e) {
      throw e;
    }
  }
Esempio n. 10
0
  // 커뮤니티 가입승인 처리
  @RequestMapping(value = "/updateComtInfoMemUser")
  public void setUpdateComtInfoMemUse(
      @RequestParam Map<String, Object> paramMap,
      HttpServletResponse response,
      Authentication authentication)
      throws IOException {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();

    paramMap.put("reguserId", memberInfo.getUserId());

    int rows = 0;
    rows = communityService.setUpdateComtInfoMemUser(paramMap);

    try {
      ObjectMapper mapper = new ObjectMapper();
      response.setContentType("application/json");
      mapper.writeValue(response.getOutputStream(), rows);
    } catch (Exception e) {
      throw e;
    }
  }
Esempio n. 11
0
  // 커뮤니티 상세 VIEW
  @RequestMapping(value = "/comtInfoEdit")
  public String getComtInfoEditView(
      @RequestParam Map<String, Object> paramMap, ModelMap model, Authentication authentication)
      throws Throwable {
    // Spring Security의 Authentication 객를 주입
    MemberInfo memberInfo = (MemberInfo) authentication.getPrincipal();
    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());

    model.put("compId", memberInfo.getCompId());
    model.put("comtVo", this.comtMaker(paramMap));
    model.put("fcComtId", paramMap.get("fcComtId"));
    model.addAttribute("useList", this.comtUserMaster(paramMap));

    // 현재 커뮤니티의 가입 여부 확인
    int joinCnt = getComtJoinYn(memberInfo, paramMap);
    if (joinCnt == 0) {
      model.put("errorType", "1");
    }

    // left 커뮤니티 조회(해당)
    Map<String, Object> comtInfo = communityService.getUsersComtInfoNm(paramMap);

    paramMap.put("compId", memberInfo.getCompId());
    paramMap.put("userId", memberInfo.getUserId());
    paramMap.put("admActYn", "Y");

    // left 커뮤니티 조회(해당제외)
    List<ComtVo> list = communityService.getComntUserJoinList(paramMap);

    // 생성된 게시판 리스트 조회
    paramMap.put("userId", memberInfo.getUserId());
    List<ComtBoardInfoVo> boardInfoList = communityService.getComtBoardInfoList(paramMap);

    model.put("compId", memberInfo.getCompId());
    model.put("joinCnt", joinCnt);
    model.put("comtInfo", comtInfo);
    model.put("comtList", list);
    model.put("boardInfoList", boardInfoList);

    return "/cumtMainLayout/left_comtBoardMain/comtViewMain";
  }