pembuatan service detail working record di dashboard pencatatan kinerja

This commit is contained in:
salmanoe 2021-05-05 17:20:19 +07:00
parent 77c8af98b9
commit 7742e1d9d6
4 changed files with 56 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import com.jasamedika.medifirst2000.entities.LogbookKinerjaDetail;
@Repository("logbookKinerjaDetailDao")
public interface LogbookKinerjaDetailDao extends PagingAndSortingRepository<LogbookKinerjaDetail, String> {
@Query("select new Map(lkh.noRec as logbookNoRec," + "lkd.noRec as noRec,"
String strGetWR = "select new Map(lkh.noRec as logbookNoRec," + "lkd.noRec as noRec,"
+ "ikm.id as indikatorId,ikm.namaIndikator as namaIndikator,"
+ "lkd.namaKegiatan as namaKegiatan,lkd.capaian as hasil,"
+ "si.id as satuanId,si.satuanIndikator as satuanIndikator," + "lkd.catatan as catatan,"
@ -26,11 +26,21 @@ public interface LogbookKinerjaDetailDao extends PagingAndSortingRepository<Logb
+ "inner join ikm.satuanIndikator si " + "where lkh.statusEnabled is true and lkh.statusVerifikasi is true "
+ "and lkd.statusEnabled is true " + "and ikm.statusEnabled is true and ikm.statusVerifikasi is true "
+ "and si.statusEnabled is true " + "and lkh.pegawaiId = :pegawaiId " + "and lkh.jabatanId = :jabatanId "
+ "and to_char(lkd.tanggalKegiatan,'yyyy-MM') = :bulan "
+ "order by lkd.statusVerifikasi, lkd.tanggalKegiatan")
+ "and to_char(lkd.tanggalKegiatan,'yyyy-MM') = :bulan";
String getWRByIndikator = " and lkh.indikatorKinerjaId = :indikatorId";
String sortGetWR = " order by lkd.statusVerifikasi, lkd.tanggalKegiatan";
@Query(strGetWR + sortGetWR)
List<Map<String, Object>> findWorkingRecord(@Param("pegawaiId") Integer idPegawai,
@Param("jabatanId") Integer idJabatan, @Param("bulan") String bulan);
@Query(strGetWR + getWRByIndikator + sortGetWR)
List<Map<String, Object>> findWorkingRecord(@Param("pegawaiId") Integer idPegawai,
@Param("jabatanId") Integer idJabatan, @Param("indikatorId") Integer idIndikator,
@Param("bulan") String bulan);
@Query("select new Map(lkd.logbookKinerjaId as logbookId,avg(lkd.capaian) as avgCapaian,ikm.satuanIndikatorId as satuanId) "
+ "from LogbookKinerjaDetail lkd " + "inner join lkd.logbookKinerja lk "
+ "inner join lk.indikatorKinerja ikm " + "where lkd.statusEnabled is true "

View File

@ -14,6 +14,9 @@ public interface LogbookKinerjaDetailService
public List<Map<String, Object>> findWorkingRecord(Integer idPegawai, Integer idJabatan, Long bulan)
throws JpaSystemException;
public List<Map<String, Object>> findWorkingRecord(Integer idPegawai, Integer idJabatan, Integer idIndikator,
Long bulan) throws JpaSystemException;
public List<Map<String, Object>> findAksesPegawai(Integer idPegawai) throws JpaSystemException;
public List<Map<String, Object>> findUsedWorkingRecordByKontrak(String logbookNoRec) throws JpaSystemException;

View File

@ -194,6 +194,23 @@ public class LogbookKinerjaDetailServiceImpl extends BaseVoServiceImpl implement
return result;
}
@Override
public List<Map<String, Object>> findWorkingRecord(Integer idPegawai, Integer idJabatan, Integer idIndikator,
Long bulan) throws JpaSystemException {
DateFormat df = new SimpleDateFormat("yyyy-MM");
List<Map<String, Object>> result = logbookKinerjaDetailDao.findWorkingRecord(idPegawai, idJabatan, idIndikator,
df.format(new Date(bulan)));
for (Map<String, Object> map : result) {
Map<String, Object> logbook = new HashMap<String, Object>();
logbook.put("noRec", map.get("logbookNoRec"));
map.put("logbookKinerja", logbook);
map.remove("logbookNoRec");
}
return result;
}
@Override
public List<Map<String, Object>> findAksesPegawai(Integer idPegawai) throws JpaSystemException {
List<Map<String, Object>> result = logbookKinerjaDao.findAksesPegawaiByAtasan(idPegawai,

View File

@ -904,6 +904,29 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
}
}
@RequestMapping(value = "/catatan-kegiatan-harian-indikator", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getCatatanKegiatanHarianByIndikator(HttpServletRequest request,
@RequestParam(value = "pegawaiId", required = true) Integer idPegawai,
@RequestParam(value = "jabatanId", required = true) Integer idJabatan,
@RequestParam(value = "indikatorId", required = true) Integer idIndikator,
@RequestParam(value = "bulan", required = true) Long bulan) throws ParseException {
try {
List<Map<String, Object>> result = logbookKinerjaDetailService.findWorkingRecord(idPegawai, idJabatan,
idIndikator, bulan);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got exception {} when get catatan kegiatan harian by indikator", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got exception {} when get catatan kegiatan harian by indikator", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/get-akses-pegawai-verifikasi-kinerja", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getAksesPegawaiVerifikasiKinerja(HttpServletRequest request,
@RequestParam(value = "pegawaiId", required = true) Integer idPegawai) throws ParseException {