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);
|
@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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user