Merge branch 'dev/remun/logbook-tarif' into dev/no-cron

This commit is contained in:
Salman Manoe 2025-01-30 08:14:02 +07:00
commit e2235fd5ef
5 changed files with 45 additions and 50 deletions

View File

@ -244,6 +244,7 @@ public final class Master {
public static final Integer[] JASA_MEDIS = { 21, 22, 35 }; public static final Integer[] JASA_MEDIS = { 21, 22, 35 };
public static final Integer[] JASA_PARAMEDIS = { 25, 26, 27 }; public static final Integer[] JASA_PARAMEDIS = { 25, 26, 27 };
public static final Integer[] JASA_SARANA = { 6, 38 }; public static final Integer[] JASA_SARANA = { 6, 38 };
public static final Integer JASA_TERAPIS = 25;
public static final Integer SPOG_ASISTEN = 206; public static final Integer SPOG_ASISTEN = 206;
public static final Integer SPOG_OPERATOR = 201; public static final Integer SPOG_OPERATOR = 201;
public static final Integer TOTAL_TARIF = 210; public static final Integer TOTAL_TARIF = 210;

View File

@ -262,11 +262,11 @@ public interface MapPegawaiJabatanToUnitKerjaDao extends JpaRepository<MapPegawa
@Param("idUnitKerja") Integer idUnitKerja); @Param("idUnitKerja") Integer idUnitKerja);
@Query("select distinct new Map(subunit.id as id, subunit.name as name) " + "from MapPegawaiJabatanToUnitKerja map " @Query("select distinct new Map(subunit.id as id, subunit.name as name) " + "from MapPegawaiJabatanToUnitKerja map "
+ "left join map.jabatan jab " + "left join map.subUnitKerjaPegawai subunit " + "where map.statusEnabled is true " + "left join map.jabatan jab " + "left join map.subUnitKerjaPegawai subunit "
+ "and map.unitKerjaPegawaiId = :idUnitKerja " + "and jab.kelompokJabatanId = :kelompokJabatanId " + "where map.statusEnabled is true " + "and map.unitKerjaPegawaiId = :idUnitKerja "
+ "order by subunit.name") + "and jab.kelompokJabatanId = :kelompokJabatanId " + "order by subunit.name")
List<Map<String, Object>> getMapSubunitKerjaMonitoringByKelompokJabatan(@Param("idUnitKerja") Integer idUnitKerja, List<Map<String, Object>> getMapSubunitKerjaMonitoringByKelompokJabatan(@Param("idUnitKerja") Integer idUnitKerja,
@Param("kelompokJabatanId") Integer IdKelompokJabatan); @Param("kelompokJabatanId") Integer IdKelompokJabatan);
@Query("select distinct mapp.pegawaiId from MapPegawaiJabatanToUnitKerja mapp " @Query("select distinct mapp.pegawaiId from MapPegawaiJabatanToUnitKerja mapp "
+ "where mapp.statusEnabled is true and mapp.pegawaiId is not null and mapp.unitKerjaPegawaiId = :idUnitKerja") + "where mapp.statusEnabled is true and mapp.pegawaiId is not null and mapp.unitKerjaPegawaiId = :idUnitKerja")
@ -517,13 +517,14 @@ public interface MapPegawaiJabatanToUnitKerjaDao extends JpaRepository<MapPegawa
List<Integer> findPegawaiIdByUnitKerjaIdAndJabatanId(@Param("unitKerjaId") List<Integer> unitKerjaId, List<Integer> findPegawaiIdByUnitKerjaIdAndJabatanId(@Param("unitKerjaId") List<Integer> unitKerjaId,
@Param("jabatanId") List<Integer> jabatanId); @Param("jabatanId") List<Integer> jabatanId);
@Query("select mj.pegawaiId from MapPegawaiJabatanToUnitKerja mj " + "where mj.statusEnabled is true "
+ "and mj.subUnitKerjaPegawaiId in (:subUnitKerjaIdIn)")
Set<Integer> findPegawaiIdBySubUnitKerjaIn(@Param("subUnitKerjaIdIn") List<Integer> subUnitKerjaIdIn);
@Query(value = "select exists(select 1 from mappegawaijabatantounitkerja_m mj " @Query(value = "select exists(select 1 from mappegawaijabatantounitkerja_m mj "
+ "where mj.statusenabled is true and mj.objectpegawaifk = :pegawaiId " + "where mj.statusenabled is true and mj.objectpegawaifk = :pegawaiId "
+ "and mj.objectjabatanfk in (:listJabatanId))", nativeQuery = true) + "and mj.objectjabatanfk in (:listJabatanId))", nativeQuery = true)
boolean existsByPegawaiIdAndJabatanIdIn(@Param("pegawaiId") Integer idPegawai, boolean existsByPegawaiIdAndJabatanIdIn(@Param("pegawaiId") Integer idPegawai,
@Param("listJabatanId") List<Integer> idJabatanList); @Param("listJabatanId") List<Integer> idJabatanList);
@Query("select mj.pegawaiId from MapPegawaiJabatanToUnitKerja mj " + "inner join mj.pegawai pg "
+ "where mj.statusEnabled is true " + "and pg.statusEnabled is true "
+ "and mj.unitKerjaPegawaiId in (:listUnitKerjaId) " + "and pg.jenisPegawaiId = 1")
Set<Integer> findDokterByUnitKerja(@Param("listUnitKerjaId") List<Integer> listIdUnitKerja);
} }

