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.DataPegawaiService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.DataPegawai;
import com.jasamedika.medifirst2000.vo.DataPegawaiVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.DataPegawaiDao;

/**
 * Implement class for DataPegawaiService
 * 
 * @author Generator
 * @param <T>
 */
@Service("dataPegawaiService")
public class DataPegawaiServiceImpl extends BaseVoServiceImpl implements DataPegawaiService 
{	
	@Autowired
	private BaseConverterImpl<DataPegawaiVO,DataPegawai>dataPegawaiConverter;
	
	@Autowired
	private DataPegawaiDao dataPegawaiDao;


	@Override
	public Map<String, Object> saveDataPegawai(DataPegawaiVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		DataPegawai model = new DataPegawai();
		model = dataPegawaiConverter.transferVOToModel(vo,model);

		DataPegawai resultDomain = dataPegawaiDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}