use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapIDs.
private void mapIDs(VesselTransportMeans vesselTransportMeans, Set<VesselIdentifierEntity> vesselIdentifiers) {
if (CollectionUtils.isNotEmpty(vesselIdentifiers)) {
List<IDType> idTypeList = new ArrayList<>();
for (VesselIdentifierEntity vesselIdentifierEntity : vesselIdentifiers) {
IDType idType = new IDType();
idType.setValue(vesselIdentifierEntity.getVesselIdentifierId());
idType.setSchemeID(vesselIdentifierEntity.getVesselIdentifierSchemeId());
idTypeList.add(idType);
}
vesselTransportMeans.setIDS(idTypeList);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapSpecifiedVesselTransportMeans.
private void mapSpecifiedVesselTransportMeans(FAReportDocument target, Set<VesselTransportMeansEntity> entities) {
if (CollectionUtils.isNotEmpty(entities) && target != null) {
VesselTransportMeans vesselTransportMeans = new VesselTransportMeans();
VesselTransportMeansEntity source = entities.iterator().next();
setRoleCode(vesselTransportMeans, source.getRoleCodeListId(), source.getRoleCode());
mapNames(vesselTransportMeans, source.getName());
mapRegistrationVesselCountry(vesselTransportMeans, source.getCountry(), source.getCountrySchemeId());
mapRegistrationEvent(vesselTransportMeans, source.getRegistrationEvent());
mapIDs(vesselTransportMeans, source.getVesselIdentifiers());
mapSpecifiedContactParties(vesselTransportMeans, source.getContactParty());
vesselTransportMeans.setGrantedFLAPDocuments(FlapDocumentMapper.INSTANCE.mapToFlapDocumentList(source.getFlapDocuments()));
target.setSpecifiedVesselTransportMeans(vesselTransportMeans);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapSpecifiedContactParties.
private void mapSpecifiedContactParties(VesselTransportMeans target, Set<ContactPartyEntity> contactPartyEntities) {
ArrayList<ContactParty> contactParties = new ArrayList<>();
if (CollectionUtils.isNotEmpty(contactPartyEntities)) {
for (ContactPartyEntity source : contactPartyEntities) {
ContactParty contactParty = new ContactParty();
ContactPerson contactPerson = ContactPersonMapper.INSTANCE.mapToContactPerson(source.getContactPerson());
if (contactPerson != null) {
// TODO @Greg mapstruct add non-iterable type
contactParty.setSpecifiedContactPersons(Collections.singletonList(contactPerson));
}
mapRoles(contactParty, source.getContactPartyRole());
contactParty.setSpecifiedStructuredAddresses(StructuredAddressMapper.INSTANCE.mapToStructuredAddressList(source.getStructuredAddresses()));
contactParties.add(contactParty);
}
}
target.setSpecifiedContactParties(contactParties);
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityMapper method getVesselTransportMeansEntity.
protected Set<VesselTransportMeansEntity> getVesselTransportMeansEntity(FishingActivity fishingActivity, FaReportDocumentEntity faReportDocumentEntity, FishingActivityEntity fishingActivityEntity) {
List<VesselTransportMeans> vesselList = fishingActivity.getRelatedVesselTransportMeans();
if (vesselList == null || vesselList.isEmpty()) {
return null;
}
Set<VesselTransportMeansEntity> vesselTransportMeansEntities = new HashSet<>();
for (VesselTransportMeans vesselTransportMeans : vesselList) {
VesselTransportMeansEntity vesselTransportMeansEntity = VesselTransportMeansMapper.INSTANCE.mapToVesselTransportMeansEntity(vesselTransportMeans);
vesselTransportMeansEntity.setFaReportDocument(faReportDocumentEntity);
vesselTransportMeansEntity.setFishingActivity(fishingActivityEntity);
vesselTransportMeansEntities.add(vesselTransportMeansEntity);
}
return vesselTransportMeansEntities;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityMapper method getFlagState.
protected String getFlagState(FishingActivity fishingActivity) {
List<VesselTransportMeans> vesselList = fishingActivity.getRelatedVesselTransportMeans();
if (CollectionUtils.isEmpty(vesselList)) {
return null;
}
VesselTransportMeans vesselTransportMeans = vesselList.get(0);
if (vesselTransportMeans == null)
return null;
return getCountry(vesselTransportMeans.getRegistrationVesselCountry());
}
Aggregations