업무구분 코드 추출 수정

main
mjkhan21 1 year ago
parent 2cbb2297d7
commit ecd7044a69

@ -44,18 +44,13 @@ public interface ImportMapper extends AbstractMapper {
/** .
* @return
*/
List<DataObject> selectTaskCd();
String selectTaskCd(Map<String, Object> params);
/** {"부서코드", "업무코드"} .
* @return {"부서코드", "업무코드"}
*/
default Map<String, String> selectTaskMap() {
List<DataObject> 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));
}
/** .

@ -51,9 +51,8 @@ public class ImportBean extends AbstractComponent {
Map<String, String>
ssgs = getSSGs(petitions),
tasks = importMapper.selectTaskMap(), //TODO: 업무구분 추출 다시 검토할 것
carModels = importMapper.selectCarMdl();
List<Crdn> crdns = create(petitions, ssgs, tasks);
List<Crdn> crdns = create(petitions, ssgs);
BiFunction<String, String, String> getCarModel = (vhctyAsortCd, mxmmLdg) -> {
if (isEmpty(vhctyAsortCd)) return null;
@ -86,7 +85,7 @@ public class ImportBean extends AbstractComponent {
* @param sggs
* @return
*/
private List<Crdn> create(List<Petition> petitions, Map<String, String> sggs, Map<String, String> tasks) {
private List<Crdn> create(List<Petition> petitions, Map<String, String> 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<String> 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)

@ -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</select>
<select id="selectTaskCd" resultType="dataobject">/* importMapper.selectTaskCd(업무코드 조회) */
SELECT '3910354' DEPT_CD, 'PVS' TASK_CD UNION
SELECT '3790034' DEPT_CD, 'PVS' TASK_CD UNION
SELECT '3800029' DEPT_CD, 'PVS' TASK_CD UNION
SELECT '3810054' DEPT_CD, 'PVS' TASK_CD UNION
SELECT '6300915' DEPT_CD, 'PVS' TASK_CD UNION
SELECT '6300753' DEPT_CD, 'BPV' TASK_CD UNION
<!-- SELECT '6300915' DEPT_CD, 'BPV' TASK_CD UNION -->
SELECT '6301014' DEPT_CD, 'BPV' TASK_CD UNION
SELECT 'default' DEPT_CD, 'DPV' TASK_CD</select>
<select id="selectTaskCd" parameterType="map" resultType="string">/* importMapper.selectTaskCd(업무코드 조회) */
SELECT CASE WHEN VLTN LIKE CONCAT('%', '전용차로', '%') THEN 'BPV'
WHEN VLTN LIKE CONCAT('%', '장애인', '%') THEN 'DPV'
WHEN VLTN LIKE CONCAT('%', '전기차', '%') THEN 'ECA'
WHEN VLTN LIKE CONCAT('%', '밤샘', '%') THEN 'TPV'
ELSE 'PVS'
END TASK_CD
FROM (SELECT #{violation} VLTN
) A</select>
<select id="selectCarMdlCd" resultType="dataobject">/* importMapper.selectCarMdlCd(차종별 과태료 차종 조회) */
SELECT '1' VHCTY_ASORT_CODE, '11' FFNLG_CARMDL_CD UNION <!-- 승용 -->

Loading…
Cancel
Save