use of eu.europa.ec.fisheries.ers.fa.utils.FaReportStatusType in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxMessageServiceBean method updateFaReportCorrections.
/**
* If there is a reference Id exist for any of the FaReport Document, than it means this is an update to an existing report.
*/
private void updateFaReportCorrections(List<FAReportDocument> faReportDocuments) throws ServiceException {
List<FaReportDocumentEntity> faReportDocumentEntities = new ArrayList<>();
for (FAReportDocument faReportDocument : faReportDocuments) {
if (faReportDocument.getRelatedFLUXReportDocument().getReferencedID() != null && faReportDocument.getRelatedFLUXReportDocument().getPurposeCode() != null) {
FaReportDocumentEntity faReportDocumentEntity = faReportDocumentDao.findFaReportByIdAndScheme(faReportDocument.getRelatedFLUXReportDocument().getReferencedID().getValue(), faReportDocument.getRelatedFLUXReportDocument().getReferencedID().getSchemeID());
if (faReportDocumentEntity != null) {
FaReportStatusType faReportStatusEnum = FaReportStatusType.getFaReportStatusEnum(Integer.parseInt(faReportDocument.getRelatedFLUXReportDocument().getPurposeCode().getValue()));
faReportDocumentEntity.setStatus(faReportStatusEnum.getStatus());
faReportDocumentEntities.add(faReportDocumentEntity);
}
}
}
faReportDocumentDao.updateAllFaData(faReportDocumentEntities);
}
Aggregations