Compare commits

..

No commits in common. "master" and "ade/monitoring-absensi/bug-fixing-absen-tunggal" have entirely different histories.

2 changed files with 17 additions and 18 deletions

View File

@ -15,7 +15,7 @@
</context-param>
<context-param>
<param-name>spring.profiles.default</param-name>
<param-value>bridging</param-value>
<param-value>localhost</param-value>
</context-param>
<listener>

View File

@ -333,25 +333,24 @@ public class LogbookKinerjaDetailServiceImpl extends BaseVoServiceImpl implement
logbookKinerjaDetailDao.save(catatanKinerja);
}
{
Optional<LogbookKinerja> byIdLogbook = logbookKinerjaDao.findByNoRec(catatanKinerja.getLogbookKinerjaId());
Optional<LogbookKinerja> byIdLogbook = logbookKinerjaDao
.findByNoRec(catatanKinerja.getLogbookKinerjaId());
byIdLogbook.ifPresent(logbookKinerja -> {
if (Arrays.asList(PERCENTAGE).contains(logbookKinerja.getIndikatorKinerja().getSatuanIndikatorId())) {
List<Map<String, Object>> listCatatan = logbookKinerjaDetailDao.findAvgCapaianByKontrak(logbookKinerja.getNoRec(), Arrays.asList(PERCENTAGE));
Optional<Map<String, Object>> catatan = listCatatan.stream().filter(c -> logbookKinerja.getNoRec().equals(c.get("logbookId"))).findFirst();
if (catatan.isPresent()) {
logbookKinerja.setCapaian(Double.parseDouble(catatan.get().get("avgCapaian").toString()));
} else {
logbookKinerja.setCapaian(0.0);
}
if (Arrays.asList(PERCENTAGE)
.contains(logbookKinerja.getIndikatorKinerja().getSatuanIndikatorId())) {
List<Map<String, Object>> listCatatan = logbookKinerjaDetailDao
.findAvgCapaianByKontrak(logbookKinerja.getNoRec(), Arrays.asList(PERCENTAGE));
Optional<Map<String, Object>> catatan = listCatatan.stream()
.filter(c -> logbookKinerja.getNoRec().equals(c.get("logbookId"))).findFirst();
catatan.ifPresent(
c -> logbookKinerja.setCapaian(Double.parseDouble(c.get("avgCapaian").toString())));
} else {
List<Map<String, Object>> listCatatan = logbookKinerjaDetailDao.findSumCapaianByKontrak(logbookKinerja.getNoRec(), Arrays.asList(PERCENTAGE));
Optional<Map<String, Object>> catatan = listCatatan.stream().filter(c -> logbookKinerja.getNoRec().equals(c.get("logbookId"))).findFirst();
if (catatan.isPresent()) {
logbookKinerja.setCapaian(Double.parseDouble(catatan.get().get("sumCapaian").toString()));
} else {
logbookKinerja.setCapaian(0.0);
}
List<Map<String, Object>> listCatatan = logbookKinerjaDetailDao
.findSumCapaianByKontrak(logbookKinerja.getNoRec(), Arrays.asList(PERCENTAGE));
Optional<Map<String, Object>> catatan = listCatatan.stream()
.filter(c -> logbookKinerja.getNoRec().equals(c.get("logbookId"))).findFirst();
catatan.ifPresent(
c -> logbookKinerja.setCapaian(Double.parseDouble(c.get("sumCapaian").toString())));
}
logbookKinerjaDao.save(logbookKinerja);
});