56 lines
2.4 KiB
Java
56 lines
2.4 KiB
Java
package com.jasamedika.medifirst2000.controller;
|
|
|
|
import com.jasamedika.medifirst2000.constants.MessageResource;
|
|
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
|
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
|
import com.jasamedika.medifirst2000.service.PelayananPasienService;
|
|
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.ResponseEntity;
|
|
import org.springframework.orm.jpa.JpaSystemException;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
|
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
|
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
import static org.springframework.http.HttpStatus.OK;
|
|
|
|
/**
|
|
* @author salmanoe
|
|
* @version 1.0.0
|
|
* @since 04/06/2024
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/remun")
|
|
public class RemunerasiController extends LocaleController<LogbookKinerjaVO> {
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(RemunerasiController.class);
|
|
|
|
@Autowired
|
|
private PelayananPasienService pelayananPasienService;
|
|
|
|
@RequestMapping(value = "/logbook-tarif/{idPegawai}/{bulan}", method = RequestMethod.GET)
|
|
public ResponseEntity<List<Map<String, Object>>> recap(HttpServletRequest request,
|
|
@PathVariable("idPegawai") Integer idPegawai, @PathVariable("bulan") String bulan) {
|
|
try {
|
|
List<Map<String, Object>> result = pelayananPasienService.rekapLogbook(idPegawai, bulan);
|
|
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
|
return RestUtil.getJsonResponse(result, OK, mapHeaderMessage);
|
|
} catch (ServiceVOException | JpaSystemException e) {
|
|
LOGGER.error("Got ServiceVOException {} when get recap remun", e.getMessage());
|
|
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
|
return RestUtil.getJsonHttptatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
|
}
|
|
}
|
|
}
|