Search in sources :

Example 16 with IdType

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;
}
Also used : ArrayList(java.util.ArrayList) IdType(eu.europa.ec.fisheries.schema.rules.mobileterminal.v1.IdType) AssetIdType(eu.europa.ec.fisheries.schema.rules.asset.v1.AssetIdType)

Example 17 with IdType

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;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) FLUXFAReportMessage(un.unece.uncefact.data.standard.fluxfareportmessage._3.FLUXFAReportMessage) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType) SneakyThrows(lombok.SneakyThrows)

Example 18 with IdType

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);
    }
}
Also used : VesselIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity) ArrayList(java.util.ArrayList) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Example 19 with IdType

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);
    }
}
Also used : IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Example 20 with 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;
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Aggregations

IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)31 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)14 ArrayList (java.util.ArrayList)9 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)7 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)7 HashSet (java.util.HashSet)5 FLUXParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty)5 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)4 FLUXReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument)4 FAQueryParameter (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter)3 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)3 FaReportIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FaReportIdentifierEntity)2 FluxPartyIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity)2 VesselIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity)2 SubscriptionDataCriteria (eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataCriteria)2 GregorianCalendar (java.util.GregorianCalendar)2 List (java.util.List)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 SneakyThrows (lombok.SneakyThrows)2 Before (org.junit.Before)2