Merge branch 'dev/remun/logbook-tarif' into dev/no-cron
This commit is contained in:
commit
e2235fd5ef
@ -244,6 +244,7 @@ public final class Master {
|
||||
public static final Integer[] JASA_MEDIS = { 21, 22, 35 };
|
||||
public static final Integer[] JASA_PARAMEDIS = { 25, 26, 27 };
|
||||
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_OPERATOR = 201;
|
||||
public static final Integer TOTAL_TARIF = 210;
|
||||
|
||||
@ -262,11 +262,11 @@ public interface MapPegawaiJabatanToUnitKerjaDao extends JpaRepository<MapPegawa
|
||||
@Param("idUnitKerja") Integer idUnitKerja);
|
||||
|
||||
@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 "
|
||||
+ "and map.unitKerjaPegawaiId = :idUnitKerja " + "and jab.kelompokJabatanId = :kelompokJabatanId "
|
||||
+ "order by subunit.name")
|
||||
+ "left join map.jabatan jab " + "left join map.subUnitKerjaPegawai subunit "
|
||||
+ "where map.statusEnabled is true " + "and map.unitKerjaPegawaiId = :idUnitKerja "
|
||||
+ "and jab.kelompokJabatanId = :kelompokJabatanId " + "order by subunit.name")
|
||||
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 "
|
||||
+ "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,
|
||||
@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 "
|
||||
+ "where mj.statusenabled is true and mj.objectpegawaifk = :pegawaiId "
|
||||
+ "and mj.objectjabatanfk in (:listJabatanId))", nativeQuery = true)
|
||||
boolean existsByPegawaiIdAndJabatanIdIn(@Param("pegawaiId") Integer idPegawai,
|
||||
@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);
|
||||
}
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package com.jasamedika.medifirst2000.service;
|
||||
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
|
||||
/**
|
||||
* View Object service
|
||||
*
|
||||
@ -19,53 +18,39 @@ import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
* @author Roberto
|
||||
*/
|
||||
public interface BaseVoService<T, V, K> {
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
public V update(V vo) throws JpaSystemException, ServiceVOException;
|
||||
V update(V vo) throws JpaSystemException, ServiceVOException;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* primary key
|
||||
* @return
|
||||
*/
|
||||
public V findById(K key) throws JpaSystemException;
|
||||
V findById(K key) throws JpaSystemException;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> findAllWithPageAndLimitAndSortByAndDirectionParameter(
|
||||
Integer page, Integer limit, String sort, String dir);
|
||||
Map<String, Object> findAllWithPageAndLimitAndSortByAndDirectionParameter(Integer page, Integer limit,
|
||||
String sort, String dir);
|
||||
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ import static com.jasamedika.medifirst2000.constants.Master.Profesi.TERAPI;
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class LogbookRemunServiceImpl implements LogbookRemunService {
|
||||
public class LogbookRemunServiceImpl extends BaseVoServiceImpl implements LogbookRemunService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LogbookRemunServiceImpl.class);
|
||||
|
||||
@ -58,9 +58,6 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
|
||||
@Autowired
|
||||
private MapPegawaiJabatanToUnitKerjaDao mapPegawaiJabatanToUnitKerjaDao;
|
||||
|
||||
@Autowired
|
||||
private SubUnitKerjaDao subUnitKerjaDao;
|
||||
|
||||
@Autowired
|
||||
private MapJabatanProfesiDao mapJabatanProfesiDao;
|
||||
|
||||
@ -72,16 +69,15 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
|
||||
Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
Date tglAwal = DateUtil.startMonth(date);
|
||||
Date tglAkhir = DateUtil.endMonth(date);
|
||||
List<Integer> subUnitKerjaIn = subUnitKerjaDao.findAllKelompokKerjaMedisId();
|
||||
Set<Integer> idPegawaiKelompokKerja = mapPegawaiJabatanToUnitKerjaDao
|
||||
.findPegawaiIdBySubUnitKerjaIn(subUnitKerjaIn);
|
||||
List<Integer> terapisRehabMedik = mapJabatanProfesiDao.findIdPegawaiByProfesiIn(Arrays.asList(TERAPI));
|
||||
idPegawaiKelompokKerja.addAll(terapisRehabMedik);
|
||||
if (!idPegawaiKelompokKerja.isEmpty()) {
|
||||
Set<Integer> listIdDokter = mapPegawaiJabatanToUnitKerjaDao
|
||||
.findDokterByUnitKerja(splitDataSettingDatafixed("listIdUnitKerjaKsm"));
|
||||
List<Integer> listTerapis = mapJabatanProfesiDao.findIdPegawaiByProfesiIn(Arrays.asList(TERAPI));
|
||||
listIdDokter.addAll(listTerapis);
|
||||
if (!listIdDokter.isEmpty()) {
|
||||
// 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) {
|
||||
@ -198,7 +194,7 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
|
||||
LogbookDokter logbookDokter = new LogbookDokter();
|
||||
logbookDokter.setKdProfile((short) 0);
|
||||
logbookDokter.setStatusEnabled(true);
|
||||
logbookDokter.setJenisLogbook("NON_JKN_DALAM_JAM_KERJA");
|
||||
logbookDokter.setJenisLogbook("DALAM_JAM_KERJA");
|
||||
logbookDokter.setJenisRuangan(fee.get("jenisRuangan").toString().toUpperCase());
|
||||
logbookDokter.setKelompokPasien(
|
||||
getKelompokPasien(Integer.parseInt(fee.get("idKelompokPasien").toString())));
|
||||
@ -262,7 +258,7 @@ public class LogbookRemunServiceImpl implements LogbookRemunService {
|
||||
LogbookDokter logbookDokter = new LogbookDokter();
|
||||
logbookDokter.setKdProfile((short) 0);
|
||||
logbookDokter.setStatusEnabled(true);
|
||||
logbookDokter.setJenisLogbook("NON_JKN_LUAR_JAM_KERJA");
|
||||
logbookDokter.setJenisLogbook("LUAR_JAM_KERJA");
|
||||
logbookDokter.setJenisRuangan(fee.get("jenisRuangan").toString().toUpperCase());
|
||||
logbookDokter.setKelompokPasien(
|
||||
getKelompokPasien(Integer.parseInt(fee.get("idKelompokPasien").toString())));
|
||||
|
||||
@ -1604,6 +1604,7 @@ public class RemunerasiServiceImpl extends BaseVoServiceImpl implements Remunera
|
||||
|
||||
private List<Map<String, Object>> transformPelayananPaket(Integer idPegawai, List<Map<String, Object>> listData) {
|
||||
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"));
|
||||
List<MapProdukPaket> paketList = mapProdukPaketDao.findAll();
|
||||
List<Integer> allProdukEntriId = paketList.stream().map(MapProdukPaket::getProdukEntriId)
|
||||
@ -1774,6 +1775,17 @@ public class RemunerasiServiceImpl extends BaseVoServiceImpl implements Remunera
|
||||
: 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()))
|
||||
&& DOKTER_PEMERIKSA.equals(d.get("idJenisPelaksana"))) {
|
||||
Optional<HargaNettoProdukByKelasD> byDetailTarifNonKelas = tarifDetailNonKelas.stream()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user