|
|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
package cokr.xit.interfaces.sntris.service.bean;
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.foundation.component.AbstractBean;
|
|
|
|
|
@ -41,4 +44,31 @@ public class SntrisBean extends AbstractBean {
|
|
|
|
|
throw runtimeException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Map<String, Ye22NoticeInfoDTO> registerPreNotices(Ye22InputDTO input, Map<String, Bu18WebPreNoticeDTO> prenotices) {
|
|
|
|
|
Map<String, Bu18WebReturnInfoDTO> registered = prenotices.entrySet().stream().collect(Collectors.toMap(
|
|
|
|
|
entry -> entry.getKey(),
|
|
|
|
|
entry -> {
|
|
|
|
|
try {
|
|
|
|
|
return register(entry.getValue());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
Bu18WebReturnInfoDTO dto = new Bu18WebReturnInfoDTO();
|
|
|
|
|
dto.setReturnMsg(ifEmpty(e.getLocalizedMessage(), e::toString));
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
));
|
|
|
|
|
return registered.entrySet().stream().collect(Collectors.toMap(
|
|
|
|
|
entry -> entry.getKey(),
|
|
|
|
|
entry -> {
|
|
|
|
|
input.setBuAk(entry.getValue().getNoticeAk());
|
|
|
|
|
Ye22NoticeInfoDTO[] dtos = getPreNoticeList(input);
|
|
|
|
|
return switch (dtos.length) {
|
|
|
|
|
case 0 -> null;
|
|
|
|
|
case 1 -> dtos[0];
|
|
|
|
|
default -> throw new RuntimeException("Multiple prenotices returned");
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|