use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty 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 un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxPartyMapper method mapFluxPartyIdentifiers.
private void mapFluxPartyIdentifiers(FLUXParty target, Set<FluxPartyIdentifierEntity> fluxPartyIdentifierEntities) {
if (CollectionUtils.isNotEmpty(fluxPartyIdentifierEntities)) {
List<IDType> idTypeList = new ArrayList<>();
for (FluxPartyIdentifierEntity source : fluxPartyIdentifierEntities) {
IDType idType = new IDType();
String fluxPartyIdentifierId = source.getFluxPartyIdentifierId();
String fluxPartyIdentifierSchemeId = source.getFluxPartyIdentifierSchemeId();
idType.setSchemeID(fluxPartyIdentifierSchemeId);
idType.setValue(fluxPartyIdentifierId);
idTypeList.add(idType);
}
target.setIDS(idTypeList);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxPartyMapper method mapNamesAndLanguageId.
private void mapNamesAndLanguageId(FLUXParty target, String fluxPartyName, String nameLanguageId) {
if (ObjectUtils.allNotNull(target) && (StringUtils.isNotEmpty(fluxPartyName) || StringUtils.isNotEmpty(nameLanguageId))) {
TextType textType = new TextType();
if (StringUtils.isNotEmpty(fluxPartyName)) {
textType.setValue(fluxPartyName);
}
if (StringUtils.isNotEmpty(nameLanguageId)) {
textType.setLanguageID(fluxPartyName);
}
target.setNames(singletonList(textType));
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.
the class SubscriptionMapper method mapFluxPartyToSenderSubscriptionCriteria.
private static List<SubscriptionDataCriteria> mapFluxPartyToSenderSubscriptionCriteria(FLUXParty party) {
List<SubscriptionDataCriteria> dataCriteriaList = new ArrayList<>();
List<IDType> organisationIds = party.getIDS();
for (IDType organisationId : organisationIds) {
if ("FLUX_GP_PARTY".equals(organisationId.getSchemeID())) {
String value = organisationId.getValue();
dataCriteriaList.add(createCriteria(SENDER, ORGANISATION, SCHEME_ID, value));
}
}
return dataCriteriaList;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getFluxReportDocument.
public static FLUXReportDocument getFluxReportDocument() {
List<IDType> ids = Arrays.asList(getIdType("flux_report_doc_1", "fhty58-gh586t-5tjf8-t58rjewe"));
IDType referencedID = getIdType("Ref ID 1", "fhty58-gh586t-5tjf8-t58rjewe");
DateTimeType creationDateTime = getDateTimeType("2016-07-01 11:15:00");
CodeType purposeCode = getCodeType("5", "FLUX_GP_PURPOSE");
final TextType purpose = getTextType("Purpose Text");
CodeType typeCode = getCodeType("FluxReportTypeCode", "fhty58-gh586t-5tjf8-t58rjewe");
FLUXParty ownerFLUXParty = new FLUXParty(Arrays.asList(getIdType("Owner flux party id 1", "58fjrut-tjfuri-586jte-5jfur")), Arrays.asList(getTextType("This is sample text for owner flux party")));
FLUXReportDocument fluxReportDocument = new FLUXReportDocument(ids, referencedID, creationDateTime, purposeCode, purpose, typeCode, ownerFLUXParty);
return fluxReportDocument;
}
Aggregations