package com.kingdee.eas.custom.integration.apimgt.app;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.integration.apimgt.OpenPlatformAuthBillInfo;
import com.kingdee.shr.base.syssetting.BaseItemStateEnum;
import org.apache.log4j.Logger;

public class OpenPlatformAuthBillControllerBean extends AbstractOpenPlatformAuthBillControllerBean {
    private static Logger logger =
            Logger.getLogger("com.kingdee.eas.custom.integration.apimgt.app.OpenPlatformAuthBillControllerBean");


    @Override
    protected void _delete(Context ctx, IObjectPK pk) throws BOSException, EASBizException {
        OpenPlatformAuthBillInfo openPlatformAuthBillInfo = getOpenPlatformAuthBillInfo(ctx, pk);
        BaseItemStateEnum state = openPlatformAuthBillInfo.getState();
        if (BaseItemStateEnum.ENABLE.equals(state)) {
            throw new BOSException("启用的数据不能删除");
        }
        super._delete(ctx, pk);
    }
}