내정보조회 쿼리 수정, 소장자료 검색결과없을시

This commit is contained in:
JSYOO 2021-11-17 12:18:19 +09:00
parent 38e8f018fc
commit 982db041ef
9 changed files with 217 additions and 121 deletions

View File

@ -194,98 +194,103 @@ public class NlibSearchServiceImpl implements NlibSearchService{
{ {
//주제분야 , 자료유형 ,생산기관 카운트 //주제분야 , 자료유형 ,생산기관 카운트
tmpList = (JsonArray) tmp.get("CategoryGroup"); tmpList = (JsonArray) tmp.get("CategoryGroup");
if(tmpList != null)
for( k=0; k < tmpList.size(); k++){
filterObject = (JsonObject) tmpList.get(k);
if(filterObject.get("SUBJECT_CATE") != null)
{
subjectList = (JsonArray) filterObject.get("SUBJECT_CATE");
}
if(filterObject.get("DIV_CATE") != null)
{
typeList = (JsonArray) filterObject.get("DIV_CATE");
}
if(filterObject.get("ORG_NM") != null)
{
orgList = (JsonArray) filterObject.get("ORG_NM");
}
}
if(subjectList.size()>0)
{ {
filterObject =(JsonObject) subjectList.get(0); for( k=0; k < tmpList.size(); k++){
filterObject = (JsonObject) filterObject.get("Categories"); filterObject = (JsonObject) tmpList.get(k);
subjectList = (JsonArray) filterObject.get("Category");
};
if(typeList.size()>0)
{
filterObject =(JsonObject) typeList.get(0);
filterObject = (JsonObject) filterObject.get("Categories");
typeList = (JsonArray) filterObject.get("Category");
};
if(orgList.size()>0)
{
filterObject =(JsonObject) orgList.get(0);
filterObject = (JsonObject) filterObject.get("Categories");
orgList = (JsonArray) filterObject.get("Category");
};
for(k = 0; k < subjectList.size(); k++){
HashMap<String,String> temp = new HashMap<String,String>();
filterObject = (JsonObject)subjectList.get(k);
nameTemp = filterObject.get("Name").getAsString();
//상위코드값
code_up = nameTemp.substring(nameTemp.indexOf("@")+1,nameTemp.indexOf("^"));
temp.put("category_nm_up",code_up);
//코드값 if(filterObject.get("SUBJECT_CATE") != null)
code = nameTemp.substring(nameTemp.lastIndexOf("@")+1); {
temp.put("category_nm",code); subjectList = (JsonArray) filterObject.get("SUBJECT_CATE");
temp.put("category_cnt",filterObject.get("Count").getAsString()); }
subjectMap.add(temp); if(filterObject.get("DIV_CATE") != null)
} {
for(k = 0; k < typeList.size(); k++){ typeList = (JsonArray) filterObject.get("DIV_CATE");
HashMap<String,String> temp = new HashMap<String,String>(); }
filterObject = (JsonObject)typeList.get(k); if(filterObject.get("ORG_NM") != null)
nameTemp = filterObject.get("Name").getAsString(); {
//상위코드값 orgList = (JsonArray) filterObject.get("ORG_NM");
code_up = nameTemp.substring(nameTemp.indexOf("@")+1,nameTemp.indexOf("^")); }
temp.put("class_nm_up",code_up); }
if(subjectList.size()>0)
{
filterObject =(JsonObject) subjectList.get(0);
filterObject = (JsonObject) filterObject.get("Categories");
subjectList = (JsonArray) filterObject.get("Category");
};
if(typeList.size()>0)
{
filterObject =(JsonObject) typeList.get(0);
filterObject = (JsonObject) filterObject.get("Categories");
typeList = (JsonArray) filterObject.get("Category");
};
if(orgList.size()>0)
{
filterObject =(JsonObject) orgList.get(0);
filterObject = (JsonObject) filterObject.get("Categories");
orgList = (JsonArray) filterObject.get("Category");
};
for(k = 0; k < subjectList.size(); k++){
HashMap<String,String> temp = new HashMap<String,String>();
filterObject = (JsonObject)subjectList.get(k);
nameTemp = filterObject.get("Name").getAsString();
//상위코드값
code_up = nameTemp.substring(nameTemp.indexOf("@")+1,nameTemp.indexOf("^"));
temp.put("category_nm_up",code_up);
//코드값 //코드값
code = nameTemp.substring(nameTemp.lastIndexOf("@")+1); code = nameTemp.substring(nameTemp.lastIndexOf("@")+1);
temp.put("class_nm",code); temp.put("category_nm",code);
temp.put("class_cnt",filterObject.get("Count").getAsString()); temp.put("category_cnt",filterObject.get("Count").getAsString());
typeMap.add(temp); subjectMap.add(temp);
} }
for(k = 0; k < orgList.size(); k++){ for(k = 0; k < typeList.size(); k++){
HashMap<String,String> temp = new HashMap<String,String>(); HashMap<String,String> temp = new HashMap<String,String>();
filterObject = (JsonObject)orgList.get(k); filterObject = (JsonObject)typeList.get(k);
nameTemp = filterObject.get("Name").getAsString(); nameTemp = filterObject.get("Name").getAsString();
if(!"null".equals(nameTemp)) { //상위코드값
temp.put("org_nm",nameTemp); code_up = nameTemp.substring(nameTemp.indexOf("@")+1,nameTemp.indexOf("^"));
temp.put("org_cnt",filterObject.get("Count").getAsString()); temp.put("class_nm_up",code_up);
orgMap.add(temp);
} //코드값
code = nameTemp.substring(nameTemp.lastIndexOf("@")+1);
temp.put("class_nm",code);
temp.put("class_cnt",filterObject.get("Count").getAsString());
typeMap.add(temp);
}
for(k = 0; k < orgList.size(); k++){
HashMap<String,String> temp = new HashMap<String,String>();
filterObject = (JsonObject)orgList.get(k);
nameTemp = filterObject.get("Name").getAsString();
if(!"null".equals(nameTemp)) {
temp.put("org_nm",nameTemp);
temp.put("org_cnt",filterObject.get("Count").getAsString());
orgMap.add(temp);
}
}
} }
tmp = (JsonObject) tmp.get("DocumentSet"); tmp = (JsonObject) tmp.get("DocumentSet");
searchVO.setTotalCount(tmp.get("TotalCount").getAsString()); searchVO.setTotalCount(tmp.get("TotalCount").getAsString());
colArray = (JsonArray) tmp.get("Document"); colArray = (JsonArray) tmp.get("Document");
//vo list로 json list 파싱 if(colArray != null)
for(j=0;j<colArray.size();j++){ {
tmp = (JsonObject)colArray.get(j); //vo list로 json list 파싱
tmp = (JsonObject) tmp.get("Field"); for(j=0;j<colArray.size();j++){
tmp = (JsonObject)colArray.get(j);
tmp = (JsonObject) tmp.get("Field");
CollectionVO vo = new CollectionVO(); CollectionVO vo = new CollectionVO();
vo.setMasterId(tmp.get("MASTER_ID").getAsString()); vo.setMasterId(tmp.get("MASTER_ID").getAsString());
list.add(vo); list.add(vo);
/*vo = gson.fromJson(tmp, NlibSearchCollectionVO.class);*/ /*vo = gson.fromJson(tmp, NlibSearchCollectionVO.class);*/
/* NlibSearchCollectionVO vo = new NlibSearchCollectionVO(); /* NlibSearchCollectionVO vo = new NlibSearchCollectionVO();
vo.setMasterId(tmp.get); = gson.fromJson(tmp, NlibSearchCollectionVO.class);*/ vo.setMasterId(tmp.get); = gson.fromJson(tmp, NlibSearchCollectionVO.class);*/
}
} }
} }
}; };

