Search in sources :

Example 1 with DateTimeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFLUXReportDocument.

public static FLUXReportDocument getFLUXReportDocument() {
    new FLUXReportDocument();
    List<IDType> ids = Arrays.asList(getIdType("FLUX_REPORT_ID_1", "FLUX_SCHEME_ID1"));
    IDType referenceId = getIdType("REF_ID 1", "47rfh-5hry4-thfur75-4hf743");
    DateTimeType creationDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType purposeCode = getCodeType("9", "FLUX_GP_PURPOSE");
    CodeType typeCode = getCodeType("type Code1", "fhr574fh-thrud754-kgitjf754-gjtufe89");
    List<IDType> ownerFluxPartyId = Arrays.asList(getIdType("Owner_flux_party_id_1", "flux_Party_scheme_id"));
    List<TextType> names = Arrays.asList(getTextType("fluxPartyOwnerName 1"));
    FLUXParty fluxParty = new FLUXParty(ownerFluxPartyId, names);
    FLUXReportDocument fluxReportDocument = new FLUXReportDocument(ids, referenceId, creationDateTime, purposeCode, getTextType("Purpose"), typeCode, fluxParty);
    return fluxReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) 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)

Example 2 with DateTimeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getStandardFishingActivity.

private static FishingActivity getStandardFishingActivity() {
    List<IDType> ids = Arrays.asList(getIdType("Id_1", "fhr574fh-thrud754-kgitjf754-gjtufe89"));
    CodeType typeCode = getCodeType("FISHING_OPERATION", "FLUX_FA_TYPE");
    DateTimeType occurrenceDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType reasonCode = getCodeType("Reason_code_1", "FA_REASON_DEPARTURE");
    CodeType vesselRelatedActivityCode = getCodeType("Vessel activity 1", "58thft-58fjd8-gt85eje-hjgute8");
    CodeType fisheryTypeCode = getCodeType("Fishing_Type_code 1", "FA_FISHERY");
    CodeType speciesTargetCode = getCodeType("Species code 1", "FAO_SPECIES");
    QuantityType operationsQuantity = getQuantityType(100);
    MeasureType fishingDurationMeasure = getMeasureType(500, "C62", "4hr2yf0-t583thf-6jgttue8-6jtie844");
    List<FLAPDocument> specifiedFLAPDocument = Arrays.asList(getFlapDocument());
    VesselStorageCharacteristic sourceVesselStorageCharacteristic = getVesselStorageCharacteristic();
    VesselStorageCharacteristic destinationVesselStorageCharacteristic = getVesselStorageCharacteristic();
    List<FACatch> specifiedFACatches = Arrays.asList(getFaCatch());
    List<FLUXLocation> relatedFLUXLocations = Arrays.asList(getFluxLocation());
    List<GearProblem> specifiedGearProblems = Arrays.asList(getGearProblem());
    List<FLUXCharacteristic> specifiedFLUXCharacteristics = Arrays.asList(getFluxCharacteristics());
    List<FishingGear> specifiedFishingGears = Arrays.asList(getFishingGear());
    List<DelimitedPeriod> specifiedDelimitedPeriods = Arrays.asList(getDelimitedPeriod());
    FishingTrip specifiedFishingTrip = getFishingTrip();
    List<VesselTransportMeans> relatedVesselTransportMeans = Arrays.asList(getVesselTransportMeans());
    FishingActivity fishingActivity = new FishingActivity(ids, typeCode, occurrenceDateTime, reasonCode, vesselRelatedActivityCode, fisheryTypeCode, speciesTargetCode, operationsQuantity, fishingDurationMeasure, specifiedFACatches, relatedFLUXLocations, specifiedGearProblems, specifiedFLUXCharacteristics, specifiedFishingGears, sourceVesselStorageCharacteristic, destinationVesselStorageCharacteristic, null, specifiedFLAPDocument, specifiedDelimitedPeriods, specifiedFishingTrip, relatedVesselTransportMeans);
    return fishingActivity;
}
Also used : DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) GearProblem(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearProblem) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) VesselStorageCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) FACatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)

