use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapDestinationVesselStorageCharacteristic.
private void mapDestinationVesselStorageCharacteristic(FishingActivity target, VesselStorageCharacteristicsEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
VesselStorageCharacteristic vesselStorageCharacteristic = new VesselStorageCharacteristic();
mapID(vesselStorageCharacteristic, source);
mapVesselStorageCharCodes(vesselStorageCharacteristic, source.getVesselStorageCharCode());
target.setDestinationVesselStorageCharacteristic(vesselStorageCharacteristic);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity 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);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity 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);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity 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.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapSpecifiedFLUXCharacteristics.
private void mapSpecifiedFLUXCharacteristics(FishingActivity fishingActivity, Set<FluxCharacteristicEntity> fluxCharacteristics) {
if (CollectionUtils.isNotEmpty(fluxCharacteristics)) {
List<FLUXCharacteristic> fluxCharacteristicList = new ArrayList<>();
for (FluxCharacteristicEntity source : fluxCharacteristics) {
FLUXCharacteristic target = new FLUXCharacteristic();
mapPurposeCode(target, source);
mapValueCode(target, source);
mapValueDateTime(target, source);
mapValueIndicator(target, source);
mapValueQuantity(target, source);
mapValueMeasure(target, source);
mapDescriptions(target, source);
mapValues(target, source);
fluxCharacteristicList.add(target);
}
fishingActivity.setSpecifiedFLUXCharacteristics(fluxCharacteristicList);
}
}
Aggregations