Search in sources :

Example 16 with DateTimeType

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

the class ActivityEntityToModelMapper method mapOccurrenceDateTime.

private void mapOccurrenceDateTime(FishingActivity target, Date source) {
    if (ObjectUtils.allNotNull(target, source)) {
        DateTimeType dateTimeType = new DateTimeType();
        dateTimeType.setDateTime(DateUtils.dateToXmlGregorian(source));
        target.setOccurrenceDateTime(dateTimeType);
    }
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)

Example 17 with DateTimeType

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

the class MapperUtil method getDelimitedPeriod.

public static DelimitedPeriod getDelimitedPeriod() {
    DateTimeType startDate = getDateTimeType("2011-07-01 11:15:00");
    DateTimeType endDate = getDateTimeType("2016-07-01 11:15:00");
    MeasureType measureType = getMeasureType(500, "C62", "4rhfy5-fhtydr-tyfr85-ghtyd54");
    DelimitedPeriod delimitedPeriod = new DelimitedPeriod(startDate, endDate, measureType);
    return delimitedPeriod;
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)

Example 18 with DateTimeType

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

the class MapperUtil method getDateTimeType.

private static DateTimeType getDateTimeType(String value) {
    try {
        DateTimeType dateTimeType = new DateTimeType();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(df.parse(value));
        XMLGregorianCalendar xmlDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND), DatatypeConstants.FIELD_UNDEFINED, cal.getTimeZone().LONG).normalize();
        dateTimeType.setDateTime(xmlDate);
        return dateTimeType;
    } catch (Exception e) {
        return null;
    }
}
Also used : XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) GregorianCalendar(java.util.GregorianCalendar) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) SimpleDateFormat(java.text.SimpleDateFormat) ParseException(com.vividsolutions.jts.io.ParseException)

Example 19 with DateTimeType

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

the class MapperUtil method getGearCharacteristics.

public static GearCharacteristic getGearCharacteristics() {
    CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<TextType> descriptions = Arrays.asList(getTextType("This is sample text"));
    MeasureType valueMeasure = getMeasureType(123, "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 type 1", "4fhry5-thfyr85-67thf-5htr84");
    TextType value = getTextType("This is sample Text");
    QuantityType valueQuantity = getQuantityType(123);
    List<FLUXLocation> specifiedFluxLocations = Arrays.asList(getFluxLocation());
    GearCharacteristic gearCharacteristic = new GearCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, value, valueQuantity, specifiedFluxLocations);
    return gearCharacteristic;
}
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) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) GearCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 20 with DateTimeType

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

the class MapperUtil method getFaReportDocument.

public static FAReportDocument getFaReportDocument() {
    CodeType typeCode = getCodeType("DECLARATION", "FLUX_FA_REPORT_TYPE");
    CodeType fmcMarkerCode = getCodeType("Fmz marker 1", "h49rh-fhrus33-fj84hjs82-4h84hw82");
    List<IDType> relatedReportIDs = Arrays.asList(getIdType("ID 1", "47rfh-5hry4-thfur75-4hf743"));
    DateTimeType acceptanceDateTime = getDateTimeType("2016-07-01 11:15:00");
    FLUXReportDocument relatedFLUXReportDocument = getFluxReportDocument();
    List<FishingActivity> specifiedFishingActivities = Arrays.asList(getFishingActivity());
    VesselTransportMeans specifiedVesselTransportMeans = getVesselTransportMeans();
    FAReportDocument faReportDocument = new FAReportDocument(typeCode, fmcMarkerCode, relatedReportIDs, acceptanceDateTime, relatedFLUXReportDocument, specifiedFishingActivities, specifiedVesselTransportMeans);
    return faReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) 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) FAReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)

Aggregations

DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)17 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)9 BigDecimal (java.math.BigDecimal)7 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)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 Nonnull (javax.annotation.Nonnull)6 Nullable (javax.annotation.Nullable)6 CrossIndustryInvoiceType (un.unece.uncefact.data.standard.crossindustryinvoice._100.CrossIndustryInvoiceType)6 FormattedDateTimeType (un.unece.uncefact.data.standard.qualifieddatatype._100.FormattedDateTimeType)6