From 165ec31e1d865a2f99139ede115fde1d9d7f2760 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Wed, 27 Dec 2023 14:19:12 +0900 Subject: [PATCH] =?UTF-8?q?B14=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/lntris/special/b/LntrisB14.java | 9 ++++++--- .../lntris/special/b/dao/LntrisB13_16Mapper.java | 15 +++++++++------ .../sql/mapper/lntris/lntris-B13_16-mapper.xml | 6 +++--- .../special/b/service/LntrisBServiceTest.java | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/lntris/special/b/LntrisB14.java b/src/main/java/cokr/xit/interfaces/lntris/special/b/LntrisB14.java index c33b5f9..cf19283 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/special/b/LntrisB14.java +++ b/src/main/java/cokr/xit/interfaces/lntris/special/b/LntrisB14.java @@ -1,5 +1,8 @@ package cokr.xit.interfaces.lntris.special.b; +import java.util.ArrayList; +import java.util.List; + import com.fasterxml.jackson.core.type.TypeReference; import cokr.xit.interfaces.lntris.SourceMessage; @@ -74,10 +77,10 @@ public class LntrisB14 extends SpecialInterface resVo1; - public B14RespDetail getResVo1() { - return resVo1 != null ? resVo1 : (resVo1 = new B14RespDetail()); + public List getResVo1() { + return resVo1 != null ? resVo1 : (resVo1 = new ArrayList<>()); } } diff --git a/src/main/java/cokr/xit/interfaces/lntris/special/b/dao/LntrisB13_16Mapper.java b/src/main/java/cokr/xit/interfaces/lntris/special/b/dao/LntrisB13_16Mapper.java index f89d95a..4f03984 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/special/b/dao/LntrisB13_16Mapper.java +++ b/src/main/java/cokr/xit/interfaces/lntris/special/b/dao/LntrisB13_16Mapper.java @@ -164,7 +164,7 @@ public interface LntrisB13_16Mapper extends AbstractMapper { Map> byB14Id = resps.stream().collect(Collectors.groupingBy(LntrisB14.B14RespDetail::getB14Id)); b14s.forEach(b14 -> { List details = byB14Id.get(b14.getB14Id()); - b14.getResponse().setResVo1(details.get(0)); + b14.getResponse().setResVo1(details); }); } @@ -229,13 +229,16 @@ public interface LntrisB13_16Mapper extends AbstractMapper { */ default int insertB14Resps(LntrisB14 b14) { String b14Id = b14.getB14Id(); - LntrisB14.B14RespDetail resp = b14.getResponse().getResVo1(); - if (isEmpty(b14Id)) return 0; + List resps = b14.getResponse().getResVo1(); + if (isEmpty(b14Id) || resps.isEmpty()) return 0; - resp.setB14Id(b14Id); - resp.setB14Sn("1"); + for (int i = 0; i < resps.size(); ++i) { + LntrisB14.B14RespDetail resp = resps.get(i); + resp.setB14Id(b14Id); + resp.setB14Sn(Integer.toString(i + 1)); + } - return insertB14Resps(params().set("resp", resp)); + return insertB14Resps(params().set("resps", resps)); } /**주정차위반 과태료대장 상세 목록 조회 요청/응답을 등록한다. diff --git a/src/main/resources/sql/mapper/lntris/lntris-B13_16-mapper.xml b/src/main/resources/sql/mapper/lntris/lntris-B13_16-mapper.xml index 8532376..0ef1cc3 100644 --- a/src/main/resources/sql/mapper/lntris/lntris-B13_16-mapper.xml +++ b/src/main/resources/sql/mapper/lntris/lntris-B13_16-mapper.xml @@ -661,8 +661,8 @@ INSERT INTO TB_NIS_SPCL_B14RV ( , RGTR , MDFCN_DT , MDFR -) VALUES ( - #{resp.b14Id} +) +SELECT #{resp.b14Id} , #{resp.b14Sn} , #{resp.sgbCd} , #{resp.sgbNm} @@ -770,7 +770,7 @@ INSERT INTO TB_NIS_SPCL_B14RV ( , #{currentUser.id} , , #{currentUser.id} -) + FROM DUAL diff --git a/src/test/java/cokr/xit/interfaces/lntris/special/b/service/LntrisBServiceTest.java b/src/test/java/cokr/xit/interfaces/lntris/special/b/service/LntrisBServiceTest.java index 7a393b2..19b6b1e 100644 --- a/src/test/java/cokr/xit/interfaces/lntris/special/b/service/LntrisBServiceTest.java +++ b/src/test/java/cokr/xit/interfaces/lntris/special/b/service/LntrisBServiceTest.java @@ -1244,7 +1244,7 @@ public class LntrisBServiceTest extends TestSupport { resp.setRprsTxmCd(rprsTxmCd); resp.setVhrno(vhrNo); - b14.getTargetMessage().getBody().setResVo1(resp); + b14.getTargetMessage().getBody().getResVo1().add(resp); } b13_16Mapper.insertB14s(List.of(b14));