com.google.zxing
diff --git a/src/main/java/nlib/sch/service/NlibSearchCollectionVO.java b/src/main/java/nlib/sch/service/NlibSearchCollectionVO.java
new file mode 100644
index 00000000..ca40bdbf
--- /dev/null
+++ b/src/main/java/nlib/sch/service/NlibSearchCollectionVO.java
@@ -0,0 +1,65 @@
+package nlib.sch.service;
+
+import nlib.col.service.CollectionVO;
+
+/**
+ *
+ * @Class Name : NlibSearchCollectionVO.java
+ *
+ * @Description : 검색엔진 결과리스트 VO
+ *
+ *
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ *
+ *
+ * @ ------------ -------- ---------------------------
+ * @ 수정일 수정자 수정내용
+ * @ ------------ -------- ---------------------------
+ * @ 2021. 9. 23. JSYOO 최초 생성
+ * @ 2021.10. 06. KKN 자료에 대한 세부 항목, 생성자 함수 추가
+ *
+ *
+ * @author 이씨플라자 * DIGITALSHIP JSYOO
+ * @since 2021. 10. 22.
+ * @version 1.0
+ *
+ */
+public class NlibSearchCollectionVO extends CollectionVO {
+ public String getTITLE() {
+ return title;
+ }
+ public void setTITLE(String tITLE) {
+ title = tITLE;
+ }
+ public String getMNGT_NO() {
+ return mngtNo;
+ }
+ public void setMNGT_NO(String mNGT_NO) {
+ mngtNo = mNGT_NO;
+ }
+ public String getCREAT_YYYY() {
+ return creatYyyy;
+ }
+ public void setCREAT_YYYY(String cREAT_YYYY) {
+ creatYyyy = cREAT_YYYY;
+ }
+ public String getMASTER_ID() {
+ return masterId;
+ }
+ public void setMASTER_ID(String mASTER_ID) {
+ masterId = mASTER_ID;
+ }
+ public String getORG_NM() {
+ return title;
+ }
+ public void setORG_NM(String oRG_NM) {
+ orgNm = oRG_NM;
+ }
+ public String getRPRS_THUMB_URL() {
+ return rprsThumbUrl;
+ }
+ public void setRPRS_THUMB_URL(String rPRS_THUMB_URL) {
+ rprsThumbUrl = rPRS_THUMB_URL;
+ }
+}
diff --git a/src/main/java/nlib/sch/service/NlibSearchInterface.java b/src/main/java/nlib/sch/service/NlibSearchInterface.java
new file mode 100644
index 00000000..930c6ef1
--- /dev/null
+++ b/src/main/java/nlib/sch/service/NlibSearchInterface.java
@@ -0,0 +1,45 @@
+package nlib.sch.service;
+
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.UriComponentsBuilder;
+
+import nlib.util.StringUtil;
+
+/**
+ *
+ * @Class Name : DataApiInterface.java
+ *
+ * @Description : DAO에서 상속할 DataApi의 부모 클래스들을 위한 인터페이스
+ *
+ *
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ *
+ *
+ * @ ------------ -------- ---------------------------
+ * @ 수정일 수정자 수정내용
+ * @ ------------ -------- ---------------------------
+ * @ 2021. 7. 9. KNKIM 최초 생성
+ *
+ *
+ * @author 이씨플라자 * DIGITALSHIP KNKIM
+ * @since 2021. 7. 9.
+ * @version 1.0
+ *
+ */
+public interface NlibSearchInterface {
+
+}
\ No newline at end of file
diff --git a/src/main/java/nlib/sch/service/NlibSearchService.java b/src/main/java/nlib/sch/service/NlibSearchService.java
new file mode 100644
index 00000000..ca8351ff
--- /dev/null
+++ b/src/main/java/nlib/sch/service/NlibSearchService.java
@@ -0,0 +1,18 @@
+package nlib.sch.service;
+
+import nlib.sch.service.NlibSearchVO;
+
+
+
+public interface NlibSearchService {
+ /** 검색결과 받기
+ * @return */
+ NlibSearchVO getSearch(NlibSearchVO searchVO) throws Exception;
+ /*
+ String getSearchEtc(SearchVO searchVO , Sf1VO sf1Vo) throws Exception;
+
+ int getSearch_All_cnt(SearchVO searchVO, Sf1VO sf1Vo) throws Exception;
+
+ SearchCollectionResult getSearch_ajax(SearchVO searchVO , Sf1VO sf1Vo) throws Exception;
+ */
+}
diff --git a/src/main/java/nlib/sch/service/NlibSearchVO.java b/src/main/java/nlib/sch/service/NlibSearchVO.java
new file mode 100644
index 00000000..45ffb6cd
--- /dev/null
+++ b/src/main/java/nlib/sch/service/NlibSearchVO.java
@@ -0,0 +1,347 @@
+package nlib.sch.service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import nlib.cmm.service.NlibProperty;
+import nlib.util.StringUtil;
+
+
+/**
+ * 검색엔진 . NlibSearchVO
+ * @Class Name : NlibSearchVO.java
+ * @author JSYOO
+ * @since 2021-10-18
+ * @version 1.0
+ */
+
+public class NlibSearchVO {
+
+ private String query =""; //검색어
+ private String collection = "lib_total"; //검색 대상 컬렉션 지정
+ private String listCount = NlibProperty.getProperty("list.paging.page.size"); //컬렉션별 출력 결과수
+ private String sort = "DATE"; //결과 정렬 DATE 날짜 내림차, RANK 정확도 내림차
+ private String startCount = ""; //검색 결과 시작 페이지
+ private String sfield = ""; //검색 영역
+ private String creatYyyyStart = ""; //생산년도 검색(시작일)
+ private String creatYyyyEnd = ""; //생산년도 검색(종료일)
+ private String createStartDate = ""; //연대 검색(시작일)
+ private String createEndDate = ""; //연대 검색(종료일)
+ private String mngtNo = ""; //관리번호
+ private String ageCode = ""; //시대
+ private String useStatus = ""; //이용구분
+ private String typeDivCd = ""; //자료유형
+ private String subjectCode = ""; //주제분야
+ private String orgNm = ""; //생산기관
+
+ private String realQuery ; //검색어(최종)
+ private String reQuery = ""; //결과내 재검색
+ private String reQueryChk ="query"; //결과내재검색 체크 유지
+
+ private String lib_total_totalCount = ""; //전체의 총 COUNT
+ private String lib_loan_totalCount = ""; //대출의 총 COUNT
+ private String lib_online_totalCount = ""; //온라인열람의 총 COUNT
+ private String lib_offline_totalCount = ""; //방문열람의 총 COUNT
+ private String lib_etc_totalCount = ""; //기타의 총 COUNT
+ private String totalCount = ""; //현재 선택된 콜렉션의 총 COUNT
+
+ private String filter_class = ""; //필터 더보기버튼 유지+depth1 open
+ private String filter_sido ; //필터 더보기버튼 유지+depth1 open
+ private String filter_thema ; //필터 더보기버튼 유지+depth1 open
+ private String filter_category ; //필터 더보기버튼 유지+depth1 open
+ private String filter_info_sido ; //필터 더보기버튼 유지
+ private String filter_info_type ; //필터 더보기버튼 유지
+ private String filter_mylist; //검색결과 필터 순서 저장
+ private String filter_info_mylist; //검색결과 필터 info 순서 저장
+
+ private String first_category ; //주제분야(대) 선택
+ private String second_category ; //주제분야(소) 선택
+ private String first_class ; //자료유형(대) 선택
+ private String second_class; //자료유형(소) 선택
+
+ private List resultList = new ArrayList<>(); // 자료 리스트
+
+ public String getFilter_class() {
+ return filter_class;
+ }
+ public void setFilter_class(String filter_class) {
+ this.filter_class = filter_class;
+ }
+ public String getFilter_sido() {
+ return filter_sido;
+ }
+ public void setFilter_sido(String filter_sido) {
+ this.filter_sido = filter_sido;
+ }
+ public String getFilter_thema() {
+ return filter_thema;
+ }
+ public void setFilter_thema(String filter_thema) {
+ this.filter_thema = filter_thema;
+ }
+ public String getFilter_category() {
+ return filter_category;
+ }
+ public void setFilter_category(String filter_category) {
+ this.filter_category = filter_category;
+ }
+ public String getFilter_info_sido() {
+ return filter_info_sido;
+ }
+ public void setFilter_info_sido(String filter_info_sido) {
+ this.filter_info_sido = filter_info_sido;
+ }
+ public String getFilter_info_type() {
+ return filter_info_type;
+ }
+ public void setFilter_info_type(String filter_info_type) {
+ this.filter_info_type = filter_info_type;
+ }
+ public String getFilter_mylist() {
+ return filter_mylist;
+ }
+ public void setFilter_mylist(String filter_mylist) {
+ this.filter_mylist = filter_mylist;
+ }
+ public String getFilter_info_mylist() {
+ return filter_info_mylist;
+ }
+ public void setFilter_info_mylist(String filter_info_mylist) {
+ this.filter_info_mylist = filter_info_mylist;
+ }
+ public String getRealQuery() {
+ return realQuery;
+ }
+ public void setRealQuery(String realQuery) {
+ this.realQuery = realQuery;
+ }
+ public String getReQuery() {
+ return reQuery;
+ }
+ public void setReQuery(String reQuery) {
+ this.reQuery = reQuery;
+ }
+ public String getReQueryChk() {
+ return reQueryChk;
+ }
+ public void setReQueryChk(String reQueryChk) {
+ this.reQueryChk = reQueryChk;
+ }
+ public String getListCount() {
+ return listCount;
+ }
+ public void setListCount(String listCount) {
+ this.listCount = listCount;
+ }
+ public String getSort() {
+ return sort;
+ }
+ public void setSort(String sort) {
+ this.sort = sort;
+ }
+ public String getStartCount() {
+ return startCount;
+ }
+ public void setStartCount(String startCount) {
+ this.startCount = startCount;
+ }
+ public String getSfield() {
+ return sfield;
+ }
+ public void setSfield(String sfield) {
+ this.sfield = sfield;
+ }
+ public String getCreatYyyyStart() {
+ return creatYyyyStart;
+ }
+ public void setCreatYyyyStart(String creatYyyyStart) {
+ this.creatYyyyStart = creatYyyyStart;
+ }
+ public String getCreatYyyyEnd() {
+ return creatYyyyEnd;
+ }
+ public void setCreatYyyyEnd(String creatYyyyEnd) {
+ this.creatYyyyEnd = creatYyyyEnd;
+ }
+ public String getCreateStartDate() {
+ return createStartDate;
+ }
+ public void setCreateStartDate(String createStartDate) {
+ this.createStartDate = createStartDate;
+ }
+ public String getCreateEndDate() {
+ return createEndDate;
+ }
+ public void setCreateEndDate(String createEndDate) {
+ this.createEndDate = createEndDate;
+ }
+ public String getMngtNo() {
+ return mngtNo;
+ }
+ public void setMngtNo(String mngtNo) {
+ this.mngtNo = mngtNo;
+ }
+ public String getAgeCode() {
+ return ageCode;
+ }
+ public void setAgeCode(String ageCode) {
+ this.ageCode = ageCode;
+ }
+ public String getUseStatus() {
+ return useStatus;
+ }
+ public void setUseStatus(String useStatus) {
+ this.useStatus = useStatus;
+ }
+ public String getTypeDivCd() {
+ return typeDivCd;
+ }
+ public void setTypeDivCd(String typeDivCd) {
+ this.typeDivCd = typeDivCd;
+ }
+ public String getSubjectCode() {
+ return subjectCode;
+ }
+ public void setSubjectCode(String subjectCode) {
+ this.subjectCode = subjectCode;
+ }
+ public String getOrgNm() {
+ return orgNm;
+ }
+ public void setOrgNm(String orgNm) {
+ this.orgNm = orgNm;
+ }
+ public String getQuery() {
+ return query;
+ }
+ public void setQuery(String query) {
+ this.query = query;
+ }
+ public String getCollection() {
+ return collection;
+ }
+ public void setCollection(String collection) {
+ this.collection = collection;
+ }
+ public String getLib_total_totalCount() {
+ return lib_total_totalCount;
+ }
+ public void setLib_total_totalCount(String lib_total_totalCount) {
+ this.lib_total_totalCount = lib_total_totalCount;
+ }
+ public String getLib_loan_totalCount() {
+ return lib_loan_totalCount;
+ }
+ public void setLib_loan_totalCount(String lib_loan_totalCount) {
+ this.lib_loan_totalCount = lib_loan_totalCount;
+ }
+ public String getLib_online_totalCount() {
+ return lib_online_totalCount;
+ }
+ public void setLib_online_totalCount(String lib_online_totalCount) {
+ this.lib_online_totalCount = lib_online_totalCount;
+ }
+ public String getLib_offline_totalCount() {
+ return lib_offline_totalCount;
+ }
+ public void setLib_offline_totalCount(String lib_offline_totalCount) {
+ this.lib_offline_totalCount = lib_offline_totalCount;
+ }
+ public String getLib_etc_totalCount() {
+ return lib_etc_totalCount;
+ }
+ public void setLib_etc_totalCount(String lib_etc_totalCount) {
+ this.lib_etc_totalCount = lib_etc_totalCount;
+ }
+ public List getResultList() {
+ return resultList;
+ }
+ public void setResultList(List resultList) {
+ this.resultList = resultList;
+ }
+ public String getFirst_category() {
+ return first_category;
+ }
+ public void setFirst_category(String first_category) {
+ this.first_category = first_category;
+ }
+ public String getSecond_category() {
+ return second_category;
+ }
+ public void setSecond_category(String second_category) {
+ this.second_category = second_category;
+ }
+ public String getFirst_class() {
+ return first_class;
+ }
+ public void setFirst_class(String first_class) {
+ this.first_class = first_class;
+ }
+ public String getSecond_class() {
+ return second_class;
+ }
+ public void setSecond_class(String second_class) {
+ this.second_class = second_class;
+ }
+ public String getTotalCount() {
+ return totalCount;
+ }
+ public void setTotalCount(String totalCount) {
+ this.totalCount = totalCount;
+ }
+ public void add(MultiValueMap map,String name, String value) {
+ if(!"".equals(StringUtil.getString(value,"")))
+ {
+ map.add(name,value);
+ }
+ }
+
+ //검색요청시 URL 생성
+ public MultiValueMap getSearchMap() {
+
+ MultiValueMap map = new LinkedMultiValueMap();
+
+ add(map,"query",this.query);
+ add(map,"collection",this.collection);
+ add(map,"sort",this.sort);
+ add(map,"startCount",this.startCount);
+ add(map,"sfield",this.sfield);
+ add(map,"CREAT_YYYY_START",this.creatYyyyStart);
+ add(map,"CREAT_YYYY_END",this.creatYyyyEnd);
+ add(map,"createStartDate",this.createStartDate);
+ add(map,"createEndDate,",this.createEndDate);
+ add(map,"MNGT_NO",this.mngtNo);
+ add(map,"AGE_CODE",this.ageCode);
+ add(map,"USE_STATUS",this.useStatus);
+ add(map,"TYPE_DIV_CD",this.typeDivCd);
+ add(map,"SUBJECT_CODE",this.subjectCode);
+ add(map,"ORG_NM,",this.orgNm);
+ add(map,"listCount",this.listCount);
+ return map;
+ }
+
+ // 탭별 total count set
+ public void setCollectionTotalCount (String collection, String totalCount) {
+ if(collection.equals("lib_loan"))
+ {
+ this.lib_loan_totalCount = totalCount;
+ }else if(collection.equals("lib_online"))
+ {
+ this.lib_online_totalCount = totalCount;
+ }else if(collection.equals("lib_offline"))
+ {
+ this.lib_offline_totalCount = totalCount;
+ }else if(collection.equals("lib_etc"))
+ {
+ this.lib_etc_totalCount = totalCount;
+ }else if(collection.equals("lib_total"))
+ {
+ this.lib_total_totalCount = totalCount;
+ }
+ }
+}
diff --git a/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java b/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java
new file mode 100644
index 00000000..b73130ec
--- /dev/null
+++ b/src/main/java/nlib/sch/service/impl/NlibSearchServiceImpl.java
@@ -0,0 +1,193 @@
+package nlib.sch.service.impl;
+
+import static kccf.sch.common.WNDefine.*;
+
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.reflect.Type;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.stereotype.Service;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.google.gson.reflect.TypeToken;
+
+import nlib.sch.service.NlibSearchVO;
+import nlib.restful.DataApi;
+import nlib.restful.service.DataApiInterface;
+import nlib.restful.service.DataApiReqVO;
+import nlib.restful.service.DataApiResVO;
+import nlib.restful.service.impl.DataApiRESTful;
+import nlib.sch.service.NlibSearchCollectionVO;
+import nlib.sch.service.NlibSearchInterface;
+import nlib.sch.service.NlibSearchService;
+import nlib.util.StringUtil;
+
+
+@Service("nlibSearchService")
+public class NlibSearchServiceImpl implements NlibSearchService{
+
+ private static final Logger log = LoggerFactory.getLogger(NlibSearchServiceImpl.class);
+
+ /* DataApi 접속 서버 정보 */
+ @Value("#{properties['search.searchIp']}")
+ private String SEARCH_IP;
+
+ @Value("#{properties['search.searchPort']}")
+ private String SEARCH_PORT;
+
+ @Value("#{properties['search.protocol']}")
+ private String SEARCH_PROTOCOL;
+
+ /** RESTFul API 송수신 모듈 */
+ @Resource(name = "dataApi")
+ private DataApi dataApi;
+
+ public NlibSearchVO getSearch(NlibSearchVO searchVO) throws Exception {
+ try {
+ String collectionTemp="";
+ //-----------------------------------
+ // 입력값 검증작업
+ //-----------------------------------
+ /*resVO = DataApiInterface.checkReqCommonParams(reqVO);
+ if(resVO != null) return resVO;
+ HttpMethod method = reqVO.getReqMethod();*/
+
+ //-----------------------------------
+ // 폼 파라메터 생성 작업 및 요청 처리
+ //-----------------------------------
+ String url = SEARCH_PROTOCOL + "://" + SEARCH_IP + ("80".equals(SEARCH_PORT) ? "" : ":" + SEARCH_PORT) + "/searchApi/searchApi.jsp";
+ log.debug("REQ URL : " + url);
+
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+
+ ResponseEntity responseEntity = null;
+ ResponseEntity allResponseEntity = null;
+ RestTemplate restTemplate = new RestTemplate();
+ restTemplate.getMessageConverters()
+ .add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));
+
+ //단일 탭 검색
+ MultiValueMap parameters= searchVO.getSearchMap();
+
+ //전체 검색 (각 탭별 count가 목적)
+ collectionTemp = searchVO.getCollection();
+ searchVO.setCollection("ALL");
+ MultiValueMap allParameters= searchVO.getSearchMap();
+ searchVO.setCollection(collectionTemp);
+ //post방식
+ parameters.forEach((k, v) -> log.debug("params > " + k + " : " + v));
+ allParameters.forEach((k, v) -> log.debug("allParams > " + k + " : " + v));
+ HttpEntity> requestEntity = new HttpEntity(parameters, headers);
+ HttpEntity> allRequestEntity = new HttpEntity(allParameters, headers);
+ responseEntity = restTemplate.postForEntity(url, requestEntity , String.class);
+ allResponseEntity = restTemplate.postForEntity(url, allRequestEntity , String.class);
+
+ //-----------------------------------
+ // 응답 처리
+ //-----------------------------------
+ HttpStatus statusCode = responseEntity.getStatusCode();
+ log.debug("RES StatusCode : " + statusCode);
+ String resultXML = responseEntity.getBody();
+ log.debug("RES resultXML : " + resultXML);
+
+ HttpStatus allStatusCode = allResponseEntity.getStatusCode();
+ log.debug("RES allStatusCode : " + allStatusCode);
+ String allResultXML = allResponseEntity.getBody();
+ log.debug("RES allResultXML : " + allResultXML);
+
+ //검색엔진 결과 json 파싱
+ JsonParser jsonParser = new JsonParser();
+
+
+ JsonObject jsonObject = null;
+ JsonObject tmp = null;
+ String collection = "";
+ String totalCount = "";
+ JsonArray jsonArray = null;
+
+ //전체검색 결과 탭별 count
+ jsonObject = (JsonObject) jsonParser.parse(allResultXML);
+ jsonObject = (JsonObject) jsonObject.get("SearchQueryResult");
+ jsonArray = (JsonArray) jsonObject.get("Collection");
+
+ for(int i=0;i list = new ArrayList<>();
+ //NlibSearchCollectionVO vo = new NlibSearchCollectionVO();
+ Gson gson = new Gson();
+
+ int j;
+
+ for(int i=0;i Exception 발생 : " + e.toString());
+ }
+ return searchVO;
+ }
+};
diff --git a/src/main/java/nlib/sch/web/NlibSearchController.java b/src/main/java/nlib/sch/web/NlibSearchController.java
index cbd2870b..b67fe3ce 100644
--- a/src/main/java/nlib/sch/web/NlibSearchController.java
+++ b/src/main/java/nlib/sch/web/NlibSearchController.java
@@ -19,6 +19,7 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import cmm.Constant;
@@ -29,7 +30,6 @@ import kccf.res.service.ResourcesService;
import kccf.sch.service.SearchCollectionResult;
import kccf.sch.service.SearchService;
import kccf.sch.service.vo.SearchCollectionVO;
-import kccf.sch.service.vo.SearchVO;
import kccf.sch.service.vo.Sf1VO;
import nlib.cmm.NlibCommonController;
import nlib.cmm.service.CodeService;
@@ -43,6 +43,9 @@ import nlib.col.service.InterestService;
import nlib.col.service.RisService;
import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;
+import nlib.sch.service.NlibSearchCollectionVO;
+import nlib.sch.service.NlibSearchService;
+import nlib.sch.service.NlibSearchVO;
import nlib.user.service.NlibLoginVO;
import nlib.util.StringUtil;
@@ -73,6 +76,9 @@ public class NlibSearchController extends NlibCommonController {
@Resource(name = "collectionService")
private CollectionService collectionService;
+ @Resource(name = "nlibSearchService")
+ private NlibSearchService nlibSearchService;
+
/** resourcesService */
@Resource(name = "resourcesService")
private ResourcesService resourcesService;
@@ -83,20 +89,19 @@ public class NlibSearchController extends NlibCommonController {
* @param req
* @return
*/
- @RequestMapping("/search/searchList.do")
+ @RequestMapping(value = "/search/searchList.do")
public String searchList(
HttpServletRequest req
, Authentication authentication
, @RequestParam Map paramMap
, ModelMap model
- , @ModelAttribute("searchVO") SearchVO searchVO
+ , @ModelAttribute("searchVO") NlibSearchVO searchVO
, String all_totalCount
, HttpServletRequest request
, HttpServletResponse res) throws Exception {
String searchKeyword = paramMap.get("searchKeyword");
String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1");
String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE);
- List vo = new ArrayList();
List operList = new ArrayList();
// 페이징 사이즈 코드 목록 조회 (DB방식으로 변경 2021.08.06 KNKIM)
@@ -109,8 +114,6 @@ public class NlibSearchController extends NlibCommonController {
//주제분야 목록 조회
List> clsf = codeService.listCtClsfs();
- //문화원 목록 조회
- /*vo = risService.selectOrgList();*/
// 반환 정보
model.addAttribute("pageIndex" , pageIndex);
@@ -121,238 +124,62 @@ public class NlibSearchController extends NlibCommonController {
model.addAttribute("dtlsType", dtlsType);
model.addAttribute("firstCategoryList", clsf);
model.addAttribute("secondCategoryList", clsf);
- /*model.addAttribute("orgList",vo);*/
- //검색엔진
- try{
- searchVO.setCollection("reference_Coll");
- // 검색관련 서버 설정
- String searchIp = nlibProperty.getString("search.searchIp");
- int searchPort = nlibProperty.getInt("search.searchPort");
- int searchTimeOut = nlibProperty.getInt("search.searchTimeOut");
-
- Sf1VO sf1Vo = new Sf1VO();
- sf1Vo.setSearchIp(searchIp);
- sf1Vo.setSearchPort(searchPort);
- sf1Vo.setSearchTimeOut(searchTimeOut);
-
- searchVO.setQuery(StringUtil.getString(searchVO.getQuery(), ""));
- searchVO.setReQuery(StringUtil.getString(searchVO.getReQuery(), ""));
-
- //결과내재검색만 입력했을경우
- if(searchVO.getQuery().length() == 0 && searchVO.getReQuery().length() > 0)
- {
- searchVO.setQuery(searchVO.getReQuery());
- searchVO.setReQuery("");
- searchVO.setReQueryChk("query");
- }
-
- SearchCollectionResult collResult = searchService.getSearch(searchVO, sf1Vo);
-
- all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo));
-
- // 결과
- SearchCollectionVO collReferecne = new SearchCollectionVO();
- SearchCollectionVO collCulturePost = new SearchCollectionVO();
- SearchCollectionVO collCulturePostHot = new SearchCollectionVO();
- SearchCollectionVO collTotal = new SearchCollectionVO();
- SearchCollectionVO collInfo = new SearchCollectionVO();
- SearchCollectionVO collMap = new SearchCollectionVO();
- SearchCollectionVO collNumber = new SearchCollectionVO();
- SearchCollectionVO collPick = new SearchCollectionVO();
- SearchCollectionVO collStory = new SearchCollectionVO();
-
- int totalCount = 0;
- int page_totalCount =0;
-
- //각 탭의 totalcount등의 데이터를 가져온다.
- ArrayList collList = collResult.getCollectionList();
-
- int collListSize = collList.size();
- for(int i = 0 ; i < collListSize ; i++){
- SearchCollectionVO coll = collList.get(i);
- String collEn = coll.getCollectionName();
+ //검색엔진
+ try{
+ searchVO.setQuery("대출");
+ searchVO.setCollection("lib_loan");
+
+ searchVO.setQuery(StringUtil.getString(searchVO.getQuery(), ""));
+ searchVO.setReQuery(StringUtil.getString(searchVO.getReQuery(), ""));
-
-
- if(collEn.indexOf("culturePostHot") < 0 && collEn.indexOf("total") < 0 && collEn.indexOf("_cate") < 0){
- totalCount = totalCount + coll.getTotalCount();
+ //결과내재검색만 입력했을경우
+ if(searchVO.getQuery().length() == 0 && searchVO.getReQuery().length() > 0)
+ {
+ searchVO.setQuery(searchVO.getReQuery());
+ searchVO.setReQuery("");
+ searchVO.setReQueryChk("query");
}
- if( !searchVO.getCollection().equals("ALL") && searchVO.getCollection().indexOf("_Coll") >= 0){
- if(searchVO.getCollection().replace("_Coll", "").equals(collEn)){
- page_totalCount = coll.getTotalCount();
- }
+ searchVO = nlibSearchService.getSearch(searchVO);
+
+
+ //열람,대출 가능 상태
+ List resultList = searchVO.getResultList(); // 자료 리스트
+ CollectionVO col = new CollectionVO();
+
+ for(int i = 0; resultList.size() > i; i++)
+ {
+ col.setMasterId(resultList.get(i).getMASTER_ID());
+ operList.add(col);
}
- if(collEn.equals("info")){
- collInfo = coll;
- }
- else if(collEn.equals("map")){
- collMap = coll;
- }
- else if(collEn.equals("number")){
- collNumber = coll;
- }
- else if(collEn.equals("pick")){
- collPick = coll;
-
- }
- else if(collEn.equals("reference")){
- collReferecne = coll;
- for(int j = 0 ; j < collReferecne.getSearchResultList().size() ; j++){
- Map