// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2004-08-10 09:03:08
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) ansi
// Source File Name:   N_F2_DELETE.java

package nc.bs.pub.action;

import java.util.Hashtable;

import nc.bs.arap.actions.N_BASE_ACTION;
import nc.bs.framework.common.NCLocator;
import nc.itf.arap.dev.IDevArapBill2R6Service;
import nc.vo.arap.gathering.AggGatheringBillVO;
import nc.vo.arap.gathering.GatheringBillVO;
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;

public class N_F2_DELETE extends N_BASE_ACTION {

    private Hashtable<String, Object> m_keyHas = null;

    /*
     * 备注：平台编写规则类 接口执行类
     */
    public Object runComClass(PfParameterVO paraVo) throws BusinessException {
        try {

            if (paraVo.m_preValueVos == null) {
                return null;
            }
            Object obj = null;
            super.m_tmpVo = paraVo;
            // 权限校验
            String actionCode = ArapConstant.DELETE;
            NCLocator.getInstance().lookup(IArapBillPubUtilService.class).interceptorVaildator(paraVo.m_preValueVos, actionCode);
            // 批量操作
            setParameter("context", paraVo.m_preValueVos);
            obj = runClass("nc.bs.arap.actions.GatheringbillDeleteBatchBSAction", "deleteVOs", "&context:nc.vo.pub.AggregatedValueObject[]", paraVo, m_keyHas);

            afterCheck();
            //调用删除更新合同销售订单更新
            if(paraVo.m_preValueVo instanceof AggGatheringBillVO){
                AggGatheringBillVO aggvo = (AggGatheringBillVO)paraVo.m_preValueVo;
                NCLocator.getInstance().lookup(IDevArapBill2R6Service.class).updateR6Info(aggvo);
            }

            if(paraVo.m_preValueVo instanceof AggGatheringBillVO){
                AggGatheringBillVO aggvo = (AggGatheringBillVO)paraVo.m_preValueVo;
                if(null !=aggvo.getHeadVO().getDef20()){
                    NCLocator.getInstance().lookup(IDevArapBill2R6Service.class).updateR6(aggvo);
                }
            }
            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 (m_keyHas == null) {
            m_keyHas = new Hashtable<String, Object>();
        }
        if (val != null) {
            m_keyHas.put(key, val);
        }
    }

}
