use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapRoles.
private void mapRoles(ContactParty target, Set<ContactPartyRoleEntity> contactPartyRoleEntities) {
List<CodeType> codeTypeList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(contactPartyRoleEntities)) {
for (ContactPartyRoleEntity source : contactPartyRoleEntities) {
CodeType codeType = new CodeType();
codeType.setValue(source.getRoleCode());
codeType.setListID(source.getRoleCodeListId());
codeTypeList.add(codeType);
}
}
target.setRoleCodes(codeTypeList);
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty 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.ContactParty in project UVMS-ActivityModule-APP by UnionVMS.
the class VesselTransportMeansMapper method getContactPartyEntity.
protected Set<ContactPartyEntity> getContactPartyEntity(List<ContactParty> contactParties, VesselTransportMeansEntity vesselTransportMeansEntity) {
if (contactParties == null || contactParties.isEmpty()) {
return Collections.emptySet();
}
Set<ContactPartyEntity> contactPartyEntities = new HashSet<>();
for (ContactParty contactParty : contactParties) {
ContactPartyEntity contactPartyEntity = ContactPartyMapper.INSTANCE.mapToContactPartyEntity(contactParty, vesselTransportMeansEntity);
contactPartyEntity.setVesselTransportMeans(vesselTransportMeansEntity);
contactPartyEntities.add(contactPartyEntity);
}
return contactPartyEntities;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getContactParty.
public static ContactParty getContactParty() {
ContactParty contactParty = new ContactParty();
CodeType roleCode = getCodeType("MASTER", "FLUX_CONTACT_ ROLE");
contactParty.setRoleCodes(Arrays.asList(roleCode));
contactParty.setSpecifiedContactPersons(Arrays.asList(getContactPerson()));
contactParty.setSpecifiedStructuredAddresses(Arrays.asList(getStructuredAddress()));
return contactParty;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getVesselTransportMeans.
public static VesselTransportMeans getVesselTransportMeans() {
VesselTransportMeans vesselTransportMeans = new VesselTransportMeans();
CodeType roleCode = getCodeType("CATCHING_VESSEL", "FA_VESSEL_ROLE");
List<TextType> names = Arrays.asList(getTextType("Test Name"));
List<FLAPDocument> grantedFLAPDocuments = Arrays.asList(getFlapDocument());
List<IDType> ids = Arrays.asList(getIdType("ID 1", "CFR"));
List<ContactParty> specifiedContactParties = Arrays.asList(getContactParty());
List<RegistrationEvent> specifiedRegistrationEvents = Arrays.asList(getRegistrationEvent());
VesselCountry vesselCounty = new VesselCountry(getIdType("Country Id 1", "tu587r-5jt85-tjfur7-tjgut7"));
vesselTransportMeans.setRoleCode(roleCode);
vesselTransportMeans.setNames(names);
vesselTransportMeans.setGrantedFLAPDocuments(grantedFLAPDocuments);
vesselTransportMeans.setIDS(ids);
vesselTransportMeans.setSpecifiedContactParties(specifiedContactParties);
vesselTransportMeans.setSpecifiedRegistrationEvents(specifiedRegistrationEvents);
vesselTransportMeans.setRegistrationVesselCountry(vesselCounty);
return vesselTransportMeans;
}
Aggregations