/*
 *    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.yifu.archives.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.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult;

import java.util.List;

/**
 * 人员档案表
 *
 * @author hgw
 * @date 2022-06-20 09:55:06
 */
public interface TEmployeeInfoService extends IService<TEmployeeInfo> {

	/**
	 * @param employeeInfo
	 * @param sql
	 * @Description: 分页查询
	 * @Author: hgw
	 * @Date: 2022/6/20 20:46
	 * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo>
	 **/
	IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql);

	/**
	 * @param employeeInfo
	 * @Description: 获取list
	 * @Author: hgw
	 * @Date: 2022/6/21 11:56
	 * @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo>
	 **/
	List<TEmployeeInfo> getList(TEmployeeInfo employeeInfo);

	/**
	 * @Description: code：2 ： 该人员在离职库已存在，是否'恢复档案'?
	 * 其余code就是成功失败，
	 * 200成功，可以下一步。
	 * @Author: hgw
	 * @Date: 2022/6/21 15:36
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo>
	 **/
	R<TEmployeeInfo> checkIdCard(TEmployeeInfo employeeInfo);

	/**
	 * @param employeeInfo
	 * @Description: 新增档案，附带新增项目档案、学历信息
	 * @Author: hgw
	 * @Date: 2022/6/21 18:31
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	R<String> addNewEmployee(TEmployeeInfo employeeInfo);

	/**
	 * @param employeeInfo
	 * @Description: 更新档案信息
	 * @Author: hgw
	 * @Date: 2022/6/21 19:29
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
	 **/
	R<Boolean> updateEmployee(TEmployeeInfo employeeInfo);

	/**
	 * @param id
	 * @Description: 删除
	 * @Author: hgw
	 * @Date: 2022/6/21 19:50
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	R<String> deleteEmployee(String id);

	/**
	 * @param id
	 * @Description: 减项
	 * @Author: hgw
	 * @Date: 2022/6/21 19:50
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	R<String> minusEmployee(String id);

	/**
	 * @param employeeInfo 档案信息
	 * @param fileSource   人员档案来源(4人员档案新建、5项目档案新建、1社保/公积金、3商险、2薪酬)
	 * @Description: 新增人员档案，其他服务新增时调用
	 * @Author: hgw
	 * @Date: 2022/6/21 19:03
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo>
	 **/
	R<TEmployeeInfo> saveNewEmpLoyee(TEmployeeInfo employeeInfo, String fileSource);

	/**
	 * @Description: 批量导入人员档案
	 * @Author: hgw
	 * @Date: 2022/6/22 11:58
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
	 **/
	R<List<ErrorMessage>> batchImportEmployee(List<EmployeeVO> excelVOList, BindingResult bindingResult, int isCanAdd);

	/**
	 * @param excelVOList
	 * @param bindingResult
	 * @Description: 批量更新人员档案
	 * @Author: hgw
	 * @Date: 2022/6/22 20:30
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.pig4cloud.plugin.excel.vo.ErrorMessage>>
	 **/
	R<List<ErrorMessage>> batchUpdateEmployee(List<EmployeeVO> excelVOList, BindingResult bindingResult);

	void updateEducationOfEmp(EmpEducationUpdateVo education);
}
