package nc.impl.wa.end;

import nc.itf.hr.wa.IMonthEndManageService;
import nc.itf.hr.wa.IMonthEndQueryService;
import nc.vo.pub.BusinessException;
import nc.vo.uif2.LoginContext;
import nc.vo.wa.end.WaClassEndVO;
import nc.vo.wa.pub.PeriodStateVO;
import nc.vo.wa.unitclass.UnitClassVO;

/**
 * @author zhangg
 *
 */
public class MonthEndManageServiceImpl implements IMonthEndManageService, IMonthEndQueryService {

	private MonthEndDAO dao;

	private MonthEndDAO getMonthEndDAO(){
		if(dao==null){
			dao = new MonthEndDAO();
		}
		return dao;
	}



	@Override
	public WaClassEndVO[] getWaClassVOs(LoginContext context, String actionType) throws BusinessException {
		return getMonthEndDAO().getWaClassVOs(context, actionType);
	}



	@Override
	public WaClassEndVO[] getClassItem2Class(LoginContext context, WaClassEndVO[] selectClassEndVOs) throws BusinessException {

		return getMonthEndDAO().getClassItem2Class(context, selectClassEndVOs);
	}


/**
 *
 * @author zhangg on 2009-12-16
 * @see nc.itf.hr.wa.IMonthEndManageService#doEndProcess(nc.vo.uif2.LoginContext, nc.vo.wa.end.WaClassEndVO[], java.lang.String)
 */
	@Override
	public void doEndProcess(LoginContext context, WaClassEndVO[] classVOs, String actionType) throws BusinessException {

        
		getMonthEndDAO().multMonthEnd(classVOs, actionType);

	}
	
	@Override
	public UnitClassVO[] queryAllUnitClassVOs() throws BusinessException {
		return getMonthEndDAO().queryAllUnitClassVOs();
	}
	
	@Override
	public String[] isHaveUnAccountUnitChildClass(String sql) throws BusinessException {
		return getMonthEndDAO().isHaveUnAccountUnitChildClass(sql);
	}



	@Override
	public void createNextPeriodAmoScheme(WaClassEndVO waClassEndVO,
			PeriodStateVO nextPeriodStateVO) throws BusinessException {
		getMonthEndDAO().createNextPeriodAmoScheme(waClassEndVO, nextPeriodStateVO);
		
	}



	@Override
	public void createNextDataIO(WaClassEndVO waClassEndVO,
			PeriodStateVO nextPeriodStateVO) throws BusinessException {
		getMonthEndDAO().createNextDataIO(waClassEndVO, nextPeriodStateVO);
		
	}

}
