package com.jasamedika.medifirst2000.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jasamedika.medifirst2000.constants.Constants;
import com.jasamedika.medifirst2000.constants.MessageResource;
import com.jasamedika.medifirst2000.controller.base.LocaleController;
import com.jasamedika.medifirst2000.core.web.WebConstants;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.ItPerbaikanService;
import com.jasamedika.medifirst2000.util.rest.RestUtil;
import com.jasamedika.medifirst2000.vo.ItPelaksanaanPerbaikanVO;
import com.jasamedika.medifirst2000.vo.ItPerbaikanVO;

@RestController
@RequestMapping("/it-perbaikan")
public class ItPerbaikanController extends LocaleController<ItPerbaikanVO>{
	
	@Autowired
	private ItPerbaikanService service;
	
	private static final Logger LOGGER = LoggerFactory.getLogger(ItPerbaikanController.class);
	
	@RequestMapping(value = "/get-no-order", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getNoOrder(HttpServletRequest request) {
		try {
			Map<String, Object> result = service.getNoOrderTable();
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getJadwalPemeliharaan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getJadwalPemeliharaan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}

	@RequestMapping(value = "/save-permintaan-perbaikan", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePermintaanPerbaikan(@Valid @RequestBody ItPerbaikanVO vo, HttpServletRequest request) {
		try {
			Map<String,Object> result = service.savePermintaanPerbaikan(vo);
			try{
				BroadcastMessageOther("PermintaanPerbaikan", result);
			}catch (Exception ex){
				ex.printStackTrace();
			}
			if (null != result)
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when savePermintaanPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when savePermintaanPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/find-ruangan-asset", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getRuanganRegistrasiAset(HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getRuanganPerbaikan();
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getRuanganRegistrasiAset", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getRuanganRegistrasiAset", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/find-asset-by-ruangan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getAsetPerbaikan(@RequestParam(value = "id", required = true) Integer id, HttpServletRequest request){
		try {
			Map<String,Object> result = service.getAsetPerbaikan(id);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getAsetPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getAsetPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/get-all-permintaan-perbaikan", 
			method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getAllPermintaanPerbaikan(
			@RequestParam(value = "page", required = false, defaultValue = "0") Integer page,
			@RequestParam(value = "take", required = false, defaultValue = "10") Integer limit,
			@RequestParam(value = "sort", required = false, defaultValue = "noOrder") String sort,
			@RequestParam(value = "dir", required = false, defaultValue = "desc") String dir,
			@RequestParam(value = "tanggalAwal", required = false) String tanggalAwal,
			@RequestParam(value = "tanggalAkhir", required = false) String tanggalAkhir,
			@RequestParam(value = "ruanganId", required = false) Integer ruanganId,
			@RequestParam(value = "statusPekerjaan", required = false) Integer statusPekerjaan,
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getAllPermintaanPerbaikan(page,limit,sort,dir,tanggalAwal,tanggalAkhir,ruanganId,statusPekerjaan);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getAllPermintaanPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getAllPermintaanPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/get-permintaan-perbaikan-by-ruangan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getPermintaanPerbaikanByRuanganId(			
			@RequestParam(value = "ruanganId", required = true) Integer ruanganId,
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getPermintaanPerbaikanByRuanganId(ruanganId);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getAllPermintaanPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getAllPermintaanPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/form-permintaan-perbaikan-it", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getOnePermintaanPerbaikan(
			@RequestParam(value = "noRec", required = true) String noRec, 
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getOnePermintaanPerbaikan(noRec);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getOnePermintaanPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getOnePermintaanPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/save-pelaksanaan-perbaikan", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> savePelaksanaanPerbaikan(@Valid @RequestBody ItPelaksanaanPerbaikanVO vo, HttpServletRequest request) {
		try {
			//Map<String,Object> result = service.savePelaksanaanPerbaikan(vo);
			Map<String,Object> result = this.service.savePelaksanaanPerbaikanRev1(vo);
			if (null != result)
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);

		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when savePelaksanaanPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when savePelaksanaanPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/get-all-It-perbaikan-by-norec", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getAllItPerbaikanByNoRec(
			@RequestParam(value = "noRec", required = true) String noRec, 
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getAllItPerbaikanByNoRec(noRec);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getAllItPerbaikanByNoRec", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getAllItPerbaikanByNoRec", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/delete-list-perbaikan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<String> deleteListPerbaikann(
			@RequestParam(value = "noRec", required = true) String noRec, 
			HttpServletRequest request) {
		try {
			Boolean status = service.deleteItPerbaikan(noRec);
			if (status){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse("noRec : "+noRec, HttpStatus.OK);
			} else{
				return RestUtil.getJsonResponse("noRec : null", HttpStatus.BAD_REQUEST);
			} 
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when deleteListPerbaikann", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when deleteListPerbaikann", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/update-data-perbaikan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> updateDataPerbaikan(@Valid @RequestBody ItPerbaikanVO vo, HttpServletRequest request) {
		try {
			Map<String, Object> result = service.updatePermintaanPerbaikan(vo);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} 
			
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when updateJadwalPerbaikanDariRuangan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getJadwalPerbaikanDariRuangan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
		
		return RestUtil.getJsonHttptatus(HttpStatus.NOT_ACCEPTABLE);
	}
	
	@RequestMapping(value="/get-pelaksanaan-perbaikan-all", 
			method=RequestMethod.GET, 
			produces=MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> getPelaksanaanPerbaikanAll(
			@RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate, HttpServletRequest request) {
		Map<String, Object> result = this.service.getPelaksanaanPerbaikIt(startDate, endDate);
		return result;
	}
	
	@RequestMapping(value="/get-pelaksanaan-perbaikan-by-noRec", 
			method=RequestMethod.GET, 
			produces=MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> getPelaksanaanPerbaikanbyNoRec(
			@RequestParam("noRec")String noRec, HttpServletRequest request) {
		Map<String, Object> result = this.service.getPelaksanaanPerbaikItByNoRec(noRec);
		return result;
	}
	
	@RequestMapping(value="/get-kategori-kerusakan-iti", 
			method=RequestMethod.GET, 
			produces=MediaType.APPLICATION_JSON_VALUE)
	public Map<String, Object> getKategoriKerusakan(HttpServletRequest request) {
		Map<String, Object> result = this.service.getKategoriKerusakan();
		return result;
	}
	
	@RequestMapping(value = "/get-asset-by-kelompok-produk", 
			method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getAssetByKelompokProduk(
			@RequestParam(value = "id", required = true) Integer id, 
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getAssetByKelompokProduk(id);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when get-asset-by-kelompok-produk", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when get-asset-by-kelompok-produk", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	
	@RequestMapping(value = "/update-status-respon", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> updateStatusRespon(
			@RequestParam(value = "noRec", required = true) String noRec, 
			@RequestParam(value = "userId", required = true) Integer userId,
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.updateStatusRespon(noRec,userId);
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when update-status-respon", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when update-status-respon", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
	@RequestMapping(value = "/get-notifikasi-itperbaikan", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Map<String, Object>> getNotifikasiItPerbaikan(
			HttpServletRequest request) {
		try {
			Map<String,Object> result = service.getNotifikasiItPerbaikan();
			if (null != result){
				mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
				return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
			} else{
				return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
			}
		} catch (ServiceVOException e) {
			LOGGER.error("Got exception {} when getNotifikasiItPerbaikan", e.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
		} catch (JpaSystemException jse) {
			LOGGER.error("Got exception {} when getNotifikasiItPerbaikan", jse.getMessage());
			addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
			return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
		}
	}
	
}
