
package nc.bs.pub.action;

import nc.bs.framework.common.NCLocator;
import nccloud.bs.ic.ic.aggbusi.plugin.bpplugin.NccsynergyPluginPoint;
import nc.bs.pubapp.pf.action.AbstractPfAction;
import nc.impl.pubapp.pattern.rule.processer.CompareAroundProcesser;
import nc.itf.ic.ic.INccsynergyMaintain;
import nc.vo.sap.syproconfig.AggSyProConfigVO;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

public class N_4008_DELETE extends AbstractPfAction<AggSyProConfigVO> {

        @Override
        protected CompareAroundProcesser<AggSyProConfigVO> getCompareAroundProcesserWithRules(
                        Object userObj) {
                CompareAroundProcesser<AggSyProConfigVO> processor = new CompareAroundProcesser<AggSyProConfigVO>(
                                NccsynergyPluginPoint.SCRIPT_DELETE);
                // TODO 在此处添加前后规则
                return processor;
        }

        @Override
        protected AggSyProConfigVO[] processBP(Object userObj,
                        AggSyProConfigVO[] clientFullVOs, AggSyProConfigVO[] originBills) {
                INccsynergyMaintain operator = NCLocator.getInstance().lookup(
                                INccsynergyMaintain.class);
                try {
                        operator.delete(clientFullVOs, originBills);
                } catch (BusinessException e) {
                        ExceptionUtils.wrappBusinessException(e.getMessage());
                }
                return clientFullVOs;
        }

}
