From ad93bd134c3aa5b339c5f5874d3d7046b3612abd Mon Sep 17 00:00:00 2001 From: leebj Date: Thu, 31 Oct 2024 10:35:10 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=84=ED=83=9D=EC=8A=A4=20=EB=82=A9?= =?UTF-8?q?=EB=B6=80=EC=9E=90=EB=B3=80=EA=B2=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/fims/mngt/MsgQuery.java | 2 +- .../xit/fims/rent/web/Rent04Controller.java | 133 +++++++++++++----- 2 files changed, 96 insertions(+), 39 deletions(-) diff --git a/src/main/java/cokr/xit/fims/mngt/MsgQuery.java b/src/main/java/cokr/xit/fims/mngt/MsgQuery.java index 57e89586..830cafcf 100644 --- a/src/main/java/cokr/xit/fims/mngt/MsgQuery.java +++ b/src/main/java/cokr/xit/fims/mngt/MsgQuery.java @@ -10,7 +10,7 @@ public class MsgQuery extends CmmnQuery { private String schInputDateTo; - private String msgPrps; //고장신고,사전알림,주차신고민원 + private String msgPrps; //고장신고,사전알림,주차신고민원,기타민원 private String msgDtlPrps; private String callback; diff --git a/src/main/java/cokr/xit/fims/rent/web/Rent04Controller.java b/src/main/java/cokr/xit/fims/rent/web/Rent04Controller.java index 7961c40a..7b563434 100644 --- a/src/main/java/cokr/xit/fims/rent/web/Rent04Controller.java +++ b/src/main/java/cokr/xit/fims/rent/web/Rent04Controller.java @@ -157,9 +157,10 @@ public class Rent04Controller extends ApplicationController { } } - if(rowNo != 0 && !resultRow.string("A").equals("")) { - List searchResult = null; - + if(rowNo != 0 //제목줄이 아닐것 + && !resultRow.string("A").equals("") //빈셀이 아닐것 + // && // TODO : 과태료구분이 시스템에서사용하는 과태료일것 + ) { RentQuery entQuery = new RentQuery(); entQuery.setUserId(currentUser().getId()); List entList = userRentEntMpngMapper.selectUserRentEntMpngList(entQuery); @@ -170,15 +171,83 @@ public class Rent04Controller extends ApplicationController { //사용자 기업명 목록 List entNms = entList.stream().map(i -> i.string("ENT_NM")).toList(); - RentQuery lsctQuery = new RentQuery(); - lsctQuery.setEntIds(entIds); - lsctQuery.setSchVhrno(resultRow.string("D")); - lsctQuery.setSchCtrtYmd(resultRow.string("G")); + String epaynoColumn = resultRow.string("B"); + String crdnDtColumn = resultRow.string("G"); + String vhrnoColumn = resultRow.string("D"); + + + boolean crdnDtCheck = CmmnUtil.isDateTimePattern(crdnDtColumn); + String extractVhrno = CmmnUtil.extractCarNumber(vhrnoColumn); + String crdnDt = ""; + + boolean useable = false; //엑셀의 차량번호,단속일시 셀 사용 가능 여부 + if(crdnDtCheck && !extractVhrno.equals("")) { + useable = true; + crdnDt = crdnDtColumn.replaceAll("-", "").replaceAll(" ", "").replaceAll(":", ""); + } + + + List searchResults = null; + DataObject searchResult1 = new DataObject(); + String foundType = ""; //HIRER,RTPYR + + if(foundType.equals("")) { + RentQuery lsctQuery = new RentQuery(); + lsctQuery.setEntIds(entIds); + lsctQuery.setEntIds("전자납부번호"); //TODO:전자납부번호 + searchResults = lsctMapper.selectLsctList(lsctQuery); + + if(searchResults != null && !searchResults.isEmpty()) { + searchResult1 = searchResults.get(0); + foundType = "HIRER"; + } + } + + if(foundType.equals("") && useable) { + RentQuery lsctQuery = new RentQuery(); + lsctQuery.setEntIds(entIds); + lsctQuery.setSchVhrno(extractVhrno); + lsctQuery.setSchCtrtYmd(crdnDt.substring(0, 8)); + //TODO:단속시간 + //TODO:과태료구분 + searchResults = lsctMapper.selectLsctList(lsctQuery); + + if(searchResults != null && !searchResults.isEmpty()) { + searchResult1 = searchResults.get(0); + foundType = "HIRER"; + } + } - searchResult = lsctMapper.selectLsctList(lsctQuery); - if(searchResult != null && !searchResult.isEmpty()) { - DataObject searchResult1 = searchResult.get(0); + if(foundType.equals("")) { + CrdnQuery crdnQuery = new CrdnQuery(); + crdnQuery.setEpayno(epaynoColumn); + searchResults = crdnListMapper.selectCrackdownList(crdnQuery); + + if(searchResults != null && !searchResults.isEmpty()) { + searchResult1 = searchResults.get(0); + foundType = "RTPYR"; + } + } + + if(foundType.equals("") && useable) { + CrdnQuery crdnQuery = new CrdnQuery(); + crdnQuery.setVhrno(extractVhrno); + crdnQuery.setCrdnYmd(crdnDt.substring(0, 8)); + crdnQuery.setCrdnTm(crdnDt.substring(8)); + //TODO:과태료구분 + searchResults = crdnListMapper.selectCrackdownList(crdnQuery); + + if(searchResults != null && !searchResults.isEmpty()) { + searchResult1 = searchResults.get(0); + foundType = "RTPYR"; + } + } + + + + + if(foundType.equals("HIRER")) { resultRow.set("K", searchResult1.string("HIRER_NM")); if(searchResult1.string("HIRER_SE_CD").equals("99")) { @@ -190,36 +259,24 @@ public class Rent04Controller extends ApplicationController { resultRow.set("O", searchResult1.string("HIRER_DTL_ADDR")); resultRow.set("P", searchResult1.string("HIRER_ZIP")); - } else { - CrdnQuery crdnQuery = new CrdnQuery(); - crdnQuery.setVhrno(resultRow.string("D")); - crdnQuery.setSchCrdnYmdFrom(resultRow.string("G")); - crdnQuery.setSchCrdnYmdTo(resultRow.string("G")); - - searchResult = crdnListMapper.selectCrackdownList(crdnQuery); - - if(searchResult != null && !searchResult.isEmpty()) { - DataObject searchResult1 = searchResult.get(0); - - //납부자정보가 사용자기업정보가 아니면 - if(!entNms.contains(searchResult1.string("RTPYR_NM")) - && !entRegNos.contains(searchResult1.string("RTPYR_NO")) - ) { - resultRow.set("K", searchResult1.string("RTPYR_NM")); - if(searchResult1.string("RTPYR_SE_CD").equals("99")) { - resultRow.set("L", searchResult1.string("RTPYR_NO")); - } else { - resultRow.set("M", searchResult1.string("RTPYR_NO")); - } - resultRow.set("N", searchResult1.string("RTPYR_ADDR")); - resultRow.set("O", searchResult1.string("RTPYR_DTL_ADDR")); - resultRow.set("P", searchResult1.string("RTPYR_ZIP")); - } - - } + } else if(foundType.equals("RTPYR")) { + + //납부자정보가 사용자기업정보가 아니면 + if(!entNms.contains(searchResult1.string("RTPYR_NM")) + && !entRegNos.contains(searchResult1.string("RTPYR_NO")) + ) { + resultRow.set("K", searchResult1.string("RTPYR_NM")); + if(searchResult1.string("RTPYR_SE_CD").equals("99")) { + resultRow.set("L", searchResult1.string("RTPYR_NO")); + } else { + resultRow.set("M", searchResult1.string("RTPYR_NO")); + } + resultRow.set("N", searchResult1.string("RTPYR_ADDR")); + resultRow.set("O", searchResult1.string("RTPYR_DTL_ADDR")); + resultRow.set("P", searchResult1.string("RTPYR_ZIP")); + } } - result.add(resultRow); } }