diff --git a/src/main/java/cokr/xit/fims/sprt/Keyword.java b/src/main/java/cokr/xit/fims/sprt/Keyword.java new file mode 100644 index 00000000..0ef8b71b --- /dev/null +++ b/src/main/java/cokr/xit/fims/sprt/Keyword.java @@ -0,0 +1,14 @@ +package cokr.xit.fims.sprt; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Keyword { + private String name; + private String value; + private String from; + private String to; + private String similar; +} diff --git a/src/main/java/cokr/xit/fims/sprt/SprtQuery.java b/src/main/java/cokr/xit/fims/sprt/SprtQuery.java index 59e71859..11ca752b 100644 --- a/src/main/java/cokr/xit/fims/sprt/SprtQuery.java +++ b/src/main/java/cokr/xit/fims/sprt/SprtQuery.java @@ -1,5 +1,7 @@ package cokr.xit.fims.sprt; +import java.util.List; + import cokr.xit.fims.cmmn.CmmnQuery; public class SprtQuery extends CmmnQuery { @@ -17,6 +19,13 @@ public class SprtQuery extends CmmnQuery { private String opnnId; // 의견 ID private String levyId; // 부과 ID private String cvlcptDscsnId; // 민원 상담 ID + + private List ischKeywordSet; // 통합조회 키워드 + + private List ischOnlyDataSet; //특정자료만 조회 + private List ischExclDataSet; //특정자료 제외 + private List ischInclDataSet; //특정자료 포함 + private String vhrno; // 차량번호 private String rtpyrNo; // 납부자 번호 private String rtpyrNm; // 납부자 명 @@ -108,6 +117,46 @@ public class SprtQuery extends CmmnQuery { return self(); } + public List getIschKeywordSet() { + return ifEmpty(ischKeywordSet, () -> null); + } + + public T setIschKeywordSet(List ischKeywordSet) { + this.ischKeywordSet = ischKeywordSet; + + return self(); + } + + public List getIschOnlyDataSet() { + return ifEmpty(ischOnlyDataSet, () -> null); + } + + public T setIschOnlyDataSet(List ischOnlyDataSet) { + this.ischOnlyDataSet = ischOnlyDataSet; + + return self(); + } + + public List getIschExclDataSet() { + return ifEmpty(ischExclDataSet, () -> null); + } + + public T setIschExclDataSet(List ischExclDataSet) { + this.ischExclDataSet = ischExclDataSet; + + return self(); + } + + public List getIschInclDataSet() { + return ifEmpty(ischInclDataSet, () -> null); + } + + public T setIschInclDataSet(List ischInclDataSet) { + this.ischInclDataSet = ischInclDataSet; + + return self(); + } + public String getVhrno() { return ifEmpty(vhrno, () -> null); } diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index 0c841925..238cca07 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -1,9 +1,12 @@ package cokr.xit.fims.sprt.web; +import java.util.ArrayList; +import java.util.Enumeration; import java.util.List; import java.util.Map; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import org.springframework.web.servlet.ModelAndView; @@ -12,6 +15,7 @@ import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.crdn.dao.GlobalStngMapper; +import cokr.xit.fims.sprt.Keyword; import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.service.Sprt01Service; import cokr.xit.foundation.data.DataObject; @@ -65,9 +69,10 @@ public class Sprt01Controller extends ApplicationController { * @param query 통합 조회 조건 * @return jsonView */ - public ModelAndView getIntegrationDataList(SprtQuery query) { + public ModelAndView getIntegrationDataList(SprtQuery query, HttpServletRequest req) { ModelAndView mav = new ModelAndView("jsonView"); - List list = null; + + this.makeIntegrationSearchQuery(query, req); String institute = currentUser().getInstitute(); String account = currentUser().getAccount(); @@ -75,10 +80,121 @@ public class Sprt01Controller extends ApplicationController { String deptCd = currentUser.getDeptCode(); String sggCd = globalStngMapper.selectSggCd(deptCd); query.setSggCd(sggCd); + + List list = null; list = sprt01Service.getIntegrationDataList(query); mav = setCollectionInfo(mav, list, "integrationData"); return mav; } + private void makeIntegrationSearchQuery(SprtQuery query, HttpServletRequest req) { + + Map pm = req.getParameterMap(); + Enumeration pns = req.getParameterNames(); + + List ischKeywordSet = new ArrayList<>(); + + List ischOnlyDataSet = new ArrayList<>(); + List ischExclDataSet = new ArrayList<>(); + List ischInclDataSet = new ArrayList<>(); + + while(pns.hasMoreElements()) { + + String key = pns.nextElement(); + String[] value = pm.get(key); + + if(!key.startsWith("isch")) { + continue; + } + if(value == null || value.length == 0) { + continue; + } + + if(value.length == 1 && ifEmpty(value[0], () -> "").equals("")) { + continue; + } + + if(key.startsWith("ischOnlyData") || key.startsWith("ischExclData") || key.startsWith("ischInclData")) { + String word = this.fnFirstLower(key.substring(12)); + + if(key.startsWith("ischOnlyData")) { + ischOnlyDataSet.add(word); + } else if(key.startsWith("ischExclData")) { + ischExclDataSet.add(word); + } else if(key.startsWith("ischInclData")) { + ischInclDataSet.add(word); + } + continue; + } + + String word = this.fnFirstLower(key.substring(4)); + int substringEnd = 0; + if(key.endsWith("Similar")){ + substringEnd = 7; + } else if(key.endsWith("From")) { + substringEnd = 4; + } else if(key.endsWith("To")){ + substringEnd = 2; + } + + if(substringEnd != 0) { + word = word.substring(0, word.length() - substringEnd); + } + + int findIndex = -1; + for (int i = 0; i < ischKeywordSet.size(); i++) { + if (ischKeywordSet.get(i).getName().equals(word)) { + findIndex = i; + break; + } + } + + if(findIndex == -1){ + + Keyword keyword = new Keyword(); + keyword.setName(word); + + if(key.endsWith("Similar")){ + keyword.setSimilar(value[0]); + } else if(key.endsWith("From")){ + keyword.setFrom(value[0]); + } else if(key.endsWith("To")){ + keyword.setTo(value[0]); + } else { + keyword.setValue(value[0]); + } + + ischKeywordSet.add(keyword); + + } else { + + if(key.endsWith("Similar")){ + ischKeywordSet.get(findIndex).setSimilar(value[0]); + } else if(key.endsWith("From")){ + ischKeywordSet.get(findIndex).setFrom(value[0]); + } else if(key.endsWith("To")){ + ischKeywordSet.get(findIndex).setTo(value[0]); + } else { + ischKeywordSet.get(findIndex).setValue(value[0]); + } + + } + } + + ischKeywordSet.removeIf(item -> item.getSimilar() != null && item.getValue() == null); + + query.setIschKeywordSet(ischKeywordSet); + query.setIschOnlyDataSet(ischOnlyDataSet); + query.setIschExclDataSet(ischExclDataSet); + query.setIschInclDataSet(ischInclDataSet); + } + + private String fnFirstLower(String string) { + + String temp1 = string.substring(0,1).toLowerCase(); + String temp2 = string.substring(1); + return temp1 + temp2; + } + } diff --git a/src/main/java/cokr/xit/fims/task/web/CmnController.java b/src/main/java/cokr/xit/fims/task/web/CmnController.java index 830b641e..46c7aa29 100644 --- a/src/main/java/cokr/xit/fims/task/web/CmnController.java +++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java @@ -1,5 +1,7 @@ package cokr.xit.fims.task.web; +import javax.servlet.http.HttpServletRequest; + import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; @@ -314,8 +316,8 @@ public class CmnController { @Override @RequestMapping(name="통합조회 자료 목록", value="/010/list.do") - public ModelAndView getIntegrationDataList(SprtQuery query) { - return super.getIntegrationDataList(query); + public ModelAndView getIntegrationDataList(SprtQuery query, HttpServletRequest req) { + return super.getIntegrationDataList(query, req); } } diff --git a/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml b/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml index 8eacb8c3..babb19f7 100644 --- a/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sprt/integrationSearch-mapper.xml @@ -6,6 +6,7 @@ /* 통합 자료 목록 조회(integrationSearchMapper.selectIntegrationDataList) */ SELECT C.CRDN_ID /* 단속 ID */ , C.SGG_CD /* 시군구 코드 */ + , (SELECT SGG_NM FROM TB_SGG_INFO WHERE SGG_CD = C.SGG_CD) AS SGG_NM /* 시군구 명 */ , C.TASK_SE_CD /* 업무 구분 코드 */ , (SELECT GET_CODE_NM('FIM054', C.TASK_SE_CD) FROM DUAL) AS TASK_SE_NM /* 업무 구분 코드 명 */ , C.CRDN_REG_SE_CD /* 단속 등록 구분 코드 */ @@ -114,27 +115,169 @@ , L.RDCAMT_ADAMT /* 감액 가산금 */ , L.RDCAMT_PCPTAX + L.RDCAMT_ADAMT AS REDUC_AMT /* 감액 금액 */ , L.SUM_AMT /* 합계 금액 */ - , VI.TXITM_NM /* 세목 명 */ + , VI.TXITM_NM /* 세목 명 */ , (CASE WHEN R.RCVMT_ID IS NOT NULL AND R.RCVMT_ID != '' THEN 'Y' ELSE 'N' END) AS RCVMT_YN - FROM TB_CRDN C /* 단속 대장 */ - INNER JOIN TB_CRDN_ADI CA ON (C.CRDN_ID = CA.CRDN_ID) /* 단속 부가 정보 */ - INNER JOIN TB_VLTN_INFO VI ON (C.VLTN_ID = VI.VLTN_ID) /* 위반 정보 */ -LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) /* 납부자 대장 */ -LEFT OUTER JOIN TB_LEVY L ON (C.CRDN_ID = L.CRDN_ID AND L.DEL_YN = 'N') /* 부과 대장 */ -LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N') - WHERE C.DEL_YN = 'N' - - AND C.VHRNO = #{vhrno} /* 차량번호 */ + FROM TB_CRDN C /* 단속 대장 */ + INNER JOIN TB_CRDN_ADI CA ON (C.CRDN_ID = CA.CRDN_ID) /* 단속 부가 정보 */ + INNER JOIN TB_VLTN_INFO VI ON (C.VLTN_ID = VI.VLTN_ID) /* 위반 정보 */ +LEFT OUTER JOIN TB_CRDN_CVLCPT CC ON (C.CVLCPT_LINK_YN = 'Y' AND C.LINK_ID = CC.CVLCPT_LINK_ID) /* 단속 민원 대장 */ +LEFT OUTER JOIN TB_ESB_INTERFACE EI ON (CC.CVLCPT_LINK_ID = EI.INTERFACE_SEQ_N) /* 국민신문고 민원 연계 */ +LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) /* 납부자 대장 */ +LEFT OUTER JOIN TB_LEVY L ON (C.CRDN_ID = L.CRDN_ID AND L.DEL_YN = 'N') /* 부과 대장 */ +LEFT OUTER JOIN TB_RCVMT R ON (L.LEVY_ID = R.LEVY_ID AND R.DEL_YN = 'N') /* 수납 대장 */ + WHERE C.DEL_YN = 'N' + AND C.SGG_CD = #{sggCd} + + AND C.TASK_SE_CD = #{taskSeCd} - - AND P.RTPYR_NO = #{rtpyrNo} /* 납부자 번호 */ + + + + + + + AND (C.VHRNO = #{item.value} OR '테이블.대체차량번호컬럼' = #{item.value}) + + + + + AND '테이블.대체차량번호컬럼' LIKE CONCAT ('%' || #{item.value} || '%') + + + AND '테이블.대체차량번호컬럼' = #{item.value} + + + + + + + AND C.VHRNO LIKE CONCAT ('%' || #{item.value} || '%') + + + AND C.VHRNO = #{item.value} + + + + + + + AND P.RTPYR_NM LIKE CONCAT ('%' || #{item.value} || '%') + + + AND P.RTPYR_NM = #{item.value} + + + + + AND P.RTPYR_NO = #{item.value} + + + AND CC.CVLCPT_APLCNT_NM = #{item.value} + + + + AND C.CRDN_YMD = ]]> #{item.from} + + + AND C.CRDN_YMD #{item.to} + + + + + AND C.CRDN_TM = ]]> #{item.from} + + + AND C.CRDN_TM #{item.to} + + + + AND P.ADDR LIKE CONCAT ('%' || #{item.value} || '%') + + + AND P.DTL_ADDR LIKE CONCAT ('%' || #{item.value} || '%') + + + AND CONCAT(L.FYR, '-', L.LEVY_NO) = #{item.value} + + + AND L.EPAYNO = #{item.value} + + + AND C.CRDN_STTS_CD = #{item.value} + + + AND C.CRDN_REG_SE_CD = #{item.value} + + + AND C.CRDN_INPT_SE_CD = #{item.value} + + + AND C.CRDN_STDG_NM = #{item.value} + + + AND C.CRDN_PLC LIKE CONCAT ('%' || #{item.value} || '%') + + + AND CC.CVLCPT_LIST_NO = #{item.value} + + + AND EI.CEL_NO_V = #{item.value} + + + + + + + + + + + + + AND L.LEVY_ID IS NULL + + + + + + + + + + + + + + + + + + - - AND P.RTPYR_NM = #{rtpyrNm} /* 납부자 명 */ + + + + + + + + C.CRDN_INPT_SE_CD + C.CRDN_YMD + C.VHRNO + C.CRDN_STDG_NM + C.ATCH_FILE_CNT + CA.CRDN_SN + + #{term} + + + + + diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp index b9c31d22..92df97f0 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp @@ -266,6 +266,31 @@ integrationSearch.fnSearchList = () => { integrationSearchControl.query.delYn = "N"; // 삭제 여부 integrationSearchControl.query.crdnDelYn = "N"; // 단속 대장 삭제 여부 + var query = integrationSearchControl.query; + var minKeyword = false; + var keys = Object.keys(query); + for(var i=0; i < keys.length; i++){ + var key = keys[i]; + if(!key.startsWith("isch")){ + continue; + } + if(key.startsWith("ischOnlyData") || key.startsWith("ischExclData") || key.startsWith("ischInclData") + || key.endsWith("Similar")){ + continue; + } + + var value = query[key]; + if(value != null && value != ""){ + minKeyword = true; + break; + } + } + + if(!minKeyword){ + dialog.alert("검색조건을 입력하세요."); + return; + } + integrationSearchControl.load(); } diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp index 74330c0e..5fe354a2 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp @@ -72,33 +72,50 @@ -
+
- +
-
+
- + + +
+ +
+ + +
- + +
- +
- +
- + @@ -121,11 +138,11 @@
- ~ - @@ -133,35 +150,35 @@
- - ~
- +
- +
- +
- +
- @@ -170,7 +187,7 @@
- @@ -180,7 +197,7 @@
- @@ -190,7 +207,7 @@
- @@ -200,22 +217,22 @@
- +
- +
- +
- +