Update remunerasi service

Pembuatan versioning API untuk logbook tarif oktober 2024
This commit is contained in:
Salman Manoe 2024-10-01 14:39:36 +07:00
parent 24e11b5391
commit 07263cefc5
3 changed files with 2959 additions and 52 deletions

View File

@ -20,4 +20,18 @@ public interface RemunerasiService {
Map<String, Object> getKuantitasCapaianHariKerja(Integer idPegawai, String bulan);
Map<String, Object> splitRemunFfs(Integer idPegawai, String bulan);
Map<String, Object> logbookRemunTarifDokter(Integer idPegawai, String bulan, Map<String, Object> data);
List<Map<String, Object>> logbookFfsTarifDokter(Integer idPegawai, String bulan, Map<String, Object> data);
List<Map<String, Object>> logbookFfsLuarTarifDokter(Integer idPegawai, String bulan, Map<String, Object> data);
List<Map<String, Object>> logbookKlaimMppDokter(Integer idPegawai, String bulan);
List<Map<String, Object>> logbookFixedPayDokter(Integer idPegawai, String bulan, Map<String, Object> data);
List<Map<String, Object>> detailLogbookTarifDokter(Integer idPegawai, List<String> norecs);
}

View File

@ -1,22 +1,26 @@
package com.jasamedika.medifirst2000.controller;
import com.jasamedika.medifirst2000.constants.Constants;
import com.jasamedika.medifirst2000.constants.MessageResource;
import com.jasamedika.medifirst2000.controller.base.LocaleController;
import com.jasamedika.medifirst2000.core.web.WebConstants;
import com.jasamedika.medifirst2000.dto.superapp.request.EmailDto;
import com.jasamedika.medifirst2000.dto.superapp.response.AuthorizationDto;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.MapPegawaiJabatanToUnitKerjaService;
import com.jasamedika.medifirst2000.service.PelayananPasienService;
import com.jasamedika.medifirst2000.service.RemunerasiService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.util.rest.RestUtil;
import com.jasamedika.medifirst2000.vo.LogbookKinerjaVO;
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.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@ -45,6 +49,9 @@ public class RemunerasiController extends LocaleController<LogbookKinerjaVO> {
@Autowired
private MapPegawaiJabatanToUnitKerjaService mapPegawaiJabatanToUnitKerjaService;
@Autowired
private RemunerasiService remunerasiService;
@RequestMapping(value = "/logbook-tarif/{idPegawai}/{bulan}", method = GET)
public ResponseEntity<Object> recap(HttpServletRequest request, @PathVariable("idPegawai") Integer idPegawai,
@PathVariable("bulan") String bulan) {
@ -65,4 +72,126 @@ public class RemunerasiController extends LocaleController<LogbookKinerjaVO> {
return new ResponseEntity<>(null, INTERNAL_SERVER_ERROR);
}
}
@RequestMapping(value = "/dokter/logbook-tarif/remun/{idPegawai}/{bulan}", method = RequestMethod.GET)
public ResponseEntity<Map<String, Object>> getLogbookRemunTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
Map<String, Object> result = remunerasiService.logbookRemunTarifDokter(idPegawai, bulan, null);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when get logbook remun tarif dokter", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when get logbook remun tarif dokter", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/dokter/logbook-tarif/ffs/{idPegawai}/{bulan}", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getLogbookFfsTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = remunerasiService.logbookFfsTarifDokter(idPegawai, bulan, null);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when get logbook ffs tarif dokter", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when get logbook ffs tarif dokter", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/dokter/logbook-tarif/ffs-luar/{idPegawai}/{bulan}", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getLogbookFfsLuarTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = remunerasiService.logbookFfsLuarTarifDokter(idPegawai, bulan, null);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when get logbook ffs luar jam kerja tarif dokter",
sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when get logbook ffs luar jam kerja tarif dokter",
jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/dokter/logbook-tarif/fixed-pay/{idPegawai}/{bulan}", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getLogbookFixedPay(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = remunerasiService.logbookFixedPayDokter(idPegawai, bulan, null);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when get logbook fixed pay tarif dokter", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when get logbook fixed pay tarif dokter", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/dokter/logbook-tarif/klaim-mpp/{idPegawai}/{bulan}", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getLogbookKlaimMpp(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = remunerasiService.logbookKlaimMppDokter(idPegawai, bulan);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when get logbook klaim MPP tarif dokter", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when get logbook klaim MPP tarif dokter", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/dokter/logbook-tarif/detail/{idPegawai}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Map<String, Object>>> getDetailLogbookTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @RequestBody List<String> norecs) {
try {
List<Map<String, Object>> result = remunerasiService.detailLogbookTarifDokter(idPegawai, norecs);
if (CommonUtil.isNotNullOrEmpty(result)) {
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS_OK,
getMessage(MessageResource.LABEL_SUCCESS_OK, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} else {
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,
getMessage(MessageResource.LABEL_ERROR, request));
return RestUtil.getJsonHttptatus(HttpStatus.BAD_REQUEST, mapHeaderMessage);
}
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when get detail logbook tarif dokter", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when get detail logbook tarif dokter", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
}