use of eu.europa.ec.fisheries.ers.service.mapper.FluxFaReportMessageMapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxMessageServiceBean method saveFishingActivityReportDocuments.
/**
* {@inheritDoc}
*/
@Override
@Transactional(Transactional.TxType.REQUIRED)
public void saveFishingActivityReportDocuments(FLUXFAReportMessage faReportMessage, FaReportSourceEnum faReportSourceEnum) throws ServiceException {
log.info("[INFO] Going to save [ " + faReportMessage.getFAReportDocuments().size() + " ] FaReportDocuments..");
FluxFaReportMessageEntity messageEntity = new FluxFaReportMessageMapper().mapToFluxFaReportMessage(faReportMessage, faReportSourceEnum, new FluxFaReportMessageEntity());
final Set<FaReportDocumentEntity> faReportDocuments = messageEntity.getFaReportDocuments();
for (FaReportDocumentEntity faReportDocument : faReportDocuments) {
try {
updateGeometry(faReportDocument);
enrichFishingActivityWithGuiID(faReportDocument);
} catch (Exception e) {
log.error("Could not update Geometry OR enrichActivities for faReportDocument:" + faReportDocument.getId());
}
}
log.debug("fishing activity records to be saved : " + faReportDocuments.size());
fluxReportMessageDao.saveFluxFaReportMessage(messageEntity);
log.debug("Save partial FluxFaReportMessage before further processing");
updateFaReportCorrections(faReportMessage.getFAReportDocuments());
log.debug("Update FaReport Corrections is complete.");
updateFishingTripStartAndEndDate(faReportDocuments);
log.info("FluxFaReportMessage Saved successfully.");
}
Aggregations