package com.dev.swms.server.service.base.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.dev.energy.server.service.pojo.DefaultBaseManager;
import com.dev.swms.server.model.interfaces.InterfaceWmsDownload;
import com.dev.swms.server.service.base.InterfaceWmsDownloadManager;

public class DefaultInterfaceWmsDownloadManager extends DefaultBaseManager implements InterfaceWmsDownloadManager{

	@Override
	public void saveInterfaceWmsDownload(InterfaceWmsDownload iwd) {
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		Date date1=new Date();
		Date date2=new Date();
		String update = format.format(date1);
		String tlupdate = format.format(date2);
		iwd.setDateUpdated(update);
		iwd.setTimeLastUpdated(tlupdate);
		iwd.setCreateDate(new Date());
		commonDao.store(iwd);
	}

	@Override
	public void deleteInterfaceWmsDownload(List<Long> ids) {
		for (Long id : ids) {
			InterfaceWmsDownload iwd = this.load(InterfaceWmsDownload.class, id);
			this.delete(iwd);
		}
		
	}

}
