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

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * 员工合同
 *
 * @author hgw
 * @date 2022-06-29 20:45:22
 */
@Data
@ColumnWidth(10)
public class EmployeeContractExportVO implements Serializable {

	private static final long serialVersionUID = 1L;
	/**
	 * @Author fxj
	 * @Description 0派增-社保派单、1派增-无社保新签、2派增-续签、3派减-作废、4派减-终止、5自动化派单-无需审核
	 * 1、增加“审核类型”，内容为：派增-社保派单、派增-无社保新签、派增-续签、派减-作废、派减-终止
	 * 2、社保派单过来的合同，审核类型统一为：派增-社保派单；
	 * 3、合同申请处申请类型为：新签（正常签订）——审核类型为：派增-无社保新签、；续签（合同未到期重新签订、离职再入职、商务合同更改）——审核类型统一为：派增-续签；
	 * 3、合同申请处申请类型为：作废——审核类型统一为：派减-作废；终止——审核类型统一为：派减-终止；
	 * @Date 14:50 2022/11/7
	 **/
	@ExcelAttribute(name = "审核类型",readConverterExp = "0=派增-社保派单,1=派增-无社保新签,2=派增-续签,3=派减-作废,4=派减-终止,5=自动化派单-无需审核")
	@Schema(description = "审核类型")
	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("审核类型")
	private String type;
	@Schema(description = "申请编号")
	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("申请编号")
	private String applyNo;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("员工编码")
	@Length(max = 32, message = "员工编码不能超过32个字符")
	@ExcelAttribute(name = "员工编码", isNotEmpty = true, errorInfo = "员工编码不能为空", maxLength = 32)
	@Schema(description = "员工编码", name = "empNo")
	private String empNo;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("员工姓名")
	@Length(max = 32, message = "员工姓名不能超过32个字符")
	@ExcelAttribute(name = "员工姓名", maxLength = 32, needExport = true)
	@Schema(description = "员工姓名", name = "empName")
	private String empName;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("身份证号")
	@Length(max = 32, message = "身份证号不能超过32个字符")
	@ExcelAttribute(name = "身份证号", maxLength = 32, isIdCard = true, needExport = true)
	@Schema(description = "身份证号", name = "empIdcard")
	private String empIdcard;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("合同起始日期")
	@NotBlank(message = "合同起始日期不能为空")
	@ExcelAttribute(name = "合同起始日期", isNotEmpty = true, errorInfo = "合同起始日期不能为空")
	@Schema(description = "合同起始日期", name = "contractStart")
	private String contractStart;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("合同截止日期")
	@ExcelAttribute(name = "合同截止日期", needExport = true)
	@Schema(description = "合同截止日期", name = "contractEnd")
	private String contractEnd;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("档案-省")
	@ExcelAttribute(name = "档案-省", maxLength = 32, isArea = true)
	@Schema(description = "档案-省", name = "fileProvince")
	private String fileProvince;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("档案-市")
	@ExcelAttribute(name = "档案-市", maxLength = 32, isArea = true, parentField = "fileProvince")
	@Schema(description = "档案-市", name = "fileCity")
	private String fileCity;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("档案-县")
	@ExcelAttribute(name = "档案-县", maxLength = 32, isArea = true, parentField = "fileCity")
	@Schema(description = "档案-县", name = "fileTown")
	private String fileTown;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("项目名称")
	@Length(max = 128, message = "项目名称不能超过128个字符")
	@ExcelAttribute(name = "项目名称", maxLength = 128)
	@Schema(description = "项目名称", name = "subjectDepart")
	private String subjectDepart;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("项目编码")
	@Schema(description = "项目编码")
	private String deptNo;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("员工类型")
	@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
	@Schema(description = "员工类型（字典值，0外包1派遣2代理3内部员工）")
	private String empNatrue;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("合同类型")
	@NotBlank(message = "合同类型不能为空")
	@Length(max = 32, message = "合同类型不能超过32个字符")
	@ExcelAttribute(name = "合同类型", isNotEmpty = true, errorInfo = "合同类型不能为空", maxLength = 32, needExport = true)
	@Schema(description = "合同类型", name = "contractName")
	private String contractName;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("业务细分")
	@NotBlank(message = "业务细分不能为空")
	@Length(max = 32, message = "业务细分不能超过32个字符")
	@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
	@Schema(description = "业务细分", name = "contractName")
	private String contractSubName;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("签订类型")
	@NotBlank(message = "签订类型不能为空")
	@Length(max = 1, message = "签订类型不能超过1个字符")
	@ExcelAttribute(name = "签订类型", isNotEmpty = true, errorInfo = "签订类型不能为空", maxLength = 100, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_SITUATION_TYPE)
	@Schema(description = "签订类型", name = "situation")
	private String situation;

