Merge branch 'master' of http://docs.nculture.org:30000/nculture/iams.nlib
This commit is contained in:
commit
5c8b212e3f
@ -3,6 +3,7 @@ package nlib.cmm.service;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -11,8 +12,8 @@ import nlib.restful.service.DataApiResVO;
|
|||||||
|
|
||||||
public interface CodeService
|
public interface CodeService
|
||||||
{
|
{
|
||||||
public List<HashMap<String, String>> listCodes(String iCodeId) throws Exception;
|
public List<Map<String, String>> listCodes(String iCodeId) throws Exception;
|
||||||
|
|
||||||
public List<HashMap<String, String>> listCtClsfs() throws Exception;
|
public List<Map<String, String>> listCtClsfs() throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package nlib.cmm.service.impl;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
|||||||
@Mapper("codeDAO")
|
@Mapper("codeDAO")
|
||||||
public interface CodeDAO {
|
public interface CodeDAO {
|
||||||
|
|
||||||
public List<HashMap<String, String>> listCodes(String iCodeId) throws Exception;
|
public List<Map<String, String>> listCodes(String iCodeId) throws Exception;
|
||||||
|
|
||||||
public List<HashMap<String, String>> listCtClsfs() throws Exception;
|
public List<Map<String, String>> listCtClsfs() throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package nlib.cmm.service.impl;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -21,14 +22,14 @@ public class CodeServiceImpl extends EgovAbstractServiceImpl implements CodeServ
|
|||||||
@Resource(name="codeDAO")
|
@Resource(name="codeDAO")
|
||||||
private CodeDAO codeDAO;
|
private CodeDAO codeDAO;
|
||||||
|
|
||||||
public List<HashMap<String, String>> listCodes(String iCodeId) throws Exception {
|
public List<Map<String, String>> listCodes(String iCodeId) throws Exception {
|
||||||
|
|
||||||
if(StringUtil.isEmpty(iCodeId)) return null;
|
if(StringUtil.isEmpty(iCodeId)) return null;
|
||||||
|
|
||||||
return codeDAO.listCodes(iCodeId.toUpperCase());
|
return codeDAO.listCodes(iCodeId.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<HashMap<String, String>> listCtClsfs() throws Exception {
|
public List<Map<String, String>> listCtClsfs() throws Exception {
|
||||||
return codeDAO.listCtClsfs();
|
return codeDAO.listCtClsfs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ public class CodeController extends NlibCommonController {
|
|||||||
|
|
||||||
String lCodeId = paramMap.get("lCodeId");
|
String lCodeId = paramMap.get("lCodeId");
|
||||||
|
|
||||||
List<HashMap<String, String>> resultList = codeService.listCodes(lCodeId);
|
List<Map<String, String>> resultList = codeService.listCodes(lCodeId);
|
||||||
model.addAttribute("resultList", resultList);
|
model.addAttribute("resultList", resultList);
|
||||||
model.addAttribute("lCodeId", lCodeId);
|
model.addAttribute("lCodeId", lCodeId);
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class CodeController extends NlibCommonController {
|
|||||||
|
|
||||||
String lCodeId = paramMap.get("lCodeId");
|
String lCodeId = paramMap.get("lCodeId");
|
||||||
|
|
||||||
List<HashMap<String, String>> resultList = codeService.listCodes(lCodeId);
|
List<Map<String, String>> resultList = codeService.listCodes(lCodeId);
|
||||||
model.addAttribute("resultList", resultList);
|
model.addAttribute("resultList", resultList);
|
||||||
model.addAttribute("lCodeId", lCodeId);
|
model.addAttribute("lCodeId", lCodeId);
|
||||||
|
|
||||||
|
|||||||
@ -9,28 +9,19 @@ import javax.annotation.Resource;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
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.ModelAttribute;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import cmm.Constant;
|
import cmm.Constant;
|
||||||
import cmm.util.CmmUtil;
|
import cmm.util.CmmUtil;
|
||||||
import cmm.util.DataMap;
|
|
||||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
||||||
import kccf.res.service.ResourcesService;
|
import kccf.res.service.ResourcesService;
|
||||||
import kccf.sch.service.SearchCollectionResult;
|
|
||||||
import kccf.sch.service.SearchService;
|
import kccf.sch.service.SearchService;
|
||||||
import kccf.sch.service.vo.SearchCollectionVO;
|
|
||||||
import kccf.sch.service.vo.Sf1VO;
|
|
||||||
import nlib.cmm.NlibCommonController;
|
import nlib.cmm.NlibCommonController;
|
||||||
import nlib.cmm.service.CodeService;
|
import nlib.cmm.service.CodeService;
|
||||||
import nlib.cmm.service.NlibProperty;
|
import nlib.cmm.service.NlibProperty;
|
||||||
@ -38,14 +29,10 @@ import nlib.cmm.service.PagingVO;
|
|||||||
import nlib.col.service.CartService;
|
import nlib.col.service.CartService;
|
||||||
import nlib.col.service.CollectionService;
|
import nlib.col.service.CollectionService;
|
||||||
import nlib.col.service.CollectionVO;
|
import nlib.col.service.CollectionVO;
|
||||||
import nlib.col.service.DeptVO;
|
|
||||||
import nlib.col.service.InterestService;
|
import nlib.col.service.InterestService;
|
||||||
import nlib.col.service.RisService;
|
import nlib.col.service.RisService;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
|
||||||
import nlib.restful.service.DataApiResVO;
|
|
||||||
import nlib.sch.service.NlibSearchService;
|
import nlib.sch.service.NlibSearchService;
|
||||||
import nlib.sch.service.NlibSearchVO;
|
import nlib.sch.service.NlibSearchVO;
|
||||||
import nlib.user.service.NlibLoginVO;
|
|
||||||
import nlib.util.StringUtil;
|
import nlib.util.StringUtil;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@ -92,18 +79,13 @@ public class NlibSearchController extends NlibCommonController {
|
|||||||
public String searchList(
|
public String searchList(
|
||||||
HttpServletRequest req
|
HttpServletRequest req
|
||||||
, Authentication authentication
|
, Authentication authentication
|
||||||
, @RequestParam Map<String, String> paramMap
|
|
||||||
, ModelMap model
|
, ModelMap model
|
||||||
, @ModelAttribute("searchVO") NlibSearchVO searchVO
|
, @ModelAttribute("searchVO") NlibSearchVO searchVO
|
||||||
, HttpServletRequest request
|
, HttpServletRequest request
|
||||||
, HttpServletResponse res) throws Exception {
|
, HttpServletResponse res) throws Exception {
|
||||||
List<CollectionVO> operList = new ArrayList();
|
List<CollectionVO> operList = new ArrayList();
|
||||||
|
|
||||||
// 페이징 사이즈 코드 목록 조회 (DB방식으로 변경 2021.08.06 KNKIM)
|
// 페이징 사이즈 코드 목록 조회 (DB방식으로 변경 2021.08.06 KNKIM)
|
||||||
List<HashMap<String,String>> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION");
|
List<Map<String,String>> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION");
|
||||||
|
|
||||||
//주제분야 목록 조회
|
|
||||||
List<HashMap<String,String>> clsf = codeService.listCtClsfs();
|
|
||||||
|
|
||||||
if(searchVO.getPageIndex() < 1) searchVO.setPageIndex(1);
|
if(searchVO.getPageIndex() < 1) searchVO.setPageIndex(1);
|
||||||
if(searchVO.getPageSize() < 1) searchVO.setPageSize(DEFUALT_PAGE_SIZE);
|
if(searchVO.getPageSize() < 1) searchVO.setPageSize(DEFUALT_PAGE_SIZE);
|
||||||
@ -148,24 +130,67 @@ public class NlibSearchController extends NlibCommonController {
|
|||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
//주제분야 목록 조회
|
||||||
|
List<Map<String,String>> clsf = codeService.listCtClsfs();
|
||||||
|
//자료유형
|
||||||
|
List<Map<String, String>> firstClassList = codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD);
|
||||||
|
List<Map<String, String>> secondClassList = codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD);
|
||||||
|
|
||||||
|
//검색엔진 주제분야 카운트
|
||||||
|
List<HashMap<String, String>> subject= searchVO.getSubjectCountList();
|
||||||
|
List<HashMap<String, String>> type= searchVO.getTypeCountList();
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
// 검색엔진 건수 자료 조합
|
// 검색엔진 건수 자료 조합
|
||||||
|
for(int i=0; i<clsf.size(); i++) {
|
||||||
List<String> councilList = new ArrayList<String>();
|
count = 0;
|
||||||
councilList.add("마포문화원");
|
for(int j=0; j<subject.size(); j++)
|
||||||
councilList.add("서울문화원");
|
{
|
||||||
councilList.add("종로문화원");
|
String.valueOf(clsf.get(i).get("clsfId"));
|
||||||
/*List<DataMap> councilList = resourcesService.selectCouncilList(); */
|
//if(String.valueOf(clsf.get(i).get("CLSF_ID")).equals(String.valueOf(subject.get(j).get("category_nm"))))
|
||||||
model.addAttribute("councilList", councilList);
|
if(StringUtil.getString(clsf.get(i).get("clsfId"),"").equals(subject.get(j).get("category_nm")))
|
||||||
|
{
|
||||||
|
count += Integer.parseInt(subject.get(j).get("category_cnt"));
|
||||||
|
}
|
||||||
|
if(String.valueOf(clsf.get(i).get("clsfId")).equals(String.valueOf(subject.get(j).get("category_nm_up"))))
|
||||||
|
{
|
||||||
|
count += Integer.parseInt(subject.get(j).get("category_cnt"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clsf.get(i).put("CNT", Integer.toString(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<firstClassList.size(); i++) {
|
||||||
|
count = 0;
|
||||||
|
for(int j=0; j<type.size(); j++)
|
||||||
|
{
|
||||||
|
if(String.valueOf(firstClassList.get(i).get("column1")).equals(String.valueOf(type.get(j).get("class_nm_up"))))
|
||||||
|
{
|
||||||
|
count += Integer.parseInt(type.get(j).get("class_cnt"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
firstClassList.get(i).put("cnt", Integer.toString(count));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=0; i<secondClassList.size(); i++) {
|
||||||
|
count = 0;
|
||||||
|
for(int j=0; j<type.size(); j++)
|
||||||
|
{
|
||||||
|
if(String.valueOf(secondClassList.get(i).get("column1")).equals(String.valueOf(type.get(j).get("class_nm"))))
|
||||||
|
{
|
||||||
|
count += Integer.parseInt(type.get(j).get("class_cnt"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
secondClassList.get(i).put("cnt", Integer.toString(count));
|
||||||
|
}
|
||||||
// 반환 정보
|
// 반환 정보
|
||||||
model.addAttribute("pageSizeCodes", pageSizeCodes);
|
model.addAttribute("pageSizeCodes", pageSizeCodes);
|
||||||
//주제분야
|
//주제분야
|
||||||
model.addAttribute("firstCategoryList", clsf);
|
model.addAttribute("firstCategoryList", clsf);
|
||||||
model.addAttribute("secondCategoryList", clsf);
|
model.addAttribute("secondCategoryList", clsf);
|
||||||
//자료유형
|
//자료유형
|
||||||
model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD));
|
model.addAttribute("firstClassList", firstClassList);
|
||||||
model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD));
|
model.addAttribute("secondClassList", secondClassList);
|
||||||
|
|
||||||
|
|
||||||
searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """));
|
searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """));
|
||||||
@ -269,7 +294,7 @@ public class NlibSearchController extends NlibCommonController {
|
|||||||
public String getDetailedSearchFormPopup(HttpServletRequest request, ModelMap model) throws Exception {
|
public String getDetailedSearchFormPopup(HttpServletRequest request, ModelMap model) throws Exception {
|
||||||
|
|
||||||
//주제분야 목록 조회
|
//주제분야 목록 조회
|
||||||
List<HashMap<String,String>> clsf = codeService.listCtClsfs();
|
List<Map<String,String>> clsf = codeService.listCtClsfs();
|
||||||
model.addAttribute("firstCategoryList", clsf);
|
model.addAttribute("firstCategoryList", clsf);
|
||||||
model.addAttribute("secondCategoryList", clsf);
|
model.addAttribute("secondCategoryList", clsf);
|
||||||
|
|
||||||
|
|||||||
@ -200,18 +200,18 @@ function fn_search_article(pageIndex) {
|
|||||||
<li>
|
<li>
|
||||||
<c:forEach var="firstClassList" items="${firstClassList}" varStatus="fcStatus">
|
<c:forEach var="firstClassList" items="${firstClassList}" varStatus="fcStatus">
|
||||||
<li>
|
<li>
|
||||||
<div class="depth-1 <c:if test="${fn:contains(searchVO.filter_class, firstClassList.column1) }"> on</c:if>">
|
<div class="depth-1 <c:if test="${fn:contains(searchVO.filter_class, firstClassList.COLUMN1) }"> on</c:if>">
|
||||||
<div class="check">
|
<div class="check">
|
||||||
<input type="checkbox" value="${firstClassList.column1}" name="first_class" id="data-type-chk${fcStatus.index+1}" <c:if test="${fn:contains(searchVO.first_class, firstClassList.column1) }">checked="checked"</c:if> />
|
<input type="checkbox" value="${firstClassList.COLUMN1}" name="first_class" id="data-type-chk${fcStatus.index+1}" <c:if test="${fn:contains(searchVO.first_class, firstClassList.COLUMN1) }">checked="checked"</c:if> />
|
||||||
<label for="data-type-chk${fcStatus.index+1}">${firstClassList.sCodeNm}(<span>0</span>) </label>
|
<label for="data-type-chk${fcStatus.index+1}">${firstClassList.S_CODE_NM}(<span>${firstClassList.CNT }</span>) </label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="depth-2">
|
<ul class="depth-2">
|
||||||
<c:forEach var="secondClassList" items="${secondClassList}" varStatus="seStatus">
|
<c:forEach var="secondClassList" items="${secondClassList}" varStatus="seStatus">
|
||||||
<c:if test="${firstClassList.column1 eq secondClassList.column2 }">
|
<c:if test="${firstClassList.COLUMN1 eq secondClassList.COLUMN2 }">
|
||||||
<li>
|
<li>
|
||||||
<div class="check"><input type="checkbox" value="${secondClassList.sCodeId}" name="second_class" id="data-type-chk${fcStatus.index+1}-${seStatus.index+1}" <c:if test="${fn:contains(searchVO.second_class, secondClassList.sCodeId) }">checked="checked"</c:if> />
|
<div class="check"><input type="checkbox" value="${secondClassList.S_CODE_ID}" name="second_class" id="data-type-chk${fcStatus.index+1}-${seStatus.index+1}" <c:if test="${fn:contains(searchVO.second_class, secondClassList.S_CODE_ID) }">checked="checked"</c:if> />
|
||||||
<label for="data-type-chk${fcStatus.index+1}-${seStatus.index+1}">${secondClassList.sCodeNm}(<span>0</span>)</label>
|
<label for="data-type-chk${fcStatus.index+1}-${seStatus.index+1}">${secondClassList.S_CODE_NM}(<span>${secondClassList.CNT }</span>)</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</c:if>
|
</c:if>
|
||||||
@ -233,15 +233,15 @@ function fn_search_article(pageIndex) {
|
|||||||
<ul id="ul_category2List">
|
<ul id="ul_category2List">
|
||||||
<c:set var="count" value="0" />
|
<c:set var="count" value="0" />
|
||||||
<c:forEach var="firstCategoryInfo" items="${firstCategoryList}" varStatus="status">
|
<c:forEach var="firstCategoryInfo" items="${firstCategoryList}" varStatus="status">
|
||||||
<c:if test="${firstCategoryInfo.upClsfId eq '2' }">
|
<c:if test="${firstCategoryInfo.UP_CLSF_ID eq '2' }">
|
||||||
<li>
|
<li>
|
||||||
<div class="depth-1 <c:if test="${fn:contains(searchVO.filter_category, firstCategoryInfo.clsfId) }"> on</c:if>">
|
<div class="depth-1 <c:if test="${fn:contains(searchVO.filter_category, firstCategoryInfo.CLSF_ID) }"> on</c:if>">
|
||||||
<div class="check"><input type="checkbox" value="${firstCategoryInfo.clsfId}" id="theme-chk${count+1}" name="first_category" <c:if test="${fn:contains(searchVO.first_category, firstCategoryInfo.clsfId) }">checked="checked"</c:if>/><label for="theme-chk${count+1}">${firstCategoryInfo.clsfNm}(<span>0</span>)</label></div>
|
<div class="check"><input type="checkbox" value="${firstCategoryInfo.CLSF_ID}" id="theme-chk${count+1}" name="first_category" <c:if test="${fn:contains(searchVO.first_category, firstCategoryInfo.CLSF_ID) }">checked="checked"</c:if>/><label for="theme-chk${count+1}">${firstCategoryInfo.CLSF_NM}(<span>${firstCategoryInfo.CNT}</span>)</label></div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="depth-2">
|
<ul class="depth-2">
|
||||||
<c:forEach var="secondCategoryInfo" items="${secondCategoryList}" varStatus="seStatus">
|
<c:forEach var="secondCategoryInfo" items="${secondCategoryList}" varStatus="seStatus">
|
||||||
<c:if test="${firstCategoryInfo.clsfId eq secondCategoryInfo.upClsfId }">
|
<c:if test="${firstCategoryInfo.CLSF_ID eq secondCategoryInfo.UP_CLSF_ID }">
|
||||||
<li><div class="check"><input type="checkbox" value="${secondCategoryInfo.clsfId}" id="theme-chk${count+1}-${seStatus.index+1}" name="second_category" <c:if test="${fn:contains(searchVO.second_category, secondCategoryInfo.clsfId) }">checked="checked"</c:if>/><label for="theme-chk${count+1}-${seStatus.index+1}">${secondCategoryInfo.clsfNm}(<span>0</span>)</label></div></li>
|
<li><div class="check"><input type="checkbox" value="${secondCategoryInfo.CLSF_ID}" id="theme-chk${count+1}-${seStatus.index+1}" name="second_category" <c:if test="${fn:contains(searchVO.second_category, secondCategoryInfo.CLSF_ID) }">checked="checked"</c:if>/><label for="theme-chk${count+1}-${seStatus.index+1}">${secondCategoryInfo.CLSF_NM}(<span>${secondCategoryInfo.CNT}</span>)</label></div></li>
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user