Example 3 with DateTimeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getRegistrationEvent.

public static RegistrationEvent getRegistrationEvent() {
    List<TextType> descriptions = Arrays.asList(getTextType("This is test Text"));
    DateTimeType occurrenceDateTime = getDateTimeType("2016-07-01 11:15:00");
    RegistrationLocation relatedRegistrationLocation = getRegistrationLocation();
    RegistrationEvent registrationEvent = new RegistrationEvent(descriptions, occurrenceDateTime, relatedRegistrationLocation);
    return registrationEvent;
}
Also used : RegistrationLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) RegistrationEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 4 with DateTimeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFluxCharacteristics.

public static FLUXCharacteristic getFluxCharacteristics() {
    CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<TextType> descriptions = Arrays.asList(getTextType("This is test description"));
    MeasureType valueMeasure = getMeasureType(333, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
    DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
    IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
    CodeType valueCode = getCodeType("Code Value 1", "57tr4t3yf-ght43yrf-ght56yr5u-ght75365h");
    List<TextType> values = Arrays.asList(getTextType("This is sample value"));
    QuantityType valueQuantity = getQuantityType(123);
    List<FLUXLocation> specifiedFLUXLocations = null;
    List<FLAPDocument> relatedFLAPDocuments = Arrays.asList(getFlapDocument());
    FLUXCharacteristic fluxCharacteristic = new FLUXCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, values, valueQuantity, specifiedFLUXLocations, relatedFLAPDocuments);
    return fluxCharacteristic;
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) IndicatorType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 5 with DateTimeType

use of un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityMapper method getCalculatedStartTime.

protected DateTimeType getCalculatedStartTime(FishingActivity fishingActivity) {
    if (fishingActivity == null)
        return null;
    DateTimeType dateTimeType = null;
    if (fishingActivity.getOccurrenceDateTime() != null)
        return fishingActivity.getOccurrenceDateTime();
    if (CollectionUtils.isNotEmpty(fishingActivity.getSpecifiedDelimitedPeriods())) {
        List<DelimitedPeriod> delimitedPeriodEntities = fishingActivity.getSpecifiedDelimitedPeriods();
        dateTimeType = delimitedPeriodEntities.iterator().next().getStartDateTime();
        if (dateTimeType != null) {
            return dateTimeType;
        }
    }
    // We reached till this point of code means FishingActivity has neither occurrence date or startDate for DelimitedPeriod.
    // In such cases, we need to check if its subactivities have date mentioned.
    // If yes, then take the first subactivity occurrence date and consider it as start date for parent fishing activity
    List<FishingActivity> relatedFishingActivities = fishingActivity.getRelatedFishingActivities();
    if (CollectionUtils.isNotEmpty(relatedFishingActivities)) {
        for (FishingActivity subFishingActivity : relatedFishingActivities) {
            if (subFishingActivity.getOccurrenceDateTime() != null || (CollectionUtils.isNotEmpty(fishingActivity.getSpecifiedDelimitedPeriods()) && fishingActivity.getSpecifiedDelimitedPeriods().iterator().next().getStartDateTime() != null)) {
                dateTimeType = subFishingActivity.getOccurrenceDateTime();
                if (dateTimeType == null) {
                    dateTimeType = fishingActivity.getSpecifiedDelimitedPeriods().iterator().next().getStartDateTime();
                }
                return dateTimeType;
            }
        }
    }
    return null;
}
Also used : FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)

Aggregations

DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)17 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)9 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)7 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)6 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 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)4 GregorianCalendar (java.util.GregorianCalendar)3 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)3 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)3 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)3 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)3 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 SneakyThrows (lombok.SneakyThrows)2 FAQuery (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQuery)2 FAQueryParameter (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAQueryParameter)2 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)2 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)2