package nc.bs.alter.glvoucher;

import nc.bs.gl.addvoucher.QueryDataMakeVoucher;
import nc.bs.pub.pa.PreAlertObject;
import nc.bs.pub.pa.PreAlertReturnType;
import nc.bs.pub.taskcenter.BgWorkingContext;
import nc.bs.pub.taskcenter.IBackgroundWorkPlugin;
import nc.vo.pub.BusinessException;

public class VoucherMake implements IBackgroundWorkPlugin {
	@Override
	public PreAlertObject executeTask(BgWorkingContext context)
			throws BusinessException {
		// TODO 自动生成的方法存根
		try { 
			//定时任务生成凭证
			QueryDataMakeVoucher voucherutil=new QueryDataMakeVoucher();
			voucherutil.makevoucher();
		} catch (Exception e) {		
			  String errmsg = e.getMessage();
			  if(errmsg!=null&&errmsg.length()>1500){
				  errmsg=errmsg.substring(0,1500);
			  }
			  throw new  BusinessException(errmsg);
		} 
		PreAlertObject preAlertObject = new PreAlertObject();
		preAlertObject.setReturnType(PreAlertReturnType.getObject(3));
		String alertMsg = "执行完毕！";
		preAlertObject.setReturnObj(alertMsg);
		return preAlertObject;
	}


}
