File name
Commit message
Commit date
2024-11-14
File name
Commit message
Commit date
2024-11-14
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
2024-09-10
File name
Commit message
Commit date
File name
Commit message
Commit date
package itn.let.mjo.block.web;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import itn.com.cmm.LoginVO;
import itn.com.utl.fcc.service.EgovStringUtil;
import itn.let.mjo.block.service.MjonBlockService;
import itn.let.mjo.block.service.MjonBlockVO;
@Controller
public class MjonBlockController {
@Resource(name = "mjonBlockService")
private MjonBlockService mjonBlockService;
/**
* 회원별 차단 목록 관리자페이지
* @param blockVO
* @param request
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/uss/ion/block/selectBlockList.do")
public String selectBlockList(@ModelAttribute("searchVO") MjonBlockVO blockVO,
HttpServletRequest request ,
ModelMap model) throws Exception {
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
blockVO.setUserId("admin");
if(blockVO.getPageUnit() != 10) {
blockVO.setPageUnit(blockVO.getPageUnit());
}
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(blockVO.getPageIndex());
paginationInfo.setRecordCountPerPage(blockVO.getPageUnit());
paginationInfo.setPageSize(blockVO.getPageSize());
blockVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
blockVO.setLastIndex(paginationInfo.getLastRecordIndex());
blockVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
if("".equals(blockVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
blockVO.setSearchSortCnd("blockId");
blockVO.setSearchSortOrd("desc");
}
List<MjonBlockVO> blockList = mjonBlockService.selectAdmBlockList(blockVO);
int totCnt = 0;
if(blockList.size() > 0) {
totCnt = blockList.get(0).getTotCnt();
}
model.addAttribute("blockList", blockList);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return "/uss/ion/msg/BlockList";
}
/**
* 회원별 차단 목록 삭제 ajax
* @param blockVO
* @param request
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/uss/ion/block/deleteBlockListAjax.do")
public ModelAndView deleteBlockListAjax(@ModelAttribute("searchVO") MjonBlockVO blockVO,
HttpServletRequest request ,
ModelMap model) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
boolean isSuccess = true;
try {
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
blockVO.setAdmUserId(userId);
// 관리자 메모작성 버전
mjonBlockService.deleteBlockWithMemo(blockVO);
}catch(Exception e) {
isSuccess = false;
}
modelAndView.addObject("isSuccess", isSuccess);
return modelAndView;
}
}