Merge branch 'hylee'

This commit is contained in:
hylee 2022-08-16 15:11:49 +09:00
commit 1cfc18b682
6 changed files with 141 additions and 132 deletions

View File

@ -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, Long> resultCntMap = new HashMap<String, Long>();
long totalCount = 0;
for (SOLR_CORE sc : SOLR_CORE.values()) {
log.debug(" :: sc.getValue() :: [{}]", sc.getValue());
resultCntMap.put(sc.getValue(), new Long(0));
resultMap.put(sc.getValue(), Collections.<Map<String, Object>>emptyList());
List<Map<String, Object>> resultList = getResultList(sc, fieldMap.get(sc.getValue()), commandMap);
@ -214,11 +214,14 @@ public class SearchServiceImpl implements InitializingBean, SearchService {
} finally {
IOUtils.closeQuietly(client);
}
log.debug(" :: resultList :: [{}]", resultList);
return resultList;
}
private SolrQuery makeQuery(SOLR_CORE core, Map<String, Object> commandMap, Set<String> fieldSet){
SolrQuery query = new SolrQuery();
log.debug(" :: commandMap :: [{}]", commandMap);
String q = StringUtils.defaultString((String)commandMap.get("q"));
q = q.replaceAll(SPECIAL_REGEX, "");
String re = (String)commandMap.get("re");
@ -228,6 +231,10 @@ public class SearchServiceImpl implements InitializingBean, SearchService {
int pageIndex = 1;
String rangeView = (String)commandMap.get("rangeView");
// log.debug(" :: rangeView :: [{}]", rangeView);
// log.debug(" :: core.getValue() :: [{}]", core.getValue());
if (core.getValue().equals(rangeView)) {
String pi = (String)commandMap.get("pageIndex");
if (StringUtils.isNotBlank(pi)) {

View File

@ -1,126 +1,126 @@
package kcc.let.solr.search.web;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.string.EgovStringUtil;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kcc.let.solr.search.service.SearchService;
@Controller
public class SearchContorller {
Logger log = LoggerFactory.getLogger(this.getClass());
@Resource(name = "searchService")
protected SearchService searchService;
//TODO test URL
// http://192.168.0.125:8983/solr/kcc_adr_advc/select?q=*:*&wt=json&indent=true
@SuppressWarnings("unchecked")
@RequestMapping(value = "/web/search/search.do")
public String search(@RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
log.debug("commandMap : {}", commandMap);
String searchWrd = (String) commandMap.get("q");
if (searchWrd!= null && !("").equals(searchWrd)) {
searchService.search(commandMap, model);
}
PaginationInfo paginationInfo = new PaginationInfo();
int totalRecordCount = 0;
String rangeView = (String)commandMap.get("rangeView");
if ( StringUtils.isNotBlank(rangeView) ) {
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
log.debug("resultCntMap : {}", resultCntMap);
Long total = resultCntMap.get(rangeView);
if (total != null) {
totalRecordCount = total.intValue();
}
log.debug("totalRecordCount : {}", totalRecordCount);
String pi = (String)commandMap.get("pageIndex");
if ( StringUtils.isBlank(pi) ) {
pi = "1";
}
int pageIndex = EgovStringUtil.string2integer(pi);
log.debug("pageIndex : {}", pageIndex);
paginationInfo.setCurrentPageNo(pageIndex);
paginationInfo.setRecordCountPerPage(10);
paginationInfo.setPageSize(10);
paginationInfo.setTotalRecordCount(totalRecordCount);
model.addAttribute("paginationInfo", paginationInfo);
}
model.addAttribute("totalRecordCount", totalRecordCount);
return "web/search/search";
//return "web/search/search_0529.jsp";
//return "kopost/search/search";
}
@SuppressWarnings("unchecked")
@RequestMapping(value = "/{siteId}/web/search/search.do")
public String siteSearch(@PathVariable("siteId") String siteId , @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
log.debug("commandMap : {}", commandMap);
String searchWrd = (String) commandMap.get("q");
if (searchWrd!= null && !("").equals(searchWrd)) {
searchService.search(commandMap, model);
}
PaginationInfo paginationInfo = new PaginationInfo();
int totalRecordCount = 0;
String rangeView = (String)commandMap.get("rangeView");
if ( StringUtils.isNotBlank(rangeView) ) {
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
log.debug("resultCntMap : {}", resultCntMap);
Long total = resultCntMap.get(rangeView);
if (total != null) {
totalRecordCount = total.intValue();
}
log.debug("totalRecordCount : {}", totalRecordCount);
String pi = (String)commandMap.get("pageIndex");
if ( StringUtils.isBlank(pi) ) {
pi = "1";
}
int pageIndex = EgovStringUtil.string2integer(pi);
log.debug("pageIndex : {}", pageIndex);
paginationInfo.setCurrentPageNo(pageIndex);
paginationInfo.setRecordCountPerPage(10);
paginationInfo.setPageSize(10);
paginationInfo.setTotalRecordCount(totalRecordCount);
model.addAttribute("paginationInfo", paginationInfo);
}
model.addAttribute("totalRecordCount", totalRecordCount);
model.addAttribute("siteId", siteId);
String siteFolder = "site/"+siteId ;
model.addAttribute("site_path", "/"+siteFolder);
//return "kopost/search/search";
return "web/"+siteFolder+"/search/search";
}
@RequestMapping(value = "/json/ajaxSuggest.do")
public ModelAndView ajaxEditorCopy(@RequestParam Map<String, Object> commandMap) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
Set<String> resultList = searchService.suggest(commandMap);
modelAndView.addObject("resultList", resultList);
return modelAndView;
}
}
package kcc.let.solr.search.web;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.string.EgovStringUtil;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kcc.let.solr.search.service.SearchService;
@Controller
public class SearchContorller {
Logger log = LoggerFactory.getLogger(this.getClass());
@Resource(name = "searchService")
protected SearchService searchService;
//TODO test URL
// http://192.168.0.125:8983/solr/kcc_adr_advc/select?q=*:*&wt=json&indent=true
@SuppressWarnings("unchecked")
@RequestMapping(value = "/web/search/search.do")
public String search(@RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
log.debug("commandMap : {}", commandMap);
String searchWrd = (String) commandMap.get("q");
if (searchWrd!= null && !("").equals(searchWrd)) {
searchService.search(commandMap, model);
}
PaginationInfo paginationInfo = new PaginationInfo();
int totalRecordCount = 0;
String rangeView = (String)commandMap.get("rangeView");
if ( StringUtils.isNotBlank(rangeView) ) {
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
log.debug("resultCntMap : {}", resultCntMap);
Long total = resultCntMap.get(rangeView);
if (total != null) {
totalRecordCount = total.intValue();
}
log.debug("totalRecordCount : {}", totalRecordCount);
String pi = (String)commandMap.get("pageIndex");
if ( StringUtils.isBlank(pi) ) {
pi = "1";
}
int pageIndex = EgovStringUtil.string2integer(pi);
log.debug("pageIndex : {}", pageIndex);
paginationInfo.setCurrentPageNo(pageIndex);
paginationInfo.setRecordCountPerPage(10);
paginationInfo.setPageSize(10);
paginationInfo.setTotalRecordCount(totalRecordCount);
model.addAttribute("paginationInfo", paginationInfo);
}
model.addAttribute("totalRecordCount", totalRecordCount);
return "web/search/search";
//return "web/search/search_0529.jsp";
//return "kopost/search/search";
}
@SuppressWarnings("unchecked")
@RequestMapping(value = "/{siteId}/web/search/search.do")
public String siteSearch(@PathVariable("siteId") String siteId , @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
log.debug("commandMap : {}", commandMap);
String searchWrd = (String) commandMap.get("q");
if (searchWrd!= null && !("").equals(searchWrd)) {
searchService.search(commandMap, model);
}
PaginationInfo paginationInfo = new PaginationInfo();
int totalRecordCount = 0;
String rangeView = (String)commandMap.get("rangeView");
if ( StringUtils.isNotBlank(rangeView) ) {
Map<String, Long> resultCntMap = (Map<String, Long>)model.get("resultCntMap");
log.debug("resultCntMap : {}", resultCntMap);
Long total = resultCntMap.get(rangeView);
if (total != null) {
totalRecordCount = total.intValue();
}
log.debug("totalRecordCount : {}", totalRecordCount);
String pi = (String)commandMap.get("pageIndex");
if ( StringUtils.isBlank(pi) ) {
pi = "1";
}
int pageIndex = EgovStringUtil.string2integer(pi);
log.debug("pageIndex : {}", pageIndex);
paginationInfo.setCurrentPageNo(pageIndex);
paginationInfo.setRecordCountPerPage(10);
paginationInfo.setPageSize(10);
paginationInfo.setTotalRecordCount(totalRecordCount);
model.addAttribute("paginationInfo", paginationInfo);
}
model.addAttribute("totalRecordCount", totalRecordCount);
model.addAttribute("siteId", siteId);
String siteFolder = "site/"+siteId ;
model.addAttribute("site_path", "/"+siteFolder);
//return "kopost/search/search";
return "web/"+siteFolder+"/search/search";
}
@RequestMapping(value = "/json/ajaxSuggest.do")
public ModelAndView ajaxEditorCopy(@RequestParam Map<String, Object> commandMap) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
Set<String> resultList = searchService.suggest(commandMap);
modelAndView.addObject("resultList", resultList);
return modelAndView;
}
}

View File

@ -72,8 +72,10 @@ function fnGoCrtfc(){
<div class="inner">
<div class="cont_tit">
<h2>조정신청</h2>
<input type="button" value="튜토리얼"/>
</div>
<!-- 안내문구 -->
<div class="info_wrap">
<div class="icon_box"><i></i></div>

View File

@ -547,7 +547,7 @@ $( document ).ready(function(){
<div class="btn_wrap btn_layout01">
<c:choose>
<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:otherwise>
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>

View File

@ -470,7 +470,7 @@
<c:when test="${fn:length(list) eq 0}">
<div class="btn_right">
<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>
</c:when>
<c:otherwise>

View File

@ -241,7 +241,7 @@ function fn_adjstReq_preview() {
<button type="button" class="btnType01" onclick="AdjstReq.stepDelete('${adjstReqVO.adrSeq}'); return false;">신청서 삭제</button>
<c:choose>
<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:otherwise>
<button type="button" class="btnType02 btn_save" onClick="AdjstReq.step3Save('<c:out value='${KccadrConstants.ADR_MODE_UPT}' />'); return false;">3단계 수정</button>