Update LogbookKinerjaService

Pembuatan service daftar pilihan jabatan riwayat pegawai di verifikasi catatan kegiatan harian
This commit is contained in:
salmanoe 2022-07-04 17:37:40 +07:00
parent 8ea57a3196
commit 52114ead46
4 changed files with 35 additions and 0 deletions

View File

@ -235,4 +235,9 @@ public interface LogbookKinerjaDao extends PagingAndSortingRepository<LogbookKin
List<Integer> findPegawaiKontrakByIndikator(@Param("bulan") String bulan,
@Param("indikatorId") Integer idIndikator);
@Query("select distinct new Map(jb.id as id,jb.namaJabatan as namaJabatan,"
+ "jb.levelJabatan as levelJabatan,jb.unitKerjaId as idUnitKerja) " + "from LogbookKinerja lkt "
+ "inner join lkt.jabatan jb " + "where lkt.statusEnabled is true " + "and lkt.pegawaiId = :pegawaiId "
+ "and to_char(lkt.bulan,'yyyy-MM') = :bulan")
List<Map<String, Object>> findJabatanByPegawai(@Param("pegawaiId") Integer idPegawai, @Param("bulan") String bulan);
}

View File

@ -74,5 +74,7 @@ public interface LogbookKinerjaService extends BaseVoService<LogbookKinerja, Log
public List<Map<String, Object>> findDetailLogbookFarmakologi(Integer idPegawai, Integer idProduk,
String tglPelayanan);
public List<Map<String, Object>> findJabatanByLogbookPegawai(Integer idPegawai, Long bulan);
}

View File

@ -3320,4 +3320,17 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
return result;
}
@Override
public List<Map<String, Object>> findJabatanByLogbookPegawai(Integer idPegawai, Long bulan) {
DateFormat mf = new SimpleDateFormat("yyyy-MM");
List<Map<String, Object>> result = logbookKinerjaDao.findJabatanByPegawai(idPegawai,
mf.format(new Date(bulan)));
for (Map<String, Object> map : result) {
map.put("isCariAkses", false);
}
return result;
}
}

View File

@ -1317,6 +1317,21 @@ public class PegawaiController extends LocaleController<PegawaiVO> implements IB
return RestUtil.getJsonResponse(result, HttpStatus.OK);
}
@RequestMapping(value = "/jabatan-logbook-kinerja", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Map<String, Object>>> getJabatanLogbookKinerja(HttpServletRequest request,
@RequestParam(value = "pegawaiId") Integer idPegawai, @RequestParam(value = "bulan") Long bulan) {
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
try {
result = logbookKinerjaService.findJabatanByLogbookPegawai(idPegawai, bulan);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
} catch (Exception e) {
e.printStackTrace();
}
return RestUtil.getJsonResponse(result, HttpStatus.OK);
}
@RequestMapping(value = "/get-list-jurusan-by-pendidikan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Map<String, Object>> getListJurusanByPendidikan(
@RequestParam(value = "pendidikanId") Integer pendidikanId, HttpServletRequest request) {