B14 응답포맷 원복

master
mjkhan21 11 months ago
parent 165ec31e1d
commit 25a780dd27

@ -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<LntrisB14.B14Request, LntrisB14.
*/
@Setter
public static class B14Response extends TargetMessage.Response {
private List<B14RespDetail> resVo1;
private B14RespDetail resVo1;
public List<B14RespDetail> getResVo1() {
return resVo1 != null ? resVo1 : (resVo1 = new ArrayList<>());
public B14RespDetail getResVo1() {
return resVo1 != null ? resVo1 : (resVo1 = new B14RespDetail());
}
}

@ -164,7 +164,7 @@ public interface LntrisB13_16Mapper extends AbstractMapper {
Map<String, List<LntrisB14.B14RespDetail>> byB14Id = resps.stream().collect(Collectors.groupingBy(LntrisB14.B14RespDetail::getB14Id));
b14s.forEach(b14 -> {
List<LntrisB14.B14RespDetail> 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<LntrisB14.B14RespDetail> 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.setB14Sn("1");
return insertB14Resps(params().set("resps", resps));
return insertB14Resps(params().set("resp", resp));
}
/** / .

@ -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));

Loading…
Cancel
Save