diff --git a/src/main/java/kcc/com/srch/service/SearchVO.java b/src/main/java/kcc/com/srch/service/SearchVO.java index 17aae17d..19dc8bf5 100644 --- a/src/main/java/kcc/com/srch/service/SearchVO.java +++ b/src/main/java/kcc/com/srch/service/SearchVO.java @@ -12,7 +12,7 @@ import lombok.Setter; @Getter @Setter @NoArgsConstructor -public class SearchVO implements Serializable { +public class SearchVO extends ComDefaultVO implements Serializable { private static final long serialVersionUID = 1L; @@ -22,8 +22,8 @@ public class SearchVO implements Serializable { */ private String searchType; private String searchKeyword; - private String pagingSize; - private String page; + private String pagingSize = "10"; + private String page = "1"; /* diff --git a/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java b/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java index 2e1cc43d..937704c8 100644 --- a/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java +++ b/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java @@ -6,12 +6,12 @@ import java.util.Map; import org.springframework.stereotype.Service; import org.springframework.ui.ModelMap; -import com.fasterxml.jackson.databind.node.TextNode; - import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; +import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import kcc.com.srch.service.SearchService; import kcc.com.srch.service.SearchVO; import seed.utils.FairnetUtils; +import seed.utils.SeedUtils; @Service("SearchService") public class SearchServiceImpl extends EgovAbstractServiceImpl implements SearchService { @@ -22,12 +22,13 @@ public class SearchServiceImpl extends EgovAbstractServiceImpl implements Search ModelMap model ){ -// Map application = FairnetUtils.searchApplication("application", "테스트", "3", "1"); - Map board = FairnetUtils.searchApplication("board", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); - Map completed = FairnetUtils.searchApplication("completed", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); - Map conference = FairnetUtils.searchApplication("conference", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); - Map counsel = FairnetUtils.searchApplication("counsel", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); - Map process = FairnetUtils.searchApplication("process", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); +// searchVO.setPage(SeedUtils.setReplaceNull(searchVO.getPageIndex()) != "" ? SeedUtils.setReplaceNull(searchVO.getPageIndex()) : "1"); + + Map board = FairnetUtils.searchApplication("board", searchVO.getSearchKeyword(), searchVO.getPagingSize(), searchVO.getPageIndex()); + Map completed = FairnetUtils.searchApplication("completed", searchVO.getSearchKeyword(), searchVO.getPagingSize(), searchVO.getPageIndex()); + Map conference = FairnetUtils.searchApplication("conference", searchVO.getSearchKeyword(), searchVO.getPagingSize(), searchVO.getPageIndex()); + Map counsel = FairnetUtils.searchApplication("counsel", searchVO.getSearchKeyword(), searchVO.getPagingSize(), searchVO.getPageIndex()); + Map process = FairnetUtils.searchApplication("process", searchVO.getSearchKeyword(), searchVO.getPagingSize(),searchVO.getPageIndex()); BigDecimal totCnt = new BigDecimal(0); @@ -44,6 +45,44 @@ public class SearchServiceImpl extends EgovAbstractServiceImpl implements Search model.addAttribute("counsel", counsel); model.addAttribute("process", process); + PaginationInfo paginationInfo = new PaginationInfo(); + + paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); + paginationInfo.setRecordCountPerPage(searchVO.getPageUnit()); + paginationInfo.setPageSize(searchVO.getPageSize()); + + searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); + searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); + searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); + + int totalREcordCount = 0; + if("process".equals(searchVO.getSearchType())) { + if(process != null) { + totalREcordCount = Integer.valueOf((String)process.get("totcnt")); + } + }else if("conference".equals(searchVO.getSearchType())) { + if(conference != null) { + totalREcordCount = Integer.valueOf((String)conference.get("totcnt")); + } + }else if("completed".equals(searchVO.getSearchType())) { + if(completed != null) { + totalREcordCount = Integer.valueOf((String)completed.get("totcnt")); + } + }else if("board".equals(searchVO.getSearchType())) { + if(board != null) { + totalREcordCount = Integer.valueOf((String)board.get("totcnt")); + } + }else if("counsel".equals(searchVO.getSearchType())) { + if(counsel != null) { + totalREcordCount = Integer.valueOf((String)counsel.get("totcnt")); + } + }else { + paginationInfo.setTotalRecordCount(totCnt.intValue()); + } + paginationInfo.setTotalRecordCount(totalREcordCount); + + model.addAttribute("paginationInfo", paginationInfo); + } diff --git a/src/main/java/kcc/com/srch/web/SearchController.java b/src/main/java/kcc/com/srch/web/SearchController.java index 81eb1674..edce1c85 100644 --- a/src/main/java/kcc/com/srch/web/SearchController.java +++ b/src/main/java/kcc/com/srch/web/SearchController.java @@ -8,6 +8,7 @@ import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import kcc.com.srch.service.SearchService; import kcc.com.srch.service.SearchVO; @@ -27,9 +28,81 @@ public class SearchController { ) throws Exception { searchVO.setPagingSize("3"); + searchVO.setPageIndex(1); + searchVO.setSearchType("ALL"); searchService.searchListSet(searchVO, model); return "com/srch/searchList"; } + + @RequestMapping(value = "/com/srch/SearchProcess.do") + public String SearchProcess( + ModelMap model + , @ModelAttribute("searchVO") SearchVO searchVO + ) throws Exception { + + searchVO.setPagingSize("10"); + searchVO.setSearchType("process"); + + searchService.searchListSet(searchVO, model); + + return "com/srch/searchProcess"; + } + + @RequestMapping(value = "/com/srch/SearchConference.do") + public String SearchConference( + ModelMap model + , @ModelAttribute("searchVO") SearchVO searchVO + ) throws Exception { + + searchVO.setPagingSize("10"); + searchVO.setSearchType("conference"); + + searchService.searchListSet(searchVO, model); + + return "com/srch/searchConference"; + } + + @RequestMapping(value = "/com/srch/SearchCompleted.do") + public String SearchCompleted( + ModelMap model + , @ModelAttribute("searchVO") SearchVO searchVO + ) throws Exception { + + searchVO.setPagingSize("10"); + searchVO.setSearchType("completed"); + + searchService.searchListSet(searchVO, model); + + return "com/srch/searchCompleted"; + } + + @RequestMapping(value = "/com/srch/SearchBoard.do") + public String SearchBoard( + ModelMap model + , @ModelAttribute("searchVO") SearchVO searchVO + ) throws Exception { + + searchVO.setPagingSize("10"); + searchVO.setSearchType("board"); + + searchService.searchListSet(searchVO, model); + + return "com/srch/searchBoard"; + } + + @RequestMapping(value = "/com/srch/SearchCounsel.do") + public String SearchCounsel( + ModelMap model + , @ModelAttribute("searchVO") SearchVO searchVO + ) throws Exception { + + searchVO.setPagingSize("10"); + searchVO.setSearchType("counsel"); + + searchService.searchListSet(searchVO, model); + + return "com/srch/searchCounsel"; + } } \ No newline at end of file diff --git a/src/main/java/seed/utils/FairnetUtils.java b/src/main/java/seed/utils/FairnetUtils.java index 75abe62c..d5675a2f 100644 --- a/src/main/java/seed/utils/FairnetUtils.java +++ b/src/main/java/seed/utils/FairnetUtils.java @@ -340,7 +340,7 @@ public class FairnetUtils { String searchType , String searchKeyword , String pagingSize - , String page + , int page ) { String url = new SearchGlobalSet().getHost() diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchBoard.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchBoard.jsp new file mode 100644 index 00000000..9df3cc73 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchBoard.jsp @@ -0,0 +1,166 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> + + + + + + + + + + +
+
+ + + + +
+ +
+
+
+ + + + + + + + +
+

''에 대한 검색결과가 없습니다.

+
    +
  • 단어의 철자가 정확한지 확인해 보세요.
  • +
  • 한글을 영어로 혹은 영어를 한글로 입력했는지 확인해 보세요.
  • +
  • 검색어의 단어 수를 줄이거나, 보다 일반적인 검색어로 다시 검색해 보세요.
  • +
  • 두 단어 이상의 검색어인 경우, 띄어쓰기를 확인해 보세요.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchCompleted.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchCompleted.jsp new file mode 100644 index 00000000..f5e91934 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchCompleted.jsp @@ -0,0 +1,171 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> + + + + + + + + + + +
+
+ + + + +
+ +
+
+
+ + + + + + + + +
+

''에 대한 검색결과가 없습니다.

+
    +
  • 단어의 철자가 정확한지 확인해 보세요.
  • +
  • 한글을 영어로 혹은 영어를 한글로 입력했는지 확인해 보세요.
  • +
  • 검색어의 단어 수를 줄이거나, 보다 일반적인 검색어로 다시 검색해 보세요.
  • +
  • 두 단어 이상의 검색어인 경우, 띄어쓰기를 확인해 보세요.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchConference.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchConference.jsp new file mode 100644 index 00000000..4d7ac320 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchConference.jsp @@ -0,0 +1,174 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> + + + + + + + + + + +
+
+ + + + +
+ +
+
+
+ + + + + + + + +
+

''에 대한 검색결과가 없습니다.

+
    +
  • 단어의 철자가 정확한지 확인해 보세요.
  • +
  • 한글을 영어로 혹은 영어를 한글로 입력했는지 확인해 보세요.
  • +
  • 검색어의 단어 수를 줄이거나, 보다 일반적인 검색어로 다시 검색해 보세요.
  • +
  • 두 단어 이상의 검색어인 경우, 띄어쓰기를 확인해 보세요.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchCounsel.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchCounsel.jsp new file mode 100644 index 00000000..40397419 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchCounsel.jsp @@ -0,0 +1,167 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> + + + + + + + + + + +
+
+ + + + +
+ +
+
+
+ + + + + + + + +
+

''에 대한 검색결과가 없습니다.

+
    +
  • 단어의 철자가 정확한지 확인해 보세요.
  • +
  • 한글을 영어로 혹은 영어를 한글로 입력했는지 확인해 보세요.
  • +
  • 검색어의 단어 수를 줄이거나, 보다 일반적인 검색어로 다시 검색해 보세요.
  • +
  • 두 단어 이상의 검색어인 경우, 띄어쓰기를 확인해 보세요.
  • +
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp index da7a54e6..60fe664c 100644 --- a/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp @@ -1,6 +1,7 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> @@ -15,6 +16,27 @@ function goSearch(obj){ document.search.submit(); } + + function doCollection(type){ + var url = ''; + + if(type === 'ALL'){ + url = '/com/srch/Search.do'; + }else if(type === 'process'){ + url = '/com/srch/SearchProcess.do'; + }else if(type === 'conference'){ + url = '/com/srch/SearchConference.do'; + }else if(type === 'completed'){ + url = '/com/srch/SearchCompleted.do'; + }else if(type === 'board'){ + url = '/com/srch/SearchBoard.do'; + }else if(type === 'counsel'){ + url = '/com/srch/SearchCounsel.do'; + } + document.search.searchType.value = type; + document.search.action = url; + document.search.submit(); + } @@ -53,6 +75,8 @@
+ +
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchProcess.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchProcess.jsp new file mode 100644 index 00000000..f61a4cbb --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchProcess.jsp @@ -0,0 +1,173 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> + + + + + + + + + + +
+
+ + + + +
+ +
+
+
+ + + + + + + + +
+

''에 대한 검색결과가 없습니다.

+
    +
  • 단어의 철자가 정확한지 확인해 보세요.
  • +
  • 한글을 영어로 혹은 영어를 한글로 입력했는지 확인해 보세요.
  • +
  • 검색어의 단어 수를 줄이거나, 보다 일반적인 검색어로 다시 검색해 보세요.
  • +
  • 두 단어 이상의 검색어인 경우, 띄어쓰기를 확인해 보세요.
  • +
+
+
+
+
+
\ No newline at end of file