Merge branch 'hylee'
This commit is contained in:
commit
1cfc18b682
@ -144,14 +144,14 @@ public class SearchServiceImpl implements InitializingBean, SearchService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
System.out.println(" :: SOLR_CORE.values().length :: "+ SOLR_CORE.values().length);
|
|
||||||
System.out.println(" :: SOLR_CORE.values() :: "+ SOLR_CORE.values());
|
|
||||||
|
|
||||||
Map<String, List<Map<String, Object>>> resultMap = new HashMap<String, List<Map<String, Object>>>();
|
Map<String, List<Map<String, Object>>> resultMap = new HashMap<String, List<Map<String, Object>>>();
|
||||||
Map<String, Long> resultCntMap = new HashMap<String, Long>();
|
Map<String, Long> resultCntMap = new HashMap<String, Long>();
|
||||||
long totalCount = 0;
|
long totalCount = 0;
|
||||||
for (SOLR_CORE sc : SOLR_CORE.values()) {
|
for (SOLR_CORE sc : SOLR_CORE.values()) {
|
||||||
|
|
||||||
|
log.debug(" :: sc.getValue() :: [{}]", sc.getValue());
|
||||||
|
|
||||||
resultCntMap.put(sc.getValue(), new Long(0));
|
resultCntMap.put(sc.getValue(), new Long(0));
|
||||||
resultMap.put(sc.getValue(), Collections.<Map<String, Object>>emptyList());
|
resultMap.put(sc.getValue(), Collections.<Map<String, Object>>emptyList());
|
||||||
List<Map<String, Object>> resultList = getResultList(sc, fieldMap.get(sc.getValue()), commandMap);
|
List<Map<String, Object>> resultList = getResultList(sc, fieldMap.get(sc.getValue()), commandMap);
|
||||||
@ -214,11 +214,14 @@ public class SearchServiceImpl implements InitializingBean, SearchService {
|
|||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(client);
|
IOUtils.closeQuietly(client);
|
||||||
}
|
}
|
||||||
|
log.debug(" :: resultList :: [{}]", resultList);
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SolrQuery makeQuery(SOLR_CORE core, Map<String, Object> commandMap, Set<String> fieldSet){
|
private SolrQuery makeQuery(SOLR_CORE core, Map<String, Object> commandMap, Set<String> fieldSet){
|
||||||
SolrQuery query = new SolrQuery();
|
SolrQuery query = new SolrQuery();
|
||||||
|
|
||||||
|
log.debug(" :: commandMap :: [{}]", commandMap);
|
||||||
String q = StringUtils.defaultString((String)commandMap.get("q"));
|
String q = StringUtils.defaultString((String)commandMap.get("q"));
|
||||||
q = q.replaceAll(SPECIAL_REGEX, "");
|
q = q.replaceAll(SPECIAL_REGEX, "");
|
||||||
String re = (String)commandMap.get("re");
|
String re = (String)commandMap.get("re");
|
||||||
@ -228,6 +231,10 @@ public class SearchServiceImpl implements InitializingBean, SearchService {
|
|||||||
|
|
||||||
int pageIndex = 1;
|
int pageIndex = 1;
|
||||||
String rangeView = (String)commandMap.get("rangeView");
|
String rangeView = (String)commandMap.get("rangeView");
|
||||||
|
|
||||||
|
// log.debug(" :: rangeView :: [{}]", rangeView);
|
||||||
|
// log.debug(" :: core.getValue() :: [{}]", core.getValue());
|
||||||
|
|
||||||
if (core.getValue().equals(rangeView)) {
|
if (core.getValue().equals(rangeView)) {
|
||||||
String pi = (String)commandMap.get("pageIndex");
|
String pi = (String)commandMap.get("pageIndex");
|
||||||
if (StringUtils.isNotBlank(pi)) {
|
if (StringUtils.isNotBlank(pi)) {
|
||||||
|
|||||||
@ -1,126 +1,126 @@
|
|||||||
package kcc.let.solr.search.web;
|
package kcc.let.solr.search.web;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import egovframework.rte.fdl.string.EgovStringUtil;
|
import egovframework.rte.fdl.string.EgovStringUtil;
|
||||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||||
import kcc.let.solr.search.service.SearchService;
|
import kcc.let.solr.search.service.SearchService;
|
||||||
@Controller
|
@Controller
|
||||||
public class SearchContorller {
|
public class SearchContorller {
|
||||||
|
|
||||||
Logger log = LoggerFactory.getLogger(this.getClass());
|
Logger log = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
@Resource(name = "searchService")
|
@Resource(name = "searchService")
|
||||||
protected SearchService searchService;
|
protected SearchService searchService;
|
||||||
|
|
||||||
//TODO test URL
|
//TODO test URL
|
||||||
// http://192.168.0.125:8983/solr/kcc_adr_advc/select?q=*:*&wt=json&indent=true
|
// http://192.168.0.125:8983/solr/kcc_adr_advc/select?q=*:*&wt=json&indent=true
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@RequestMapping(value = "/web/search/search.do")
|
@RequestMapping(value = "/web/search/search.do")
|
||||||
public String search(@RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
public String search(@RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
||||||
log.debug("commandMap : {}", commandMap);
|
log.debug("commandMap : {}", commandMap);
|
||||||
|
|
||||||
String searchWrd = (String) commandMap.get("q");
|
String searchWrd = (String) commandMap.get("q");
|
||||||
|
|
||||||
if (searchWrd!= null && !("").equals(searchWrd)) {
|
if (searchWrd!= null && !("").equals(searchWrd)) {
|
||||||
searchService.search(commandMap, model);
|
searchService.search(commandMap, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
PaginationInfo paginationInfo = new PaginationInfo();
|
PaginationInfo paginationInfo = new PaginationInfo();
|
||||||
int totalRecordCount = 0;
|
int totalRecordCount = 0;
|
||||||
String rangeView = (String)commandMap.get("rangeView");
|
String rangeView = (String)commandMap.get("rangeView");
|
||||||
if ( StringUtils.isNotBlank(rangeView) ) {
|
if ( StringUtils.isNotBlank(rangeView) ) {
|
||||||
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
|
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
|
||||||
log.debug("resultCntMap : {}", resultCntMap);
|
log.debug("resultCntMap : {}", resultCntMap);
|
||||||
Long total = resultCntMap.get(rangeView);
|
Long total = resultCntMap.get(rangeView);
|
||||||
if (total != null) {
|
if (total != null) {
|
||||||
totalRecordCount = total.intValue();
|
totalRecordCount = total.intValue();
|
||||||
}
|
}
|
||||||
log.debug("totalRecordCount : {}", totalRecordCount);
|
log.debug("totalRecordCount : {}", totalRecordCount);
|
||||||
|
|
||||||
String pi = (String)commandMap.get("pageIndex");
|
String pi = (String)commandMap.get("pageIndex");
|
||||||
if ( StringUtils.isBlank(pi) ) {
|
if ( StringUtils.isBlank(pi) ) {
|
||||||
pi = "1";
|
pi = "1";
|
||||||
}
|
}
|
||||||
int pageIndex = EgovStringUtil.string2integer(pi);
|
int pageIndex = EgovStringUtil.string2integer(pi);
|
||||||
log.debug("pageIndex : {}", pageIndex);
|
log.debug("pageIndex : {}", pageIndex);
|
||||||
paginationInfo.setCurrentPageNo(pageIndex);
|
paginationInfo.setCurrentPageNo(pageIndex);
|
||||||
paginationInfo.setRecordCountPerPage(10);
|
paginationInfo.setRecordCountPerPage(10);
|
||||||
paginationInfo.setPageSize(10);
|
paginationInfo.setPageSize(10);
|
||||||
paginationInfo.setTotalRecordCount(totalRecordCount);
|
paginationInfo.setTotalRecordCount(totalRecordCount);
|
||||||
model.addAttribute("paginationInfo", paginationInfo);
|
model.addAttribute("paginationInfo", paginationInfo);
|
||||||
}
|
}
|
||||||
model.addAttribute("totalRecordCount", totalRecordCount);
|
model.addAttribute("totalRecordCount", totalRecordCount);
|
||||||
|
|
||||||
return "web/search/search";
|
return "web/search/search";
|
||||||
//return "web/search/search_0529.jsp";
|
//return "web/search/search_0529.jsp";
|
||||||
//return "kopost/search/search";
|
//return "kopost/search/search";
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@RequestMapping(value = "/{siteId}/web/search/search.do")
|
@RequestMapping(value = "/{siteId}/web/search/search.do")
|
||||||
public String siteSearch(@PathVariable("siteId") String siteId , @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
public String siteSearch(@PathVariable("siteId") String siteId , @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
||||||
log.debug("commandMap : {}", commandMap);
|
log.debug("commandMap : {}", commandMap);
|
||||||
|
|
||||||
String searchWrd = (String) commandMap.get("q");
|
String searchWrd = (String) commandMap.get("q");
|
||||||
if (searchWrd!= null && !("").equals(searchWrd)) {
|
if (searchWrd!= null && !("").equals(searchWrd)) {
|
||||||
searchService.search(commandMap, model);
|
searchService.search(commandMap, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
PaginationInfo paginationInfo = new PaginationInfo();
|
PaginationInfo paginationInfo = new PaginationInfo();
|
||||||
int totalRecordCount = 0;
|
int totalRecordCount = 0;
|
||||||
String rangeView = (String)commandMap.get("rangeView");
|
String rangeView = (String)commandMap.get("rangeView");
|
||||||
if ( StringUtils.isNotBlank(rangeView) ) {
|
if ( StringUtils.isNotBlank(rangeView) ) {
|
||||||
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
|
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
|
||||||
log.debug("resultCntMap : {}", resultCntMap);
|
log.debug("resultCntMap : {}", resultCntMap);
|
||||||
Long total = resultCntMap.get(rangeView);
|
Long total = resultCntMap.get(rangeView);
|
||||||
if (total != null) {
|
if (total != null) {
|
||||||
totalRecordCount = total.intValue();
|
totalRecordCount = total.intValue();
|
||||||
}
|
}
|
||||||
log.debug("totalRecordCount : {}", totalRecordCount);
|
log.debug("totalRecordCount : {}", totalRecordCount);
|
||||||
|
|
||||||
String pi = (String)commandMap.get("pageIndex");
|
String pi = (String)commandMap.get("pageIndex");
|
||||||
if ( StringUtils.isBlank(pi) ) {
|
if ( StringUtils.isBlank(pi) ) {
|
||||||
pi = "1";
|
pi = "1";
|
||||||
}
|
}
|
||||||
int pageIndex = EgovStringUtil.string2integer(pi);
|
int pageIndex = EgovStringUtil.string2integer(pi);
|
||||||
log.debug("pageIndex : {}", pageIndex);
|
log.debug("pageIndex : {}", pageIndex);
|
||||||
paginationInfo.setCurrentPageNo(pageIndex);
|
paginationInfo.setCurrentPageNo(pageIndex);
|
||||||
paginationInfo.setRecordCountPerPage(10);
|
paginationInfo.setRecordCountPerPage(10);
|
||||||
paginationInfo.setPageSize(10);
|
paginationInfo.setPageSize(10);
|
||||||
paginationInfo.setTotalRecordCount(totalRecordCount);
|
paginationInfo.setTotalRecordCount(totalRecordCount);
|
||||||
model.addAttribute("paginationInfo", paginationInfo);
|
model.addAttribute("paginationInfo", paginationInfo);
|
||||||
}
|
}
|
||||||
model.addAttribute("totalRecordCount", totalRecordCount);
|
model.addAttribute("totalRecordCount", totalRecordCount);
|
||||||
|
|
||||||
model.addAttribute("siteId", siteId);
|
model.addAttribute("siteId", siteId);
|
||||||
String siteFolder = "site/"+siteId ;
|
String siteFolder = "site/"+siteId ;
|
||||||
model.addAttribute("site_path", "/"+siteFolder);
|
model.addAttribute("site_path", "/"+siteFolder);
|
||||||
|
|
||||||
//return "kopost/search/search";
|
//return "kopost/search/search";
|
||||||
return "web/"+siteFolder+"/search/search";
|
return "web/"+siteFolder+"/search/search";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/json/ajaxSuggest.do")
|
@RequestMapping(value = "/json/ajaxSuggest.do")
|
||||||
public ModelAndView ajaxEditorCopy(@RequestParam Map<String, Object> commandMap) throws Exception {
|
public ModelAndView ajaxEditorCopy(@RequestParam Map<String, Object> commandMap) throws Exception {
|
||||||
ModelAndView modelAndView = new ModelAndView();
|
ModelAndView modelAndView = new ModelAndView();
|
||||||
modelAndView.setViewName("jsonView");
|
modelAndView.setViewName("jsonView");
|
||||||
|
|
||||||
Set<String> resultList = searchService.suggest(commandMap);
|
Set<String> resultList = searchService.suggest(commandMap);
|
||||||
modelAndView.addObject("resultList", resultList);
|
modelAndView.addObject("resultList", resultList);
|
||||||
return modelAndView;
|
return modelAndView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,8 +72,10 @@ function fnGoCrtfc(){
|
|||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div class="cont_tit">
|
<div class="cont_tit">
|
||||||
<h2>조정신청</h2>
|
<h2>조정신청</h2>
|
||||||
|
<input type="button" value="튜토리얼"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- 안내문구 -->
|
<!-- 안내문구 -->
|
||||||
<div class="info_wrap">
|
<div class="info_wrap">
|
||||||
<div class="icon_box"><i></i></div>
|
<div class="icon_box"><i></i></div>
|
||||||
|
|||||||
@ -547,7 +547,7 @@ $( document ).ready(function(){
|
|||||||
<div class="btn_wrap btn_layout01">
|
<div class="btn_wrap btn_layout01">
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${empty adjstReqVO.adrSeq}">
|
<c:when test="${empty adjstReqVO.adrSeq}">
|
||||||
<button type="button" class="btnType02 btn_save" onclick="AdjstReq.step1Save('${KccadrConstants.ADR_MODE_NEW}'); return false;">1단계 저장</button>
|
<button type="button" class="btnType02 btn_save" onclick="AdjstReq.step1Save('${KccadrConstants.ADR_MODE_NEW}'); return false;">임시저장</button>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
|
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
|
||||||
|
|||||||
@ -470,7 +470,7 @@
|
|||||||
<c:when test="${fn:length(list) eq 0}">
|
<c:when test="${fn:length(list) eq 0}">
|
||||||
<div class="btn_right">
|
<div class="btn_right">
|
||||||
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
|
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
|
||||||
<button type="button" class="btnType02 btn_save" onclick="AdjstReq.step2Save('${KccadrConstants.ADR_MODE_NEW}'); return false">2단계 저장</button>
|
<button type="button" class="btnType02 btn_save" onclick="AdjstReq.step2Save('${KccadrConstants.ADR_MODE_NEW}'); return false">임시저장</button>
|
||||||
</div>
|
</div>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
|
|||||||
@ -241,7 +241,7 @@ function fn_adjstReq_preview() {
|
|||||||
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
|
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${empty fn:trim(master.ccTy)}">
|
<c:when test="${empty fn:trim(master.ccTy)}">
|
||||||
<button type="button" class="btnType02 btn_save" onClick="AdjstReq.step3Save('<c:out value='${KccadrConstants.ADR_MODE_NEW}' />'); return false;">3단계 저장</button>
|
<button type="button" class="btnType02 btn_save" onClick="AdjstReq.step3Save('<c:out value='${KccadrConstants.ADR_MODE_NEW}' />'); return false;">임시저장</button>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<button type="button" class="btnType02 btn_save" onClick="AdjstReq.step3Save('<c:out value='${KccadrConstants.ADR_MODE_UPT}' />'); return false;">3단계 수정</button>
|
<button type="button" class="btnType02 btn_save" onClick="AdjstReq.step3Save('<c:out value='${KccadrConstants.ADR_MODE_UPT}' />'); return false;">3단계 수정</button>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user