View File

@ -359,7 +359,7 @@ public class MemberController extends NlibCommonController{
String jsessionId = session.getId(); String jsessionId = session.getId();
OAuthUniversalUser oauthUser = SessionConfig.popNewMemberInfo(jsessionId); OAuthUniversalUser oauthUser = SessionConfig.popNewMemberInfo(jsessionId);
if(oauthUser.getNlibVO()!=null) if(oauthUser != null && oauthUser.getNlibVO()!=null)
{ {
//핸드폰인증시 sns제공 번호와 회원가입폼 번호 비교 //핸드폰인증시 sns제공 번호와 회원가입폼 번호 비교
if(!(vo.getMobileNo().equals(oauthUser.getSnsMobileNo()))) if(!(vo.getMobileNo().equals(oauthUser.getSnsMobileNo())))
@ -808,6 +808,7 @@ public class MemberController extends NlibCommonController{
public @ResponseBody String changePassword(Authentication authentication,HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{ public @ResponseBody String changePassword(Authentication authentication,HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{
//사용자 정보를 가져온다. //사용자 정보를 가져온다.
NlibLoginVO loginVO = getNlibLoginVO(authentication); NlibLoginVO loginVO = getNlibLoginVO(authentication);
loginVO.setJoinCouncilCd(getCurCouncilCd(request)); loginVO.setJoinCouncilCd(getCurCouncilCd(request));
loginVO = loginService.selectLoginUserInfo(loginVO); loginVO = loginService.selectLoginUserInfo(loginVO);

View File

@ -114,6 +114,7 @@ public class UserInfoController extends NlibCommonController {
* 정보 조회 * 정보 조회
* @exception Exception * @exception Exception
*/ */
@Secured("ROLE_USER")
@RequestMapping(value="/userInfo/getMyInfo.do") @RequestMapping(value="/userInfo/getMyInfo.do")
public String getMyInfo(HttpServletResponse response,HttpServletRequest request) throws Exception{ public String getMyInfo(HttpServletResponse response,HttpServletRequest request) throws Exception{
return "nlib/userInfo/getMyInfo"; return "nlib/userInfo/getMyInfo";
@ -123,14 +124,28 @@ public class UserInfoController extends NlibCommonController {
* 정보 수정 페이지 * 정보 수정 페이지
* @exception Exception * @exception Exception
*/ */
@Secured("ROLE_USER")
@RequestMapping(value="/userInfo/putMyInfo.do") @RequestMapping(value="/userInfo/putMyInfo.do")
public String putMyInfo(NlibLoginVO vo,HttpServletResponse response,HttpServletRequest request,Authentication authentication,ModelMap model) throws Exception{ public String putMyInfo(NlibLoginVO vo,HttpServletResponse response,HttpServletRequest request,Authentication authentication,ModelMap model) throws Exception{
//사용자 정보를 가져온다. //사용자 정보를 가져온다.
NlibLoginVO loginVO = getNlibLoginVO(authentication); NlibLoginVO loginVO = getNlibLoginVO(authentication);
if(loginVO == null)
{
model.addAttribute("msg","비정상적인 접근입니다. 관리자에게 문의하여 주시기 바랍니다.");
model.addAttribute("url","/userInfo/pwCertMyInfo.do");
return "nlib/cmm/alert";
}
loginVO.setJoinCouncilCd(getCurCouncilCd(request)); loginVO.setJoinCouncilCd(getCurCouncilCd(request));
loginVO = loginService.selectLoginUserInfo(loginVO); loginVO = loginService.selectLoginUserInfo(loginVO);
if(loginVO == null)
{
model.addAttribute("msg","비정상적인 접근입니다. 관리자에게 문의하여 주시기 바랍니다.");
model.addAttribute("url","/userInfo/pwCertMyInfo.do");
return "nlib/cmm/alert";
}
List<OAuthUniversalUser> snsList = new ArrayList<OAuthUniversalUser>(); List<OAuthUniversalUser> snsList = new ArrayList<OAuthUniversalUser>();
@ -158,6 +173,7 @@ public class UserInfoController extends NlibCommonController {
* @return * @return
* @exception Exception * @exception Exception
*/ */
@Secured("ROLE_USER")
@RequestMapping(value="/userInfo/updateMyInfo.do" , method=RequestMethod.POST) @RequestMapping(value="/userInfo/updateMyInfo.do" , method=RequestMethod.POST)
public String updateMyInfo(NlibLoginVO vo,Authentication authentication,HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{ public String updateMyInfo(NlibLoginVO vo,Authentication authentication,HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{
@ -209,6 +225,7 @@ public class UserInfoController extends NlibCommonController {
* 정보 수정 password 인증 * 정보 수정 password 인증
* @exception Exception * @exception Exception
*/ */
@Secured("ROLE_USER")
@RequestMapping(value="/userInfo/pwCertMyInfo.do") @RequestMapping(value="/userInfo/pwCertMyInfo.do")
public String pwCertMyInfo(HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{ public String pwCertMyInfo(HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{
NlibLoginVO nlibLoginVO = getNlibLoginVO(request); NlibLoginVO nlibLoginVO = getNlibLoginVO(request);

View File

@ -37,9 +37,9 @@
FROM UAC_CLTR_DB.MB_INFO A /* 사용자정보 */ FROM UAC_CLTR_DB.MB_INFO A /* 사용자정보 */
JOIN UAC_CLTR_DB.MB_SNS B /* 사용자 SNS 정보 */ JOIN UAC_CLTR_DB.MB_SNS B /* 사용자 SNS 정보 */
ON A.MB_INFO_ID = B.MB_INFO_ID ON A.MB_INFO_ID = B.MB_INFO_ID
WHERE B.SNS_ID = #{snsId} WHERE A.MB_INFO_ID = #{mbInfoId}
AND UPPER(SNS_TYPE) = UPPER(#{snsType})
AND B.UNLINK_DD IS NULL /* 연동해제건 제외 */ AND B.UNLINK_DD IS NULL /* 연동해제건 제외 */
ORDER BY B.REG_DD
LIMIT 1 LIMIT 1
]]> ]]>
</select> </select>

View File

@ -17,10 +17,10 @@ $(document).ready(function() {
}); });
function goSearch(){ function goSearch(){
if($("#top_query").val() != "") /* if($("#top_query").val() != "")
{ {
$('#searchHeaderForm input[name=filter_mylist]').val("search_query,"); $('#searchHeaderForm input[name=filter_mylist]').val("search_query,");
} } */
document.searchHeaderForm.submit(); document.searchHeaderForm.submit();
} }

View File

@ -154,7 +154,6 @@
// 출력 // 출력
$.each(jsonObj.data,function(key,obj) { $.each(jsonObj.data,function(key,obj) {
var t_data = ""; var t_data = "";
var count = 0;
t_data += "<div class=\"img\"><a><img src=\"" + obj.rprsThumbUrlWithDefault + "\"</a>"; t_data += "<div class=\"img\"><a><img src=\"" + obj.rprsThumbUrlWithDefault + "\"</a>";
t_data += "<span id=\"favorites_" + obj.masterId + "\" class=\"favorites\" onclick=\"deleteInterests('single','" + obj.masterId + "');\"><img src=\"/images/icon/icon-cart-Favorites-on.png\" class=\"off\" alt=\"즐겨찾기 아이콘\"><img src=\"/images/icon/icon-cart-Favorites.png\" class=\"on\" alt=\"즐겨찾기 아이콘\"></span></div>"; t_data += "<span id=\"favorites_" + obj.masterId + "\" class=\"favorites\" onclick=\"deleteInterests('single','" + obj.masterId + "');\"><img src=\"/images/icon/icon-cart-Favorites-on.png\" class=\"off\" alt=\"즐겨찾기 아이콘\"><img src=\"/images/icon/icon-cart-Favorites.png\" class=\"on\" alt=\"즐겨찾기 아이콘\"></span></div>";
t_data += "<div class=\"type\">" t_data += "<div class=\"type\">"
@ -184,32 +183,55 @@
t_data += "</div>" t_data += "</div>"
t_data += "<div class=\"subject\">" t_data += "<div class=\"subject\">"
if(!fn_isEmpty(obj.typeCodeNm))
{ t_data += "<span>자료유형 : "
count += 1; if(!fn_isEmpty(obj.typeCodeNm)){
t_data += "<span>자료유형 : " + obj.typeCodeNm + " &#62; " + obj.dtlsTypeDivNm + "</span>" t_data += obj.typeCodeNm
} }
if(!fn_isEmpty(obj.subjectNmUp)) if(!fn_isEmpty(obj.typeCodeNm) && !fn_isEmpty(obj.dtlsTypeDivNm)){
{ t_data += " &#62; "
if(count > 0)
t_data += " | ";
count += 1;
t_data += "<span>주제분야 : " + obj.subjectNmUp + " &#62; " + obj.subjectNm + "</span>"
} }
if(!fn_isEmpty(obj.orgNm)) if(fn_isEmpty(obj.typeCodeNm) && fn_isEmpty(obj.dtlsTypeDivNm)){
{ t_data += "-"
if(count > 0)
t_data += " | ";
count += 1;
t_data += "<span>생산기관 : " + obj.orgNm + "</span>"
} }
if(!fn_isEmpty(obj.creatYyyy)) if(!fn_isEmpty(obj.dtlsTypeDivNm)){
{ t_data += obj.dtlsTypeDivNm
if(count > 0)
t_data += " | ";
count += 1;
t_data += "<span>생산년도 : " + obj.creatYyyy + "</span>"
} }
t_data += "</span>"
t_data += "&nbsp;&nbsp;|&nbsp;&nbsp;"
t_data += "<span>주제분야 : "
if(!fn_isEmpty(obj.subjectNmUp)){
t_data += obj.subjectNmUp
}
if(!fn_isEmpty(obj.subjectNmUp) && !fn_isEmpty(obj.subjectNm)){
t_data += " &#62; "
}
if(fn_isEmpty(obj.subjectNmUp) && fn_isEmpty(obj.subjectNm)){
t_data += "-"
}
if(!fn_isEmpty(obj.subjectNm)){
t_data += obj.subjectNm
}
t_data += "</span>"
t_data += "&nbsp;&nbsp;|&nbsp;&nbsp;"
t_data += "<span>생산기관 : "
if(!fn_isEmpty(obj.orgNm)){
t_data += obj.orgNm
}else{
t_data += "-"
}
t_data += "</span>"
t_data += "&nbsp;&nbsp;|&nbsp;&nbsp;"
t_data += "<span>생산년도 : "
if(!fn_isEmpty(obj.creatYyyy)){
t_data += obj.creatYyyy
}else{
t_data += "-"
}
t_data += "</span>"
t_data += "</div>" t_data += "</div>"
var t_btn = ""; var t_btn = "";

View File

@ -131,6 +131,52 @@ function fnSetInitialValue()
$("#m-year-1").prop('checked',true); $("#m-year-1").prop('checked',true);
} }
} }
function goSearchNculture() {
var form = document.createElement("form");
form.style.display = "none";
$(form).attr("action", "https://www.nculture.org/sch/totalSearchList.do");
$(form).attr("method", "post");
$(form).attr("target", "_blank");
var collection = document.createElement("input");
$(collection).attr("name", "collection");
$(collection).attr("value","reference_Coll");
form.appendChild(collection);
if(!fn_isEmpty($("#query").val()))
{
var query = document.createElement("input");
$(query).attr("name", "query");
$(query).attr("value", $("#query").val());
form.appendChild(query);
}
if(!fn_isEmpty($("#reQuery").val()))
{
var reQuery = document.createElement("input");
$(reQuery).attr("name", "reQuery");
$(reQuery).attr("value", $("#reQuery").val());
form.appendChild(reQuery);
}
if(!fn_isEmpty($("#filter_mylist").val()))
{
var filter_mylist = document.createElement("input");
$(filter_mylist).attr("name", "filter_mylist");
$(filter_mylist).attr("value", "category_A01,");
form.appendChild(filter_mylist);
}
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
return;
}
//탭 이동 //탭 이동
function fnTabMoveSch(collection){ function fnTabMoveSch(collection){
$("#collection").val(collection); $("#collection").val(collection);
@ -443,9 +489,14 @@ function fn_search_article(pageIndex) {
</div> </div>
</c:forEach> <!-- 리스트 출력 끝부분 --> </c:forEach> <!-- 리스트 출력 끝부분 -->
<c:if test = "${fn:length(searchVO.resultList) < 1}"> <c:if test = "${fn:length(searchVO.resultList) < 1}">
<li class="no-result"> <div class="list resu">
<span>검색결과가 없습니다.</span> <div class="no-result">
</li> <p class="icon"><img src="/images/icon/icon-data-noresult.png" alt="느낌표 아이콘"></p>
<p class="text1">검색된 결과가 없습니다</p>
<p class="text2"><span>지역N문화</span>에서 더 많은 자료를 확인하세요!</p>
<p class="btnbox"><button type="button" class="btn btn-color" onclick="goSearchNculture();">지역N문화에서 검색</button></p>
</div>
</div>
</c:if> </c:if>
</div> </div>
</div> </div>

View File

@ -223,11 +223,11 @@ function d_search(){
}else{ }else{
$("#d_filter_creatYyyy").val("all"); $("#d_filter_creatYyyy").val("all");
} }
if($("#d_query").val() != "") /* if($("#d_query").val() != "")
{ {
filter_myList+= "search_query,"; filter_myList+= "search_query,";
} }
if($("#d_bookIndex").val() != "") */ if($("#d_bookIndex").val() != "")
{ {
filter_myList+= "search_bookIndex,"; filter_myList+= "search_bookIndex,";
} }

View File

@ -310,9 +310,9 @@ function fnLabel_reference(){
}else if(mylist_arr[j].indexOf("agency") >= 0){ }else if(mylist_arr[j].indexOf("agency") >= 0){
var second_cate_nm = mylist_arr[j].substring(mylist_arr[j].indexOf("_")+1); var second_cate_nm = mylist_arr[j].substring(mylist_arr[j].indexOf("_")+1);
$("#reference_fillter_append").append("<li>생산기관 &#62; "+ second_cate_nm + "<button type=\"button\" class=\"btn-del-filter\" id=\"" + second_cate_nm + "\" name=\"first_agency_del\" >삭제</button></li>").text(); $("#reference_fillter_append").append("<li>생산기관 &#62; "+ second_cate_nm + "<button type=\"button\" class=\"btn-del-filter\" id=\"" + second_cate_nm + "\" name=\"first_agency_del\" >삭제</button></li>").text();
}else if(mylist_arr[j].indexOf("search_query") >= 0){ }/*else if(mylist_arr[j].indexOf("search_query") >= 0){
$("#reference_fillter_append").append("<li>검색어 &#62; "+ $("#realQuery").val() + "<button type=\"button\" class=\"btn-del-filter detailFilter\" id=\"\" name=\"search_query\">삭제</button></li>").text(); $("#reference_fillter_append").append("<li>검색어 &#62; "+ $("#realQuery").val() + "<button type=\"button\" class=\"btn-del-filter detailFilter\" id=\"\" name=\"search_query\">삭제</button></li>").text();
}else if(mylist_arr[j].indexOf("search_bookIndex") >= 0){ }*/else if(mylist_arr[j].indexOf("search_bookIndex") >= 0){
$("#reference_fillter_append").append("<li>목차 &#62; "+ $("#bookIndex").val() + "<button type=\"button\" class=\"btn-del-filter detailFilter\" id=\"\" name=\"search_bookIndex\">삭제</button></li>").text(); $("#reference_fillter_append").append("<li>목차 &#62; "+ $("#bookIndex").val() + "<button type=\"button\" class=\"btn-del-filter detailFilter\" id=\"\" name=\"search_bookIndex\">삭제</button></li>").text();
}else if(mylist_arr[j].indexOf("search_mngtNo") >= 0){ }else if(mylist_arr[j].indexOf("search_mngtNo") >= 0){
$("#reference_fillter_append").append("<li>관리번호 &#62; "+ $("#mngtNo").val() + "<button type=\"button\" class=\"btn-del-filter detailFilter\" id=\"\" name=\"search_mngtNo\">삭제</button></li>").text(); $("#reference_fillter_append").append("<li>관리번호 &#62; "+ $("#mngtNo").val() + "<button type=\"button\" class=\"btn-del-filter detailFilter\" id=\"\" name=\"search_mngtNo\">삭제</button></li>").text();