	/**
	 * 签订期限employee_contract_type
	 * 0	已完成一定工作任务为期限
	 * 1	固定期限
	 * 2	无固定期限
	 */
	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("签订期限")
	@NotBlank(message = "签订期限不能为空")
	@Length(max = 32, message = "签订期限不能超过32个字符")
	@ExcelAttribute(name = "签订期限", isNotEmpty = true, errorInfo = "签订期限不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
	@Schema(description = "签订期限", name = "contractType")
	private String contractType;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("合同甲方")
	@ExcelAttribute(name = "合同甲方")
	@Schema(description = "合同甲方")
	@Size(max = 50, message = "合同甲方不可超过50位")
	private String contractParty;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("客户名称")
	@Length(max = 128, message = "客户名称不能超过128个字符")
	@ExcelAttribute(name = "客户名称", maxLength = 128)
	@Schema(description = "客户名称", name = "subjectUnit")
	private String subjectUnit;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("审核状态")
	@ExcelAttribute(name = "审核状态", readConverterExp = "0=待提交,1=待审核,2=审核通过,3=审核不通过,4=签署中,5=撤销签署,6=签署失败")
	@Schema(description = "审核状态")
	private String auditStatus;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelAttribute(name = "不通过原因")
	@Schema(description = "不通过原因")
	@ExcelProperty("不通过原因")
	private String noPassReason;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelAttribute(name = "审核说明")
	@Schema(description = "审核说明")
	@ExcelProperty("审核说明")
	private String remark;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("合同状态")
	@ExcelAttribute(name = "合同状态", readConverterExp = "0=可用,1=不可用")
	@Schema(description = "合同状态", name = "inUse")
	private String inUse;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("附件状态")
	@ExcelAttribute(name = "附件状态")
	@Schema(description = "附件状态", name = "isFile")
	private String files;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("归档状态")
	@ExcelAttribute(name = "归档状态", readConverterExp = "0=已归档,1=未归档")
	@Schema(description = "归档状态", name = "isFile")
	private String isFile;

	/**
	 * 合同岗位
	 */
	@Length(max = 32, message = "合同岗位不能超过32个字符")
	@ExcelAttribute(name = "合同岗位", maxLength = 32, needExport = true)
	@ExcelProperty("合同岗位")
	@Schema(description = "合同岗位", name = "post")
	private String post;

	/**
	 * 工时制（数据字典） 1标准工时 2 综合工时 3不定时工时制
	 */
	@ExcelAttribute(name = "工时制")
	@Schema(description = "工时制（数据字典） 1标准工时 2 综合工时 3不定时工时制", name = "workingHours")
	@ExcelProperty("工时制")
	private String workingHours;
	/**
	 * 合同编码
	 */
	@NotBlank(message = "合同编码不能为空")
	@Length(max = 50, message = "合同编码不能超过50个字符")
	@ExcelAttribute(name = "合同编码", maxLength = 50)
	@ExcelProperty("合同编码")
	@Schema(description = "合同编码", name = "contractNo")
	private String contractNo;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("创建人")
	private String createName;

	@ExcelAttribute(name = "审核人")
	@ExcelProperty("审核人")
	@Schema(description = "审核人")
	private String auditUserName;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("创建时间")
	private String createTime;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("累计签订次数")
	private String createNum;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("首签日期")
	private String startDate;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("最晚到期日期")
	private String endDate;

	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelProperty("历次记录")
	private String history;

	@TableField(exist = false)
	@Schema(description = "选中的idList")
	private List<String> idList;

	@TableField(exist = false)
	@Schema(description = "导出的表头的Set")
	private Set<String> exportFields;


	@HeadFontStyle(fontHeightInPoints = 11)
	@ExcelAttribute(name = "备注")
	@Schema(description = "备注")
	@ExcelProperty("备注")
	private String memo;

	/**
	 * 试用期（单位月）
	 */
	@ExcelAttribute(name = "试用期")
	@Schema(description = "试用期", name = "tryPeriod")
	@ExcelProperty("试用期")
	private String tryPeriod;
}
