Search in sources :

Example 1 with IDType

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

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

Example 3 with IDType

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

Example 4 with IDType

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;
}
Also used : FAQueryParameter(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) DatatypeConfigurationException(javax.xml.datatype.DatatypeConfigurationException) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) FAQuery(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQuery) 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)

Example 5 with IDType

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;
}
Also used : FAQueryParameter(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter) ArrayList(java.util.ArrayList) SubscriptionDataCriteria(eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionDataCriteria) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Aggregations

IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)34 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)15 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._100.IDType)12 ArrayList (java.util.ArrayList)11 Nullable (javax.annotation.Nullable)9 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType)9 BigDecimal (java.math.BigDecimal)7 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)7 CGlobal (com.helger.commons.CGlobal)6 ValueEnforcer (com.helger.commons.ValueEnforcer)6 CollectionHelper (com.helger.commons.collection.CollectionHelper)6 EqualsHelper (com.helger.commons.equals.EqualsHelper)6 ErrorList (com.helger.commons.error.list.ErrorList)6 IErrorList (com.helger.commons.error.list.IErrorList)6 MathHelper (com.helger.commons.math.MathHelper)6 ETriState (com.helger.commons.state.ETriState)6 StringHelper (com.helger.commons.string.StringHelper)6 Serializable (java.io.Serializable)6 LocalDate (java.time.LocalDate)6 Consumer (java.util.function.Consumer)6