package com.kingdee.eas.custom.integration.feishu;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.framework.ejb.EJBRemoteException;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.integration.feishu.app.FeishuApprovalsController;
import com.kingdee.shr.base.syssetting.SHRBaseItem;

import java.rmi.RemoteException;

/**
 * @Description TODO
 * @Date 2026/3/12 10:36
 * @Created by HeYuan
 */
public class FeishuApprovals extends SHRBaseItem implements IFeishuApprovals {
    public FeishuApprovals() {
        super();
        registerInterface(IFeishuApprovals.class, this);
    }

    public FeishuApprovals(Context ctx) {
        super(ctx);
        registerInterface(IFeishuApprovals.class, this);
    }

    public BOSObjectType getType() {
        return new BOSObjectType("EF01A9A7");
    }

    private FeishuApprovalsController getController() throws BOSException {
        return (FeishuApprovalsController) getBizController();
    }

    /**
     * 取值-System defined method
     *
     * @param pk 取值
     * @return
     */
    public FeishuApprovalsInfo getFeishuApprovalsInfo(IObjectPK pk) throws BOSException, EASBizException {
        try {
            return getController().getFeishuApprovalsInfo(getContext(), pk);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取值-System defined method
     *
     * @param pk       取值
     * @param selector 取值
     * @return
     */
    public FeishuApprovalsInfo getFeishuApprovalsInfo(IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException {
        try {
            return getController().getFeishuApprovalsInfo(getContext(), pk, selector);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取值-System defined method
     *
     * @param oql 取值
     * @return
     */
    public FeishuApprovalsInfo getFeishuApprovalsInfo(String oql) throws BOSException, EASBizException {
        try {
            return getController().getFeishuApprovalsInfo(getContext(), oql);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取集合-System defined method
     *
     * @return
     */
    public FeishuApprovalsCollection getFeishuApprovalsCollection() throws BOSException {
        try {
            return getController().getFeishuApprovalsCollection(getContext());
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取集合-System defined method
     *
     * @param view 取集合
     * @return
     */
    public FeishuApprovalsCollection getFeishuApprovalsCollection(EntityViewInfo view) throws BOSException {
        try {
            return getController().getFeishuApprovalsCollection(getContext(), view);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取集合-System defined method
     *
     * @param oql 取集合
     * @return
     */
    public FeishuApprovalsCollection getFeishuApprovalsCollection(String oql) throws BOSException {
        try {
            return getController().getFeishuApprovalsCollection(getContext(), oql);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    @Override
    public void syncFeishuApprovals(String billID) throws BOSException, EASBizException {
        try {
            getController().syncFeishuApprovals(getContext(), billID);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }
}