Remove cron tasks
This commit is contained in:
parent
fe15bd14ab
commit
b61706ee5e
@ -1,164 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.task.schedule;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.dao.PelayananPasienPetugasDao;
|
|
||||||
import com.jasamedika.medifirst2000.dao.RekapLogbookDokterDao;
|
|
||||||
import com.jasamedika.medifirst2000.entities.KelompokPasien;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pegawai;
|
|
||||||
import com.jasamedika.medifirst2000.entities.RekapLogbookDokter;
|
|
||||||
import com.jasamedika.medifirst2000.service.PelayananPasienService;
|
|
||||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author salmanoe
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 07/11/2023
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class LogbookTask {
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(PasienTask.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PelayananPasienPetugasDao pelayananPasienPetugasDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RekapLogbookDokterDao rekapLogbookDokterDao;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PelayananPasienService pelayananPasienService;
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 0 6 * ?")
|
|
||||||
public void saveRekapLogbookDokter() {
|
|
||||||
LOGGER.info("Simpan rekapitulasi logbook dokter");
|
|
||||||
|
|
||||||
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> idPegawaiByTglPelayanan = pelayananPasienPetugasDao.findPegawaiByTglPelayanan(tglAwal, tglAkhir);
|
|
||||||
DateFormat df = new SimpleDateFormat("yyyy-MM");
|
|
||||||
String bulan = df.format(date);
|
|
||||||
List<RekapLogbookDokter> models = new ArrayList<>();
|
|
||||||
idPegawaiByTglPelayanan.forEach(idPegawai -> {
|
|
||||||
{
|
|
||||||
Map<String, Object> kinerjaDokter = pelayananPasienService.logbookRemunTarifDokter(idPegawai, bulan);
|
|
||||||
List<Map<String, Object>> remun = (List<Map<String, Object>>) kinerjaDokter.get("data");
|
|
||||||
List<Integer> listIdKelompokPasien = new ArrayList<>();
|
|
||||||
remun.forEach(r -> {
|
|
||||||
if (!listIdKelompokPasien.contains(Integer.parseInt(r.get("idKelompokPasien").toString())))
|
|
||||||
listIdKelompokPasien.add(Integer.parseInt(r.get("idKelompokPasien").toString()));
|
|
||||||
});
|
|
||||||
listIdKelompokPasien.forEach(idKelompokPasien -> {
|
|
||||||
double jumlah = remun.stream().filter(r -> idKelompokPasien.equals(r.get("idKelompokPasien")))
|
|
||||||
.mapToDouble(r -> Double.parseDouble(r.get("jumlah").toString())).sum();
|
|
||||||
double hargaJasa = remun.stream().filter(r -> idKelompokPasien.equals(r.get("idKelompokPasien")))
|
|
||||||
.mapToDouble(r -> Double.parseDouble(r.get("jumlahHargaJasa").toString())).sum();
|
|
||||||
RekapLogbookDokter rekapLogbookDokter = new RekapLogbookDokter();
|
|
||||||
rekapLogbookDokter.setKdProfile((short) 0);
|
|
||||||
rekapLogbookDokter.setStatusEnabled(true);
|
|
||||||
Pegawai pegawai = new Pegawai();
|
|
||||||
pegawai.setId(idPegawai);
|
|
||||||
rekapLogbookDokter.setPegawai(pegawai);
|
|
||||||
rekapLogbookDokter.setJenisLogbook("JKN");
|
|
||||||
KelompokPasien kelompokPasien = new KelompokPasien();
|
|
||||||
kelompokPasien.setId(idKelompokPasien);
|
|
||||||
rekapLogbookDokter.setKelompokPasien(kelompokPasien);
|
|
||||||
rekapLogbookDokter.setBulan(date);
|
|
||||||
rekapLogbookDokter.setJumlah(jumlah);
|
|
||||||
rekapLogbookDokter.setCapaian(hargaJasa);
|
|
||||||
models.add(rekapLogbookDokter);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
{
|
|
||||||
List<Map<String, Object>> ffs = pelayananPasienService.logbookFfsTarifDokter(idPegawai, bulan);
|
|
||||||
List<String> listJenisRuangan = new ArrayList<>();
|
|
||||||
List<Integer> listIdKelompokPasien = new ArrayList<>();
|
|
||||||
ffs.forEach(r -> {
|
|
||||||
if (!listJenisRuangan.contains(r.get("jenisRuangan").toString()))
|
|
||||||
listJenisRuangan.add(r.get("jenisRuangan").toString());
|
|
||||||
if (!listIdKelompokPasien.contains(Integer.parseInt(r.get("idKelompokPasien").toString())))
|
|
||||||
listIdKelompokPasien.add(Integer.parseInt(r.get("idKelompokPasien").toString()));
|
|
||||||
});
|
|
||||||
listJenisRuangan.forEach(jenisRuangan -> listIdKelompokPasien.forEach(idKelompokPasien -> {
|
|
||||||
double jumlah = ffs.stream()
|
|
||||||
.filter(r -> jenisRuangan.equals(r.get("jenisRuangan"))
|
|
||||||
&& idKelompokPasien.equals(r.get("idKelompokPasien")))
|
|
||||||
.mapToDouble(r -> Double.parseDouble(r.get("jumlah").toString())).sum();
|
|
||||||
double hargaJasa = ffs.stream()
|
|
||||||
.filter(r -> jenisRuangan.equals(r.get("jenisRuangan"))
|
|
||||||
&& idKelompokPasien.equals(r.get("idKelompokPasien")))
|
|
||||||
.mapToDouble(r -> Double.parseDouble(r.get("jumlahHargaJasa").toString())).sum();
|
|
||||||
RekapLogbookDokter rekapLogbookDokter = new RekapLogbookDokter();
|
|
||||||
rekapLogbookDokter.setKdProfile((short) 0);
|
|
||||||
rekapLogbookDokter.setStatusEnabled(true);
|
|
||||||
Pegawai pegawai = new Pegawai();
|
|
||||||
pegawai.setId(idPegawai);
|
|
||||||
rekapLogbookDokter.setPegawai(pegawai);
|
|
||||||
rekapLogbookDokter.setJenisLogbook("NON_JKN");
|
|
||||||
rekapLogbookDokter.setJenisRuangan(jenisRuangan);
|
|
||||||
KelompokPasien kelompokPasien = new KelompokPasien();
|
|
||||||
kelompokPasien.setId(idKelompokPasien);
|
|
||||||
rekapLogbookDokter.setKelompokPasien(kelompokPasien);
|
|
||||||
rekapLogbookDokter.setBulan(date);
|
|
||||||
rekapLogbookDokter.setJumlah(jumlah);
|
|
||||||
rekapLogbookDokter.setCapaian(hargaJasa);
|
|
||||||
models.add(rekapLogbookDokter);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
List<Map<String, Object>> fixedPay = pelayananPasienService.logbookFixedPayDokter(idPegawai, bulan);
|
|
||||||
List<String> listJenisRuangan = new ArrayList<>();
|
|
||||||
List<Integer> listIdKelompokPasien = new ArrayList<>();
|
|
||||||
List<String> listBulanIbuPulangRanap = new ArrayList<>();
|
|
||||||
fixedPay.forEach(r -> {
|
|
||||||
if (!listJenisRuangan.contains(r.get("jenisRuangan").toString()))
|
|
||||||
listJenisRuangan.add(r.get("jenisRuangan").toString());
|
|
||||||
if (!listIdKelompokPasien.contains(Integer.parseInt(r.get("idKelompokPasien").toString())))
|
|
||||||
listIdKelompokPasien.add(Integer.parseInt(r.get("idKelompokPasien").toString()));
|
|
||||||
if (!listBulanIbuPulangRanap.contains(r.get("bulanPulangIbu").toString()))
|
|
||||||
listBulanIbuPulangRanap.add(r.get("bulanPulangIbu").toString());
|
|
||||||
});
|
|
||||||
listJenisRuangan.forEach(jenisRuangan -> listIdKelompokPasien
|
|
||||||
.forEach(idKelompokPasien -> listBulanIbuPulangRanap.forEach(bulanIbuPulangRanap -> {
|
|
||||||
double jumlah = fixedPay.stream()
|
|
||||||
.filter(r -> jenisRuangan.equals(r.get("jenisRuangan"))
|
|
||||||
&& idKelompokPasien.equals(r.get("idKelompokPasien"))
|
|
||||||
&& bulanIbuPulangRanap.equals(r.get("bulanPulangIbu")))
|
|
||||||
.mapToDouble(r -> Double.parseDouble(r.get("jumlah").toString())).sum();
|
|
||||||
double hargaJasa = fixedPay.stream()
|
|
||||||
.filter(r -> jenisRuangan.equals(r.get("jenisRuangan"))
|
|
||||||
&& idKelompokPasien.equals(r.get("idKelompokPasien"))
|
|
||||||
&& bulanIbuPulangRanap.equals(r.get("bulanPulangIbu")))
|
|
||||||
.mapToDouble(r -> Double.parseDouble(r.get("jumlahHargaJasa").toString())).sum();
|
|
||||||
RekapLogbookDokter rekapLogbookDokter = new RekapLogbookDokter();
|
|
||||||
rekapLogbookDokter.setKdProfile((short) 0);
|
|
||||||
rekapLogbookDokter.setStatusEnabled(true);
|
|
||||||
Pegawai pegawai = new Pegawai();
|
|
||||||
pegawai.setId(idPegawai);
|
|
||||||
rekapLogbookDokter.setPegawai(pegawai);
|
|
||||||
rekapLogbookDokter.setJenisLogbook("FIXED_PAY");
|
|
||||||
rekapLogbookDokter.setJenisRuangan(jenisRuangan);
|
|
||||||
KelompokPasien kelompokPasien = new KelompokPasien();
|
|
||||||
kelompokPasien.setId(idKelompokPasien);
|
|
||||||
rekapLogbookDokter.setKelompokPasien(kelompokPasien);
|
|
||||||
rekapLogbookDokter.setBulanPulangIbu(bulanIbuPulangRanap);
|
|
||||||
rekapLogbookDokter.setBulan(date);
|
|
||||||
rekapLogbookDokter.setJumlah(jumlah);
|
|
||||||
rekapLogbookDokter.setCapaian(hargaJasa);
|
|
||||||
models.add(rekapLogbookDokter);
|
|
||||||
})));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
rekapLogbookDokterDao.save(models);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,135 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.task.schedule;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.jasamedika.medifirst2000.dao.PasienDao;
|
|
||||||
import com.jasamedika.medifirst2000.dto.PesertaBpjsDto;
|
|
||||||
import com.jasamedika.medifirst2000.entities.Pasien;
|
|
||||||
import com.jasamedika.medifirst2000.util.CommonUtil;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.HttpEntity;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static org.springframework.http.HttpMethod.GET;
|
|
||||||
import static org.springframework.http.HttpStatus.CREATED;
|
|
||||||
import static org.springframework.http.HttpStatus.OK;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author salmanoe
|
|
||||||
* @version 1.0.0
|
|
||||||
* @since 11/10/2023
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class PasienTask {
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(PasienTask.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ObjectMapper objectMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RestTemplate restTemplate;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasienDao pasienDao;
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 0 * * *")
|
|
||||||
public void nikPesertaBpjs() {
|
|
||||||
LOGGER.info("Task PasienTask.nikPesertaBpjs {}", LocalDateTime.now());
|
|
||||||
|
|
||||||
adjustNikPesertaBpjs();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
private void adjustNikPesertaBpjs() {
|
|
||||||
LOGGER.info("Adjusting NIK Peserta BPJS {}", LocalDateTime.now());
|
|
||||||
|
|
||||||
List<PesertaBpjsDto> listDtoUpdate = new ArrayList<>();
|
|
||||||
List<PesertaBpjsDto> listDtoNotUpdate = new ArrayList<>();
|
|
||||||
List<Pasien> pasienValidBpjs = pasienDao.findByValidBpjs();
|
|
||||||
for (Pasien pasien : pasienValidBpjs) {
|
|
||||||
try {
|
|
||||||
PesertaBpjsDto pesertaBpjsDto = cekKepesertaan(pasien.getNoBpjs());
|
|
||||||
if (pesertaBpjsDto.getKdProfile() == 0)
|
|
||||||
listDtoUpdate.add(pesertaBpjsDto);
|
|
||||||
if (pesertaBpjsDto.getKdProfile() == 1)
|
|
||||||
listDtoNotUpdate.add(pesertaBpjsDto);
|
|
||||||
|
|
||||||
Thread.sleep((long) (Math.random() * 1000 * 8));
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOGGER.error("Error adjusting NIK Peserta BPJS {} -> {}", pasien.getNoBpjs(), e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
List<String> listNoKartu = listDtoUpdate.stream().map(PesertaBpjsDto::getNoKartu)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
List<Pasien> availableValid = pasienValidBpjs.stream()
|
|
||||||
.filter(pasien -> listNoKartu.contains(pasien.getNoBpjs())).collect(Collectors.toList());
|
|
||||||
availableValid.forEach(pasien -> {
|
|
||||||
Optional<PesertaBpjsDto> first = listDtoUpdate.stream()
|
|
||||||
.filter(dto -> pasien.getNoBpjs().equals(dto.getNoKartu())).findFirst();
|
|
||||||
first.ifPresent(dto -> {
|
|
||||||
pasien.setKdProfile(dto.getKdProfile());
|
|
||||||
pasien.setNoIdentitas(dto.getNik());
|
|
||||||
});
|
|
||||||
});
|
|
||||||
if (CommonUtil.isNotNullOrEmpty(availableValid)) {
|
|
||||||
LOGGER.info("Save available valid data");
|
|
||||||
|
|
||||||
pasienDao.save(availableValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
List<String> listNoKartu = listDtoNotUpdate.stream().map(PesertaBpjsDto::getNoKartu)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
List<Pasien> availableValid = pasienValidBpjs.stream()
|
|
||||||
.filter(pasien -> listNoKartu.contains(pasien.getNoBpjs())).collect(Collectors.toList());
|
|
||||||
availableValid.forEach(pasien -> {
|
|
||||||
Optional<PesertaBpjsDto> first = listDtoNotUpdate.stream()
|
|
||||||
.filter(dto -> pasien.getNoBpjs().equals(dto.getNoKartu())).findFirst();
|
|
||||||
first.ifPresent(dto -> pasien.setKdProfile(dto.getKdProfile()));
|
|
||||||
});
|
|
||||||
if (CommonUtil.isNotNullOrEmpty(availableValid)) {
|
|
||||||
LOGGER.info("Flag kdProfile can not update");
|
|
||||||
|
|
||||||
pasienDao.save(availableValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private PesertaBpjsDto cekKepesertaan(String noKartu) {
|
|
||||||
try {
|
|
||||||
LOGGER.info("Cek kepesertaan BPJS {} {}", noKartu, LocalDateTime.now());
|
|
||||||
|
|
||||||
URI uri = new URI("https://daftar.rsabhk.co.id/api/data/pasien/jaminan/bpjs/cek-kepesertaan/" + noKartu);
|
|
||||||
HttpEntity<Object> request = new HttpEntity<>(null);
|
|
||||||
ResponseEntity<Object> response = restTemplate.exchange(uri, GET, request, Object.class);
|
|
||||||
if (OK.equals(response.getStatusCode()) || CREATED.equals(response.getStatusCode())) {
|
|
||||||
Map<String, Object> responseBody = objectMapper.convertValue(response.getBody(), Map.class);
|
|
||||||
Map<String, Object> responseMap = objectMapper.convertValue(responseBody.get("response"),
|
|
||||||
HashMap.class);
|
|
||||||
Map<String, Object> responsePeserta = objectMapper.convertValue(responseMap.get("peserta"),
|
|
||||||
HashMap.class);
|
|
||||||
return PesertaBpjsDto.builder().noKartu(responsePeserta.get("noKartu").toString())
|
|
||||||
.nik(responsePeserta.get("nik").toString()).kdProfile((short) 0).build();
|
|
||||||
} else {
|
|
||||||
LOGGER.error("Error handshake cek kepesertaan BPJS {}", response.getStatusCode().getReasonPhrase());
|
|
||||||
|
|
||||||
return PesertaBpjsDto.builder().noKartu(noKartu).kdProfile((short) 1).build();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOGGER.error("Error cek kepesertaan BPJS {}", e.getMessage());
|
|
||||||
|
|
||||||
return PesertaBpjsDto.builder().noKartu(noKartu).kdProfile((short) 1).build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.task.schedule.config;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.TaskScheduler;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Salman
|
|
||||||
* @since 12 Jul 2023
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@EnableScheduling
|
|
||||||
@ComponentScan("com.jasamedika.medifirst2000.task")
|
|
||||||
public class ScheduleTaskConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public TaskScheduler taskScheduler() {
|
|
||||||
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
|
||||||
threadPoolTaskScheduler.setPoolSize(5);
|
|
||||||
threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler");
|
|
||||||
return threadPoolTaskScheduler;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public ObjectMapper objectMapper() {
|
|
||||||
return new ObjectMapper();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public RestTemplate restTemplate() {
|
|
||||||
return new RestTemplate();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.task.schedule;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.service.KalenderService;
|
|
||||||
import com.jasamedika.medifirst2000.service.PegawaiJadwalKerjaService;
|
|
||||||
import com.jasamedika.medifirst2000.service.SlipGajiService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Salman
|
|
||||||
* @since 12 Jul 2023
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class ScheduleTask {
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ScheduleTask.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private KalenderService kalenderService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PegawaiJadwalKerjaService pegawaiJadwalKerjaService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SlipGajiService slipGajiService;
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 23 30 6 ?")
|
|
||||||
public void generateKalender() {
|
|
||||||
LOGGER.info("Generate kalender tahun {}",
|
|
||||||
LocalDate.now().plusYears(1).format(DateTimeFormatter.ofPattern("yyyy")));
|
|
||||||
|
|
||||||
kalenderService.generateAndSaveKalender();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 0 1 * ?")
|
|
||||||
public void genarateJadwalPegawaiNonShift() {
|
|
||||||
LOGGER.info("Generate jadwal pegawai bulan {}", LocalDate.now().format(DateTimeFormatter.ofPattern("MM-yyyy")));
|
|
||||||
|
|
||||||
pegawaiJadwalKerjaService.autoSaveJadwalKerjaNonShift();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 0 1 * ?")
|
|
||||||
public void templateSlipGajiTask() {
|
|
||||||
LOGGER.info("Initiate template slip gaji bulan {}",
|
|
||||||
LocalDate.now().format(DateTimeFormatter.ofPattern("MM-yyyy")));
|
|
||||||
|
|
||||||
slipGajiService.init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.jasamedika.medifirst2000.task.schedule.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.TaskScheduler;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Salman
|
|
||||||
* @since 12 Jul 2023
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@EnableScheduling
|
|
||||||
@ComponentScan("com.jasamedika.medifirst2000.task")
|
|
||||||
public class ScheduleTaskConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public TaskScheduler taskScheduler() {
|
|
||||||
ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
|
|
||||||
threadPoolTaskScheduler.setPoolSize(5);
|
|
||||||
threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler");
|
|
||||||
return threadPoolTaskScheduler;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user