View File

@ -1,12 +1,11 @@
package com.jasamedika.medifirst2000.service; package com.jasamedika.medifirst2000.service;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import org.springframework.orm.jpa.JpaSystemException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.orm.jpa.JpaSystemException;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
/** /**
* View Object service * View Object service
* *
@ -19,53 +18,39 @@ import com.jasamedika.medifirst2000.exception.ServiceVOException;
* @author Roberto * @author Roberto
*/ */
public interface BaseVoService<T, V, K> { public interface BaseVoService<T, V, K> {
/** /**
* Add model from VO * Add model from VO
*
* @param vo
* @return
*/ */
public V add(V vo) throws JpaSystemException, ServiceVOException; V add(V vo) throws JpaSystemException, ServiceVOException;
/** /**
* Update model from vo * Update model from vo
*
* @param vo
* @return
*/ */
public V update(V vo) throws JpaSystemException, ServiceVOException; V update(V vo) throws JpaSystemException, ServiceVOException;
/** /**
* Delete model by primary key * Delete model by primary key
*
* @param key
* @return
*/ */
public Boolean delete(K key) throws JpaSystemException; Boolean delete(K key) throws JpaSystemException;
/** /**
* Find by Id * Find by ID
* *
* @param key * @param key
* primary key * primary key
* @return
*/ */
public V findById(K key) throws JpaSystemException; V findById(K key) throws JpaSystemException;
/** /**
* Find all model to vo * Find all model to vo
*
* @return
*/ */
public List<V> findAll() throws JpaSystemException; List<V> findAll() throws JpaSystemException;
/** /**
* Find all model to vo by page and limit and sort and dir parameter * Find all model to vo by page and limit and sort and dir parameter
*
* @return
*/ */
public Map<String, Object> findAllWithPageAndLimitAndSortByAndDirectionParameter( Map<String, Object> findAllWithPageAndLimitAndSortByAndDirectionParameter(Integer page, Integer limit,
Integer page, Integer limit, String sort, String dir); String sort, String dir);
} }

View File

