package nc.plugin.fa;

import nc.bs.businessevent.IBusinessEvent;
import nc.bs.businessevent.IBusinessListener;
import nc.bs.businessevent.BusinessEvent.BusinessUserObj;
import nc.vo.fa.assetcard.AggCardVO;
import nc.vo.pub.BusinessException;

public class AssetDeleteAfterPlugin implements IBusinessListener {

	@Override
	public void doAction(IBusinessEvent businessEvent) throws BusinessException {
		BusinessUserObj obj = (BusinessUserObj) businessEvent.getUserObject();
		AggCardVO[] aggvos = (AggCardVO[]) obj.getUserObj();
		for (AggCardVO aggvo : aggvos) {
			if ("Y".equals(aggvo.getParentVO().getAttributeValue("def21")))
				throw new BusinessException("已经同步ARC单据不能删除！");
		}
	}
}
