package com.jasamedika.medifirst2000.controller;

import com.jasamedika.medifirst2000.constants.MessageResource;
import com.jasamedika.medifirst2000.controller.base.LocaleController;
import com.jasamedika.medifirst2000.dao.JenisGajiDao;
import com.jasamedika.medifirst2000.dao.MapUraianTugasToRincianKegiatanDao;
import com.jasamedika.medifirst2000.entities.JenisGaji;
import com.jasamedika.medifirst2000.entities.MapUraianTugasToRincianKegiatan;
import com.jasamedika.medifirst2000.entities.Pegawai;
import com.jasamedika.medifirst2000.entities.UnitKerjaPegawai;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.*;
import com.jasamedika.medifirst2000.vo.*;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
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.util.List;
import java.util.Map;
import java.util.Set;

import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
import static com.jasamedika.medifirst2000.util.DateUtil.toDate;
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
import static org.slf4j.LoggerFactory.getLogger;
import static org.springframework.http.HttpStatus.*;
import static org.springframework.http.MediaType.ALL_VALUE;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

@RestController
@RequestMapping("/sdm")
public class SdmController extends LocaleController<AkunVO> {

	private static final Logger LOGGER = getLogger(SdmController.class);

	@Autowired
	private BerkasLamaranService berkasLamaranService;

	@Autowired
	private MonitoringAbsenService monitoringAbsenService;

	@Autowired
	private RiwayatPenilaianKompetensiPegawaiService riwayatPenilaianKompetensiPegawaiService;

	@Autowired
	private CustomIndexKerjaService customIndexKerjaService;

	@Autowired
	private UraianTugasService uraianTugasService;

	@Autowired
	private UnitKerjaPegawaiService unitKerjaPegawaiService;

	@Autowired
	private UraianTugasTransaksiService uraianTugasTransaksiService;

	@Autowired
	private MappingPegawaiToAtasanService mappingPegawaiToAtasanService;

	@Autowired
	private KategoriPegawaiService kategoriPegawaiService;

	@Autowired
	private ReservasiService reservasiService;

	@Autowired
	private JadwalDokterService jadwalDokterService;

	@Autowired
	private AbsensiPegawaiService absensiPegawaiService;

	@Autowired
	private KedudukanService kedudukanService;

	@Autowired
	private JabatanService jabatanService;

	@Autowired
	private ShiftKerjaService shiftKerjaService;

	@Autowired
	private AturanPeminjamanService aturanPeminjamanService;

	@Autowired
	private BibliographyService bibliographyService;

	@Autowired
	private DaftarKeanggotaanService daftarKeanggotaanService;

	@Autowired
	private DataKeluargaService dataKeluargaService;

	@Autowired
	private MutasiPegawaiService mutasiPegawaiService;

	@Autowired
	private PerhitunganPremiBPJSKesehatanService perhitunganPremiBPJSKesehatanService;

	@Autowired
	private PerhitunganSantunanPegawaiMeninggalDuniaService perhitunganSantunanPegawaiMeninggalDuniaService;

	@Autowired
	private PermohonanCutiPegawaiService permohonanCutiPegawaiService;

	@Autowired
	private RegistrasiKeanggotaanService registrasiKeanggotaanService;

	@Autowired
	private RekamDataPegawaiService rekamDataPegawaiService;

	@Autowired
	private IsianPelamarService IsianPelamarService;

	@Autowired
	private AsuransiNakerService AsuransiNakerService;

	@Autowired
	private MasterHonorTimService MasterHonorTimService;

	@Autowired
	private GolonganService GolonganService;

	@Autowired
	private IndekKinerjaService indekKinerjaService;

	@Autowired
	private NilaiKelompokJabatanService kelompokJabatanService;

	@Autowired
	private MasterEvaluasiJabatanService MasterEvaluasiJabatanService;

	@Autowired
	private EvaluasiJabatanService EvaluasiJabatanService;

	@Autowired
	private SimulasiPendapatanService simulasiPendapatanService;

	@Autowired
	private PerhitunganAbkService PerhitunganAbkService;

	@Autowired
	private JadwalOrientasiService jadwalOrientasiService;

	@Autowired
	private PegawaiMutasiSanksiResignService serviceMusare;

	@Autowired
	private PermohonanStatusPegawaiService servicePermohonanStatus;

	@Autowired
	private InformasiDaftarGajiService informasiDaftarGajiService;

	@Autowired
	private JenisGajiDao jenisGajiDao;

	@Autowired
	private MapUraianTugasToRincianKegiatanDao mapUraianTugasToRincianKegiatanDao;