@ -36,7 +36,7 @@ import static com.jasamedika.medifirst2000.constants.Master.Profesi.TERAPI;
*/ */
@Service @Service
@Transactional @Transactional
public class LogbookRemunServiceImpl implements LogbookRemunService { public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements LogbookRemunService {
private static final Logger LOGGER = LoggerFactory.getLogger(LogbookRemunServiceImpl.class); private static final Logger LOGGER = LoggerFactory.getLogger(LogbookRemunServiceImpl.class);
@ -58,9 +58,6 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
@Autowired @Autowired
private MapPegawaiJabatanToUnitKerjaDao mapPegawaiJabatanToUnitKerjaDao; private MapPegawaiJabatanToUnitKerjaDao mapPegawaiJabatanToUnitKerjaDao;
@Autowired
private SubUnitKerjaDao subUnitKerjaDao;
@Autowired @Autowired
private MapJabatanProfesiDao mapJabatanProfesiDao; private MapJabatanProfesiDao mapJabatanProfesiDao;
@ -72,16 +69,15 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
Date tglAwal = DateUtil.startMonth(date); Date tglAwal = DateUtil.startMonth(date);
Date tglAkhir = DateUtil.endMonth(date); Date tglAkhir = DateUtil.endMonth(date);
List<Integer> subUnitKerjaIn = subUnitKerjaDao.findAllKelompokKerjaMedisId(); Set<Integer> listIdDokter = mapPegawaiJabatanToUnitKerjaDao
Set<Integer> idPegawaiKelompokKerja = mapPegawaiJabatanToUnitKerjaDao .findDokterByUnitKerja(splitDataSettingDatafixed("listIdUnitKerjaKsm"));
.findPegawaiIdBySubUnitKerjaIn(subUnitKerjaIn); List<Integer> listTerapis = mapJabatanProfesiDao.findIdPegawaiByProfesiIn(Arrays.asList(TERAPI));
List<Integer> terapisRehabMedik = mapJabatanProfesiDao.findIdPegawaiByProfesiIn(Arrays.asList(TERAPI)); listIdDokter.addAll(listTerapis);
idPegawaiKelompokKerja.addAll(terapisRehabMedik); if (!listIdDokter.isEmpty()) {
if (!idPegawaiKelompokKerja.isEmpty()) {
// Delete untuk pembaharuan data // Delete untuk pembaharuan data
deleteByPeriod(idPegawaiKelompokKerja, tglAwal, tglAkhir); deleteByPeriod(listIdDokter, tglAwal, tglAkhir);
} }
saveRekapDetailLogbookDokter(idPegawaiKelompokKerja, date); saveRekapDetailLogbookDokter(listIdDokter, date);
} }
public void deleteByPeriod(Set<Integer> idPegawai, Date tglAwal, Date tglAkhir) { public void deleteByPeriod(Set<Integer> idPegawai, Date tglAwal, Date tglAkhir) {
@ -198,7 +194,7 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
LogbookDokter logbookDokter = new LogbookDokter(); LogbookDokter logbookDokter = new LogbookDokter();
logbookDokter.setKdProfile((short) 0); logbookDokter.setKdProfile((short) 0);
logbookDokter.setStatusEnabled(true); logbookDokter.setStatusEnabled(true);
logbookDokter.setJenisLogbook("NON_JKN_DALAM_JAM_KERJA"); logbookDokter.setJenisLogbook("DALAM_JAM_KERJA");
logbookDokter.setJenisRuangan(fee.get("jenisRuangan").toString().toUpperCase()); logbookDokter.setJenisRuangan(fee.get("jenisRuangan").toString().toUpperCase());
logbookDokter.setKelompokPasien( logbookDokter.setKelompokPasien(
getKelompokPasien(Integer.parseInt(fee.get("idKelompokPasien").toString()))); getKelompokPasien(Integer.parseInt(fee.get("idKelompokPasien").toString())));
@ -262,7 +258,7 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
LogbookDokter logbookDokter = new LogbookDokter(); LogbookDokter logbookDokter = new LogbookDokter();
logbookDokter.setKdProfile((short) 0); logbookDokter.setKdProfile((short) 0);
logbookDokter.setStatusEnabled(true); logbookDokter.setStatusEnabled(true);
logbookDokter.setJenisLogbook("NON_JKN_LUAR_JAM_KERJA"); logbookDokter.setJenisLogbook("LUAR_JAM_KERJA");
logbookDokter.setJenisRuangan(fee.get("jenisRuangan").toString().toUpperCase()); logbookDokter.setJenisRuangan(fee.get("jenisRuangan").toString().toUpperCase());
logbookDokter.setKelompokPasien( logbookDokter.setKelompokPasien(
getKelompokPasien(Integer.parseInt(fee.get("idKelompokPasien").toString()))); getKelompokPasien(Integer.parseInt(fee.get("idKelompokPasien").toString())));

View File

@ -1604,6 +1604,7 @@ public class RemunerasiServiceImpl extends BaseVoServiceImpl implements Remunera
private List<Map<String, Object>> transformPelayananPaket(Integer idPegawai, List<Map<String, Object>> listData) { private List<Map<String, Object>> transformPelayananPaket(Integer idPegawai, List<Map<String, Object>> listData) {
List<Integer> drKsmObgyn = pegawaiDao.getDokterByKsm(KSM_OBGYN); List<Integer> drKsmObgyn = pegawaiDao.getDokterByKsm(KSM_OBGYN);
List<Integer> terapisRehabMedik = mapJabatanProfesiDao.findIdPegawaiByProfesiIn(Arrays.asList(TERAPI));
SimpleDateFormat month = new SimpleDateFormat("MMM-yyyy", new Locale("in", "ID")); SimpleDateFormat month = new SimpleDateFormat("MMM-yyyy", new Locale("in", "ID"));
List<MapProdukPaket> paketList = mapProdukPaketDao.findAll(); List<MapProdukPaket> paketList = mapProdukPaketDao.findAll();
List<Integer> allProdukEntriId = paketList.stream().map(MapProdukPaket::getProdukEntriId) List<Integer> allProdukEntriId = paketList.stream().map(MapProdukPaket::getProdukEntriId)
@ -1774,6 +1775,17 @@ public class RemunerasiServiceImpl extends BaseVoServiceImpl implements Remunera
: byDetailTarifNonKelas.get().getHargaSatuan())); : byDetailTarifNonKelas.get().getHargaSatuan()));
} }
} }
} else if (terapisRehabMedik.contains(idPegawai)
&& !Arrays.asList(GRUP_RAWAT_INAP).contains(Integer.parseInt(d.get("idDepartemen").toString()))
&& DOKTER_PEMERIKSA.equals(d.get("idJenisPelaksana"))) {
Optional<HargaNettoProdukByKelasD> byDetailTarifNonKelas = tarifDetailNonKelas.stream()
.filter(dt -> dt.getProdukId().equals(d.get("idProduk")))
.filter(dt -> dt.getKelasId().equals(d.get("idKelas")))
.filter(dt -> dt.getKomponenHargaId().equals(JASA_TERAPIS)).findFirst();
byDetailTarifNonKelas.ifPresent(hargaNettoProdukByKelasD -> d.put("hargaJasa",
CommonUtil.isNotNullOrEmpty(byDetailTarifNonKelas.get().getHargaNetto1())
? byDetailTarifNonKelas.get().getHargaNetto1()
: byDetailTarifNonKelas.get().getHargaSatuan()));
} else if (!Arrays.asList(GRUP_RAWAT_INAP).contains(Integer.parseInt(d.get("idDepartemen").toString())) } else if (!Arrays.asList(GRUP_RAWAT_INAP).contains(Integer.parseInt(d.get("idDepartemen").toString()))
&& DOKTER_PEMERIKSA.equals(d.get("idJenisPelaksana"))) { && DOKTER_PEMERIKSA.equals(d.get("idJenisPelaksana"))) {
Optional<HargaNettoProdukByKelasD> byDetailTarifNonKelas = tarifDetailNonKelas.stream() Optional<HargaNettoProdukByKelasD> byDetailTarifNonKelas = tarifDetailNonKelas.stream()