pembuatan service hitung capaian skor dokter berdasarkan tahun
This commit is contained in:
parent
2ce47a9614
commit
f7db1f389e
@ -488,4 +488,9 @@ public interface MapPegawaiJabatanToUnitKerjaDao extends CrudRepository<MapPegaw
|
|||||||
@Param("remun") List<Integer> listIdRemun, @Param("dokter") Integer idDokter,
|
@Param("remun") List<Integer> listIdRemun, @Param("dokter") Integer idDokter,
|
||||||
@Param("nonAktif") List<Integer> listIdNonAktif);
|
@Param("nonAktif") List<Integer> listIdNonAktif);
|
||||||
|
|
||||||
|
@Query("select distinct mj.pegawaiId " + "from MapPegawaiJabatanToUnitKerja mj " + "inner join mj.pegawai pg "
|
||||||
|
+ "inner join mj.jabatan jb " + "where mj.unitKerjaPegawaiId in (:listKsmId) "
|
||||||
|
+ "and pg.jenisPegawaiId = 1 " + "and jb.levelJabatan = 5")
|
||||||
|
List<Integer> findAllDokterKelompokStafMedik(@Param("listKsmId") List<Integer> listIdKsm);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.jasamedika.medifirst2000.service;
|
package com.jasamedika.medifirst2000.service;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -9,6 +10,7 @@ import org.springframework.orm.jpa.JpaSystemException;
|
|||||||
import com.jasamedika.medifirst2000.entities.LogbookKinerja;
|
import com.jasamedika.medifirst2000.entities.LogbookKinerja;
|
||||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||||
import com.jasamedika.medifirst2000.vo.LogbookKinerjaVO;
|
import com.jasamedika.medifirst2000.vo.LogbookKinerjaVO;
|
||||||
|
import com.jasamedika.medifirst2000.vo.SkorDokterVO;
|
||||||
|
|
||||||
public interface LogbookKinerjaService extends BaseVoService<LogbookKinerja, LogbookKinerjaVO, String> {
|
public interface LogbookKinerjaService extends BaseVoService<LogbookKinerja, LogbookKinerjaVO, String> {
|
||||||
|
|
||||||
@ -54,6 +56,8 @@ public interface LogbookKinerjaService extends BaseVoService<LogbookKinerja, Log
|
|||||||
|
|
||||||
public void autoVerifLogbookJamKerjaDokter(Date bulan);
|
public void autoVerifLogbookJamKerjaDokter(Date bulan);
|
||||||
|
|
||||||
|
public List<SkorDokterVO> hitungTargetSkorLogbookDokter(String tahun) throws ParseException;
|
||||||
|
|
||||||
public List<Double> findBobotJenisJabatan(Long periode, Integer idJabatan);
|
public List<Double> findBobotJenisJabatan(Long periode, Integer idJabatan);
|
||||||
|
|
||||||
List<Map<String, Object>> findJabatanKontrakVerifKinerja(Integer idPegawai, Integer idPegawaiLogin);
|
List<Map<String, Object>> findJabatanKontrakVerifKinerja(Integer idPegawai, Integer idPegawaiLogin);
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.math.RoundingMode;
|
|||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@ -57,6 +58,7 @@ import com.jasamedika.medifirst2000.vo.JabatanVO;
|
|||||||
import com.jasamedika.medifirst2000.vo.LogbookKinerjaVO;
|
import com.jasamedika.medifirst2000.vo.LogbookKinerjaVO;
|
||||||
import com.jasamedika.medifirst2000.vo.PegawaiVO;
|
import com.jasamedika.medifirst2000.vo.PegawaiVO;
|
||||||
import com.jasamedika.medifirst2000.vo.SatuanIndikatorVO;
|
import com.jasamedika.medifirst2000.vo.SatuanIndikatorVO;
|
||||||
|
import com.jasamedika.medifirst2000.vo.SkorDokterVO;
|
||||||
|
|
||||||
@Service("LogbookKinerjaService")
|
@Service("LogbookKinerjaService")
|
||||||
public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements LogbookKinerjaService {
|
public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements LogbookKinerjaService {
|
||||||
@ -2247,8 +2249,14 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public void autoVerifLogbookJamKerjaDokter(Date bulan) {
|
* @param bulan
|
||||||
|
* bulan spesifik perhitungan
|
||||||
|
* @param typeId
|
||||||
|
* 1-Hitung Target, 2-Hitung Verifikasi
|
||||||
|
*/
|
||||||
|
public List<SkorDokterVO> hitungSkorDokter(Date bulan, byte typeId) {
|
||||||
|
List<SkorDokterVO> result = new ArrayList<>();
|
||||||
List<Integer> listDetailJenisProduk = new ArrayList<>();
|
List<Integer> listDetailJenisProduk = new ArrayList<>();
|
||||||
List<Integer> listDetailJenisProdukException = new ArrayList<>();
|
List<Integer> listDetailJenisProdukException = new ArrayList<>();
|
||||||
|
|
||||||
@ -2269,8 +2277,14 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
|||||||
|
|
||||||
List<Integer> listIdNonjadwal = shiftKerjaDao.findListNonjadwal();
|
List<Integer> listIdNonjadwal = shiftKerjaDao.findListNonjadwal();
|
||||||
|
|
||||||
List<Integer> listIdPegawai = logbookKinerjaDao.findPegawaiKontrakByIndikator(mf.format(bulan),
|
List<Integer> listIdPegawai = new ArrayList<>();
|
||||||
Master.IndikatorKinerja.PELAYANAN_MEDIS_JAM_KERJA);
|
if (typeId == 1) {
|
||||||
|
listIdPegawai = mapPegawaiJabatanToUnitKerjaDao
|
||||||
|
.findAllDokterKelompokStafMedik(Arrays.asList(Master.UnitKerja.KSM));
|
||||||
|
} else if (typeId == 2) {
|
||||||
|
listIdPegawai = logbookKinerjaDao.findPegawaiKontrakByIndikator(mf.format(bulan),
|
||||||
|
Master.IndikatorKinerja.PELAYANAN_MEDIS_JAM_KERJA);
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> dataLayanan = ikiDanRemunerasiDao.getDataLogbookJamKerjaDokter(mf.format(bulan),
|
List<Map<String, Object>> dataLayanan = ikiDanRemunerasiDao.getDataLogbookJamKerjaDokter(mf.format(bulan),
|
||||||
pssbAwal, pssbAkhir, listIdNonjadwal, Master.JenisPegawai.DOKTER, listIdPegawai,
|
pssbAwal, pssbAkhir, listIdNonjadwal, Master.JenisPegawai.DOKTER, listIdPegawai,
|
||||||
@ -2330,6 +2344,8 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
|||||||
List<Integer> drKsmUmumList = mapPegawaiJabatanToUnitKerjaDao.getPegawaiByUnitKerja(Master.UnitKerja.KSM_UMUM);
|
List<Integer> drKsmUmumList = mapPegawaiJabatanToUnitKerjaDao.getPegawaiByUnitKerja(Master.UnitKerja.KSM_UMUM);
|
||||||
|
|
||||||
for (Integer idPegawai : listIdPegawai) {
|
for (Integer idPegawai : listIdPegawai) {
|
||||||
|
SkorDokterVO skorDokterVO = new SkorDokterVO();
|
||||||
|
|
||||||
if (pegawaiDao.getDokterLabPatologiAnatomi().contains(idPegawai)) {
|
if (pegawaiDao.getDokterLabPatologiAnatomi().contains(idPegawai)) {
|
||||||
listDetailJenisProduk = new ArrayList<>(
|
listDetailJenisProduk = new ArrayList<>(
|
||||||
Arrays.asList(Master.DetailJenisProduk.PENUNJANG_PATOLOGI_ANATOMI));
|
Arrays.asList(Master.DetailJenisProduk.PENUNJANG_PATOLOGI_ANATOMI));
|
||||||
@ -2362,19 +2378,83 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skorDokterVO.setBulan(bulan);
|
||||||
|
skorDokterVO.setIdPegawai(idPegawai);
|
||||||
|
skorDokterVO.setSkor(capaian);
|
||||||
|
result.add(skorDokterVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void autoVerifLogbookJamKerjaDokter(Date bulan) {
|
||||||
|
byte verifId = 2;
|
||||||
|
List<SkorDokterVO> listSkorDokterVO = hitungSkorDokter(bulan, verifId);
|
||||||
|
|
||||||
|
for (SkorDokterVO skorDokterVO : listSkorDokterVO) {
|
||||||
LogbookKinerjaVO vo = new LogbookKinerjaVO();
|
LogbookKinerjaVO vo = new LogbookKinerjaVO();
|
||||||
PegawaiVO pegawai = new PegawaiVO();
|
PegawaiVO pegawai = new PegawaiVO();
|
||||||
pegawai.setId(idPegawai);
|
pegawai.setId(skorDokterVO.getIdPegawai());
|
||||||
vo.setPegawai(pegawai);
|
vo.setPegawai(pegawai);
|
||||||
IndikatorKinerjaVO indikator = new IndikatorKinerjaVO();
|
IndikatorKinerjaVO indikator = new IndikatorKinerjaVO();
|
||||||
indikator.setId(Master.IndikatorKinerja.PELAYANAN_MEDIS_JAM_KERJA);
|
indikator.setId(Master.IndikatorKinerja.PELAYANAN_MEDIS_JAM_KERJA);
|
||||||
vo.setIndikatorKinerja(indikator);
|
vo.setIndikatorKinerja(indikator);
|
||||||
vo.setBulan(bulan);
|
vo.setBulan(skorDokterVO.getBulan());
|
||||||
vo.setCapaian(capaian);
|
vo.setCapaian(skorDokterVO.getSkor());
|
||||||
this.autoVerify(vo);
|
this.autoVerify(vo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SkorDokterVO> hitungTargetSkorLogbookDokter(String tahun) throws ParseException {
|
||||||
|
List<SkorDokterVO> result = new ArrayList<>();
|
||||||
|
|
||||||
|
DateFormat mf = new SimpleDateFormat("yyyy-MM");
|
||||||
|
byte hitungTargetId = 1;
|
||||||
|
for (int bulan = 1; bulan <= 12; bulan++) {
|
||||||
|
List<SkorDokterVO> listRs = hitungSkorDokter(mf.parse(tahun + "-" + (bulan < 10 ? "0" + bulan : bulan)),
|
||||||
|
hitungTargetId);
|
||||||
|
result.addAll(listRs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Untuk output internal
|
||||||
|
*/
|
||||||
|
List<Integer> listIdPegawai = new ArrayList<>();
|
||||||
|
List<Date> listBulan = new ArrayList<>();
|
||||||
|
for (SkorDokterVO skorDokterVO : result) {
|
||||||
|
if (!listIdPegawai.contains(skorDokterVO.getIdPegawai())) {
|
||||||
|
listIdPegawai.add(skorDokterVO.getIdPegawai());
|
||||||
|
}
|
||||||
|
if (!listBulan.contains(skorDokterVO.getBulan())) {
|
||||||
|
listBulan.add(skorDokterVO.getBulan());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<Integer> sortedListIdPegawai = listIdPegawai.stream().sorted().collect(Collectors.toList());
|
||||||
|
List<Date> sortedListBulan = listBulan.stream().sorted().collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (Integer idPegawai : sortedListIdPegawai) {
|
||||||
|
String out = "";
|
||||||
|
String skor = "";
|
||||||
|
for (Date bulan : sortedListBulan) {
|
||||||
|
for (SkorDokterVO vo : result) {
|
||||||
|
if (idPegawai.equals(vo.getIdPegawai()) && bulan.equals(vo.getBulan())) {
|
||||||
|
if (skor == "") {
|
||||||
|
skor = vo.getSkor().toString();
|
||||||
|
} else {
|
||||||
|
skor += "," + vo.getSkor().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out = idPegawai + "," + skor;
|
||||||
|
System.out.println(out);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Double> findBobotJenisJabatan(Long periode, Integer idJabatan) {
|
public List<Double> findBobotJenisJabatan(Long periode, Integer idJabatan) {
|
||||||
List<Double> result = new ArrayList<>();
|
List<Double> result = new ArrayList<>();
|
||||||
|
|||||||
@ -64,6 +64,7 @@ import com.jasamedika.medifirst2000.vo.ProdukPerawatVO;
|
|||||||
import com.jasamedika.medifirst2000.vo.ProfesiVO;
|
import com.jasamedika.medifirst2000.vo.ProfesiVO;
|
||||||
import com.jasamedika.medifirst2000.vo.RemunerasiOperasionalVO;
|
import com.jasamedika.medifirst2000.vo.RemunerasiOperasionalVO;
|
||||||
import com.jasamedika.medifirst2000.vo.SettingPirSdmVO;
|
import com.jasamedika.medifirst2000.vo.SettingPirSdmVO;
|
||||||
|
import com.jasamedika.medifirst2000.vo.SkorDokterVO;
|
||||||
import com.jasamedika.medifirst2000.vo.SkoringTindakanMedisVO;
|
import com.jasamedika.medifirst2000.vo.SkoringTindakanMedisVO;
|
||||||
import com.jasamedika.medifirst2000.vo.SkoringTindakanNakesVO;
|
import com.jasamedika.medifirst2000.vo.SkoringTindakanNakesVO;
|
||||||
import com.jasamedika.medifirst2000.vo.SkoringTindakanPerawatVO;
|
import com.jasamedika.medifirst2000.vo.SkoringTindakanPerawatVO;
|
||||||
@ -2074,4 +2075,23 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/get-skor-dokter", method = RequestMethod.GET)
|
||||||
|
public ResponseEntity<List<SkorDokterVO>> getSkorDokter(HttpServletRequest request,
|
||||||
|
@RequestParam(value = "tahun", required = true) String tahun) throws ParseException {
|
||||||
|
try {
|
||||||
|
List<SkorDokterVO> result = logbookKinerjaService.hitungTargetSkorLogbookDokter(tahun);
|
||||||
|
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 skor dokter", 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 skor dokter", jse.getMessage());
|
||||||
|
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||||
|
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user