//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package nc.bs.pub.action;

import nc.bs.arap.actions.N_BASE_ACTION;
import nc.bs.arap.util.GatheringBillAfter;
import nc.bs.framework.common.NCLocator;
import nc.vo.arap.gathering.AggGatheringBillVO;
import nc.vo.arap.pub.ArapConstant;
import nc.vo.fipub.exception.ExceptionHandler;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nccloud.pubitf.arap.arappub.IArapBillPubUtilService;

import java.util.Hashtable;

public class N_F2_DELETE extends N_BASE_ACTION {
    private Hashtable<String, Object> m_keyHas = null;

    public N_F2_DELETE() {
    }

    public Object runComClass(PfParameterVO paraVo) throws BusinessException {
        try {
            if (paraVo.m_preValueVos == null) {
                return null;
            } else {
                Object obj = null;
                super.m_tmpVo = paraVo;
                String actionCode = ArapConstant.DELETE;
                ((IArapBillPubUtilService) NCLocator.getInstance().lookup(IArapBillPubUtilService.class)).interceptorVaildator(paraVo.m_preValueVos, actionCode);
                this.setParameter("context", paraVo.m_preValueVos);
                obj = this.runClass("nc.bs.arap.actions.GatheringbillDeleteBatchBSAction", "deleteVOs", "&context:nc.vo.pub.AggregatedValueObject[]", paraVo, this.m_keyHas);
                this.afterCheck();
                // 收款单删除后将对应的到账通知cmp_informer的生成状态generateflag修改为已生成hasnogenerate
                AggGatheringBillVO[] aggVos = (AggGatheringBillVO[]) paraVo.m_preValueVos;
                GatheringBillAfter.updateInformerGenerateFlag(aggVos, "hasnogenerate");
                return obj;
            }
        } catch (Exception ex) {
            throw ExceptionHandler.handleException(this.getClass(), ex);
        }
    }

    public String getCodeRemark() {
        return " arap action script not allowed to modify ,all rights reserved!";
    }

    protected void setParameter(String key, Object val) {
        if (this.m_keyHas == null) {
            this.m_keyHas = new Hashtable();
        }

        if (val != null) {
            this.m_keyHas.put(key, val);
        }

    }
}
