B14 수정

master
mjkhan21 11 months ago
parent 623c8307b5
commit 165ec31e1d

@ -1,5 +1,8 @@
package cokr.xit.interfaces.lntris.special.b; package cokr.xit.interfaces.lntris.special.b;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.interfaces.lntris.SourceMessage; import cokr.xit.interfaces.lntris.SourceMessage;
@ -74,10 +77,10 @@ public class LntrisB14 extends SpecialInterface<LntrisB14.B14Request, LntrisB14.
*/ */
@Setter @Setter
public static class B14Response extends TargetMessage.Response { public static class B14Response extends TargetMessage.Response {
private B14RespDetail resVo1; private List<B14RespDetail> resVo1;
public B14RespDetail getResVo1() { public List<B14RespDetail> getResVo1() {
return resVo1 != null ? resVo1 : (resVo1 = new B14RespDetail()); return resVo1 != null ? resVo1 : (resVo1 = new ArrayList<>());
} }
} }

@ -164,7 +164,7 @@ public interface LntrisB13_16Mapper extends AbstractMapper {
Map<String, List<LntrisB14.B14RespDetail>> byB14Id = resps.stream().collect(Collectors.groupingBy(LntrisB14.B14RespDetail::getB14Id)); Map<String, List<LntrisB14.B14RespDetail>> byB14Id = resps.stream().collect(Collectors.groupingBy(LntrisB14.B14RespDetail::getB14Id));
b14s.forEach(b14 -> { b14s.forEach(b14 -> {
List<LntrisB14.B14RespDetail> details = byB14Id.get(b14.getB14Id()); List<LntrisB14.B14RespDetail> 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) { default int insertB14Resps(LntrisB14 b14) {
String b14Id = b14.getB14Id(); String b14Id = b14.getB14Id();
LntrisB14.B14RespDetail resp = b14.getResponse().getResVo1(); List<LntrisB14.B14RespDetail> resps = b14.getResponse().getResVo1();
if (isEmpty(b14Id)) return 0; if (isEmpty(b14Id) || resps.isEmpty()) return 0;
for (int i = 0; i < resps.size(); ++i) {
LntrisB14.B14RespDetail resp = resps.get(i);
resp.setB14Id(b14Id); resp.setB14Id(b14Id);
resp.setB14Sn("1"); resp.setB14Sn(Integer.toString(i + 1));
}
return insertB14Resps(params().set("resp", resp)); return insertB14Resps(params().set("resps", resps));
} }
/** / . /** / .

@ -661,8 +661,8 @@ INSERT INTO TB_NIS_SPCL_B14RV (
, RGTR <!-- 등록자 --> , RGTR <!-- 등록자 -->
, MDFCN_DT <!-- 수정 일시 --> , MDFCN_DT <!-- 수정 일시 -->
, MDFR <!-- 수정자 --> , MDFR <!-- 수정자 -->
) VALUES ( )<foreach collection="resps" item="resp" separator=" UNION">
#{resp.b14Id} <!-- 일련번호 ID --> SELECT #{resp.b14Id} <!-- 일련번호 ID -->
, #{resp.b14Sn} <!-- 일련번호 --> , #{resp.b14Sn} <!-- 일련번호 -->
, #{resp.sgbCd} <!-- 자치단체코드 --> , #{resp.sgbCd} <!-- 자치단체코드 -->
, #{resp.sgbNm} <!-- 자치단체명 --> , #{resp.sgbNm} <!-- 자치단체명 -->
@ -770,7 +770,7 @@ INSERT INTO TB_NIS_SPCL_B14RV (
, #{currentUser.id} <!-- 등록자 --> , #{currentUser.id} <!-- 등록자 -->
,<include refid="utility.now" /> <!-- 수정 일시 --> ,<include refid="utility.now" /> <!-- 수정 일시 -->
, #{currentUser.id} <!-- 수정자 --> , #{currentUser.id} <!-- 수정자 -->
)</insert> FROM DUAL</foreach></insert>
<resultMap id="b15ReqRow" type="cokr.xit.interfaces.lntris.special.b.LntrisB15"> <!-- 전용차로위반 과태료 대장 목록 요청 --> <resultMap id="b15ReqRow" type="cokr.xit.interfaces.lntris.special.b.LntrisB15"> <!-- 전용차로위반 과태료 대장 목록 요청 -->
<result property="b15Id" column="B15_ID" /> <!-- 일련번호 ID --> <result property="b15Id" column="B15_ID" /> <!-- 일련번호 ID -->

@ -1244,7 +1244,7 @@ public class LntrisBServiceTest extends TestSupport {
resp.setRprsTxmCd(rprsTxmCd); resp.setRprsTxmCd(rprsTxmCd);
resp.setVhrno(vhrNo); resp.setVhrno(vhrNo);
b14.getTargetMessage().getBody().setResVo1(resp); b14.getTargetMessage().getBody().getResVo1().add(resp);
} }
b13_16Mapper.insertB14s(List.of(b14)); b13_16Mapper.insertB14s(List.of(b14));

Loading…
Cancel
Save