From 50e7d16575d2d0427db1afee0db44ad2aac53cba Mon Sep 17 00:00:00 2001 From: tolag3 Date: Tue, 3 Dec 2024 21:18:01 +0900 Subject: [PATCH] Merge branch 'tolag3' --- .../kcc/com/srch/service/SearchService.java | 7 + .../java/kcc/com/srch/service/SearchVO.java | 165 +++++++++++++- .../srch/service/impl/SearchServiceImpl.java | 57 +++++ .../kcc/com/srch/web/SearchController.java | 21 +- src/main/java/seed/utils/FairnetUtils.java | 38 ++-- src/main/webapp/WEB-INF/decorators.xml | 1 + .../WEB-INF/jsp/com/srch/searchList.jsp | 215 ++++++++++++++++++ 7 files changed, 473 insertions(+), 31 deletions(-) create mode 100644 src/main/java/kcc/com/srch/service/SearchService.java create mode 100644 src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java create mode 100644 src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp diff --git a/src/main/java/kcc/com/srch/service/SearchService.java b/src/main/java/kcc/com/srch/service/SearchService.java new file mode 100644 index 00000000..ea989b80 --- /dev/null +++ b/src/main/java/kcc/com/srch/service/SearchService.java @@ -0,0 +1,7 @@ +package kcc.com.srch.service; + +import org.springframework.ui.ModelMap; + +public interface SearchService { + public void searchListSet(SearchVO searchVO, ModelMap model); +} diff --git a/src/main/java/kcc/com/srch/service/SearchVO.java b/src/main/java/kcc/com/srch/service/SearchVO.java index f9c31776..17aae17d 100644 --- a/src/main/java/kcc/com/srch/service/SearchVO.java +++ b/src/main/java/kcc/com/srch/service/SearchVO.java @@ -12,11 +12,20 @@ import lombok.Setter; @Getter @Setter @NoArgsConstructor -public class SearchVO extends ComDefaultVO implements Serializable { +public class SearchVO implements Serializable { private static final long serialVersionUID = 1L; + /* + * 기본 검색자 + */ + private String searchType; + private String searchKeyword; + private String pagingSize; + private String page; + + /* * application 시작 */ @@ -54,7 +63,7 @@ public class SearchVO extends ComDefaultVO implements Serializable { private String contactHp; @JsonProperty("P_CONTACT_HP") - private String pContactHp; + private String pcontactHp; @JsonProperty("APPLICATION_OBJ") private String applicationObj; @@ -69,6 +78,158 @@ public class SearchVO extends ComDefaultVO implements Serializable { * application 끝 */ + /* + * board 시작 + */ + + @JsonProperty("TEAM_NO") + private String teamNo; // 팀 번호 + + @JsonProperty("TEAM_TITLE") + private String teamTitle; // 제목 + + @JsonProperty("TEAM_CONTENT") + private String teamContent; // 내용 + + @JsonProperty("TEAM_REGNM") + private String teamRegnm; // 작성자 + + @JsonProperty("TEAM_REGDATE") + private String teamRegdate; // 작성일 + + @JsonProperty("TEAM_GUBUN") + private String teamGubun; // 팀 구분 + + /* + * board 끝 + */ + /* + * completed 시작 + */ + @JsonProperty("CASE_NO") + private String caseNo; // 사건번호 + + @JsonProperty("SDATE") + private String sdate; // 등록일자 + + @JsonProperty("CASE_GUBUN_NM") + private String caseGubunNm; // 사건구분명 + + @JsonProperty("CASE_EXAMINER_NM") + private String caseExaminerNm; // 담당자이름 + + @JsonProperty("MEDIATION_BIG") + private String mediationBig; // 대분류 + + @JsonProperty("MEDIATION_SMALL") + private String mediationSmall; // 소분류 + + @JsonProperty("CASE_DATE") + private String caseDate; // 접수일자 + + @JsonProperty("ROAD_ADDR1") + private String roadAddr1; // 신청인소재지 + + @JsonProperty("KPI_ASSETS1") + private String kpiAssets1; // 피신청인자산총액 + + @JsonProperty("CONFERENCE_NAMES") + private String conferenceNames; // 종료회차 + + @JsonProperty("FILE_NAME") + private String fileName; // 첨부파일내용 + + @JsonProperty("FIX_DAY") + private String fixDay; // 종료일자 + + /* + * completed 끝 + */ + + + /* + * conference 시작 + */ + + @JsonProperty("STATE_PRO") + private String statePro; // 진행 상태 + + @JsonProperty("DLBRTMTR_CNT") + private int dlbrtmtrCnt; // 보고 안건 수 + + @JsonProperty("ENDMTR_CNT") + private int endmtrCnt; // 심의 안건 수 + + @JsonProperty("CONFERENCE_PLACE") + private String conferencePlace; // 장소 + + @JsonProperty("CONFERENCE_GUBUN_NM") + private String conferenceGubunNm; // 회의 구분 + + /* + * counsel 끝 + */ + + @JsonProperty("COUNSEL_SEQ") + private String counselSeq; // 상담번호 + + @JsonProperty("APPLCNT_NM") + private String applcntNm; // 신청인 + + @JsonProperty("MEDIATION_TYPE_NAME") + private String mediationTypeName; // 조정유형 + + @JsonProperty("COUNSEL_TITLE") + private String counselTitle; // 상담제목 + + @JsonProperty("COUNSEL_REGDATE") + private String counselRegdate; // 등록일 + + @JsonProperty("MANAGER_NM") + private String managerNm; // 담당자 + + @JsonProperty("NOTICE_DATE") + private String noticeDate; // 처리일자 + + @JsonProperty("COUNSEL_STATE_NAME") + private String counselStateName; // 상태 + + @JsonProperty("CIVIL_TYPE") + private String civilType; // 민원 유형 + + @JsonProperty("NOTICE_TYPE") + private String noticeType; // 공지 유형 + + /* + * counsel 시작 + */ + + + /* + * process시작 + */ + + @JsonProperty("DOC_ID") + private String docId; // 사건번호 + + @JsonProperty("STATE_PRO_NM") + private String stateProNm; // 현재 단계 + + @JsonProperty("STATE_PRO_NEXT") + private String stateProNext; // 다음 단계 + + @JsonProperty("PRO_DATE") + private int proDate; // 진행일수 + + @JsonProperty("TERM_CHECK") + private String termCheck; // 기간 경과 여부 + + @JsonProperty("TIMHDER_ASSIGN") + private String timhderAssign; // 팀장 팀 배정 + + /* + * process 시작 + */ } \ No newline at end of file diff --git a/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java b/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java new file mode 100644 index 00000000..2e1cc43d --- /dev/null +++ b/src/main/java/kcc/com/srch/service/impl/SearchServiceImpl.java @@ -0,0 +1,57 @@ +package kcc.com.srch.service.impl; + +import java.math.BigDecimal; +import java.util.Map; + +import org.springframework.stereotype.Service; +import org.springframework.ui.ModelMap; + +import com.fasterxml.jackson.databind.node.TextNode; + +import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; +import kcc.com.srch.service.SearchService; +import kcc.com.srch.service.SearchVO; +import seed.utils.FairnetUtils; + +@Service("SearchService") +public class SearchServiceImpl extends EgovAbstractServiceImpl implements SearchService { + + @Override + public void searchListSet( + SearchVO searchVO, + ModelMap model + ){ + +// Map application = FairnetUtils.searchApplication("application", "테스트", "3", "1"); + Map board = FairnetUtils.searchApplication("board", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); + Map completed = FairnetUtils.searchApplication("completed", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); + Map conference = FairnetUtils.searchApplication("conference", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); + Map counsel = FairnetUtils.searchApplication("counsel", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); + Map process = FairnetUtils.searchApplication("process", searchVO.getSearchKeyword(), searchVO.getPagingSize(), "1"); + + BigDecimal totCnt = new BigDecimal(0); + + totCnt = totCnt.add(getTotCnt(board)); + totCnt = totCnt.add(getTotCnt(completed)); + totCnt = totCnt.add(getTotCnt(conference)); + totCnt = totCnt.add(getTotCnt(counsel)); + totCnt = totCnt.add(getTotCnt(process)); + + model.addAttribute("totCnt", totCnt); + model.addAttribute("board", board); + model.addAttribute("completed", completed); + model.addAttribute("conference", conference); + model.addAttribute("counsel", counsel); + model.addAttribute("process", process); + + } + + + private BigDecimal getTotCnt(Map map) { + if (map != null) { + String totcntStr = map.get("totcnt").toString(); + return new BigDecimal(totcntStr); + } + return new BigDecimal(0); + } +} diff --git a/src/main/java/kcc/com/srch/web/SearchController.java b/src/main/java/kcc/com/srch/web/SearchController.java index 91b7e865..81eb1674 100644 --- a/src/main/java/kcc/com/srch/web/SearchController.java +++ b/src/main/java/kcc/com/srch/web/SearchController.java @@ -1,26 +1,35 @@ package kcc.com.srch.web; -import java.util.Map; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; -import seed.utils.FairnetUtils; +import kcc.com.srch.service.SearchService; +import kcc.com.srch.service.SearchVO; @Controller public class SearchController { private static final Logger LOGGER = LoggerFactory.getLogger(SearchController.class); + + @Autowired + private SearchService searchService; - @RequestMapping(value = "/cmm/srch/Search.do") + @RequestMapping(value = "/com/srch/Search.do") public String totalSearch( + ModelMap model + , @ModelAttribute("searchVO") SearchVO searchVO ) throws Exception { - Map application = FairnetUtils.searchApplication("application", "테스트", "-1", "1"); + searchVO.setPagingSize("3"); - return ""; + searchService.searchListSet(searchVO, model); + + return "com/srch/searchList"; } } \ No newline at end of file diff --git a/src/main/java/seed/utils/FairnetUtils.java b/src/main/java/seed/utils/FairnetUtils.java index a7a39165..75abe62c 100644 --- a/src/main/java/seed/utils/FairnetUtils.java +++ b/src/main/java/seed/utils/FairnetUtils.java @@ -24,6 +24,7 @@ import org.springframework.web.client.RestTemplate; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.TextNode; import com.ibm.icu.text.SimpleDateFormat; import kcc.com.srch.service.SearchVO; @@ -324,12 +325,12 @@ public class FairnetUtils { * @date : 2024.12.02 * @description : * @param searchType : - * application - 조정신청 - * , board - teamboard - * , completed - 종료건 - * , conference - 협의회 - * , counsel - 상담 - * , process - 조정 진행중 + * application - 조정신청 (미사용) + * , board - 게시판 + * , completed - 사건종료관리 + * , conference - 협의회관리 + * , counsel - 상담관리 + * , process - 사건처리관리 * @param searchKeyword : 검색어 * @param pagingSize : 페이징 크기 (무한: -1) * @param page : 페이지 @@ -342,41 +343,32 @@ public class FairnetUtils { , String page ) { - SearchGlobalSet searchGlobalSet = new SearchGlobalSet(); - - Map result = new HashMap(); - - RestTemplate restTemplate = new RestTemplate(); - ObjectMapper objectMapper = new ObjectMapper(); - String url = searchGlobalSet.getHost() + String url = new SearchGlobalSet().getHost() + "/srch_resultjson?" -// + "w=application" + "w=" + searchType -// + "&q=테스트" + "&q=" + searchKeyword -// + "&outmax=-1" + "&outmax=" + pagingSize + "§ion=" -// + "&pg=1" + "&pg=" + page; try { - String response = restTemplate.getForObject(url, String.class); - JsonNode root = objectMapper.readTree(response); + String response = new RestTemplate().getForObject(url, String.class); + JsonNode root = new ObjectMapper().readTree(response); JsonNode listNode = root.path("section_list") .path(0) .path("section") .path(0); -// .path("att_list"); if (listNode.path("att_list").isArray()) { - List searchList = objectMapper.convertValue( + List searchList = new ObjectMapper().convertValue( listNode.path("att_list"), new TypeReference>() {} ); - result.put("totcnt", listNode.get("totcnt")); + Map result = new HashMap(); + + result.put("totcnt", ((TextNode) listNode.get("totcnt")).asText()); result.put("list", searchList); return result; } } catch (Exception e) { - e.printStackTrace(); + System.out.println(e.getMessage()); } return null; diff --git a/src/main/webapp/WEB-INF/decorators.xml b/src/main/webapp/WEB-INF/decorators.xml index d72f3475..f29c2c92 100644 --- a/src/main/webapp/WEB-INF/decorators.xml +++ b/src/main/webapp/WEB-INF/decorators.xml @@ -104,6 +104,7 @@ /gtm/* /xxx/* /common/gtm/multiFileList.do + /com/srch/* diff --git a/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp b/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp new file mode 100644 index 00000000..da7a54e6 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/com/srch/searchList.jsp @@ -0,0 +1,215 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + + + + + + + + +
+
+ +
+ +
+
+
+ + + + + + +