diff --git a/.classpath b/.classpath index f73ac5da..9778664e 100644 --- a/.classpath +++ b/.classpath @@ -34,6 +34,5 @@ - diff --git a/pom.xml b/pom.xml index 712c3bca..b5a11092 100644 --- a/pom.xml +++ b/pom.xml @@ -257,7 +257,6 @@ httpclient 4.5.3 - 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 mapResult = collReferecne.getSearchResultList().get(j); - DataMap paramMap1 = new DataMap(); - paramMap1.put("mId", mapResult.get("MEDIA_ID")); - if(StringUtils.isNotEmpty(mapResult.get("MEDIA_ID").toString())){ - //DataMap media = cmmService.selectCmmAmsAssetsMediaDetail(paramMap1); - String url=""; - /*String mediaId = media.getString("mid"); - String mediaInterfaceId = media.getString("interfaceId"); - String url = ""; - if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성 - if(media.get("assetType") != null){ - if(media.get("assetType").toString().equals("문서") ){ - url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/npdfView.do?"; - url += "npdf="+Constant.UA_TYPE_R+mediaInterfaceId; // MEDIA 의 INTERFACE_ID 사용 - - }else if(media.get("assetType").toString().equals("링크")){ - url = media.get("linkData").toString(); - }else{ - url = CmmUtil.getPropertyStr(Constant.KCCF_HOME_KEY)+"/lib/libraryDetail.do?contentId="+mediaId; - url += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 시 사용 - } - } - }*/ - mapResult.put("LINK_URL", url); - } - } - } - else if(collEn.equals("culturePost")){ - collCulturePost = coll; - } - else if(collEn.equals("total")){ - collTotal = coll; - } - else if(collEn.equals("total_tags")){ - model.addAttribute("total_tags", coll); - } - else if(collEn.indexOf("_cate") >= 0){ //cate - if(collEn.equals("first_class_cate")){ - model.addAttribute("first_class_cate", coll); - } - else if(collEn.equals("second_class_cate")){ - model.addAttribute("second_class_cate", coll); - } - else if(collEn.equals("first_council_cate")){ - model.addAttribute("first_council_cate", coll); - } - else if(collEn.equals("second_council_cate")){ - model.addAttribute("second_council_cate", coll); - } - else if(collEn.equals("first_category_cate")){ - model.addAttribute("first_category_cate", coll); - } - else if(collEn.equals("second_category_cate")){ - model.addAttribute("second_category_cate", coll); - } - else if(collEn.equals("first_theme_cate")){ - model.addAttribute("first_theme_cate", coll); - } - else if(collEn.equals("second_theme_cate")){ - model.addAttribute("second_theme_cate", coll); - } - } - else if(collEn.indexOf("culturePostHot") >= 0){ //cate - if(collEn.equals("culturePostHot")){ - collCulturePostHot = coll; - } - else if(collEn.equals("culturePostHot_keywords")){ - model.addAttribute("culturePostHot_keywords", coll); - } - else if(collEn.equals("culturePostHot_tags")){ - model.addAttribute("culturePostHot_tags", coll); - } - } - } - - - // - 값 (검색엔진 오류 일때 0값 으로 ) - if(totalCount < 0){ - totalCount = 0; - } - model.addAttribute("totalCount",totalCount); - model.addAttribute("reference", collReferecne); - model.addAttribute("culturePost", collCulturePost); - model.addAttribute("culturePostHot", collCulturePostHot); - model.addAttribute("total", collTotal); - model.addAttribute("all_totalCount",all_totalCount); - - CollectionVO colVO = new CollectionVO(); - // 검색엔진에서 받아온 데이터로 api통해 열람,대출신청상태등 받아온다 - for(int i = 0; collReferecne.getSearchResultList().size() > i;i++) - { - /*collReferecne.getSearchResultList().get(i).get("MASTER_ID");*/ - colVO.setMasterId("UR-91F3EB466E2743C48CC264BAC8CC573B"); - operList.add(colVO); - } - - //열람,대출 가능 상태 - operList = collectionService.setDetailInfoForList(operList); - - model.addAttribute("operList", operList); - - // 경로 - CmmUtil.setNfsPathModelMap(request,model); - - // 페이징 관련 - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getStartCount()); - if(searchVO.getCollection().indexOf("toon") >= 0){ - if(searchVO.getViewCount() == 10){ - paginationInfo.setRecordCountPerPage(12); - }else{ - paginationInfo.setRecordCountPerPage(searchVO.getViewCount()); - } - }else{ - paginationInfo.setRecordCountPerPage(searchVO.getViewCount()); - } - paginationInfo.setPageSize((CmmUtil.isMobile(request)) ? 5 :10); - //paginationInfo.setTotalRecordCount(totalCount); - - paginationInfo.setTotalRecordCount(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("") ? totalCount :page_totalCount ); - model.addAttribute("paginationInfo", paginationInfo); - - - //serviceVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - //serviceVO.setLastIndex(paginationInfo.getLastRecordIndex()); - //serviceVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - model.addAttribute("searchVO", searchVO); - //System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString()); - - }catch(Exception e){ - e.printStackTrace(); - } - - List councilList = new ArrayList(); - councilList.add("마포문화원"); - councilList.add("서울문화원"); - councilList.add("종로문화원"); - /*List councilList = resourcesService.selectCouncilList(); */ - model.addAttribute("councilList", councilList); + + operList = collectionService.setDetailInfoForList(operList); + + model.addAttribute("operList", operList); + + // 경로 + CmmUtil.setNfsPathModelMap(request,model); + model.addAttribute("searchVO", searchVO); + }catch(Exception e){ + e.printStackTrace(); + } - //자료유형 - model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD)); - model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD)); - - - - // ams 서버 패스 정보 - CmmUtil.setAmsPathModelMap(request,model); - searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """)); - searchVO.setExactQuery(searchVO.getExactQuery().replaceAll("\\\"", """)); + List councilList = new ArrayList(); + councilList.add("마포문화원"); + councilList.add("서울문화원"); + councilList.add("종로문화원"); + /*List councilList = resourcesService.selectCouncilList(); */ + model.addAttribute("councilList", councilList); + + + //자료유형 + model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD)); + model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD)); + + searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """)); return "nlib/collection/searchList"; } @@ -362,7 +189,7 @@ public class NlibSearchController extends NlibCommonController { * @param req * @return */ - @RequestMapping(value="/collection/listItemsAjax.do") + @RequestMapping(value="/collection/listItemsAjax.do", method = RequestMethod.POST) public ResponseEntity listItemsAjax(HttpServletRequest req, Authentication authentication, @RequestBody CollectionVO searchCollectionVO) { @@ -420,23 +247,31 @@ public class NlibSearchController extends NlibCommonController { * @param request * @param model * @return + * @throws Exception */ @RequestMapping(value="/search/getDetailedSearchFormPopup.do") - public String getMemberQrcodeFormPopup(HttpServletRequest request, ModelMap model) { + public String getDetailedSearchFormPopup(HttpServletRequest request, ModelMap model) throws Exception { + + //주제분야 목록 조회 + List> clsf = codeService.listCtClsfs(); + model.addAttribute("firstCategoryList", clsf); + model.addAttribute("secondCategoryList", clsf); - NlibLoginVO loginVO = getNlibLoginVO(request); - - model.addAttribute("loginVO", loginVO); + //자료유형 + model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD)); + model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD)); + return "nlib/search/getDetailedSearchFormPopup"; } + /** * 소장자료 상세 내용 조회한다. * * @param req * @return *//* - @RequestMapping("/collection/selectItemInfo.do") + @RequestMapping("/search/selectItemInfo.do") public String selectItemInfo(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) { // 목록 이동시 전달할 매개변수 String searchKeyword = paramMap.get("searchKeyword"); diff --git a/src/main/resources/egovframework/mapper/nlib/cmm/CodeDAO_SQL.xml b/src/main/resources/egovframework/mapper/nlib/cmm/CodeDAO_SQL.xml index 83c1f19b..0d6850b3 100644 --- a/src/main/resources/egovframework/mapper/nlib/cmm/CodeDAO_SQL.xml +++ b/src/main/resources/egovframework/mapper/nlib/cmm/CodeDAO_SQL.xml @@ -23,6 +23,7 @@ CLSF_ID ,CLSF_NM ,UP_CLSF_ID + ,REMARK FROM CT_CLSF WHERE 1=1 diff --git a/src/main/webapp/WEB-INF/jsp/nlib/collection/searchList.jsp b/src/main/webapp/WEB-INF/jsp/nlib/collection/searchList.jsp index 0159237e..c1f15a4f 100644 --- a/src/main/webapp/WEB-INF/jsp/nlib/collection/searchList.jsp +++ b/src/main/webapp/WEB-INF/jsp/nlib/collection/searchList.jsp @@ -100,38 +100,12 @@ window.onload = function() { reference_filterDel(); }; // window.onload - -<%//검색필터 서브메뉴 보이기%> -function fn_show_sub(subId,subClass){ - if($("#" + subId).css("display") == "none") - { - $("."+subClass).css("display","none"); - $("#" + subId).css("display","block"); - }else{ - $("#" + subId).css("display","none"); - } -} //탭 이동 function fn_tabMove_sch(itemType){ - $("#itemType").val(itemType); + alert(itemType); fnFilterSch(); } -<%//검색필터 메뉴 더보기%> -function fn_show_more(showMoreId){ - if($("#" + showMoreId).html() == "더 보기") - { - $("."+showMoreId).css("display","block"); - $("#" + showMoreId).html("접기"); - } - else if($("#" + showMoreId).html() == "접기") - { - $("."+showMoreId).css("display","none"); - $("#" + showMoreId).html("더 보기"); - } -} - - function docView(){ alert("원문보기"); @@ -166,367 +140,316 @@ function fn_search_article(pageIndex) { - -

${pageTitle }

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - style="display:none;" placeholder="검색어를 입력하세요." value="${searchVO.query}" size="35" maxlength="50" /> - style="display:none;" placeholder="결과내재검색" value="${searchVO.reQuery}" size="35" maxlength="50" /> - - checked="checked"> -
-
-
검색결과 안내
-
- - - '${searchVO.realQuery}'에 대한 검색결과는 총 건 입니다. - - - 총 건 - - -
-
-
-
- - - - - -        - - -
-
-
-
    -

    검색필터

    -
      - + +
      +

      소장자료 섹션영역

      +
      +
      +
      +
        +
      • HOME
      • +
      • 소장자료
      -
    -
      -

      자료유형

      -
    • -
      - <%--
      --%> -
      - +
        +
      • 소장자료
      • +
      +
      +
      화살표 아이콘
      +
      +
      +
      + +
      +
      +
      +

      검색필터

      + +
      +
      +
        +
      • 문서 > 고문서
      • +
      • 문서 > 일반문서
      • +
      • 도면/지도 > 탁본
      • +
      +
      +
      +
      +
      +

      자료유형

      +
      +
      +
        +
      • + +
      • +
        on"> +
        + checked="checked" /> + +
        +
        +
          + + +
        • +
          checked="checked" /> + +
          +
        • +
          +
          +
        +
      • + + +
      +
      + +
      +
      +
      +

      주제분야

      + +
      +
      +
        + + + +
      • +
        on"> +
        checked="checked"/>
        +
        +
          + + +
        • checked="checked"/>
        • +
          +
          +
        +
      • + +
        +
        +
      +
      + +
      + +
      +
      +

      생산년도

      +
      +
      +
        +
      • + +
      • +
      • + +
      • +
      +
      + +
      + +
      +
      +

      생산기관

      +
      +
      +
        + +
      • +
        +
        +
        +
      • +
        +
      +
      + +
      + +
      +
      +
      + +
      +
      + + +
      + +
      + +
      + +
      +
      + style="display:none;" placeholder="검색어를 입력하세요." value="${searchVO.query}" maxlength="50" /> + style="display:none;" placeholder="결과내재검색" value="${searchVO.reQuery}" maxlength="50" /> + +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      자료정보
      +
      이용
      +
      + +
      +
      + +
      + 온라인열람 + 대출 + 방문열람 +
      + +
      KCCF1010010001
      +
      + 주제분야 : 도서간행물 > 연속간행물 + 주제분야 : 자연과지리 > 자연환경 + 생산기관 : 경북경주문화원 + 생산년도 : 2021 +
      +
      +
      + + +
      +
      +
      +
      +
      즐겨찾기 아이콘즐겨찾기 아이콘
      +
      + 온라인열람 + 대출 + 방문열람 +
      + +
      KCCF1010010001
      +
      + 주제분야 : 도서간행물 > 연속간행물 + 주제분야 : 자연과지리 > 자연환경 + 생산기관 : 경북경주문화원 + 생산년도 : 2021 +
      +
      +
      +

      대출신청 가능
      방문열람신청 가능

      +
      +
      +
      +
      +
      즐겨찾기 아이콘즐겨찾기 아이콘
      +
      + 온라인열람 + 대출 + 방문열람 +
      + +
      KCCF1010010001
      +
      + 주제분야 : 도서간행물 > 연속간행물 + 주제분야 : 자연과지리 > 자연환경 + 생산기관 : 경북경주문화원 + 생산년도 : 2021 +
      +
      +
      + + +
      +
      +
      +
      +
      + + + +
      +
      + +
      +
      + 02 +
      +
      + +
      +
      + 03 +
      +
      + +
      +
      + 04 +
      +
      + +
      +
      + 05 +
      +
      +
      -
    • - -
    • class="showMoreType" style="display:none;" > -
      on"> -
      - checked="checked" /> - -
      -
      - -
    • -
      -
    • 더 보기
    • -
    -
      -

      주제분야

      - - - -
    • class="showMoreClsf" style="display:none;" > -
      on"> -
      checked="checked"/>
      -
      - -
    • - -
      -
      -
    • 더 보기
    • -
    -
      -

      생산년도

      -
      - 전체
      - - ~
      - (미상포함) - 적용
      -
    -
      -

      생산기관

      - - ${councilList}
      -
      -
    -
-
- - - - - - - - - - - -
자료정보이용
- - ${result.TITLE} -

출처:${result.COPYRIGHT}

-
- - - - - 온라인열람  - - - 대출  - - - 방문열람  - - - 기타 - - - -
- [${result.FIRST_CLASS_NM}]
- <%--자료유형 : --%>자료유형 : ${result.FIRST_CLASS_NM} > ${result.SECOND_CLASS_NM} - <%--주제분야 : --%>주제분야 : ${result.FIRST_CATEGORY_NM} > ${result.SECOND_CATEGORY_NM} - | 생산기관 : ${result.PUBLISHER} - | 생산년도 : ${result.GENYEAR} -
- <%--
  • 소장처 : ${result.COUNCIL_NM_TOT}
  • --%> -
    - - - - ${operList.operOutRangeNm}
    -
    - - ${operList.operReadRangeNm}
    -
    - -
    -
    - -
    -
    -
    -
    + +
    - - -
    - + diff --git a/src/main/webapp/WEB-INF/jsp/nlib/search/getDetailedSearchFormPopup.jsp b/src/main/webapp/WEB-INF/jsp/nlib/search/getDetailedSearchFormPopup.jsp index b1bee223..41dcba78 100644 --- a/src/main/webapp/WEB-INF/jsp/nlib/search/getDetailedSearchFormPopup.jsp +++ b/src/main/webapp/WEB-INF/jsp/nlib/search/getDetailedSearchFormPopup.jsp @@ -115,7 +115,7 @@ $(document).ready(function() {

    선택조건

    - +
    • @@ -124,90 +124,22 @@ $(document).ready(function() {
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    -
    + + + +
    +
    +
      + + +
    • +
      +
      +
    +
    + +
    +
    @@ -217,7 +149,7 @@ $(document).ready(function() {

    선택조건

    - +
    • @@ -226,76 +158,26 @@ $(document).ready(function() {
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    • -
    • -
    -
    -
    -
    -
      -
    • -
    -
    + +
    +
    + + +
    +
      + + +
    • +
      + + +
      +
    • +
      +
      +
    +
    +
    diff --git a/src/main/webapp/js/default.js b/src/main/webapp/js/default.js index 554fd594..afd58e79 100644 --- a/src/main/webapp/js/default.js +++ b/src/main/webapp/js/default.js @@ -140,15 +140,33 @@ $(document).ready(function(){ }); $('.pop-advanced-search .depth2 input').change(function() { + var html = ""; + var depth1 = ""; + var depth2 = ""; + if ($(this).is(':checked')) { + depth1 = $(this).parents('.depth2').siblings('.depth1-check').find('label').text(); + depth2 = $("label[for='"+$(this).attr('id')+"']").text(); + + html = "
  • " + $(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', true); + $(this).parents('.conditions-box').siblings('.selected-conditions').find('.conditions').append(html); } else { if ($(this).parents('.depth2').find('input:checked').length <= 0) { $(this).parents('.depth2').siblings('.depth1-check').find('input').prop('checked', false); + $("button[name="+$(this).attr('id')+"]").remove(); } } }); + // 상세검색 초기화 + $('.pop-advanced-search .btn-reset-conditions').on('click', function() { + alert("DAD"); + $("input[id^='"+$(this).attr('name')+"-chk']").each(function() { + $(this).prop('checked', false); + }); + }); // depth-1 열고 닫기 $('.filter-tit .btn-toggle').on('click', function() { if($(this).text() == '닫기') {