use of org.geotoolkit.gml.xml.v311.CodeType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapVesselStorageCharCodes.
private void mapVesselStorageCharCodes(VesselStorageCharacteristic target, Set<VesselStorageCharCodeEntity> vesselStorageCharCode) {
if (CollectionUtils.isNotEmpty(vesselStorageCharCode) && target != null) {
List<CodeType> codeTypeList = new ArrayList<>();
for (VesselStorageCharCodeEntity source : vesselStorageCharCode) {
CodeType codeType = new CodeType();
codeType.setValue(source.getVesselTypeCode());
codeType.setListID(source.getVesselTypeCodeListId());
codeTypeList.add(codeType);
}
target.setTypeCodes(codeTypeList);
}
}
use of org.geotoolkit.gml.xml.v311.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);
}
}
use of org.geotoolkit.gml.xml.v311.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;
}
use of org.geotoolkit.gml.xml.v311.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);
}
}
use of org.geotoolkit.gml.xml.v311.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);
}
}
Aggregations