use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapAcceptanceDateTime.
private void mapAcceptanceDateTime(FAReportDocument target, Date source) {
if (ObjectUtils.allNotNull(target, source)) {
DateTimeType dateTimeType = new DateTimeType();
dateTimeType.setDateTime(DateUtils.dateToXmlGregorian(source));
target.setAcceptanceDateTime(dateTimeType);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument 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);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapFMCMarkerCode.
private void mapFMCMarkerCode(FAReportDocument target, String fmcMarkerValue, String fmcMarkerListId) {
if (ObjectUtils.allNotNull(target) && (StringUtils.isNotEmpty(fmcMarkerValue) || StringUtils.isNotEmpty(fmcMarkerListId))) {
CodeType codeType = new CodeType();
if (StringUtils.isNotEmpty(fmcMarkerValue)) {
codeType.setValue(fmcMarkerValue);
}
if (StringUtils.isNotEmpty(fmcMarkerListId)) {
codeType.setListID(fmcMarkerListId);
}
target.setFMCMarkerCode(codeType);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapFishingActivities.
private void mapFishingActivities(FAReportDocument faReportDocument, Set<FishingActivityEntity> fishingActivityEntities) {
if (CollectionUtils.isNotEmpty(fishingActivityEntities)) {
List<FishingActivity> fishingActivityList = new ArrayList<>();
for (FishingActivityEntity source : fishingActivityEntities) {
FishingActivity target = new FishingActivity();
mapPurposeCode(target, source);
mapReasonCode(target, source);
mapOperationsQuantity(target, source);
mapFisheryTypeCode(target, source);
mapSpeciesTargetCode(target, source);
mapFishingDurationMeasure(target, source);
mapVesselRelatedActivityCode(target, source);
mapOccurrenceDateTime(target, source.getOccurence());
mapSourceVesselStorageCharacteristic(target, source.getSourceVesselCharId());
mapDestinationVesselStorageCharacteristic(target, source.getDestVesselCharId());
target.setRelatedFLUXLocations(FluxLocationMapper.INSTANCE.mapToFluxLocationList(source.getFluxLocations()));
mapSpecifiedFLUXCharacteristics(target, source.getFluxCharacteristics());
target.setSpecifiedDelimitedPeriods(DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodList(source.getDelimitedPeriods()));
List<FishingTrip> fishingTrips = FishingTripMapper.INSTANCE.mapToFishingTripList(source.getFishingTrips());
if (CollectionUtils.isNotEmpty(fishingTrips)) {
target.setSpecifiedFishingTrip(fishingTrips.get(0));
}
// TODO MAP
source.getFishingGears();
// TODO MAP
source.getFlagState();
// target.getSpecifiedFACatches() // TODO map
fishingActivityList.add(target);
}
faReportDocument.setSpecifiedFishingActivities(fishingActivityList);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapFAReportDocuments.
private void mapFAReportDocuments(FLUXFAReportMessage target, List<FaReportDocumentEntity> faReportDocuments) {
List<FAReportDocument> faReportDocumentList = new ArrayList<>();
for (FaReportDocumentEntity faReportDocumentEntity : faReportDocuments) {
FAReportDocument faReportDocument = new FAReportDocument();
mapFAReportDocument(faReportDocument, faReportDocumentEntity);
faReportDocumentList.add(faReportDocument);
}
target.setFAReportDocuments(faReportDocumentList);
}
Aggregations