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 cf19283..c33b5f9 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,8 +1,5 @@ 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; @@ -77,10 +74,10 @@ public class LntrisB14 extends SpecialInterface resVo1; + private B14RespDetail resVo1; - public List getResVo1() { - return resVo1 != null ? resVo1 : (resVo1 = new ArrayList<>()); + public B14RespDetail getResVo1() { + return resVo1 != null ? resVo1 : (resVo1 = new B14RespDetail()); } } 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 4f03984..f89d95a 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); + b14.getResponse().setResVo1(details.get(0)); }); } @@ -229,16 +229,13 @@ public interface LntrisB13_16Mapper extends AbstractMapper { */ default int insertB14Resps(LntrisB14 b14) { String b14Id = b14.getB14Id(); - List resps = b14.getResponse().getResVo1(); - if (isEmpty(b14Id) || resps.isEmpty()) return 0; + LntrisB14.B14RespDetail resp = b14.getResponse().getResVo1(); + if (isEmpty(b14Id)) return 0; - for (int i = 0; i < resps.size(); ++i) { - LntrisB14.B14RespDetail resp = resps.get(i); - resp.setB14Id(b14Id); - resp.setB14Sn(Integer.toString(i + 1)); - } + resp.setB14Id(b14Id); + resp.setB14Sn("1"); - return insertB14Resps(params().set("resps", resps)); + return insertB14Resps(params().set("resp", resp)); } /**주정차위반 과태료대장 상세 목록 조회 요청/응답을 등록한다. 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 19b6b1e..7a393b2 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().getResVo1().add(resp); + b14.getTargetMessage().getBody().setResVo1(resp); } b13_16Mapper.insertB14s(List.of(b14));