From ecd7044a69afe0dcf484d33a468ad1b7d10abd06 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Mon, 21 Aug 2023 10:54:56 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=85=EB=AC=B4=EA=B5=AC=EB=B6=84=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EC=B6=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/crdn/dao/ImportMapper.java | 11 +++------- .../fims/crdn/service/bean/ImportBean.java | 10 ++++----- .../sql/mapper/fims/crdn/import-mapper.xml | 21 ++++++++----------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/dao/ImportMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/ImportMapper.java index cf6ac83d..cf032123 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/ImportMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/ImportMapper.java @@ -44,18 +44,13 @@ public interface ImportMapper extends AbstractMapper { /**업무코드를 조회한다. * @return 업무코드 목록 */ - List selectTaskCd(); + String selectTaskCd(Map params); /**업무코드를 조회하여 {"부서코드", "업무코드"} 형식의 맵으로 반환한다. * @return {"부서코드", "업무코드"} 맵 */ - default Map selectTaskMap() { - List list = selectTaskCd(); - return list.stream() - .collect(Collectors.toMap( - row -> row.string("DEPT_CD"), - row -> row.string("TASK_CD") - )); + default String selectTaskCd(String violation) { + return selectTaskCd(params().set("violation", violation)); } /**차종별 과태료 차종코드를 조회한다. diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/ImportBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/ImportBean.java index bac38bbb..1e89106a 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/ImportBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/ImportBean.java @@ -51,9 +51,8 @@ public class ImportBean extends AbstractComponent { Map ssgs = getSSGs(petitions), - tasks = importMapper.selectTaskMap(), //TODO: 업무구분 추출 다시 검토할 것 carModels = importMapper.selectCarMdl(); - List crdns = create(petitions, ssgs, tasks); + List crdns = create(petitions, ssgs); BiFunction getCarModel = (vhctyAsortCd, mxmmLdg) -> { if (isEmpty(vhctyAsortCd)) return null; @@ -86,7 +85,7 @@ public class ImportBean extends AbstractComponent { * @param sggs 시군구코드 * @return 단속자료 목록 */ - private List create(List petitions, Map sggs, Map tasks) { + private List create(List petitions, Map sggs) { Petition.Violation violation = new Petition.Violation(); DateFormats dateFormats = new DateFormats(); @@ -100,6 +99,8 @@ public class ImportBean extends AbstractComponent { .collect(Collectors.groupingBy(map -> map.get("vehicleNo"))); //차량번호별 단속정보 List vehicleNos = List.copyOf(byVehicleNo.keySet()); + String taskCd = importMapper.selectTaskCd(petition.getPetiTitleV() + " " + petition.getPetiReasonL()); //업무 구분(FIM054) + return byVehicleNo.entrySet().stream() .map(entry -> { String vehicleNo = entry.getKey(); @@ -109,8 +110,7 @@ public class ImportBean extends AbstractComponent { String instDept = petition.getPcdAncCodeV() + "-" + petition.getPcdDeptV(), sgg = sggs.get(instDept); crdn.setSggCd(sgg); - String dept = petition.getPcdDeptV(); - crdn.setTaskSeCd(ifEmpty(tasks.get(dept), () -> tasks.get("default"))); + crdn.setTaskSeCd(taskCd); crdn.setCrdnRegSeCd(first ? "02" : "04"); // 첫번째면 자동등록, 아니면 복사등록 (FIM026) crdn.setCrdnInptSeCd("14"); // 국민신문고 연계 (FIM003) diff --git a/src/main/resources/sql/mapper/fims/crdn/import-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/import-mapper.xml index 49512477..0dbec528 100644 --- a/src/main/resources/sql/mapper/fims/crdn/import-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/import-mapper.xml @@ -18,18 +18,15 @@ SELECT CASE WHEN A.SGG_CD = B.SGG_CD THEN A.SGG_CD ELSE 'DIFF' END SGG_CD ) B ON A.SGG_CD = B.SGG_CD - +