Update service logbook remunerasi
Perubahan filter dokter rekap logbook menggunakan unit kerja ksm
This commit is contained in:
parent
7cfa90c61a
commit
b0ad2cbe00
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user