package com.jasamedika.medifirst2000.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


	

import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.StatusPegawaiService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.StatusPegawai;
import com.jasamedika.medifirst2000.vo.StatusPegawaiVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.StatusPegawaiDao;

/**
 * Implement class for StatusPegawaiService
 * 
 * @author Generator
 * @param <T>
 */
@Service("statusPegawaiService")
public class StatusPegawaiServiceImpl extends BaseVoServiceImpl implements StatusPegawaiService 
{	
	@Autowired
	private BaseConverterImpl<StatusPegawaiVO,StatusPegawai>statusPegawaiConverter;
	
	@Autowired
	private StatusPegawaiDao statusPegawaiDao;

	
	@Override
	public Map<String, Object> saveStatusPegawai(StatusPegawaiVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		StatusPegawai model = new StatusPegawai();
		model = statusPegawaiConverter.transferVOToModel(vo,model);
		
		StatusPegawai resultDomain = statusPegawaiDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}