package market.Lms.Consumable.impl;

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

import market.Com.pb.PbMethod;
import market.Lms.Consumable.mapper.LmsConsumableInInfoMapper;
import market.Lms.Consumable.service.LmsConsumableInInfoService;
import market.Lms.Consumable.vo.LmsConsumableInInfo;

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

@RemoteService(path="LmsConsumableInInfo")
public class LmsConsumableInInfoServiceImpl extends BaseServiceImpl<LmsConsumableInInfo,Object> implements LmsConsumableInInfoService{

	//新增
	public String doAdd(LmsConsumableInInfo in){
		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);
		in.setValid_flag("1");
		in.setIn_no(id);
		in.setCreate_man_no(userId);
		in.setCreate_man_name(userName);
		in.setCreate_time(new Date());
		this.getMapper(LmsConsumableInInfoMapper.class).insert(in);
		return id;
	}

	//删除
	public void doDelete(LmsConsumableInInfo in){
		this.getMapper(LmsConsumableInInfoMapper.class).delete(in.getIn_no());
	}

	//修改
	public void doUpdate(LmsConsumableInInfo in){
		this.getMapper(LmsConsumableInInfoMapper.class).update(in);
	}

	//查询
	public LmsConsumableInInfo doQuery(String inNo){
		LmsConsumableInInfo in = new LmsConsumableInInfo();
		in = this.getMapper(LmsConsumableInInfoMapper.class).findById(inNo);
		return in;
	}


}
