/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the yifu4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.yifu.cloud.plus.v1.csp.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.vo.BatchSureLeaveVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.csp.vo.ErrorInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 自动化离职待办
 *
 * @author hgw
 * @date 2025-11-19 19:23:15
 */
public interface EmployeeRegistrationLeaveService extends IService<EmployeeRegistrationLeave> {
	/**
	 * 自动化离职待办简单分页查询
	 *
	 * @param employeeRegistrationLeave 自动化离职待办
	 * @return
	 */
	IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);

	List<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);

	long getRegistrationLeaveCount(EmployeeRegistrationLeaveSearchVo searchVo);

	IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);

	void exportTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo);

	void exportConfirmTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo);

	// 初始化新增离职待办信息
	void saveLeaveInfo(EmployeeRegistration registration);

	EmployeeRegistrationLeave initLeaveInfo(String id);

	// 单个关闭
	R<String> doClose(String id, String remark, String doTypeWu, String doTypeYi);

	// 单个确认（含编辑功能）
	R<String> doSure(EmployeeRegistrationLeave leave);

	// 批量确认初始化
	BatchSureLeaveVo initBatchSureInfo();

	// 批量确认（不含编辑）
	R<List<ErrorMessage>> doSureBatch(BatchSureLeaveVo vo);

	// 每天下午三点、三点二十推送续保待派单数据
	void autoDoLeave();

	// 批量派单
	// 	@param isExit: 1仅发起日期为今日及之前的事项 0立即发起（全量）
	//	@param doType: 需处理项：1社保2公积金3商险4合同5项目档案6人员档案
	R<List<EmployeeRegistrationLeave>> batchDoLeave(List<String> idList, String isExit, String doType);

	void reduceHandleToLeave(BaseServiceParamListVO vo);

}
