Update LogbookKinerjaService

Perbaikan query data set jabatan saat verifikasi logbook skoring capaian pegawai
This commit is contained in:
salmanoersabhk 2022-10-02 17:48:04 +07:00
parent 76cf5f2a28
commit e765eaaa14
2 changed files with 8 additions and 7 deletions

View File

@ -233,11 +233,12 @@ public interface LogbookKinerjaDao extends PagingAndSortingRepository<LogbookKin
@Param("unitKerjaId") Integer idUnitKerja, @Param("subunitKerjaId") Integer idSubunitKerja,
@Param("pegawaiId") Integer idPegawai);
@Query("select new Map(lkt.noRec as noRec,lkt.jabatanId as jabatanId) " + "from LogbookKinerja lkt "
+ "where to_char(lkt.bulan,'yyyy-MM') = :bulan " + "and lkt.pegawaiId = :pegawaiId "
+ "and lkt.indikatorKinerjaId = :indikatorId " + "and lkt.statusEnabled is true "
+ "and lkt.statusVerifikasi is true")
Map<String, Object> findKontrakByLogbook(@Param("bulan") String bulan, @Param("pegawaiId") Integer idPegawai,
@Query("select new Map(lkt.noRec as noRec,lkt.jabatanId as jabatanId) "
+ "from LogbookKinerja lkt, MapPegawaiJabatanToUnitKerja mj " + "where lkt.pegawaiId = mj.pegawaiId "
+ "and lkt.jabatanId = mj.jabatanId " + "and to_char(lkt.bulan,'yyyy-MM') = :bulan "
+ "and lkt.pegawaiId = :pegawaiId " + "and lkt.indikatorKinerjaId = :indikatorId "
+ "and lkt.statusEnabled is true and lkt.statusVerifikasi is true " + "and mj.statusEnabled is true")
Map<String, Object> findKontrakForVerify(@Param("bulan") String bulan, @Param("pegawaiId") Integer idPegawai,
@Param("indikatorId") Integer idIndikator);
@Query("select distinct lkt.pegawaiId " + "from LogbookKinerja lkt "

View File

@ -320,7 +320,7 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
public LogbookKinerjaVO verify(LogbookKinerjaVO vo) throws JpaSystemException, ServiceVOException {
DateFormat df = new SimpleDateFormat("yyyy-MM");
Map<String, Object> kontrak = logbookKinerjaDao.findKontrakByLogbook(df.format(vo.getBulan()),
Map<String, Object> kontrak = logbookKinerjaDao.findKontrakForVerify(df.format(vo.getBulan()),
vo.getPegawai().getId(), vo.getIndikatorKinerja().getId());
if (CommonUtil.isNullOrEmpty(kontrak)) {
@ -351,7 +351,7 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
public void autoVerify(LogbookKinerjaVO vo) throws JpaSystemException, ServiceVOException {
DateFormat df = new SimpleDateFormat("yyyy-MM");
Map<String, Object> kontrak = logbookKinerjaDao.findKontrakByLogbook(df.format(vo.getBulan()),
Map<String, Object> kontrak = logbookKinerjaDao.findKontrakForVerify(df.format(vo.getBulan()),
vo.getPegawai().getId(), vo.getIndikatorKinerja().getId());
LogbookKinerja logbookKinerja = logbookKinerjaDao.findOne(kontrak.get("noRec").toString());