use of eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method deleteDuplicatedReportsFromXMLDocument.
private void deleteDuplicatedReportsFromXMLDocument(FLUXFAReportMessage repMsg) {
GetNonUniqueIdsRequest getNonUniqueIdsRequest = null;
try {
getNonUniqueIdsRequest = ActivityModuleRequestMapper.mapToGetNonUniqueIdRequestObject(collectAllIdsFromMessage(repMsg));
} catch (ActivityModelMarshallException e) {
log.error("[ERROR] Error while trying to get the unique ids from FaReportDocumentIdentifiers table...");
}
GetNonUniqueIdsResponse matchingIdsResponse = matchingIdsService.getMatchingIdsResponse(getNonUniqueIdsRequest.getActivityUniquinessLists());
List<ActivityUniquinessList> activityUniquinessLists = matchingIdsResponse.getActivityUniquinessLists();
final List<FAReportDocument> faReportDocuments = repMsg.getFAReportDocuments();
if (CollectionUtils.isNotEmpty(activityUniquinessLists)) {
for (ActivityUniquinessList unique : activityUniquinessLists) {
deleteBranchesThatMatchWithTheIdsList(unique.getIds(), faReportDocuments);
}
}
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityMatchingIdsServiceBean method getMatchingIdsResponse.
public GetNonUniqueIdsResponse getMatchingIdsResponse(List<ActivityUniquinessList> activityUniquinessLists) {
if (CollectionUtils.isEmpty(activityUniquinessLists)) {
return null;
}
GetNonUniqueIdsResponse response = new GetNonUniqueIdsResponse();
List<ActivityUniquinessList> activityUniquinessResponseLists = new ArrayList<>();
response.setMethod(ActivityModuleMethod.GET_NON_UNIQUE_IDS);
response.setActivityUniquinessLists(activityUniquinessResponseLists);
for (ActivityUniquinessList actUniqueReq : activityUniquinessLists) {
activityUniquinessResponseLists.add(getActivityNonUniqueIdsList(actUniqueReq));
}
return response;
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityMatchingIdsServiceBean method getActivityNonUniqueIdsList.
private ActivityUniquinessList getActivityNonUniqueIdsList(ActivityUniquinessList actRequestUniqueReq) {
ActivityUniquinessList respUniqList = new ActivityUniquinessList();
respUniqList.setActivityTableType(actRequestUniqueReq.getActivityTableType());
List<ActivityIDType> ids = actRequestUniqueReq.getIds();
respUniqList.setIds(mapIDsListToActivityIDTypeList(fluxRepIdentDao.getMatchingIdentifiers(ids, actRequestUniqueReq.getActivityTableType())));
return respUniqList;
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxReportIdentifierDaoTest method testGetMatchingIdentifiers.
@Test
public void testGetMatchingIdentifiers() {
when(dao.getEntityManager().createNamedQuery(anyString(), any(FluxReportIdentifierEntity.class.getClass()))).thenReturn(query);
ActivityUniquinessList reqElem = getMockedRequest().iterator().next();
final List<FluxReportIdentifierEntity> matchingIdentifiers = dao.getMatchingIdentifiers(reqElem.getIds(), reqElem.getActivityTableType());
assertNotNull(matchingIdentifiers);
assertTrue(matchingIdentifiers.size() == 0);
}
Aggregations