Search in sources :

Example 36 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method setGeopoliticalRegionCode.

private void setGeopoliticalRegionCode(RegistrationLocation target, RegistrationLocationEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        CodeType codeType = new CodeType();
        codeType.setListID(source.getRegionCodeListId());
        codeType.setValue(source.getRegionCode());
        target.setGeopoliticalRegionCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 37 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType 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 38 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method setRoleCode.

private void setRoleCode(VesselTransportMeans target, String roleCodeListId, String roleCodeListValue) {
    if (ObjectUtils.allNotNull(target)) {
        CodeType codeType = new CodeType();
        codeType.setValue(roleCodeListValue);
        codeType.setListID(roleCodeListId);
        target.setRoleCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 39 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapVesselRelatedActivityCode.

private void mapVesselRelatedActivityCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source) && (StringUtils.isNotEmpty(source.getVesselActivityCode()) || StringUtils.isNotEmpty(source.getVesselActivityCodeListId()))) {
        CodeType codeType = new CodeType();
        if (StringUtils.isNotEmpty(source.getVesselActivityCode())) {
            codeType.setValue(source.getVesselActivityCode());
        }
        if (StringUtils.isNotEmpty(source.getVesselActivityCodeListId())) {
            codeType.setListID(source.getVesselActivityCodeListId());
        }
        target.setVesselRelatedActivityCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 40 with CodeType

use of org.geotoolkit.ows.xml.v110.CodeType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapFisheryTypeCode.

private void mapFisheryTypeCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source) && (StringUtils.isNotEmpty(source.getFisheryTypeCode()) || StringUtils.isNotEmpty(source.getFisheryTypeCodeListId()))) {
        CodeType codeType = new CodeType();
        if (StringUtils.isNotEmpty(source.getFisheryTypeCode())) {
            codeType.setValue(source.getFisheryTypeCode());
        }
        if (StringUtils.isNotEmpty(source.getFisheryTypeCodeListId())) {
            codeType.setListID(source.getFisheryTypeCodeListId());
        }
        target.setFisheryTypeCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Aggregations

CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)46 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)15 ArrayList (java.util.ArrayList)13 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)10 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)9 BigDecimal (java.math.BigDecimal)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