package com.kingdee.eas.custom.attendanceexception.handler;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.attendanceexception.task.AttendanceExceptionFacadeFactory;
import com.kingdee.eas.custom.attendanceexception.task.IAttendanceExceptionFacade;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
import org.springframework.ui.ModelMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description TODO
 * @Date 2025/4/22 11:32
 * @Created by Heyuan
 */
public class AttendanceExceptionLogListHandler extends ListHandler {

    /**
     * 员工个人异常提醒
     *
     * @param request
     * @param response
     * @param modelMap
     * @return
     * @throws SHRWebException
     */
    public void notifyEmployeeExceptionAction(
            HttpServletRequest request,
            HttpServletResponse response,
            ModelMap modelMap
    ) throws SHRWebException, BOSException, EASBizException {
        Context ctx = SHRContext.getInstance().getContext();
        IAttendanceExceptionFacade iAttendanceExceptionFacade = AttendanceExceptionFacadeFactory.getLocalInstance(ctx);
        iAttendanceExceptionFacade.notifyEmployeeException();
    }

    /**
     * 提醒员工累计异常
     *
     * @param request
     * @param response
     * @param modelMap
     * @return
     * @throws SHRWebException
     */
    public void notifyEmployeeCumulativeExceptionAction(
            HttpServletRequest request,
            HttpServletResponse response,
            ModelMap modelMap
    ) throws SHRWebException, BOSException, EASBizException {
        Context ctx = SHRContext.getInstance().getContext();
        IAttendanceExceptionFacade iAttendanceExceptionFacade = AttendanceExceptionFacadeFactory.getLocalInstance(ctx);
        iAttendanceExceptionFacade.notifyEmployeeCumulativeException("5");
    }

    /**
     * 提醒中心负责人累计异常
     *
     * @param request
     * @param response
     * @param modelMap
     * @return
     * @throws SHRWebException
     */
    public void alertLeaderExceptionTotalAction(
            HttpServletRequest request,
            HttpServletResponse response,
            ModelMap modelMap
    ) throws SHRWebException, BOSException, EASBizException {
        Context ctx = SHRContext.getInstance().getContext();
        IAttendanceExceptionFacade iAttendanceExceptionFacade = AttendanceExceptionFacadeFactory.getLocalInstance(ctx);
        iAttendanceExceptionFacade.alertLeaderExceptionTotal();
    }
}
