Update service mapping jabatan pegawai
Pembuatan endpoint jenis logbook berdasarkan pegawai yang dipilih
This commit is contained in:
parent
42dc402040
commit
d7b469e420
@ -272,6 +272,12 @@ public final class Master {
|
||||
public static final Long BATAS_TERLAMBAT = 15L; // 15_Menit
|
||||
}
|
||||
|
||||
public static final class NilaiKelompokJabatan {
|
||||
public static final Integer[] MEDIK = { 3, 4, 5, 6, 10, 11, 12 };
|
||||
public static final Integer[] PENUNJANG_MEDIK = { 22, 23, 24, 25, 26 };
|
||||
public static final Integer[] NURSE = { 17, 18, 19, 20, 21 };
|
||||
}
|
||||
|
||||
public static final class Pegawai {
|
||||
public static final Integer[] ADMINISTRATOR = { 0, 320272 };
|
||||
public static final Integer[] LOGIN_ADMIN = { 320263, 320264 };
|
||||
|
||||
@ -67,4 +67,6 @@ public interface MapPegawaiJabatanToUnitKerjaService {
|
||||
List<Map<String, Object>> getlistPegawaiByUnitKerja(Integer unitKerjaPegawaiId);
|
||||
|
||||
AuthorizationDto get(EmailDto dto);
|
||||
|
||||
String getJenisLogbook(Integer idPegawai);
|
||||
}
|
||||
|
||||
@ -1748,4 +1748,25 @@ public class MapPegawaiJabatanToUnitKerjaServiceImpl extends BaseVoServiceImpl
|
||||
return byEmailOrEmailAlternatif.map(pegawai -> AuthorizationDto.builder().pegawaiId(pegawai.getId())
|
||||
.email(pegawai.getEmail()).emailAlternatif(pegawai.getEmailAlternatif()).build()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJenisLogbook(Integer idPegawai) {
|
||||
List<MapPegawaiJabatanToUnitKerja> byPegawaiId = mapPegawaiJabatanToUnitKerjaDao.findByPegawaiId(idPegawai);
|
||||
Optional<MapPegawaiJabatanToUnitKerja> anyMedik = byPegawaiId.stream()
|
||||
.filter(m -> Arrays.asList(Master.NilaiKelompokJabatan.MEDIK).contains(m.getGradeId())).findAny();
|
||||
Optional<MapPegawaiJabatanToUnitKerja> anyPenunjangMedik = byPegawaiId.stream()
|
||||
.filter(m -> Arrays.asList(Master.NilaiKelompokJabatan.PENUNJANG_MEDIK).contains(m.getGradeId()))
|
||||
.findAny();
|
||||
Optional<MapPegawaiJabatanToUnitKerja> anyNurse = byPegawaiId.stream()
|
||||
.filter(m -> Arrays.asList(Master.NilaiKelompokJabatan.NURSE).contains(m.getGradeId())).findAny();
|
||||
if (anyMedik.isPresent()) {
|
||||
return "Logbook-Tarif Dokter";
|
||||
} else if (anyPenunjangMedik.isPresent()) {
|
||||
return "Logbook-Tarif Paramedis";
|
||||
} else if (anyNurse.isPresent()) {
|
||||
return "Logbook-Tarif Perawat";
|
||||
} else {
|
||||
return "Logbook Tarif";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,11 +8,11 @@ hibernate.show_sql = true
|
||||
hikari.config.maximum.pool.size = 5
|
||||
|
||||
# DB Development
|
||||
jdbc.url = jdbc:postgresql://192.168.12.3:5432/rsab_hk_24_08_20
|
||||
jdbc.url = jdbc:postgresql://192.168.12.3:5432/rsab_hk_25_01_14
|
||||
jdbc.username = smart_user
|
||||
jdbc.password = 1miwhir3yr
|
||||
jdbc.serverName = 192.168.12.3
|
||||
jdbc.databaseName = rsab_hk_24_08_20
|
||||
jdbc.databaseName = rsab_hk_25_01_14
|
||||
jdbc.portNumber = 5432
|
||||
|
||||
corePoolSizeAsyncConfigurer = 5
|
||||
|
||||
@ -1,28 +1,5 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.Master;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
@ -32,6 +9,22 @@ import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.MapPegawaiJabatanToUnitKerjaService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.MapPegawaiJabatanToUnitKerjaVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/map-pegawai-jabatan-unitkerja")
|
||||
@ -369,4 +362,10 @@ public class MapPegawaiJabatanToUnitKerjaController extends LocaleController<Map
|
||||
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/logbook-title/{idPegawai}", method = RequestMethod.GET)
|
||||
public ResponseEntity<String> logbookTitle(@PathVariable("idPegawai") Integer idPegawai) {
|
||||
String jenisLogbook = mapPegawaiJabatanToUnitKerjaService.getJenisLogbook(idPegawai);
|
||||
return RestUtil.getJsonResponse(jenisLogbook, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user