package com.jasamedika.medifirst2000.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

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

import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.JenisTransaksiDao;
import com.jasamedika.medifirst2000.dao.KelompokProdukDao;
import com.jasamedika.medifirst2000.dao.KirimProdukDao;
import com.jasamedika.medifirst2000.dao.ProdukDao;
import com.jasamedika.medifirst2000.dao.RunningNumberDao;
import com.jasamedika.medifirst2000.dao.SatuanStandarDao;
import com.jasamedika.medifirst2000.dao.StokProdukDetailDao;
import com.jasamedika.medifirst2000.dao.StokProdukGlobalDao;
import com.jasamedika.medifirst2000.dao.StrukHistoriDao;
import com.jasamedika.medifirst2000.dao.StrukKirimDao;
import com.jasamedika.medifirst2000.dao.StrukKonfirmasiDao;
import com.jasamedika.medifirst2000.dao.StrukOrderDao;
import com.jasamedika.medifirst2000.dao.StrukPelayananDao;
import com.jasamedika.medifirst2000.dao.custom.DestroyProdukDetailDaoCustom;
import com.jasamedika.medifirst2000.dao.custom.StokProdukDetailDaoCustom;
import com.jasamedika.medifirst2000.dao.custom.StokProdukGlobalDaoCustom;
import com.jasamedika.medifirst2000.dao.custom.StrukKirimDaoCustom;
import com.jasamedika.medifirst2000.dao.custom.StrukOrderDaoCustom;
import com.jasamedika.medifirst2000.dao.custom.StrukPelayananDetailDaoCustom;
import com.jasamedika.medifirst2000.entities.AsalProduk;
import com.jasamedika.medifirst2000.entities.DestroyProduk;
import com.jasamedika.medifirst2000.entities.DestroyProdukDetail;
import com.jasamedika.medifirst2000.entities.DestroyProdukPetugas;
import com.jasamedika.medifirst2000.entities.JenisPermintaan;
import com.jasamedika.medifirst2000.entities.KelompokTransaksi;
import com.jasamedika.medifirst2000.entities.KirimProduk;
import com.jasamedika.medifirst2000.entities.OrderPelayanan;
import com.jasamedika.medifirst2000.entities.Pegawai;
import com.jasamedika.medifirst2000.entities.Produk;
import com.jasamedika.medifirst2000.entities.Ruangan;
import com.jasamedika.medifirst2000.entities.RunningNumber;
import com.jasamedika.medifirst2000.entities.SatuanStandar;
import com.jasamedika.medifirst2000.entities.StrukHistori;
import com.jasamedika.medifirst2000.entities.StrukKirim;
import com.jasamedika.medifirst2000.entities.StrukOrder;
import com.jasamedika.medifirst2000.entities.StrukPelayanan;
import com.jasamedika.medifirst2000.service.KartuStokService;
import com.jasamedika.medifirst2000.service.LoginUserService;
import com.jasamedika.medifirst2000.service.PemusnahanBarangService;
import com.jasamedika.medifirst2000.service.SlowFastMovingService;
import com.jasamedika.medifirst2000.service.StokProdukGlobalService;
import com.jasamedika.medifirst2000.service.StrukOrderService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.util.DateUtil;
import com.jasamedika.medifirst2000.util.StringUtil;
import com.jasamedika.medifirst2000.vo.AsalProdukVO;
import com.jasamedika.medifirst2000.vo.DestroyProdukVO;
import com.jasamedika.medifirst2000.vo.JenisPermintaanVO;
import com.jasamedika.medifirst2000.vo.PegawaiVO;
import com.jasamedika.medifirst2000.vo.ProdukVO;
import com.jasamedika.medifirst2000.vo.RequestBarangDariRuanganDetailVO;
import com.jasamedika.medifirst2000.vo.RequestBarangDariRuanganVO;
import com.jasamedika.medifirst2000.vo.RuanganVO;
import com.jasamedika.medifirst2000.vo.SatuanStandarVO;
import com.jasamedika.medifirst2000.vo.StrukHistoriVO;
import com.jasamedika.medifirst2000.vo.StrukPelayananVO;


/**
 * 
 * @author adik
 */
@Service("slowFastMovingService")
public class SlowFastMovingServiceImpl extends BaseAngaranServiceImpl implements SlowFastMovingService{
	
	@Autowired
	private StrukPelayananDetailDaoCustom strukPelayananDetailDaoCustom;

	@Override
	public Map<String, Object> slowMoving(String dateStart, String dateEnd, Integer kelompokProdukId,Integer jenisProdukId, Integer produkId) {
		Map<String,Object> data=new HashMap<String,Object>();
		Integer ruanganId=getRuanganByUserLogin().getId();
		data.put("data", strukPelayananDetailDaoCustom.findSlowMoving(dateStart,dateEnd,kelompokProdukId,jenisProdukId,produkId,ruanganId));
		return data;
	}

	@Override
	public Map<String, Object> fastMoving(String dateStart, String dateEnd, Integer kelompokProdukId,
			Integer jenisProdukId, Integer produkId) {
		Map<String,Object> data=new HashMap<String,Object>();
		Integer ruanganId=getRuanganByUserLogin().getId();
		data.put("data", strukPelayananDetailDaoCustom.findFastMoving(dateStart,dateEnd,kelompokProdukId,jenisProdukId,produkId,ruanganId));
		return data;
	}


	
}

