Update LogbookKinerjaService
Perbaikan subrutin perhitungan menit kerja untuk penerapan di bulan ramadhan di kontrak kinerja individu
This commit is contained in:
parent
9ca45ad991
commit
00d820567c
@ -8,6 +8,7 @@ public class Master {
|
||||
public static final boolean STATUS_ENABLE_TRUE = true;
|
||||
|
||||
public static final Double MENIT_KERJA_HARIAN = 8.0 * 60.0;
|
||||
public static final Double MENIT_KERJA_RAMADHAN = 6.5 * 60.0;
|
||||
|
||||
public static final String TIDAK_ADA_PERUBAHAN_DATA = "Tidak Ada Perubahan Data!";
|
||||
|
||||
|
||||
@ -19,6 +19,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.joda.time.Chronology;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.chrono.IslamicChronology;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -170,8 +173,7 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
||||
logbookKinerja.setJabatan(jabatan);
|
||||
logbookKinerja.setIndikatorKinerja(indikatorKinerja);
|
||||
if (vo.getIndikatorKinerja().getId().equals(Master.IndikatorKinerja.PEMENUHAN_JAM_KERJA)) {
|
||||
Integer targetHariKerja = hitungTargetHariKerja(vo.getBulan());
|
||||
Double targetJamKerja = targetHariKerja.doubleValue() * Master.MENIT_KERJA_HARIAN;
|
||||
Double targetJamKerja = hitungTargetMenitKerja(vo.getBulan());
|
||||
logbookKinerja.setTarget(targetJamKerja);
|
||||
}
|
||||
logbookKinerja.setCapaian(0.0);
|
||||
@ -459,6 +461,31 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
||||
return result;
|
||||
}
|
||||
|
||||
private Double hitungTargetMenitKerja(Date bulan) {
|
||||
Double result = 0.0;
|
||||
|
||||
Chronology hijri = IslamicChronology.getInstance();
|
||||
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM");
|
||||
|
||||
List<Kalender> targetPresensi = kalenderDao.getTargetKerja(df.format(bulan));
|
||||
Integer jumlahHariKerjaHarian = 0;
|
||||
Integer jumlahHariKerjaRamadhan = 0;
|
||||
for (Kalender kalender : targetPresensi) {
|
||||
LocalDate hijriDate = new LocalDate(kalender.getTanggal().getTime(), hijri);
|
||||
if (hijriDate.getMonthOfYear() == 9) {
|
||||
jumlahHariKerjaRamadhan += 1;
|
||||
} else {
|
||||
jumlahHariKerjaHarian += 1;
|
||||
}
|
||||
}
|
||||
|
||||
result += jumlahHariKerjaHarian.doubleValue() * Master.MENIT_KERJA_HARIAN;
|
||||
result += jumlahHariKerjaRamadhan.doubleValue() * Master.MENIT_KERJA_RAMADHAN;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> findKontrakKinerja(Integer idPegawai, Integer idJabatan, Long bulan)
|
||||
throws JpaSystemException {
|
||||
@ -470,7 +497,7 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
||||
DateFormat mf = new SimpleDateFormat("yyyy-MM");
|
||||
|
||||
Integer targetHariKerja = hitungTargetHariKerja(new Date(bulan));
|
||||
Double targetJamKerja = targetHariKerja.doubleValue() * Master.MENIT_KERJA_HARIAN;
|
||||
Double targetJamKerja = hitungTargetMenitKerja(new Date(bulan));
|
||||
|
||||
List<Map<String, Object>> listMap = logbookKinerjaDao.findIndikatorByJabatan(idJabatan,
|
||||
mf.format(new Date(bulan)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user