검색엔진 소스 개발중

This commit is contained in:
JSYOO 2021-10-13 14:01:13 +09:00
parent 1318bafc6e
commit e2d9ffdb64
5 changed files with 290 additions and 511 deletions

View File

@ -94,6 +94,8 @@ public class Constant {
public static final String CODE_ID_FMS009 = "FMS009"; // 지역 public static final String CODE_ID_FMS009 = "FMS009"; // 지역
public static final String CODE_ID_FMS012 = "FMS012"; // 자료유형(대분류) public static final String CODE_ID_FMS012 = "FMS012"; // 자료유형(대분류)
public static final String CODE_ID_FMS013 = "FMS013"; // 자료유형(중분류) public static final String CODE_ID_FMS013 = "FMS013"; // 자료유형(중분류)
public static final String CODE_ID_MASTER_TYPE_DIV_CD = "MASTER_TYPE_DIV_CD"; // 자료유형(대분류)
public static final String CODE_ID_DTLS_TYPE_DIV_CD = "DTLS_TYPE_DIV_CD"; // 자료유형(중분류)
public static final String CODE_ID_FMS014 = "FMS014"; // 주제분야(대주제) public static final String CODE_ID_FMS014 = "FMS014"; // 주제분야(대주제)
public static final String CODE_ID_FMS015 = "FMS015"; // 주제분야(중주제) public static final String CODE_ID_FMS015 = "FMS015"; // 주제분야(중주제)
public static final String CODE_ID_FMS016 = "FMS016"; // 지역문화정보 public static final String CODE_ID_FMS016 = "FMS016"; // 지역문화정보

View File

@ -24,6 +24,7 @@ import kccf.sch.service.vo.SearchCollectionVO;
import kccf.sch.service.vo.SearchVO; import kccf.sch.service.vo.SearchVO;
import kccf.sch.service.vo.Sf1VO; import kccf.sch.service.vo.Sf1VO;
import kccf.ton.service.LocalToonService; import kccf.ton.service.LocalToonService;
import nlib.cmm.service.CodeService;
import nlib.cmm.service.NlibProperty; import nlib.cmm.service.NlibProperty;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -83,6 +84,10 @@ public class SearchController {
@Resource(name = "resourcesService") @Resource(name = "resourcesService")
private ResourcesService resourcesService; private ResourcesService resourcesService;
@Resource(name = "codeService")
private CodeService codeService;
/**SEARCHLIST**/ /**SEARCHLIST**/
@RequestMapping(value="/sch/totalSearchList.do") @RequestMapping(value="/sch/totalSearchList.do")
public String totalSearchList ( public String totalSearchList (
@ -99,7 +104,9 @@ public class SearchController {
try{ try{
LOGGER.debug("[PATH][/sch/totalSearchList.do][searchVO][{}]",searchVO.toString()); LOGGER.debug("[PATH][/sch/totalSearchList.do][searchVO][{}]",searchVO.toString());
//System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString()); //System.out.println("\n\n\n\n\n\n\n/*****************totalSearchList-searchVO.toString()********************/"+searchVO.toString());
searchVO.setRealQuery("한복");
searchVO.setQuery("한복");
searchVO.setCollection("reference_Coll");
// 검색관련 서버 설정 // 검색관련 서버 설정
String searchIp = nlibProperty.getString("search.searchIp"); String searchIp = nlibProperty.getString("search.searchIp");
int searchPort = nlibProperty.getInt("search.searchPort"); int searchPort = nlibProperty.getInt("search.searchPort");
@ -112,15 +119,7 @@ public class SearchController {
SearchCollectionResult collResult = searchService.getSearch(searchVO, sf1Vo); SearchCollectionResult collResult = searchService.getSearch(searchVO, sf1Vo);
if(gubun.equals("1")){ //&&(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("")) all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo));
all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo));
// all_totalCount = Integer.toString(collResult_all_cnt);
// System.out.println("################################"+searchVO.getCollection()+"/"+all_totalCount+"/"+gubun);
}else {
all_totalCount = Integer.toString(searchService.getSearch_All_cnt(searchVO, sf1Vo)); //2019-11-27 gubun??
// System.out.println("else ################################:"+searchVO.getCollection()+"/"+all_totalCount+"/"+gubun);
}
//System.out.println("\n\n\n\n\n################################gubun_ajax:"+searchVO.getCollection()+"/"+gubun_ajax);
// 결과 // 결과
SearchCollectionVO collInfo = new SearchCollectionVO(); SearchCollectionVO collInfo = new SearchCollectionVO();
@ -178,7 +177,8 @@ public class SearchController {
paramMap.put("mId", mapResult.get("MEDIA_ID")); paramMap.put("mId", mapResult.get("MEDIA_ID"));
if(StringUtils.isNotEmpty(mapResult.get("MEDIA_ID").toString())){ if(StringUtils.isNotEmpty(mapResult.get("MEDIA_ID").toString())){
DataMap media = cmmService.selectCmmAmsAssetsMediaDetail(paramMap); DataMap media = cmmService.selectCmmAmsAssetsMediaDetail(paramMap);
String mediaId = media.getString("id"); String url="";
/*String mediaId = media.getString("mid");
String mediaInterfaceId = media.getString("interfaceId"); String mediaInterfaceId = media.getString("interfaceId");
String url = ""; String url = "";
if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성 if (StringUtils.isNotEmpty(mediaInterfaceId)) { // mediaInterfaceId가 존재할 경우만 URL 정보 생성
@ -194,7 +194,7 @@ public class SearchController {
url += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 사용 url += "&rfType="+Constant.UA_TYPE_R; // 히스토리 등록 사용
} }
} }
} }*/
mapResult.put("LINK_URL", url); mapResult.put("LINK_URL", url);
} }
} }
@ -248,22 +248,6 @@ public class SearchController {
model.addAttribute("culturePostHot_tags", coll); model.addAttribute("culturePostHot_tags", coll);
} }
} }
else if(collEn.indexOf("toon") >= 0){
if(collEn.equals("toon")){
collToon = coll;
}
else if(collEn.equals("toon_tags")){
model.addAttribute("toon_tags", coll);
}
// 최근열람툰
CmmActivityHstVO cmmActivityHstVO = new CmmActivityHstVO();
cmmActivityHstVO.setTargetId(CmmUtil.getCookieId(request));
cmmActivityHstVO.setUaType(Constant.UA_TYPE_W);
cmmActivityHstVO.setActivityType(Constant.ACTIVITY_TYPE_O);
cmmActivityHstVO.setContentType(Constant.CONTENT_TYPE_T);
model.addAttribute("openPageList", localToonService.selectLocalToonOpenPageList(cmmActivityHstVO));
model.addAttribute("openPageHotList", localToonService.selectLocalToonOpenPageHotList(cmmActivityHstVO));
}
} }
@ -319,80 +303,14 @@ public class SearchController {
String resultUrl =""; String resultUrl ="";
//자료유형
/*if(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("")){ model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD));
resultUrl = "kccf/sch/totalSearchList.kccf"; model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD));
}else if(searchVO.getCollection().equals("pick_Coll")){
resultUrl = "kccf/sch/searchPickList.kccf";
}else if(searchVO.getCollection().equals("culturePost_Coll")){
resultUrl = "kccf/sch/searchCulturePostList.kccf";
}else if(searchVO.getCollection().equals("number_Coll")){
resultUrl = "kccf/sch/searchNumberList.kccf";
}else if(searchVO.getCollection().equals("story_Coll")){
resultUrl = "kccf/sch/searchStoryList.kccf";
}else if(searchVO.getCollection().equals("reference_Coll")){
resultUrl = "kccf/sch/searchReferenceList.kccf";
}else if(searchVO.getCollection().equals("info_Coll")){
resultUrl = "kccf/sch/searchInfoList.kccf";
}*/
ComDefaultCodeVO CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS014);
model.addAttribute("firstCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS015);
model.addAttribute("secondCategoryList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS004);
model.addAttribute("themaList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS005);
model.addAttribute("seriesList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS012);
model.addAttribute("firstClassList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS013);
model.addAttribute("secondClassList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS016);
model.addAttribute("contentTypeList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS018);
model.addAttribute("couSidoList", cmmUseService.selectCmmCodeDetail(CodeVO));
List<DataMap> councilList = resourcesService.selectCouncilList(); List<DataMap> councilList = resourcesService.selectCouncilList();
model.addAttribute("councilList", councilList); model.addAttribute("councilList", councilList);
if(searchVO.getCollection().equals("ALL") || searchVO.getCollection().equals("")){ resultUrl = "nlib/collection/searchReferenceListAjax";
if(gubun_ajax != null && gubun_ajax.equals("2")){
resultUrl = "kccf/sch/totalSearchListAjax";
}else{
resultUrl = "kccf/sch/totalSearchList.kccf";
}
}else if(searchVO.getCollection().equals("pick_Coll")){
resultUrl = "kccf/sch/searchPickListAjax";
}else if(searchVO.getCollection().equals("culturePost_Coll")){
resultUrl = "kccf/sch/searchCulturePostList";
}else if(searchVO.getCollection().equals("number_Coll")){
resultUrl = "kccf/sch/searchNumberListAjax";
}else if(searchVO.getCollection().equals("story_Coll")){
resultUrl = "kccf/sch/searchStoryListAjax";
}else if(searchVO.getCollection().equals("reference_Coll")){
resultUrl = "kccf/sch/searchReferenceListAjax";
}else if(searchVO.getCollection().equals("info_Coll")){
resultUrl = "kccf/sch/searchInfoListAjax";
}else if(searchVO.getCollection().equals("toon_Coll")){
resultUrl = "kccf/sch/searchToonListAjax";
}
//System.out.println("\n\n\n\n\n################################gubun_ajax:"+searchVO.getCollection()+"/"+gubun_ajax+"/"+resultUrl); //System.out.println("\n\n\n\n\n################################gubun_ajax:"+searchVO.getCollection()+"/"+gubun_ajax+"/"+resultUrl);
@ -716,11 +634,11 @@ public class SearchController {
model.addAttribute("seriesList", cmmUseService.selectCmmCodeDetail(CodeVO)); model.addAttribute("seriesList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO(); CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS012); CodeVO.setCodeId(Constant.CODE_ID_MASTER_TYPE_DIV_CD);
model.addAttribute("firstClassList", cmmUseService.selectCmmCodeDetail(CodeVO)); model.addAttribute("firstClassList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO(); CodeVO = new ComDefaultCodeVO();
CodeVO.setCodeId(Constant.CODE_ID_FMS013); CodeVO.setCodeId(Constant.CODE_ID_DTLS_TYPE_DIV_CD);
model.addAttribute("secondClassList", cmmUseService.selectCmmCodeDetail(CodeVO)); model.addAttribute("secondClassList", cmmUseService.selectCmmCodeDetail(CodeVO));
CodeVO = new ComDefaultCodeVO(); CodeVO = new ComDefaultCodeVO();

View File

@ -60,102 +60,6 @@ public class RisController extends NlibCommonController
@Resource(name = "interestService") @Resource(name = "interestService")
private InterestService interestService; private InterestService interestService;
/**
* 소장자료 화면을 호출한다.
*
* @param req
* @return
*/
// @RequestMapping("/collection/listItems.do")
// public String listItems(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) 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<DeptVO> vo = new ArrayList();
//
// // 페이징 사이즈 코드 목록 조회 (DB방식으로 변경 2021.08.06 KNKIM)
// List<HashMap<String,String>> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION");
//
// // 자료유형 코드 목록 조회
// List<HashMap<String,String>> masterType = codeService.listCodes("MASTER_TYPE_DIV_CD");
// List<HashMap<String,String>> dtlsType = codeService.listCodes("DTLS_TYPE_DIV_CD");
//
// //주제분야 목록 조회
// List<HashMap<String,String>> clsf = codeService.listCtClsfs();
//
// //문화원 목록 조회
// vo = risService.selectOrgList();
//
// // 반환 정보
// model.addAttribute("pageIndex" , pageIndex);
// model.addAttribute("pageSize" , pageSize);
// model.addAttribute("searchKeyword", searchKeyword);
// model.addAttribute("pageSizeCodes", pageSizeCodes);
// model.addAttribute("masterType", masterType);
// model.addAttribute("dtlsType", dtlsType);
// model.addAttribute("masterClsf", clsf);
// model.addAttribute("dtlsClsf", clsf);
// model.addAttribute("orgList",vo);
// return "nlib/collection/listItems";
// }
/**
* 소장자료를 조회한다.
*
* @param req
* @return
*/
// @RequestMapping(value="/collection/listItemsAjax.do")
// public ResponseEntity<String> listItemsAjax(HttpServletRequest req,
// Authentication authentication, @RequestBody CollectionVO searchCollectionVO) {
//
// //String searchKeyword = paramMap.get("searchKeyword");
// if(searchCollectionVO.getPageIndex() < 1) searchCollectionVO.setPageIndex(1);
// if(searchCollectionVO.getPageSize() < 1) searchCollectionVO.setPageSize(DEFUALT_PAGE_SIZE);
//
//
// int totalCount= 0;
// //사용자 정보를 가져온다.
// NlibLoginVO loginVO = getNlibLoginVO(authentication);
//
// searchCollectionVO.setPageStart(searchCollectionVO.getPageIndex(), searchCollectionVO.getPageSize());
// List<CollectionVO> List = new ArrayList();
//
// // 요청
// List = risService.listItems(searchCollectionVO);
// totalCount = risService.countListItems(searchCollectionVO);
//
// PagingVO pageVO = new PagingVO();
// pageVO.setPagingVO(totalCount, searchCollectionVO.getPageIndex(), searchCollectionVO.getPageSize());
//
// //-------------------------------
// // REQ VO 구성
// //-------------------------------
// /*DataApiReqVO reqVO = new DataApiReqVO();
// reqVO.setPageIndex(pageIndex);
// reqVO.setPageSize(pageSize);
// reqVO.putInfoItem("searchKeyword", searchKeyword);*/
//
// // 요청
// //DataApiResVO resVO = collectionService.listItems(reqVO);
//
// //-------------------------------
// // JSON변환 응답 처리
// //-------------------------------
// // JS-GRID 페이징 처리를 포함한 응답값 처리
// // {data: [{...}],
// // itemsCount: 255
// // }
// HashMap<String, Object> retMap = new HashMap<String, Object>();
// /*retMap.put("data", resVO.getList(DataApiVO.XML_EL_NAME_RECORD));
// retMap.put("itemsCount", resVO.getRecordTotCount());*/
// retMap.put("data", List);
// retMap.put("pageVO", pageVO);
//
// return makeResponseEntityJson(retMap);
// }
/** /**
* RIS파일 다운로드 * RIS파일 다운로드
* @param vo * @param vo
@ -223,49 +127,4 @@ public class RisController extends NlibCommonController
os.close(); os.close();
} }
/**
* 소장자료 상세 내용 조회한다.
*
* @param req
* @return
*//*
@RequestMapping("/collection/selectItemInfo.do")
public String selectItemInfo(HttpServletRequest req, Authentication authentication, @RequestParam Map<String, String> paramMap, ModelMap model) {
// 목록 이동시 전달할 매개변수
String searchKeyword = paramMap.get("searchKeyword");
String pageIndex = paramMap.get("pageIndex");
String pageSize = paramMap.get("pageSize");
String message = paramMap.get("message");
// 게시물 번호
String articleNo = paramMap.get("articleNo");
log.debug("selectQnA > pageIndex = " + pageIndex);
log.debug("selectQnA > pageSize = " + pageSize);
log.debug("selectQnA > searchKeyword = " + searchKeyword);
log.debug("selectQnA > articleNo = " + articleNo);
log.debug("selectQnA > message = " + message);
//-------------------------------
// REQ VO 구성
//-------------------------------
DataApiReqVO reqVO = new DataApiReqVO();
reqVO.setPageIndex(pageIndex);
reqVO.setPageSize(pageSize);
reqVO.addInfoItem("boardNo", "QNA"); // 게시판ID
reqVO.addInfoItem("articleNo", articleNo); // 게시물번호
// 요청
DataApiResVO resVO = collectionService.selectItemInfo(reqVO);
// 반환 정보
model.addAttribute("articleNo" , articleNo);
model.addAttribute("article" , resVO.getInfo()); // 게시물 상세
model.addAttribute("message" , message);
model.addAttribute("pageIndex" , pageIndex);
model.addAttribute("pageSize" , pageSize);
model.addAttribute("searchKeyword", searchKeyword);
return "nlib/collection/selectItemInfo";
}*/
} }

View File

@ -34,7 +34,7 @@
]]> ]]>
</select> </select>
<select id="listItems" parameterType="CollectionVO" resultType="CollectionVO"> <!-- <select id="listItems" parameterType="CollectionVO" resultType="CollectionVO">
/* CollectionDAO.listItems 소장자료 목록조회 */ /* CollectionDAO.listItems 소장자료 목록조회 */
SELECT SELECT
* *
@ -53,8 +53,8 @@
RG_MASTER RM RG_MASTER RM
WHERE 1=1 WHERE 1=1
AND USE_FLAG = "Y" AND USE_FLAG = "Y"
<!-- <if test='mngOrgCd != null and !mngOrgCd.equals("")'> <if test='mngOrgCd != null and !mngOrgCd.equals("")'>
AND MNG_ORG_CD = #{mngOrgCd} AND MNG_ORG_CD = #{mngOrgCd}
</if> --> </if>
</select> </select> -->
</mapper> </mapper>