	@RequestMapping(value = "/save-custom-uraian-kerja", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveBerkasLamaran(@Valid @RequestBody CustomIndexKerjaVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = customIndexKerjaService.saveCustomIndexKerja(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveCustomIndexKerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveCustomIndexKerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-custom-uraian-kerja/{id}/{tanggal}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getCustomUraianKerja(@PathVariable("id") String id,
			@PathVariable("tanggal") String tanggal, HttpServletRequest request) {
		try {
			Map<String, Object> result = customIndexKerjaService.findByPegawaiAndData(id, toDate(tanggal));
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-berkas-lamaran", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveBerkasLamaran(@Valid @RequestBody BerkasLamaranVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = berkasLamaranService.saveBerkasLamaran(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveBerkasLamaran", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveBerkasLamaran", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-berkas-lamaran/{nama}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getsaveBerkasLamaran(@PathVariable("nama") String nama,
			HttpServletRequest request) {
		try {
			if (nama.equals("-"))
				nama = "";
			Map<String, Object> result = berkasLamaranService.findByNamaPelamarNoRec(nama);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-reservasi", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveReservasi(@Valid @RequestBody ReservasiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = reservasiService.saveReservasi(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveReservasi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveReservasi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/upload-absen", method = POST, produces = APPLICATION_JSON_VALUE, consumes = ALL_VALUE)
	public ResponseEntity<Map<String, Object>> uploadAbsen(@Valid @RequestBody UploadExcelVO fileInput,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = jadwalDokterService.uploadAbsensi(fileInput);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when uploadAbsensi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when uploadAbsensi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-absen", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveAbsen(@Valid @RequestBody SaveAbsenVO fileInput,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = null;
			for (AbsensiPegawaiVO absensiPegawaiVO : fileInput.getData())
				result = absensiPegawaiService.saveAbsensiPegawai(absensiPegawaiVO);
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveAbsensiPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveAbsensiPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-reservasi-by-anggota/{norec}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getReservasiByNoRec(@PathVariable("norec") String norec,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = reservasiService.findReservasiByAnggota(norec);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-kedudukan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveKedudukan(@Valid @RequestBody KedudukanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = kedudukanService.saveKedudukan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveKedudukan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveKedudukan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-shift-kerja", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveShiftKerja(@Valid @RequestBody ShiftKerjaVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = shiftKerjaService.saveShiftKerja(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveShiftKerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveShiftKerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/delete-shift-kerja/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> deleteShiftKerja(@RequestParam(value = "id") Integer id,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = shiftKerjaService.deleteShiftKerja(id);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when deleteShiftKerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when deleteShiftKerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-shift-kerja", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getShiftKerja(HttpServletRequest request) {
		try {
			Map<String, Object> result = shiftKerjaService.findAll();
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when shiftKerjaService.findAll", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when shiftKerjaService.findAll", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-aturan-peminjaman", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveAturanPeminjaman(@Valid @RequestBody AturanPeminjamanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = aturanPeminjamanService.saveAturanPeminjaman(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveAturanPeminjaman", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveAturanPeminjaman", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-bibliography", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveBibliography(@Valid @RequestBody BibliographyVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = bibliographyService.saveBibliography(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveBibliography", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveBibliography", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-bibliography/{nama}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getBibliography(@PathVariable("nama") String nama,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = bibliographyService.findByName(nama);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-daftar-keanggotaan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveDaftarKeanggotaan(@Valid @RequestBody DaftarKeanggotaanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = daftarKeanggotaanService.saveDaftarKeanggotaan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveDaftarKeanggotaan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveDaftarKeanggotaan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-data-keluarga", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveDataKeluarga(@Valid @RequestBody DataKeluargaVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = dataKeluargaService.saveDataKeluarga(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveDataKeluarga", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveDataKeluarga", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-mutasi-pegawai", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveMutasiPegawai(@Valid @RequestBody MutasiPegawaiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = mutasiPegawaiService.saveMutasiPegawai(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveMutasiPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveMutasiPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-perhitungan-premi-b-p-j-s-kesehatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePerhitunganPremiBPJSKesehatan(
			@Valid @RequestBody PerhitunganPremiBPJSKesehatanVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = perhitunganPremiBPJSKesehatanService.savePerhitunganPremiBPJSKesehatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePerhitunganPremiBPJSKesehatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePerhitunganPremiBPJSKesehatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-perhitungan-santunan-pegawai-meninggal-dunia", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePerhitunganSantunanPegawaiMeninggalDunia(
			@Valid @RequestBody PerhitunganSantunanPegawaiMeninggalDuniaVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = perhitunganSantunanPegawaiMeninggalDuniaService
					.savePerhitunganSantunanPegawaiMeninggalDunia(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePerhitunganSantunanPegawaiMeninggalDunia", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePerhitunganSantunanPegawaiMeninggalDunia",
					jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-permohonan-cuti-pegawai", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePermohonanCutiPegawai(@Valid @RequestBody PermohonanCutiPegawaiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = permohonanCutiPegawaiService.savePermohonanCutiPegawai(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePermohonanCutiPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePermohonanCutiPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-registrasi-keanggotaan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveRegistrasiKeanggotaan(@Valid @RequestBody RegistrasiKeanggotaanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = registrasiKeanggotaanService.saveRegistrasiKeanggotaan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveRegistrasiKeanggotaan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveRegistrasiKeanggotaan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-registrasi-keanggotaan/{nama}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getRegistrasiKeanggotaan(@PathVariable("nama") String nama,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = registrasiKeanggotaanService.findByName(nama);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-rekam-data-pegawai", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveRekamDataPegawai(@Valid @RequestBody RekamDataPegawaiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = rekamDataPegawaiService.saveRekamDataPegawai(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveRekamDataPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveRekamDataPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-isian-pelamar", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveIsianPelamar(@Valid @RequestBody IsianPelamarVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = IsianPelamarService.saveIsianPelamar(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveIsianPelamar", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveIsianPelamar", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-isian-pelamar/", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getIsianPelamar(HttpServletRequest request) {
		try {
			Map<String, Object> result = IsianPelamarService.findDataPelamar();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-asuransi-naker", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveAsuransiNaker(@Valid @RequestBody AsuransiNakerVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = AsuransiNakerService.saveAsuransiNaker(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveAsuransiNaker", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveAsuransiNaker", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-master-honor-tim", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveMasterHonorTim(@Valid @RequestBody MasterHonorTimVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = MasterHonorTimService.saveMasterHonorTim(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveMasterHonorTim", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveMasterHonorTim", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/jenis-gaji", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<JenisGaji>> listJenisGaji() {
		List<JenisGaji> listJenisGaji = (List<JenisGaji>) jenisGajiDao.findAll();
		return getJsonResponse(listJenisGaji);
	}

	@RequestMapping(value = "/save-golongan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveGolongan(@Valid @RequestBody GolonganVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = GolonganService.saveGolongan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveGolongan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveGolongan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-indek-kinerja", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveIndekKinerja(@Valid @RequestBody List<IndekKinerjaVO> vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.saveIndekKinerja(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveIndekKinerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveIndekKinerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-indek-kinerja/{tahun}/{bulan}/{pegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getPegawaiByJadwal(@PathVariable("tahun") Integer tahun,
			@PathVariable("bulan") Integer bulan, @PathVariable("pegawai") Integer pegawai,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.findPegawaiByRuangan(tahun, bulan, pegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/set-uraian-tugas/{id}/{bobot}/{target}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> setBobot(@PathVariable("id") Integer id,
			@PathVariable("bobot") Integer bobot, @PathVariable("target") Integer target, HttpServletRequest request) {
		try {
			MapUraianTugasToRincianKegiatan model = mapUraianTugasToRincianKegiatanDao.findOne(id);
			model.setBobot(bobot.toString());
			model.setTarget(target.toString());
			model.setReportDisplay(model.getRincianKegiatan());
			model.setNamaExternal("-");
			model.setReportDisplay("-");
			model.setKodeExternal("-");
			mapUraianTugasToRincianKegiatanDao.save(model);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonHttpStatus(OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-kelompok-jabatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveKelompokJabatan(@Valid @RequestBody NilaiKelompokJabatanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = kelompokJabatanService.saveNilaiKelompokJabatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveNilaiKelompokJabatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveNilaiKelompokJabatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-master-evaluasi-jabatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveMasterEvaluasiJabatan(@Valid @RequestBody MasterEvaluasiJabatanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = MasterEvaluasiJabatanService.saveMasterEvaluasiJabatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveMasterEvaluasiJabatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveMasterEvaluasiJabatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/hitung-master-evaluasi-jabatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> hitungMasterEvaluasiJabatan(
			@Valid @RequestBody MasterEvaluasiJabatanVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = MasterEvaluasiJabatanService.hitungPoinEvaluasi(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when MasterEvaluasiJabatanService.hitungPoinEvaluasi",
					e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when MasterEvaluasiJabatanService.hitungPoinEvaluasi",
					jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/hitung-grade-evaluasi-jabatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> hitungGradeEvaluasiJabatan(@Valid @RequestBody EvaluasiJabatanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = EvaluasiJabatanService.hitungPoinEvaluasi(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when EvaluasiJabatanService.hitungPoinEvaluasi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when EvaluasiJabatanService.hitungPoinEvaluasi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-jabatan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListJabatan(HttpServletRequest request) {
		try {
			Map<String, Object> result = MasterEvaluasiJabatanService.findJabatan();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-by-jabatan/{idJabatan}/{bulan}/{tahun}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListByJabatan(@PathVariable("idJabatan") Integer idJabatan,
			@PathVariable("bulan") String bulan, @PathVariable("tahun") Integer tahun, HttpServletRequest request) {
		try {
			Map<String, Object> result = MasterEvaluasiJabatanService.findEvaluasiByJabatan(idJabatan, tahun, bulan);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-evaluasi-jabatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveEvaluasiJabatan(@Valid @RequestBody List<EvaluasiJabatanVO> vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = EvaluasiJabatanService.saveEvaluasiJabatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveEvaluasiJabatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveEvaluasiJabatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-evaluasi-jabatan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getEvaluasiJabatan(@RequestParam(value = "tahun") Integer tahun,
			@RequestParam(value = "bulan") String bulan, @RequestParam(value = "ruangan") Integer ruangan,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = EvaluasiJabatanService.findEvaluasiJabatan(tahun, bulan, ruangan);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-rekap", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getRekap(@RequestParam(value = "tahun") Integer tahun,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = EvaluasiJabatanService.findPegawaiByTahun(tahun);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-evaluasi-pegawai", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getEvaluasiPegawai(@RequestParam(value = "tahun") Integer tahun,
			@RequestParam(value = "idPegawai") Integer idPegawai, @RequestParam(value = "bulan") Integer bulan,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = EvaluasiJabatanService.findPegawaiByTahun(tahun, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-simulasi-pendapatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveSimulasiPendapatan(@Valid @RequestBody SimulasiPendapatanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = simulasiPendapatanService.saveSimulasiPendapatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveSimulasiPendapatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveSimulasiPendapatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-save-simulasi-pendapatan/{tahun}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getsaveSimulasiPendapatan(@PathVariable("tahun") Integer tahun,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = simulasiPendapatanService.findByTahun(tahun);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-perhitungan-abk", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePerhitunganAbk(@Valid @RequestBody List<PerhitunganAbkVO> vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = PerhitunganAbkService.savePerhitunganAbk(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePerhitunganAbk", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePerhitunganAbk", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-perhitungan-abk", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getPerhitunganAbk(@RequestParam(value = "tahun") Integer tahun,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = PerhitunganAbkService.findByTahun(tahun);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-jadwal-orientasi", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveJadwalOrientasi(@Valid @RequestBody JadwalOrientasiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = jadwalOrientasiService.saveJadwalOrientasi(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveJadwalOrientasi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveJadwalOrientasi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-save-jadwal-orientasi/{nama}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getsaveJadwalOrientasi(@PathVariable("nama") String nama,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = jadwalOrientasiService.findByName(nama);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-tindakan-by-user-id/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getTindakanByUserId(@PathVariable("startDate") String startDate,
			@PathVariable("endDate") String endDate, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.findByUserId(startDate, endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-uraian-kerja", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getUraianKerja(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.findUraianTugas();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-persen-uraian-kerja/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getPersen(@PathVariable("startDate") String startDate,
			@PathVariable("endDate") String endDate, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.findCountTindakanByIdUserAndPeriod(startDate,
					endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-detail-poin/{tgl}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getDetailPoin(@PathVariable("tgl") String tgl,
			@PathVariable("idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.detailPoin(tgl, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-rekap-poin/{month}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getRekapPoin(@PathVariable("month") String month,
			@PathVariable("idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.rekapPoin(month, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-uraian-tugas-transaksi", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveUraianTugasTransaksi(@Valid @RequestBody UraianTugasCustomVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = uraianTugasTransaksiService.saveUraianTugas(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveUraianTugas", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveUraianTugas", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-indek-kinerja-kuantitas/{month}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getIndekKinerjaKuantitas(@PathVariable("month") String month,
			@PathVariable("idPegawai") Integer idPegawai,
			@RequestParam(value = "isNew", required = false) Boolean isNew, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.getIndekKinerjaKuantitasData(month, idPegawai, isNew);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-rekapitulasi-capaian/{month}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getRekapitulasiCapaian(@PathVariable("month") String month,
			@PathVariable("idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.getRekapitulasiCapaianUraianTugas(month, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-uraian-kerja-dan-capaian/{date}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getUraianKerjaDanCapaian(@PathVariable("date") String date,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.findUraianTugasByTanggal(date);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-target-bobot-uraian-kerja/{idPegawai}/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getTargetBobotUraianKerja(@PathVariable("idPegawai") Integer idPegawai,
			@PathVariable("periode") String periode, HttpServletRequest request) {
		try {
			Map<String, Object> result = uraianTugasTransaksiService.findTargetAndBobot(idPegawai, periode);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-id-pgw", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Pegawai> getIDs(HttpServletRequest request) {
		try {
			Pegawai result = indekKinerjaService.getPegawaiByUserLogin();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-target-bobot-uraian-tugas-transaksi", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveTargetBobotUraianTugasTransaksi(
			@Valid @RequestBody UraianTugasCustomVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = uraianTugasTransaksiService.saveTargetBobotUraianTugas(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveTargetBobotUraianTugas", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveTargetBobotUraianTugas", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-list-indeks-kinerja-individu", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveListIndeksKinerjaindividu(
			@Valid @RequestBody IndeksKinerjaIndividuCustomVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.saveAllIndekKinerja(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveAllIndekKinerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveAllIndekKinerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-kualitas-inovasi-IKI/{periode}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findKualitasAndInovasi(@PathVariable("periode") String periode,
			@PathVariable("idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.findKualitasAndInovasi(periode, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-kehadiran/{idPegawai}/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findKehadiran(@PathVariable("idPegawai") Integer idPegawai,
			@PathVariable("startDate") String startDate, @PathVariable("endDate") String endDate,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.jumlahKehadiran(null, null, idPegawai, startDate,
					endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-monitoring-absen", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveMonitoringAbsen(@Valid @RequestBody MonitoringAbsenCustomVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveMonitoring(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveMonitoring", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveMonitoring", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-kehadiran-iki/{periode}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findKehadiranIKI(@PathVariable("periode") String periode,
			@PathVariable("idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.findKehadiran(periode, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-kehadiran-by-ruangan/{idUnitKerja}/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findKehadiranByRuangan(@PathVariable("idUnitKerja") Integer idUnitKerja,
			@PathVariable("startDate") String startDate, @PathVariable("endDate") String endDate,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.jumlahKehadiran(idUnitKerja, null, null, startDate,
					endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-kehadiran-by-ruangan/{idUnitKerja}/{idSubUnitKerja}/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findKehadiranByRuangan(@PathVariable("idUnitKerja") Integer idUnitKerja,
			@PathVariable("idSubUnitKerja") Integer idSubUnitKerja, @PathVariable("startDate") String startDate,
			@PathVariable("endDate") String endDate, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.jumlahKehadiran(idUnitKerja, idSubUnitKerja, null,
					startDate, endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-kehadiran-all-pegawai/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findAllKehadiran(@PathVariable("startDate") String startDate,
			@PathVariable("endDate") String endDate, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.findKehadiranAllPegawai(startDate, endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-rekap-IKI/{idRuangan}/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findRekapIKI(@PathVariable("idRuangan") Integer idRuangan,
			@PathVariable("periode") String periode, HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.rekapIKI(idRuangan, periode);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-penilaian-kompetensi/{idJabatan}/{tglPenilaian}/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findRekapIKI(@PathVariable("idJabatan") Integer idJabatan,
			@PathVariable("tglPenilaian") String tglPenilaian, @PathVariable("idPegawai") Integer idPegawai,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = riwayatPenilaianKompetensiPegawaiService
					.getPenilaianKompetensiPegawai(idJabatan, tglPenilaian, idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-penilaian-kompetensi-pegawai", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePenilaianKompetensiPegawai(@Valid @RequestBody StrukHistoriVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = riwayatPenilaianKompetensiPegawaiService.savePenilaianKompetensiPegawai(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePenilaianKompetensiPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePenilaianKompetensiPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-login-user-musare", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getUserLogin(HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.getUserLogin();
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when serviceMusare.getUserLogin", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when serviceMusare.getUserLogin", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-data-by-pegawai", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getDataByPegawai(@RequestParam(value = "id") Integer id,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.getDataMuSaReByPegawai(id);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getDataMuSaReByPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getDataMuSaReByPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-load-pengajuan-mutasi", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> loadPagePengajuanMutasi(
			@RequestParam(value = "ruanganId") Integer ruanganId, HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.loadPagePengajuanMutasi(ruanganId);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when loadPagePengajuanMutasi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when loadPagePengajuanMutasi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-pengajuan-mutasi", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePengajuanMutasi(@Valid @RequestBody PlanningPegawaiMuSaReVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.savePengajuanMutasi(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePengajuanMutasi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePengajuanMutasi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-pengajuan-mutasi", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListPengajuanMutasi(@RequestParam(value = "id") Integer id,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.getListPengajuanMutasi(id);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getListPengajuanMutasi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getListPengajuanMutasi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-load-pengajuan-sanksi", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> loadPagePengajuanSanksi(
			@RequestParam(value = "ruanganId") Integer ruanganId, HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.loadPagePengajuanSanksi(ruanganId);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when loadPagePengajuanSanksi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when loadPagePengajuanSanksi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-pengajuan-sanksi", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePengajuanSanksi(@Valid @RequestBody PlanningPegawaiMuSaReVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.savePengajuanSanksi(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePengajuanSanksi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePengajuanSanksi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-pengajuan-sanksi", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListPengajuanSanksi(@RequestParam(value = "id") Integer id,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.getListPengajuanSanksi(id);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getListPengajuanSanksi", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getListPengajuanSanksi", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-load-pengajuan-resign", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> loadPagePengajuanResign(
			@RequestParam(value = "ruanganId") Integer ruanganId, HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.loadPagePengajuanResign(ruanganId);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when loadPagePengajuanResign", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when loadPagePengajuanResign", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-pengajuan-resign", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePengajuanResign(@Valid @RequestBody PlanningPegawaiMuSaReVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.savePengajuanResign(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePengajuanResign", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePengajuanResign", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-pengajuan-resign", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListPengajuanResign(@RequestParam(value = "id") Integer id,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.getListPengajuanResign(id);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getListPengajuanResign", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getListPengajuanResign", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-pengajuan-musare", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListDaftarMuSaRe(
			@RequestParam(value = "namaPegawai") String namaPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.getListDaftarMuSaRe(namaPegawai);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getListDaftarMuSaRe", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getListDaftarMuSaRe", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/verifikasi-pengajuan-musare", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> ApprovalMusare(@Valid @RequestBody PlanningPegawaiMuSaReVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.ApprovalMusare(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when ApprovalMusare", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when ApprovalMusare", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/unverif-pengajuan-musare", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> unVerifMusare(@Valid @RequestBody PlanningPegawaiMuSaReVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = serviceMusare.unVerifMusare(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when unVerifMusare", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when unVerifMusare", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-login-user-permohonan-status", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getUserLoginPermohonanStatus(HttpServletRequest request,
			@RequestParam(value = "idPegawai") Integer idPegawai) {
		try {
			Map<String, Object> result = servicePermohonanStatus.getUserLogin(idPegawai);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getUserLogin", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getUserLogin", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-load-permohonan-status", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getLoadData(
			@RequestParam(value = "subUnitKerjaId") Integer subUnitKerjaId, HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.getLoadData(subUnitKerjaId);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getLoadData", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getLoadData", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-data-cuti", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getDataCuti(@RequestParam(value = "pegawaiId") Integer pegawaiId,
			@RequestParam(value = "year", required = false) String year,
			@RequestParam(value = "statusPegawaiId") Integer statusPegawaiId, HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.getDataCuti(pegawaiId, year, statusPegawaiId);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getDataCuti", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getDataCuti", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-data-pegawai", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getDataPermohonanStatus(
			@RequestParam(value = "pegawaiId") Integer pegawaiId, HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.getDataPermohonanStatus(pegawaiId);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getDataPermohonanStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getDataPermohonanStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-approval-status", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListApprovalStatus(
			@RequestParam(value = "idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.getApprovalStatus(idPegawai);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getApprovalStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getApprovalStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-pegawai-status", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePlanningPegawaiStatus(@Valid @RequestBody PlanningPegawaiStatusVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.savePlanningPegawaiStatus(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when savePlanningPegawaiStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when savePlanningPegawaiStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/update-pegawai-status", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> updatePlanningPegawaiStatus(
			@Valid @RequestBody PlanningPegawaiStatusVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.updatePlanningPegawaiStatus(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when updatePlanningPegawaiStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when updatePlanningPegawaiStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/delete-pegawai-status/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> deletePlanningPegawaiStatus(@RequestParam(value = "noRec") String noRec,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.deletePlanningPegawaiStatus(noRec);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when deletePlanningPegawaiStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when deletePlanningPegawaiStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/approval-permohonan-status", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> approvalPermohonanStatus(@Valid @RequestBody PlanningPegawaiStatusVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.approvalPermohonanStatus(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when approvalPermohonanStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when approvalPermohonanStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/unverif-permohonan-status", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> unVerifPermohonanStatus(@Valid @RequestBody PlanningPegawaiStatusVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.unVerifPermohonanStatus(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when unVerifPermohonanStatus", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when unVerifPermohonanStatus", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-periode-golongan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getPeriodeRekap(HttpServletRequest request) {
		try {
			Map<String, Object> result = informasiDaftarGajiService.getPeriodeGolongan();
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getPeriodeGolongan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getPeriodeGolongan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-daftar-gaji-pns", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getDaftarGajiPns(@RequestParam(value = "periode") String periode,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = informasiDaftarGajiService.getDaftarGajiPns(periode);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getDaftarGajiPns", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getDaftarGajiPns", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-detail-gaji-pns", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getDtailGajiPns(@RequestParam(value = "noRec") String noRec,
			@RequestParam(value = "id") Integer id, @RequestParam(value = "periode") String periode,
			@RequestParam(value = "namaPegawai") String namaPegawai, HttpServletRequest request) {
		try {
			Map<String, Object> result = informasiDaftarGajiService.getDtailGajiPns(noRec, id, namaPegawai, periode);
			if (null != result) {
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
				return getJsonResponse(result, OK, mapHeaderMessage);
			} else {
				return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getDtailGajiPns", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getDtailGajiPns", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-gap-kompetensi/{idRuangan}/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> findGapKompetensi(@PathVariable("idRuangan") Integer idRuangan,
			@PathVariable("periode") String periode, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = riwayatPenilaianKompetensiPegawaiService
					.getGapKompetensiPegawai(idRuangan, periode);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}

	}

	@RequestMapping(value = "/get-kompetensi-by-ruangan/{idRuangan}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findGapKompetensi(@PathVariable("idRuangan") Integer idRuangan,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = riwayatPenilaianKompetensiPegawaiService.getKompetensiPegawai(idRuangan);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-rekap-kehadiran", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveRekapKehadiran(@Valid @RequestBody StrukHistoriVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveRekapKomponen(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveRekapKomponen", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveRekapKomponen", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-total-index-kehadiran", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveTotalIndexKehadiran(@Valid @RequestBody StrukHistoriVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveTotalIndexRekapitulasiKehadiran(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveTotalIndexRekapitulasiKehadiran", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveTotalIndexRekapitulasiKehadiran", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-factor-rate-kelompok-Shift", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveFactorRateKelompokShift(
			@Valid @RequestBody KelompokShiftKerjaCustomVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveFactorRate(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveFactorRate", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveFactorRate", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}

	}

	@RequestMapping(value = "/get-rencana-tindak-lanjut", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> findRencanaTindakLanjut(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = riwayatPenilaianKompetensiPegawaiService.getRencanaTindakLanjut();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/rekap-kehadiran-by-unit-kerja/{idUnitKerja}/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> rekapKehadiranByUnitKerja(
			@PathVariable("idUnitKerja") Integer idUnitKerja, @PathVariable("startDate") String startDate,
			@PathVariable("endDate") String endDate, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.rekapitulasiKehadiranByUnitKerja(idUnitKerja, startDate,
					endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/rekap-index-kehadiran-by-unit-kerja/{idUnitKerja}/{startDate}/{endDate}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> rekapIndeksKehadiranByUnitKerja(
			@PathVariable("idUnitKerja") Integer idUnitKerja, @PathVariable("startDate") String startDate,
			@PathVariable("endDate") String endDate, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.rekapitulasiIndeksKehadiranByunitKerja(idUnitKerja,
					startDate, endDate);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-shift-kerja", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListShiftKerja(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = shiftKerjaService.getListShiftKerja();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-factor-rate-shift-kerja/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListFactorRateShiftKerja(HttpServletRequest request,
			@PathVariable("periode") String periode) {
		try {
			List<Map<String, Object>> result = monitoringAbsenService.findFactorRateIndekkehadiran(periode);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-master-evaluasi", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListMasterJabatanEvaluasiByTahunBulan(
			@RequestParam(value = "tahun", required = false) Integer tahun,
			@RequestParam(value = "bulan", required = false) String bulan, HttpServletRequest request) {
		try {
			Map<String, Object> result = EvaluasiJabatanService.findEvaluasiJabatanTahun(tahun);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-kehadiran-lembur-sdm-by-periode/{idPegawai}/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> findKehadiranLemburKerjaSdm(@PathVariable("idPegawai") Integer idPegawai,
			@PathVariable("periode") String periode, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.jumlahKehadiranLemburKerjaSdm(idPegawai, periode);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-input-lembur-verifikasi-sdm", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveInputLemburVerifikasiSdm(
			@Valid @RequestBody InputLemburSdmCustomVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveLemburVerifikasiSdm(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveLemburVerifikasiSdm", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveLemburVerifikasiSdm", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-all-pegawai-aktif-verified-by-unitkerja/{period}", method = GET)
	public ResponseEntity<List<Pegawai>> getAllPegawaiAktifVerfiedByUnitKerja(@PathVariable("period") String period,
			HttpServletRequest request) {
		try {
			List<Pegawai> listPegawaiVo = monitoringAbsenService.findPegawaiAktifAndVerifiedByUnitKerja(period);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(listPegawaiVo, OK, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when findPegawaiAktifAndVerifiedByUnitKerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when findPegawaiAktifAndVerifiedByUnitKerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-running-text-struk-histori/", method = GET)
	public ResponseEntity<String> getRunningTextStrukHistori(HttpServletRequest request) {
		try {
			String runningNumber = monitoringAbsenService.getRunningNumberStrukHistori();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(runningNumber, OK, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when getRunningNumberStrukHistori", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when getRunningNumberStrukHistori", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-pegawai-lembur-by-priod/{period}", method = GET)
	public ResponseEntity<List<Map<String, Object>>> getPegawaiLemburByPeriod(@PathVariable("period") String period,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> runningNumber = monitoringAbsenService.findJumlahLembur(period);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(runningNumber, OK, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when findJumlahLembur", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when findJumlahLembur", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-perhitungan-uang-lembur", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveUangLembur(@Valid @RequestBody Set<UangLemburVO> vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveUangLembur(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveUangLembur", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveUangLembur", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-poin-dokter/{idUnitKerja}/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getPoinDokter(@PathVariable("idUnitKerja") Integer idUnitKerja,
			@PathVariable("periode") String periode, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.getIndekKinerjaKuantitasPerUnitKerja(periode,
					idUnitKerja);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/menangguhkan-permohonan-status", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> menangguhkanVerifPermohonanStatus(
			@Valid @RequestBody PlanningPegawaiStatusVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.penangguhanPerubahanStatusKehadiran(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when penangguhanPerubahanStatusKehadiran", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when penangguhanPerubahanStatusKehadiran", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-jatah-cuti-dan-izin", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveJatahCutiDanIzin(@Valid @RequestBody KelompokShiftKerjaCustomVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.setJatahCuti(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when setJatahCuti", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when setJatahCuti", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-jatah-cuti-dan-izin-pegawai", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveJatahCutiDanIzinPegawai(@Valid @RequestBody JatahCutiDanIzinVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = servicePermohonanStatus.setJatahCutiPegawai(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when setJatahCutiPegawai", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when setJatahCutiPegawai", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-mapping-pegawai-to-atasan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveMappingPegawaiToJabatan(
			@Valid @RequestBody List<MappingPegawaiToAtasanVO> vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = mappingPegawaiToAtasanService.saveMappingPegawaiToAtasan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveMappingPegawaiToAtasan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveMappingPegawaiToAtasan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-pegawai-bawahan/{id}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getPegawaibawahan(@PathVariable("id") Integer id,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = mappingPegawaiToAtasanService.getPegawaibawahan(id);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-mapping-pegawai", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getMappingPegawai(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = mappingPegawaiToAtasanService.getMappingpegawai();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-pegawai-atasan/{id}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getPegawaiAtasan(@PathVariable("id") Integer id,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = mappingPegawaiToAtasanService.getPegawaiAtasan(id);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-rincian-kegiatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveRincianKegiatan(@Valid @RequestBody RincianKegiatanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = uraianTugasService.saveRincianKegiatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveRincianKegiatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveRincianKegiatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-map-rincian-kegiatan-to-uraian-tugas", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveRincianKegiatanToUraianTugas(@Valid @RequestBody UraianTugasMVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = uraianTugasService.saveUraianTugasNew(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveUraianTugasNew", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveUraianTugasNew", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-indeks-iki/{nilai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Double> getIndeksIKI(@PathVariable("nilai") Double nilai, HttpServletRequest request) {
		try {
			Double result = indekKinerjaService.getIndeksIKI(nilai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-all-uraian-tugas", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getAllUT(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = uraianTugasTransaksiService.findAllUraianTugas();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-uraian-kerja-by-jabatan/{idJabatan}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getUraianKerjaByJabatan(
			@PathVariable("idJabatan") Integer idJabatan, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = uraianTugasTransaksiService.getUraianTugasByJabatan(idJabatan);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-unit-kerja", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveRincianKegiatan(@Valid @RequestBody UnitKerjaPegawaiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = unitKerjaPegawaiService.saveUnitkerja(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveUnitkerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveUnitkerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-all-unit-kerja", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<UnitKerjaPegawai>> getAllUnitKerja(HttpServletRequest request) {
		try {
			List<UnitKerjaPegawai> result = unitKerjaPegawaiService.getAllUnitKerja();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-unit-kerja-by-name/{name}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<UnitKerjaPegawai>> getUnitKerjaByName(@PathVariable("name") String name,
			HttpServletRequest request) {
		try {
			List<UnitKerjaPegawai> result = unitKerjaPegawaiService.getUnitKerjaByName(name);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-habsen-manual", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveHabsenManual(@Valid @RequestBody MonitoringAbsenCustomVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = monitoringAbsenService.saveAbsenManual(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveAbsenManual", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveAbsenManual", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-sub-unit-kerja", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveSubUnitKerja(@Valid @RequestBody SubUnitKerjaPegawaiVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = unitKerjaPegawaiService.saveSubUnitkerja(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveSubUnitkerja", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveSubUnitkerja", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-all-sub-unit-kerja", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getAllSubUnitKerja(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = unitKerjaPegawaiService.getAllSubUnitKerja();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-sub-unit-kerja-by-name/{name}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getSubUnitKerjaByName(@PathVariable("name") String name,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = unitKerjaPegawaiService.getSubUnitKerjaByName(name);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-sub-unit-kerja-by-unit-kerja/{id}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getSubUnitKerjaByUnitKerja(@PathVariable("id") Integer id,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = unitKerjaPegawaiService.getAllSubUnitKerjaByUnitKerja(id);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-detail-pasien/{idProduk}/{idKelas}/{idPegawai}/{tgl}/{ffs}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getDetailPasien(@PathVariable("idProduk") Integer idProduk,
			@PathVariable("idKelas") Integer idKelas, @PathVariable("tgl") String tgl, @PathVariable("ffs") Boolean ffs,
			@PathVariable("idPegawai") Integer idPegawai, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.findPatientDetailForEveryTindakan(idProduk, idKelas,
					idPegawai, tgl, ffs);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-all-kelompok-jabatan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getAllKelompokJabatan(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = jabatanService.getKelompokJabatan();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-master-kelompok-jabatan", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveKelompokJabatan(@Valid @RequestBody KelompokJabatanVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = jabatanService.saveKelompokJabatan(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveKelompokJabatan", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveKelompokJabatan", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-all-kedudukan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getAllKedudukan(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = kedudukanService.getKedudukanByStatusEnabled();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-all-kategoriPegawai", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getAllategoriPegawai(HttpServletRequest request) {
		try {
			Map<String, Object> result = kategoriPegawaiService.findAlls();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-all-golongan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getAllGolongan(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = GolonganService.getKedudukanByStatusEnabled();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-all-hari-libur", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getAllHariLibur(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = indekKinerjaService.getAllMapKalenderToHariLibur();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-hari-libur", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveHariLibur(@Valid @RequestBody MapKalenderToHariLiburVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = indekKinerjaService.saveMapKalenderToHariLibur(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when saveMapKalenderToHariLibur", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when saveMapKalenderToHariLibur", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-detail-kelompok-jabatan", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getDetailkelompokJabatan(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = kelompokJabatanService.getAllByStatusEnabled();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-detail-history-pegawai/{noRec}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<RekamDataPegawaiCustomVO> getDetailHistoryPegawai(@PathVariable("noRec") String noRec,
			HttpServletRequest request) {
		try {
			RekamDataPegawaiCustomVO result = rekamDataPegawaiService.getDetailPerubahan(noRec);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-history-pegawai/{idPegawai}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getListHistoryPegawai(@PathVariable("idPegawai") Integer idPegawai,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = rekamDataPegawaiService.getListHistoryDatapegawai(idPegawai);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/save-uraian-tugas-flexible", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> saveUraianTugasFlexible(@Valid @RequestBody UraianTugasFlexibleVO vo,
			HttpServletRequest request) {
		try {
			Map<String, Object> result = uraianTugasTransaksiService.saveUraianTugasFlexible(vo);
			if (null != result)
				mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, CREATED, mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got ServiceVOException {} when add saveUraianTugasFlexible", e.getMessage());
			addHeaderMessage(ERROR_MESSAGE, e.getMessage());
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got JpaSystemException {} when add saveUraianTugasFlexible", jse.getMessage());
			addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
			return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/get-list-uraian-tugas-flexible-by-date/{idPegawai}/{date}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListUraianTugas(@PathVariable("idPegawai") Integer idPegawai,
			@PathVariable("date") String date, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = uraianTugasTransaksiService.findAllUraianTugasToday(idPegawai, date);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-uraian-tugas-verified-monthly/{idPegawai}/{periode}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListUraianTugasMonthly(
			@PathVariable("idPegawai") Integer idPegawai, @PathVariable("periode") String periode,
			HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = uraianTugasTransaksiService.findAllUraianTugasMonthly(idPegawai,
					periode);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-uraian-tugas-bawahan/{idAtasan}", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListUraianTugasBawahan(
			@PathVariable("idAtasan") Integer idAtasan, HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = uraianTugasTransaksiService.findAllUraianTugasBawahan(idAtasan);
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-all-jatah-cuti/", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListJatahCuti(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = servicePermohonanStatus.getAllDataCuti();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = "/get-list-penandatangan-surat-izin-cuti", method = GET, produces = APPLICATION_JSON_VALUE)
	public ResponseEntity<List<Map<String, Object>>> getListPenandaTanganSuratIzinCuti(HttpServletRequest request) {
		try {
			List<Map<String, Object>> result = monitoringAbsenService.findListPenandaTangan();
			mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
			return getJsonResponse(result, OK);
		} catch (Exception e) {
			return getJsonHttpStatus(INTERNAL_SERVER_ERROR);
		}
	}

}
