Update service remunerasi

Hapus API baru, penyesuaian validasi cut-off  tarif baru di controller existing
This commit is contained in:
Salman Manoe 2024-10-02 20:47:55 +07:00
parent eca1f38fcb
commit f7fb78722d
3 changed files with 475 additions and 338 deletions

View File

@ -24,6 +24,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.text.ParseException;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -118,6 +120,9 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
@Autowired
private PenilaianKinerjaService penilaianKinerjaService;
@Autowired
private RemunerasiService remunerasiService;
@RequestMapping(value = "/get-load-data", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Map<String, Object>> getLoadData(HttpServletRequest request) {
try {
@ -197,11 +202,11 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
return RestUtil.getJsonResponse(null, HttpStatus.NOT_FOUND, mapHeaderMessage);
}
} catch (ServiceVOException e) {
LOGGER.error("Got ServiceVOException {} when getKalkulasiDataRemunerasi", e.getMessage());
LOGGER.error("Got ServiceVOException {} when getKalkulasiDataRemunerasiPegawai", e.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got JpaSystemException {} when getKalkulasiDataRemunerasi", jse.getMessage());
LOGGER.error("Got JpaSystemException {} when getKalkulasiDataRemunerasiPegawai", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
@ -766,11 +771,11 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(true, HttpStatus.CREATED, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when add/update working record", sve.getMessage());
LOGGER.error("Got ServiceVOException {} when add/update set kontrak kinerja", 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 add/update working record", jse.getMessage());
LOGGER.error("Got JpaSystemException {} when add/update set kontrak kinerja", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
@ -1441,11 +1446,11 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
return RestUtil.getJsonResponse(result, HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
}
} catch (ServiceVOException sve) {
LOGGER.error("Got ServiceVOException {} when verifikasi logbook dokter", sve.getMessage());
LOGGER.error("Got ServiceVOException {} when verifikasi logbook skor", 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 verifikasi logbook dokter", jse.getMessage());
LOGGER.error("Got JpaSystemException {} when verifikasi logbook skor", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
@ -2666,7 +2671,15 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
public ResponseEntity<Map<String, Object>> getLogbookRemunTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
Map<String, Object> result = pelayananPasienService.logbookRemunTarifDokter(idPegawai, bulan, null);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
YearMonth oct24 = YearMonth.parse("2024-09", formatter);
YearMonth month = YearMonth.parse(bulan, formatter);
Map<String, Object> result;
if (month.isBefore(oct24)) {
result = pelayananPasienService.logbookRemunTarifDokter(idPegawai, bulan, null);
} else {
result = remunerasiService.logbookRemunTarifDokter(idPegawai, bulan, null);
}
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
@ -2685,7 +2698,15 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
public ResponseEntity<List<Map<String, Object>>> getLogbookFfsTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = pelayananPasienService.logbookFfsTarifDokter(idPegawai, bulan, null);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
YearMonth oct24 = YearMonth.parse("2024-09", formatter);
YearMonth month = YearMonth.parse(bulan, formatter);
List<Map<String, Object>> result;
if (month.isBefore(oct24)) {
result = pelayananPasienService.logbookFfsTarifDokter(idPegawai, bulan, null);
} else {
result = remunerasiService.logbookFfsTarifDokter(idPegawai, bulan, null);
}
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
@ -2704,7 +2725,15 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
public ResponseEntity<List<Map<String, Object>>> getLogbookFfsLuarTarifDokter(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = pelayananPasienService.logbookFfsLuarTarifDokter(idPegawai, bulan, null);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
YearMonth oct24 = YearMonth.parse("2024-09", formatter);
YearMonth month = YearMonth.parse(bulan, formatter);
List<Map<String, Object>> result;
if (month.isBefore(oct24)) {
result = pelayananPasienService.logbookFfsLuarTarifDokter(idPegawai, bulan, null);
} else {
result = remunerasiService.logbookFfsLuarTarifDokter(idPegawai, bulan, null);
}
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
@ -2725,7 +2754,15 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
public ResponseEntity<List<Map<String, Object>>> getLogbookKlaimMpp(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = pelayananPasienService.logbookKlaimMppDokter(idPegawai, bulan);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
YearMonth oct24 = YearMonth.parse("2024-09", formatter);
YearMonth month = YearMonth.parse(bulan, formatter);
List<Map<String, Object>> result;
if (month.isBefore(oct24)) {
result = pelayananPasienService.logbookKlaimMppDokter(idPegawai, bulan);
} else {
result = remunerasiService.logbookKlaimMppDokter(idPegawai, bulan);
}
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
@ -2744,7 +2781,15 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
public ResponseEntity<List<Map<String, Object>>> getLogbookFixedPay(HttpServletRequest request,
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
try {
List<Map<String, Object>> result = pelayananPasienService.logbookFixedPayDokter(idPegawai, bulan, null);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
YearMonth oct24 = YearMonth.parse("2024-09", formatter);
YearMonth month = YearMonth.parse(bulan, formatter);
List<Map<String, Object>> result;
if (month.isBefore(oct24)) {
result = pelayananPasienService.logbookFixedPayDokter(idPegawai, bulan, null);
} else {
result = remunerasiService.logbookFixedPayDokter(idPegawai, bulan, null);
}
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);

View File

@ -1,26 +1,22 @@
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.*;
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 javax.servlet.http.HttpServletRequest;
import java.util.List;
@ -49,9 +45,6 @@ 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) {
@ -73,125 +66,4 @@ public class RemunerasiController extends LocaleController<LogbookKinerjaVO> {
}
}
@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);
}
}
}