/*
 *    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.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * 自动化离职待办
 *
 * @author hgw
 * @date 2025-11-19 19:23:15
 */
@Data
@TableName("employee_registration_leave")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化离职待办")
public class EmployeeRegistrationLeave extends BaseEntity {

	/**
	 * 主键ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@ExcelProperty("主键ID")
	@Schema(description = "主键ID")
	private String id;
	/**
	 * 离职处理状态：0待确认1待处理2处理中3已处理
	 */
	@ExcelAttribute(name = "离职处理状态：0待确认1待处理2处理中3已处理", maxLength = 1)
	@Length(max = 1, message = "离职处理状态：0待确认1待处理2处理中3已处理不能超过1个字符")
	@ExcelProperty("离职处理状态：0待确认1待处理2处理中3已处理")
	@Schema(description = "离职处理状态：0待确认1待处理2处理中3已处理")
	private String leaveStatus;
	/**
	 * 执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理
	 */
	@ExcelAttribute(name = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理", maxLength = 1)
	@Length(max = 1, message = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理不能超过1个字符")
	@ExcelProperty("执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理")
	@Schema(description = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理")
	private String doStatus;

	/**
	 * 合同终止：0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
	 */
	@ExcelAttribute(name = "合同终止：0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过", maxLength = 2)
	@Length(max = 2, message = "合同终止：0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过不能超过2个字符")
	@ExcelProperty("合同终止：0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过")
	@Schema(description = "合同终止：0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过")
	private String doStatusContract;
	/**
	 * 社保减员：0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败7办理中8办理成功9办理失败10审核不通过
	 * 2026-02-03 MVP1.7.20 增加7办理中
	 */
	@ExcelAttribute(name = "社保减员：0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败7办理中8办理成功9办理失败10审核不通过", maxLength = 2)
	@Length(max = 2, message = "社保减员：0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败7办理中8办理成功9办理失败10审核不通过不能超过2个字符")
	@ExcelProperty("社保减员：0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败7办理中8办理成功9办理失败10审核不通过")
	@Schema(description = "社保减员：0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败7办理中8办理成功9办理失败10审核不通过")
	private String doStatusSocial;
	/**
	 * 公积金减员：0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过
	 */
	@ExcelAttribute(name = "公积金减员：0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过", maxLength = 2)
	@Length(max = 2, message = "公积金减员：0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过不能超过2个字符")
	@ExcelProperty("公积金减员：0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过")
	@Schema(description = "公积金减员：0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过")
	private String doStatusFund;
	/**
	 * 商险退保：0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回
	 */
	@ExcelAttribute(name = "商险退保：0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回", maxLength = 2)
	@Length(max = 2, message = "商险退保：0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回不能超过2个字符")
	@ExcelProperty("商险退保：0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回")
	@Schema(description = "商险退保：0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回")
	private String doStatusInsurance;
	/**
	 * 减项：0空1无需处理2待减项8减项成功9减项失败
	 */
	@ExcelAttribute(name = "减项：0空1无需处理2待减项8减项成功9减项失败", maxLength = 2)
	@Length(max = 2, message = "减项：0空1无需处理2待减项8减项成功9减项失败不能超过2个字符")
	@ExcelProperty("减项：0空1无需处理2待减项8减项成功9减项失败")
	@Schema(description = "减项：0空1无需处理2待减项8减项成功9减项失败")
	private String doStatusProject;
	/**
	 * 减档：0空1无需处理2待减档8减档成功9减档失败
	 */
	@ExcelAttribute(name = "减档：0空1无需处理2待减档8减档成功9减档失败", maxLength = 2)
	@Length(max = 2, message = "减档：0空1无需处理2待减档8减档成功9减档失败不能超过2个字符")
	@ExcelProperty("减档：0空1无需处理2待减档8减档成功9减档失败")
	@Schema(description = "减档：0空1无需处理2待减档8减档成功9减档失败")
	private String doStatusEmp;
	/**
	 * 需处理项：1社保2公积金3商险4合同5项目档案6人员档案
	 */
	@ExcelAttribute(name = "需处理项：1社保2公积金3商险4合同5项目档案6人员档案", maxLength = 2)
	@Length(max = 2, message = "需处理项：1社保2公积金3商险4合同5项目档案6人员档案不能超过2个字符")
	@ExcelProperty("需处理项：1社保2公积金3商险4合同5项目档案6人员档案")
	@Schema(description = "需处理项：1社保2公积金3商险4合同5项目档案6人员档案")
	private String doType;
	/**
	 * 社保Id
	 */
	@ExcelAttribute(name = "社保Id", maxLength = 36)
	@Length(max = 36, message = "社保Id不能超过36个字符")
	@ExcelProperty("社保Id")
	@Schema(description = "社保Id")
	private String socialId;
	/**
	 * 停缴社保日期
	 */
	@ExcelAttribute(name = "停缴社保日期", maxLength = 10)
	@Length(max = 10, message = "停缴社保日期不能超过10个字符")
	@ExcelProperty("停缴社保日期")
	@Schema(description = "停缴社保日期")
	private String socialReduceDate;
	/**
	 * 社保派减备注
	 */
	@ExcelAttribute(name = "社保派减备注", maxLength = 50)
	@Length(max = 50, message = "社保派减备注不能超过50个字符")
	@ExcelProperty("社保派减备注")
	@Schema(description = "社保派减备注")
	private String socialTrustRemark;
	/**
	 * 社保派减时间
	 */
	@ExcelAttribute(name = "社保派减时间", isDate = true)
	@ExcelProperty("社保派减时间")
	@Schema(description = "社保派减时间")
	private LocalDateTime socialExpectedTime;
	/**
	 * 公积金Id
	 */
	@ExcelAttribute(name = "公积金Id", maxLength = 36)
	@Length(max = 36, message = "公积金Id不能超过36个字符")
	@ExcelProperty("公积金Id")
	@Schema(description = "公积金Id")
	private String fundId;
	/**
	 * 停缴公积金日期
	 */
	@ExcelAttribute(name = "停缴公积金日期", maxLength = 10)
	@Length(max = 10, message = "停缴公积金日期不能超过10个字符")
	@ExcelProperty("停缴公积金日期")
	@Schema(description = "停缴公积金日期")
	private String fundReduceDate;
	/**
	 * 公积金派减备注
	 */
	@ExcelAttribute(name = "公积金派减备注", maxLength = 50)
	@Length(max = 50, message = "公积金派减备注不能超过50个字符")
	@ExcelProperty("公积金派减备注")
	@Schema(description = "公积金派减备注")
	private String fundTrustRemark;
	/**
	 * 公积金派减时间
	 */
	@ExcelAttribute(name = "公积金派减时间", isDate = true)
	@ExcelProperty("公积金派减时间")
	@Schema(description = "公积金派减时间")
	private LocalDateTime fundExpectedTime;
	/**
	 * 商险ID
	 */
	@ExcelAttribute(name = "商险ID", maxLength = 36)
	@Length(max = 36, message = "商险ID不能超过36个字符")
	@ExcelProperty("商险ID")
	@Schema(description = "商险ID")
	private String insuranceId;
	/**
	 * 预计商险退保派单时间
	 */
	@ExcelAttribute(name = "预计商险退保派单时间", isDate = true)
	@ExcelProperty("预计商险退保派单时间")
	@Schema(description = "预计商险退保派单时间")
	private LocalDateTime insuranceExpectedTime;
	/**
	 * 商险停保日期
	 */
	@ExcelAttribute(name = "商险停保日期", isDate = true)
	@ExcelProperty("商险停保日期")
	@Schema(description = "商险停保日期")
	private LocalDateTime insuranceExpectedTimeNext;
	/**
	 * 合同ID
	 */
	@ExcelAttribute(name = "合同ID", maxLength = 36)
	@Length(max = 36, message = "合同ID不能超过36个字符")
	@ExcelProperty("合同ID")
	@Schema(description = "合同ID")
	private String contractId;
	/**
	 * 合同终止发起时间
	 */
	@ExcelAttribute(name = "合同终止发起时间", isDate = true)
	@ExcelProperty("合同终止发起时间")
	@Schema(description = "合同终止发起时间")
	private LocalDateTime contractExpectedTime;
	/**
	 * 档案ID
	 */
	@ExcelAttribute(name = "档案ID", maxLength = 36)
	@Length(max = 36, message = "档案ID不能超过36个字符")
	@ExcelProperty("档案ID")
	@Schema(description = "档案ID")
	private String empId;
	/**
	 * 项目档案ID
	 */
	@ExcelAttribute(name = "项目档案ID", maxLength = 36)
	@Length(max = 36, message = "项目档案ID不能超过36个字符")
	@ExcelProperty("项目档案ID")
	@Schema(description = "项目档案ID")
	private String empProjectId;

	@Schema(description = "确认人")
	private String confirmUser;

	@Schema(description = "确认时间")
	private LocalDateTime confirmTime;

	// 联动端口：固定值：人员离职
	@Schema(description = "联动端口")
	private String linkPort;

	@Schema(description = "是否多项目0否1是")
	private String isMultipleDept;

	/**
	 * 原社保派单ID
	 */
	@ExcelAttribute(name = "原社保派单ID", maxLength = 36)
	@Length(max = 36, message = "原社保派单ID不能超过36个字符")
	@ExcelProperty("原社保派单ID")
	@Schema(description = "原社保派单ID")
	private String socialDispatchIdOld;
	/**
	 * 原公积金派单ID
	 */
	@ExcelAttribute(name = "原公积金派单ID", maxLength = 36)
	@Length(max = 36, message = "原公积金派单ID不能超过36个字符")
	@ExcelProperty("原公积金派单ID")
	@Schema(description = "原公积金派单ID")
	private String fundDispatchIdOld;
	/**
	 * 原商险ID
	 */
	@ExcelAttribute(name = "原商险ID", maxLength = 36)
	@Length(max = 36, message = "原商险ID不能超过36个字符")
	@ExcelProperty("原商险ID")
	@Schema(description = "原商险ID")
	private String insuranceIdOld;
	/**
	 * 原合同ID
	 */
	@ExcelAttribute(name = "原合同ID", maxLength = 36)
	@Length(max = 36, message = "原合同ID不能超过36个字符")
	@ExcelProperty("原合同ID")
	@Schema(description = "原合同ID")
	private String contractIdOld;
	/**
	 * 原档案ID
	 */
	@ExcelAttribute(name = "原档案ID", maxLength = 36)
	@Length(max = 36, message = "原档案ID不能超过36个字符")
	@ExcelProperty("原档案ID")
	@Schema(description = "原档案ID")
	private String empIdOld;
	/**
	 * 原项目档案ID
	 */
	@ExcelAttribute(name = "原项目档案ID", maxLength = 36)
	@Length(max = 36, message = "原项目档案ID不能超过36个字符")
	@ExcelProperty("原项目档案ID")
	@Schema(description = "原项目档案ID")
	private String empProjectIdOld;
	/**
	 * 原社保状态
	 */
	@ExcelAttribute(name = "原社保状态", maxLength = 36)
	@Length(max = 36, message = "原社保状态不能超过36个字符")
	@ExcelProperty("原社保状态")
	@Schema(description = "原社保状态")
	private String socialStatusOld;
	/**
	 * 原公积金状态
	 */
	@ExcelAttribute(name = "原公积金状态", maxLength = 36)
	@Length(max = 36, message = "原公积金状态不能超过36个字符")
	@ExcelProperty("原公积金状态")
	@Schema(description = "原公积金状态")
	private String fundStatusOld;
	/**
	 * 原商险状态
	 */
	@ExcelAttribute(name = "原商险状态", maxLength = 36)
	@Length(max = 36, message = "原商险状态不能超过36个字符")
	@ExcelProperty("原商险状态")
	@Schema(description = "原商险状态")
	private String insuranceStatusOld;
	/**
	 * 原合同状态
	 */
	@ExcelAttribute(name = "原合同状态", maxLength = 36)
	@Length(max = 36, message = "原合同状态不能超过36个字符")
	@ExcelProperty("原合同状态")
	@Schema(description = "原合同状态")
	private String contractStatusOld;
	/**
	 * 原档案状态
	 */
	@ExcelAttribute(name = "原档案状态", maxLength = 36)
	@Length(max = 36, message = "原档案状态不能超过36个字符")
	@ExcelProperty("原档案状态")
	@Schema(description = "原档案状态")
	private String empStatusOld;
	/**
	 * 原项目档案状态
	 */
	@ExcelAttribute(name = "原项目档案状态", maxLength = 36)
	@Length(max = 36, message = "原项目档案状态不能超过36个字符")
	@ExcelProperty("原项目档案状态")
	@Schema(description = "原项目档案状态")
	private String empProjectStatusOld;

	/**
	 * 社保失败人
	 */
	@ExcelAttribute(name = "社保失败人", maxLength = 50)
	@Length(max = 50, message = "社保失败人不能超过50个字符")
	@ExcelProperty("社保失败人")
	@Schema(description = "社保失败人")
	private String failSocialUser;
	/**
	 * 公积金失败人
	 */
	@ExcelAttribute(name = "公积金失败人", maxLength = 50)
	@Length(max = 50, message = "公积金失败人不能超过50个字符")
	@ExcelProperty("公积金失败人")
	@Schema(description = "公积金失败人")
	private String failFundUser;
	/**
	 * 商险失败人
	 */
	@ExcelAttribute(name = "商险失败人", maxLength = 50)
	@Length(max = 50, message = "商险失败人不能超过50个字符")
	@ExcelProperty("商险失败人")
	@Schema(description = "商险失败人")
	private String failInsuranceUser;
	/**
	 * 合同失败人
	 */
	@ExcelAttribute(name = "合同失败人", maxLength = 50)
	@Length(max = 50, message = "合同失败人不能超过50个字符")
	@ExcelProperty("合同失败人")
	@Schema(description = "合同失败人")
	private String failContractUser;
	/**
	 * 档案失败人
	 */
	@ExcelAttribute(name = "档案失败人", maxLength = 50)
	@Length(max = 50, message = "档案失败人不能超过50个字符")
	@ExcelProperty("档案失败人")
	@Schema(description = "档案失败人")
	private String failEmpUser;
	/**
	 * 项目档案失败人
	 */
	@ExcelAttribute(name = "项目档案失败人", maxLength = 50)
	@Length(max = 50, message = "项目档案失败人不能超过50个字符")
	@ExcelProperty("项目档案失败人")
	@Schema(description = "项目档案失败人")
	private String failEmpProjectUser;
	/**
	 * 社保失败原因
	 */
	@ExcelAttribute(name = "社保失败原因", maxLength = 50)
	@Length(max = 50, message = "社保失败原因不能超过50个字符")
	@ExcelProperty("社保失败原因")
	@Schema(description = "社保失败原因")
	private String failSocialRemark;
	/**
	 * 公积金失败原因
	 */
	@ExcelAttribute(name = "公积金失败原因", maxLength = 50)
	@Length(max = 50, message = "公积金失败原因不能超过50个字符")
	@ExcelProperty("公积金失败原因")
	@Schema(description = "公积金失败原因")
	private String failFundRemark;
	/**
	 * 商险失败原因
	 */
	@ExcelAttribute(name = "商险失败原因", maxLength = 50)
	@Length(max = 50, message = "商险失败原因不能超过50个字符")
	@ExcelProperty("商险失败原因")
	@Schema(description = "商险失败原因")
	private String failInsuranceRemark;
	/**
	 * 合同失败原因
	 */
	@ExcelAttribute(name = "合同失败原因", maxLength = 50)
	@Length(max = 50, message = "合同失败原因不能超过50个字符")
	@ExcelProperty("合同失败原因")
	@Schema(description = "合同失败原因")
	private String failContractRemark;
	/**
	 * 档案失败原因
	 */
	@ExcelAttribute(name = "档案失败原因", maxLength = 50)
	@Length(max = 50, message = "档案失败原因不能超过50个字符")
	@ExcelProperty("档案失败原因")
	@Schema(description = "档案失败原因")
	private String failEmpRemark;
	/**
	 * 项目档案失败原因
	 */
	@ExcelAttribute(name = "项目档案失败原因", maxLength = 50)
	@Length(max = 50, message = "项目档案失败原因不能超过50个字符")
	@ExcelProperty("项目档案失败原因")
	@Schema(description = "项目档案失败原因")
	private String failEmpProjectRemark;
	/**
	 * 社保失败时间
	 */
	@ExcelAttribute(name = "社保失败时间", isDate = true)
	@ExcelProperty("社保失败时间")
	@Schema(description = "社保失败时间")
	private LocalDateTime failSocialTime;
	/**
	 * 公积金失败时间
	 */
	@ExcelAttribute(name = "公积金失败时间", isDate = true)
	@ExcelProperty("公积金失败时间")
	@Schema(description = "公积金失败时间")
	private LocalDateTime failFundTime;
	/**
	 * 商险失败时间
	 */
	@ExcelAttribute(name = "商险失败时间", isDate = true)
	@ExcelProperty("商险失败时间")
	@Schema(description = "商险失败时间")
	private LocalDateTime failInsuranceTime;
	/**
	 * 合同失败时间
	 */
	@ExcelAttribute(name = "合同失败时间", isDate = true)
	@ExcelProperty("合同失败时间")
	@Schema(description = "合同失败时间")
	private LocalDateTime failContractTime;
	/**
	 * 档案失败时间
	 */
	@ExcelAttribute(name = "档案失败时间", isDate = true)
	@ExcelProperty("档案失败时间")
	@Schema(description = "档案失败时间")
	private LocalDateTime failEmpTime;
	/**
	 * 项目档案失败时间
	 */
	@ExcelAttribute(name = "项目档案失败时间", isDate = true)
	@ExcelProperty("项目档案失败时间")
	@Schema(description = "项目档案失败时间")
	private LocalDateTime failEmpProjectTime;


	@Schema(description = "无需处理原因（社保）")
	private String closeRemarkSocial;
	@Schema(description = "无需处理原因（公积金）")
	private String closeRemarkFund;
	@Schema(description = "无需处理原因（合同）")
	private String closeRemarkContract;
	@Schema(description = "无需处理原因（项目档案）")
	private String closeRemarkEmpProject;

	// 目前只有这些无需处理：
	@Schema(description = "无需处理原因（商险）")
	private String closeRemarkInsurance;
	@Schema(description = "无需处理原因（档案）")
	private String closeRemarkEmp;

	@Schema(description = "减少原因（名称）")
	private String leaveReasonName;
	@Schema(description = "减少原因（ID）")
	private String leaveReasonId;

	@TableField(exist = false)
	@ExcelProperty(value = "项目编码")
	private String deptNo;

	@TableField(exist = false)
	@ExcelProperty(value = "项目名称")
	private String deptName;

	@TableField(exist = false)
	@Schema(description = "员工姓名")
	private String employeeName;

	@TableField(exist = false)
	@Schema(description = "身份证号")
	private String empIdcard;

	@TableField(exist = false)
	@Schema(description = "离职日期")
	private String joinLeaveDate;

	@TableField(exist = false)
	@Schema(description = "最新的客服名称")
	private String customerUsernameNew;
}
