package market.Lms.Consumable.impl;

import java.text.SimpleDateFormat;
import java.util.Date;

import market.Com.pb.PbMethod;
import market.Lms.Consumable.mapper.LmsConsumableOverInInfoMapper;
import market.Lms.Consumable.service.LmsConsumableOverInInfoService;
import market.Lms.Consumable.vo.LmsConsumableOverInInfo;

import com.hnshituo.basic.service.impl.BaseServiceImpl;
import com.hnshituo.basic.spring.remoting.annotation.RemoteService;
import com.hnshituo.core.auth.service.HomeService;

@RemoteService(path="LmsConsumableOverInInfo")
public class LmsConsumableOverInInfoServiceImpl extends BaseServiceImpl<LmsConsumableOverInInfo,Object> implements LmsConsumableOverInInfoService{

	//新增
	public String doAdd(LmsConsumableOverInInfo overInInfo){
		String id = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())+PbMethod.RandomCreate(3);
		String userId = (String) this.getSession().getAttribute(HomeService.SESSION_USER_ID);
		String userName=(String) this.getSession().getAttribute(HomeService.SESSION_USER_NAME);
		overInInfo.setOver_in_no(id);
		overInInfo.setCreate_man_no(userId);
		overInInfo.setCreate_man_name(userName);
		overInInfo.setCreate_time(new Date());
		overInInfo.setValid_flag("1");
		this.getMapper(LmsConsumableOverInInfoMapper.class).insert(overInInfo);
		return id;
	}

	//删除
	public void doDelete(LmsConsumableOverInInfo overInInfo){
		this.getMapper(LmsConsumableOverInInfoMapper.class).delete(overInInfo.getOver_in_no());
	}

	//修改
	public void doUpdate(LmsConsumableOverInInfo overInInfo){
		this.getMapper(LmsConsumableOverInInfoMapper.class).update(overInInfo);
	}

	//查询
	public LmsConsumableOverInInfo doQuery(String overInInfoNo){
		LmsConsumableOverInInfo overInInfo = new LmsConsumableOverInInfo();
		overInInfo = this.getMapper(LmsConsumableOverInInfoMapper.class).findById(overInInfoNo);
		return overInInfo;
	}
}
