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

import com.kingdee.bos.framework.ejb.EJBRemoteException;
import com.kingdee.bos.util.BOSObjectType;
import java.rmi.RemoteException;
import com.kingdee.bos.framework.AbstractBizCtrl;
import com.kingdee.bos.orm.template.ORMObject;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.util.*;
import com.kingdee.eas.common.EASBizException;
import java.util.Date;
import java.util.Map;
import java.lang.String;
import com.kingdee.bos.Context;
import com.kingdee.bos.framework.*;
import com.kingdee.eas.custom.integration.feishu.task.*;

public class FeishuBizFacade extends AbstractBizCtrl implements IFeishuBizFacade
{
    public FeishuBizFacade()
    {
        super();
        registerInterface(IFeishuBizFacade.class, this);
    }
    public FeishuBizFacade(Context ctx)
    {
        super(ctx);
        registerInterface(IFeishuBizFacade.class, this);
    }
    public BOSObjectType getType()
    {
        return new BOSObjectType("04260294");
    }
    private FeishuBizFacadeController getController() throws BOSException
    {
        return (FeishuBizFacadeController)getBizController();
    }
    /**
     *同步飞书UserId-User defined method
     *@param userId 用户id
     *@param switchType 0:工号匹配; 1:手机号匹配;默认值为0
     */
    public void syncFeishuUserId(String userId, int switchType) throws BOSException, EASBizException
    {
        try {
            getController().syncFeishuUserId(getContext(), userId, switchType);
        }
        catch(RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }
    /**
     *同步考勤打卡记录-User defined method
     *@param startDate 开始日期
     *@param endDate 结束日期
     *@param advanceDays 前延天数
     *@return
     */
    public Map syncAttendanceRecord(Date startDate, Date endDate, int advanceDays) throws BOSException, EASBizException
    {
        try {
            return getController().syncAttendanceRecord(getContext(), startDate, endDate, advanceDays);
        }
        catch(RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }
}