use of un.unece.uncefact.data.standard.unqualifieddatatype._100.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapID.
private void mapID(VesselStorageCharacteristic target, VesselStorageCharacteristicsEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
IDType idType = new IDType();
idType.setSchemeID(source.getVesselSchemaId());
idType.setValue(source.getVesselId());
target.setID(idType);
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapRelatedReportIDs.
private void mapRelatedReportIDs(FAReportDocument target, Set<FaReportIdentifierEntity> faReportIdentifiers) {
if (CollectionUtils.isNotEmpty(faReportIdentifiers)) {
List<IDType> idTypeList = new ArrayList<>();
for (FaReportIdentifierEntity source : faReportIdentifiers) {
IDType idType = new IDType();
String faReportIdentifierId = source.getFaReportIdentifierId();
String faReportIdentifierSchemeId = source.getFaReportIdentifierSchemeId();
idType.setSchemeID(faReportIdentifierSchemeId);
idType.setValue(faReportIdentifierId);
idTypeList.add(idType);
}
target.setRelatedReportIDs(idTypeList);
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapRegistrationVesselCountry.
private void mapRegistrationVesselCountry(VesselTransportMeans target, String country, String schemeID) {
if (ObjectUtils.allNotNull(target)) {
VesselCountry vesselCountry = new VesselCountry();
IDType idType = new IDType();
idType.setValue(country);
idType.setSchemeID(schemeID);
vesselCountry.setID(idType);
target.setRegistrationVesselCountry(vesselCountry);
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class FaQueryFactory method createFaQueryForTrip.
public static FAQuery createFaQueryForTrip(String tripId, String sendTo, boolean consolidated) {
FAQuery faq = new FAQuery();
faq.setID(new IDType(UUID.randomUUID().toString(), "UUID", null, null, null, null, null, null));
faq.setTypeCode(new CodeType("TRIP", "FA_QUERY_TYPE", null, null, null, null, null, null, null, null));
try {
final XMLGregorianCalendar currentDate = DateUtils.getCurrentDate();
faq.setSubmittedDateTime(new DateTimeType(currentDate, null));
} catch (DatatypeConfigurationException e) {
log.error("[ERROR] Error while trying to create XMLGregorianCalendar () DateUtils.getCurrentDate()! Going to retry", e);
return null;
}
faq.setSubmitterFLUXParty(new FLUXParty(Collections.singletonList(new IDType(sendTo, "FLUX_GP_PARTY", null, null, null, null, null, null)), null));
faq.setSimpleFAQueryParameters(Arrays.asList(new FAQueryParameter(new CodeType("TRIPID", "FA_QUERY_PARAMETER", null, null, null, null, null, null, null, null), null, null, new IDType(tripId, "EU_TRIP_ID", null, null, null, null, null, null)), new FAQueryParameter(new CodeType("CONSOLIDATED", "FA_QUERY_PARAMETER", null, null, null, null, null, null, null, null), new CodeType(consolidated ? "Y" : "N", "BOOLEAN_VALUE", null, null, null, null, null, null, null, null), null, null)));
return faq;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class SubscriptionMapper method mapFAQueryParametersToSubscriptionCriteria.
private static List<SubscriptionDataCriteria> mapFAQueryParametersToSubscriptionCriteria(List<FAQueryParameter> faQueryParameters) {
List<SubscriptionDataCriteria> dataCriteriaList = new ArrayList<>();
for (FAQueryParameter faQueryParameter : faQueryParameters) {
SubscriptionDataCriteria criteria = new SubscriptionDataCriteria();
criteria.setCriteria(CriteriaType.VESSEL);
CodeType faQueryParameterTypeCode = faQueryParameter.getTypeCode();
if (faQueryParameterTypeCode != null) {
criteria.setSubCriteria(SubCriteriaType.valueOf(faQueryParameterTypeCode.getValue()));
}
IDType valueID = faQueryParameter.getValueID();
if (valueID != null) {
criteria.setValueType(ValueType.valueOf(faQueryParameter.getValueID().getSchemeID()));
criteria.setValue(faQueryParameter.getValueID().getValue());
}
CodeType valueCode = faQueryParameter.getValueCode();
if (valueCode != null) {
criteria.setValueType(ValueType.valueOf(faQueryParameter.getValueCode().getListID()));
criteria.setValue(faQueryParameter.getValueCode().getValue());
}
dataCriteriaList.add(criteria);
}
return dataCriteriaList;
}
Aggregations