Update service logbook kinerja detail
Perbaikan parameter bulan query daftar logbook kinerja
This commit is contained in:
parent
0ea5964315
commit
25352e2130
@ -1,5 +1,6 @@
|
||||
package com.jasamedika.medifirst2000.dao;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -28,7 +29,7 @@ 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";
|
||||
+ "and lkd.tanggalKegiatan between :start and :end";
|
||||
|
||||
String getWRByPegawai = " and lkd.statusVerifikasi = :isVerified";
|
||||
|
||||
@ -40,13 +41,13 @@ public interface LogbookKinerjaDetailDao extends PagingAndSortingRepository<Logb
|
||||
|
||||
@Query(strGetWR + getWRByVerifStatus + sortGetWR)
|
||||
List<Map<String, Object>> findWorkingRecord(@Param("pegawaiId") Integer idPegawai,
|
||||
@Param("jabatanId") Integer idJabatan, @Param("bulan") String bulan,
|
||||
@Param("jabatanId") Integer idJabatan, @Param("start") Date start, @Param("end") Date end,
|
||||
@Param("isVerified") Boolean statusVerif);
|
||||
|
||||
@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);
|
||||
@Param("start") Date start, @Param("end") Date end);
|
||||
|
||||
@Query("select new Map(lkd.logbookKinerjaId as logbookId,sum(lkd.capaian) as sumCapaian,ikm.satuanIndikatorId as satuanId) "
|
||||
+ "from LogbookKinerjaDetail lkd " + "inner join lkd.logbookKinerja lk "
|
||||
|
||||
@ -6,6 +6,7 @@ import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
@ -191,13 +192,18 @@ public class LogbookKinerjaDetailServiceImpl extends BaseVoServiceImpl implement
|
||||
public List<Map<String, Object>> findWorkingRecord(Integer idPegawai, Integer idJabatan, Long bulan,
|
||||
Boolean statusVerif) throws JpaSystemException {
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM");
|
||||
LocalDate month = new Date(bulan).toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
Date start = Date.from(month.with(TemporalAdjusters.firstDayOfMonth()).atStartOfDay()
|
||||
.atZone(ZoneId.systemDefault()).toInstant());
|
||||
Date end = Date.from(month.with(TemporalAdjusters.lastDayOfMonth()).atTime(LocalTime.MAX)
|
||||
.atZone(ZoneId.systemDefault()).toInstant());
|
||||
|
||||
String strTglLimitVerif = settingDataFixedDao.getSettingDataFixed("tglLimitVerifWorkingRecord");
|
||||
LocalDateTime tglLimitVerif = LocalDateTime
|
||||
.of(LocalDate.parse(df.format(new Date(bulan)) + strTglLimitVerif).plusMonths(1), LocalTime.MAX);
|
||||
|
||||
List<Map<String, Object>> result = logbookKinerjaDetailDao.findWorkingRecord(idPegawai, idJabatan,
|
||||
df.format(new Date(bulan)), statusVerif);
|
||||
List<Map<String, Object>> result = logbookKinerjaDetailDao.findWorkingRecord(idPegawai, idJabatan, start, end,
|
||||
statusVerif);
|
||||
for (Map<String, Object> map : result) {
|
||||
Map<String, Object> logbook = new HashMap<String, Object>();
|
||||
logbook.put("noRec", map.get("logbookNoRec"));
|
||||
@ -212,10 +218,14 @@ public class LogbookKinerjaDetailServiceImpl extends BaseVoServiceImpl implement
|
||||
@Override
|
||||
public List<Map<String, Object>> findWorkingRecord(Integer idPegawai, Integer idJabatan, Integer idIndikator,
|
||||
Long bulan) throws JpaSystemException {
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM");
|
||||
LocalDate month = new Date(bulan).toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
Date start = Date.from(month.with(TemporalAdjusters.firstDayOfMonth()).atStartOfDay()
|
||||
.atZone(ZoneId.systemDefault()).toInstant());
|
||||
Date end = Date.from(month.with(TemporalAdjusters.lastDayOfMonth()).atTime(LocalTime.MAX)
|
||||
.atZone(ZoneId.systemDefault()).toInstant());
|
||||
|
||||
List<Map<String, Object>> result = logbookKinerjaDetailDao.findWorkingRecord(idPegawai, idJabatan, idIndikator,
|
||||
df.format(new Date(bulan)));
|
||||
start, end);
|
||||
for (Map<String, Object> map : result) {
|
||||
Map<String, Object> logbook = new HashMap<String, Object>();
|
||||
logbook.put("noRec", map.get("logbookNoRec"));
|
||||
|
||||
@ -18,6 +18,8 @@ import com.jasamedika.medifirst2000.helper.Caption;
|
||||
@Table(name = "sdm_logbookkinerjadetail_t")
|
||||
public class LogbookKinerjaDetail extends BaseTransaction {
|
||||
|
||||
private static final long serialVersionUID = -7534794958436007877L;
|
||||
|
||||
@Column(name = "namakegiatan", nullable = false)
|
||||
@Caption(value = "Nama Kegiatan")
|
||||
private String namaKegiatan;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user