Keep average PDCI in FaoInstitute
Maintain average PDCI score in FaoInsitute
entity.
Add Double
fields pdciMin
, pdciMax
, pdciAvg
to FaoInstitute
(update liquibase).
These values should be updated in the org.genesys2.server.service.worker.AccessionCounter
method process:
FaoInstitute institute = instituteService.findInstitute(forProcessing.getObj());
if (institute != null) {
LOG.info("Updating count for {}", institute.getCode());
genesysService.updateAccessionCount(institute);
// Add
genesysService.updatePDCI(institute);
}
Implement method genesysService.updatePDCI(FaoInstitute)
based on genesysService.statisticsPDCI(FaoInstitute)
.
Remove method genesysService.statisticsPDCI(FaoInstitute)
and refactor code to use the numbers stored in FaoInstitute
entity. This means fix the code in genesysService.statisticsPDCI(Organization)
-- just use numbers from the entity, don't query the database. You will need to use institute.accessionCount
instead of (Long) overall[3]
(which contains the count).
Update mvc.AccessionController
and remove the call to statisticsService, use values from institute
in the JSP.