use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ExchangeModule-APP by UnionVMS.
the class MovementMapper method mapMobileTerminalIdList.
public static List<eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdList> mapMobileTerminalIdList(List<eu.europa.ec.fisheries.schema.exchange.movement.mobileterminal.v1.IdList> inList) {
List<eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdList> outList = new ArrayList<>();
for (eu.europa.ec.fisheries.schema.exchange.movement.mobileterminal.v1.IdList inId : inList) {
eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdList outId = new eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdList();
IdType idType = null;
switch(inId.getType()) {
case DNID:
idType = IdType.DNID;
break;
case LES:
idType = IdType.LES;
break;
case MEMBER_NUMBER:
idType = IdType.MEMBER_NUMBER;
break;
case SERIAL_NUMBER:
idType = IdType.SERIAL_NUMBER;
break;
}
outId.setType(idType);
outId.setValue(inId.getValue());
outList.add(outId);
}
return outList;
}
use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapToFLUXFAReportMessage.
@SneakyThrows
public FLUXFAReportMessage mapToFLUXFAReportMessage(List<FaReportDocumentEntity> faReportMessageEntity) {
FLUXFAReportMessage target = new FLUXFAReportMessage();
FLUXReportDocument fluxReportDocument = new FLUXReportDocument();
CodeType codeType = new CodeType();
codeType.setValue("9");
codeType.setListID("FLUX_GP_PURPOSE");
fluxReportDocument.setPurposeCode(codeType);
IDType idType = new IDType();
idType.setSchemeID("UUID");
idType.setValue(UUID.randomUUID().toString());
fluxReportDocument.setIDS(Collections.singletonList(idType));
DateTimeType dateTimeType = new DateTimeType();
dateTimeType.setDateTime(DateUtils.getCurrentDate());
fluxReportDocument.setCreationDateTime(dateTimeType);
TextType textType = new TextType();
textType.setValue("LOAD_REPORTS");
fluxReportDocument.setPurpose(textType);
FLUXParty party = new FLUXParty();
IDType idType1 = new IDType();
idType1.setSchemeID("FLUX_GP_PARTY");
idType1.setValue("TODO_SET_NODE_ALIAS");
party.setIDS(Collections.singletonList(idType1));
fluxReportDocument.setOwnerFLUXParty(party);
target.setFLUXReportDocument(fluxReportDocument);
if (CollectionUtils.isNotEmpty(faReportMessageEntity)) {
mapFAReportDocuments(target, faReportMessageEntity);
}
return target;
}
use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapIDs.
private void mapIDs(VesselTransportMeans vesselTransportMeans, Set<VesselIdentifierEntity> vesselIdentifiers) {
if (CollectionUtils.isNotEmpty(vesselIdentifiers)) {
List<IDType> idTypeList = new ArrayList<>();
for (VesselIdentifierEntity vesselIdentifierEntity : vesselIdentifiers) {
IDType idType = new IDType();
idType.setValue(vesselIdentifierEntity.getVesselIdentifierId());
idType.setSchemeID(vesselIdentifierEntity.getVesselIdentifierSchemeId());
idTypeList.add(idType);
}
vesselTransportMeans.setIDS(idTypeList);
}
}
use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapCountryID.
private void mapCountryID(RegistrationLocation target, RegistrationLocationEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
IDType idType = new IDType();
idType.setSchemeID(source.getLocationCountrySchemeId());
idType.setValue(source.getLocationCountryId());
target.setCountryID(idType);
}
}
use of eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method mapToFishingTripEntity.
private static FishingTripEntity mapToFishingTripEntity(FishingTrip fishingTrip) {
FishingTripEntity fishingTripEntity = FishingTripMapper.INSTANCE.mapToFishingTripEntity(fishingTrip);
List<IDType> ids = fishingTrip.getIDS();
if (CollectionUtils.isNotEmpty(ids)) {
for (IDType idType : ids) {
fishingTripEntity.addFishingTripIdentifiers(FishingTripIdentifierMapper.INSTANCE.mapToFishingTripIdentifier(idType));
}
}
List<DelimitedPeriod> specifiedDelimitedPeriods = fishingTrip.getSpecifiedDelimitedPeriods();
if (CollectionUtils.isNotEmpty(specifiedDelimitedPeriods)) {
for (DelimitedPeriod delimitedPeriod : specifiedDelimitedPeriods) {
fishingTripEntity.addDelimitedPeriods(DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodEntity(delimitedPeriod));
}
}
return fishingTripEntity;
}
Aggregations