package market.Lms.Consumable.impl;

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

import market.Com.pb.PbMethod;
import market.Lms.Consumable.mapper.LmsConsumableOveroutGoodInfoMapper;
import market.Lms.Consumable.service.LmsConsumableOveroutGoodInfoService;
import market.Lms.Consumable.vo.LmsConsumableOveroutGoodInfo;

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

@RemoteService(path="LmsConsumableOveroutGoodInfo")
public class LmsConsumableOveroutGoodInfoServiceImpl extends BaseServiceImpl<LmsConsumableOveroutGoodInfo,Object> implements LmsConsumableOveroutGoodInfoService{

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

	//删除
	public void doDelete(LmsConsumableOveroutGoodInfo overoutGood){
		this.getMapper(LmsConsumableOveroutGoodInfoMapper.class).delete(overoutGood.getOverout_good_no());
	}

	//修改
	public void doUpdate(LmsConsumableOveroutGoodInfo overoutGood){
		this.getMapper(LmsConsumableOveroutGoodInfoMapper.class).update(overoutGood);
	}

	//查询
	public LmsConsumableOveroutGoodInfo doQuery(String overoutGoodNo){
		LmsConsumableOveroutGoodInfo overoutGood = new LmsConsumableOveroutGoodInfo();
		overoutGood = this.getMapper(LmsConsumableOveroutGoodInfoMapper.class).findById(overoutGoodNo);
		return overoutGood;
	}
}
