package market.Slm.ContractManagement.impl;

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

import market.Com.pb.PbMethod;
import market.Com.vo.ResultModel;
import market.Slm.ContractManagement.mapper.SlmContractPscOrgMapper;
import market.Slm.ContractManagement.service.SlmContractPscOrgService;
import market.Slm.ContractManagement.vo.SlmContractPscOrg;

import org.springframework.transaction.annotation.Transactional;

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

@RemoteService(path="SlmContractPscOrgService")
public class SlmContractPscOrgServiceImpl extends BaseServiceImpl<SlmContractPscOrg,Object> implements SlmContractPscOrgService {
	@Transactional(value = "tm", rollbackFor = Exception.class)
	public ResultModel doAdd(SlmContractPscOrg po) throws Exception{
		ResultModel rm=new ResultModel();
		try{
			String id=new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())+PbMethod.RandomCreate(3);
			po.setId(id);
			this.getMapper(SlmContractPscOrgMapper.class).insert(po);
		}catch(Exception e){
			rm.setState("500");
			rm.setMsgInfo(e.getMessage());
			//--19-10-15添加异常回滚
			throw new Exception(rm.getMsgInfo());
		}
		return rm;
	}
}