Perbaikan Fitur Scheduler Rekap Logbook Tarif
This commit is contained in:
parent
ccfeecc7c6
commit
1e85db0adf
@ -501,4 +501,9 @@ public interface MapPegawaiJabatanToUnitKerjaDao extends JpaRepository<MapPegawa
|
||||
+ "where mj.statusEnabled is true " + "and skj.statusEnabled is true " + "and lower(skj.name) like 'kk%' "
|
||||
+ "and mj.pegawaiId = :pegawaiId")
|
||||
List<Integer> findKelompokKerjaByDokter(@Param("pegawaiId") Integer idPegawai);
|
||||
|
||||
@Query("select mj.pegawaiId from MapPegawaiJabatanToUnitKerja mj " + "inner join mj.pegawai pg "
|
||||
+ "where mj.statusEnabled is true " + "and pg.statusEnabled is true "
|
||||
+ "and mj.pegawaiId = :idPegawai " + "and pg.jenisPegawaiId = 1")
|
||||
Set<Integer> findDokterByPegawaiId(@Param("idPegawai") Integer idPegawai);
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@ package com.jasamedika.medifirst2000.service;
|
||||
* @since 25/04/2024
|
||||
*/
|
||||
public interface LogbookRemunService {
|
||||
|
||||
void generateRecap();
|
||||
/* Service ini digunakan untuk mendapatkan data rekap loggbook seluruh pegawai dengan data bulan now - 1 */
|
||||
void generateRecap(Integer idPegawai);
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ import com.jasamedika.medifirst2000.service.LogbookRemunService;
|
||||
import com.jasamedika.medifirst2000.service.PelayananPasienService;
|
||||
import com.jasamedika.medifirst2000.service.RemunerasiService;
|
||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
||||
import com.jasamedika.medifirst2000.util.CommonUtil;
|
||||
import com.jasamedika.medifirst2000.util.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -62,19 +64,26 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
private MapJabatanProfesiDao mapJabatanProfesiDao;
|
||||
|
||||
@Override
|
||||
public void generateRecap() {
|
||||
public void generateRecap(Integer idPegawai) {
|
||||
LOGGER.info("Start simpan rekapitulasi detail logbook dokter");
|
||||
|
||||
Set<Integer> listIdDokter = new HashSet<>();
|
||||
LocalDate localDate = LocalDate.now().minusMonths(1);
|
||||
Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
Date tglAwal = DateUtil.startMonth(date);
|
||||
Date tglAkhir = DateUtil.endMonth(date);
|
||||
Set<Integer> listIdDokter = mapPegawaiJabatanToUnitKerjaDao
|
||||
.findDokterByUnitKerja(splitDataSettingDatafixed("listIdUnitKerjaKsm"));
|
||||
|
||||
if (CommonUtil.isNotNullOrEmpty(idPegawai)) {
|
||||
Set<Integer> getListIdDokter = mapPegawaiJabatanToUnitKerjaDao.findDokterByPegawaiId(idPegawai);
|
||||
listIdDokter.addAll(getListIdDokter);
|
||||
}else{
|
||||
Set<Integer> getListIdDokter = mapPegawaiJabatanToUnitKerjaDao.findDokterByUnitKerja(splitDataSettingDatafixed("listIdUnitKerjaKsm"));
|
||||
listIdDokter.addAll(getListIdDokter);
|
||||
List<Integer> listTerapis = mapJabatanProfesiDao.findIdPegawaiByProfesiIn(Arrays.asList(TERAPI));
|
||||
listIdDokter.addAll(listTerapis);
|
||||
if (!listIdDokter.isEmpty()) {
|
||||
// Delete untuk pembaharuan data
|
||||
}
|
||||
|
||||
if (CommonUtil.isNotNullOrEmpty(listIdDokter)) {
|
||||
deleteByPeriod(listIdDokter, tglAwal, tglAkhir);
|
||||
}
|
||||
saveRekapDetailLogbookDokter(listIdDokter, date);
|
||||
@ -120,7 +129,10 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
} else {
|
||||
kinerjaDokter = remunerasiService.logbookRemunTarifDokter(idPegawai, bulan, null);
|
||||
}
|
||||
|
||||
if(!kinerjaDokter.isEmpty()){
|
||||
List<Map<String, Object>> remun = (List<Map<String, Object>>) kinerjaDokter.get("data");
|
||||
if(!remun.isEmpty()){
|
||||
for (Map<String, Object> map : remun) {
|
||||
List<String> listNorecPelayananPasienPetugas = new ArrayList<>();
|
||||
{
|
||||
@ -177,6 +189,8 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
List<Map<String, Object>> ffs;
|
||||
if (month.isBefore(oct24)) {
|
||||
@ -184,6 +198,8 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
} else {
|
||||
ffs = remunerasiService.logbookFfsTarifDokter(idPegawai, bulan, null);
|
||||
}
|
||||
|
||||
if(!ffs.isEmpty()){
|
||||
for (Map<String, Object> fee : ffs) {
|
||||
List<String> listNorecPelayananPasienPetugas = new ArrayList<>();
|
||||
{
|
||||
@ -241,6 +257,7 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
List<Map<String, Object>> ffs;
|
||||
if (month.isBefore(oct24)) {
|
||||
@ -248,6 +265,8 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
} else {
|
||||
ffs = remunerasiService.logbookFfsLuarTarifDokter(idPegawai, bulan, null);
|
||||
}
|
||||
|
||||
if(!ffs.isEmpty()){
|
||||
for (Map<String, Object> fee : ffs) {
|
||||
List<String> listNorecPelayananPasienPetugas = new ArrayList<>();
|
||||
{
|
||||
@ -305,6 +324,7 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
List<Map<String, Object>> fixedPay;
|
||||
if (month.isBefore(oct24)) {
|
||||
@ -312,6 +332,8 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
} else {
|
||||
fixedPay = remunerasiService.logbookFixedPayDokter(idPegawai, bulan, null);
|
||||
}
|
||||
|
||||
if(!fixedPay.isEmpty()){
|
||||
for (Map<String, Object> pay : fixedPay) {
|
||||
List<String> listNorecPelayananPasienPetugas = new ArrayList<>();
|
||||
{
|
||||
@ -367,6 +389,7 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
List<Map<String, Object>> klaimMpp;
|
||||
if (month.isBefore(oct24)) {
|
||||
@ -374,6 +397,8 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
} else {
|
||||
klaimMpp = remunerasiService.logbookKlaimMppDokter(idPegawai, bulan);
|
||||
}
|
||||
|
||||
if(!klaimMpp.isEmpty()){
|
||||
for (Map<String, Object> mpp : klaimMpp) {
|
||||
List<String> listNorecPelayananPasienPetugas = new ArrayList<>();
|
||||
{
|
||||
@ -429,6 +454,7 @@ public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements Logboo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
latch.countDown();
|
||||
});
|
||||
}
|
||||
|
||||
@ -199,9 +199,16 @@ public class LogbookTask {
|
||||
LOGGER.info("Simpan rekapitulasi logbook dokter berhasil...!");
|
||||
}
|
||||
|
||||
/*
|
||||
@Scheduled(cron = "0 0 0 1-6 * ?")
|
||||
public void saveRekapDetailLogbookDokter() {
|
||||
logbookRemunService.generateRecap();
|
||||
}
|
||||
*/
|
||||
|
||||
@Scheduled(cron = "0 15 0 4-5 * ?")
|
||||
public void saveRekapDetailLogbookDokter() {
|
||||
logbookRemunService.generateRecap(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@ -23,6 +24,7 @@ import static org.springframework.http.HttpStatus.ACCEPTED;
|
||||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
|
||||
/**
|
||||
* @author Salman
|
||||
@ -41,7 +43,7 @@ public class LogbookRemunController extends LocaleController<LogbookKinerjaVO> {
|
||||
@RequestMapping(value = "/rekap", method = POST, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> patchingRecapLogbook(HttpServletRequest request) {
|
||||
try {
|
||||
logbookRemunService.generateRecap();
|
||||
logbookRemunService.generateRecap(null);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse("The recap has been successfully generated", ACCEPTED, mapHeaderMessage);
|
||||
} catch (ServiceVOException | JpaSystemException e) {
|
||||
@ -51,4 +53,17 @@ public class LogbookRemunController extends LocaleController<LogbookKinerjaVO> {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/rekap/by-pegawai/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> patchingRecapLogbook1(HttpServletRequest request, @PathVariable("idPegawai") Integer idPegawai) {
|
||||
try {
|
||||
//System.out.println(idPegawai);
|
||||
logbookRemunService.generateRecap(idPegawai);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse("The recap has been successfully generated", ACCEPTED, mapHeaderMessage);
|
||||
} catch (ServiceVOException | JpaSystemException e) {
|
||||
LOGGER.error("Got Exception {} when generateRecap", e.getMessage());
|
||||
mapHeaderMessage.put(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttptatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user