package com.yifu.cloud.plus.v1.yifu.archives.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
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.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 合同流程中信息记录表
 *
 * @author system
 * @date 2026-04-23
 */
@Data
@TableName("t_contract_pre_detail")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同流程中信息记录表")
public class TContractPreDetail extends BaseEntity {

	/**
	 * 主键ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@ExcelProperty("ID")
	@Schema(description = "主键ID")
	private String id;

	/**
	 * 申请编号
	 */
	@ExcelAttribute(name = "申请编号", maxLength = 100)
	@Length(max = 100, message = "申请编号不能超过100个字符")
	@ExcelProperty("申请编号")
	@Schema(description = "申请编号")
	private String applyNo;

	/**
	 * 档案-省
	 */
	@ExcelAttribute(name = "档案-省", maxLength = 32, isDataId = true, isArea = true, parentField = "")
	@Schema(description = "档案-省", name = "fileProvince")
	private Integer fileProvince;
	/**
	 * 档案-市
	 */
	@ExcelAttribute(name = "档案-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fileProvince")
	@Schema(description = "档案-市", name = "fileCity")
	private Integer fileCity;
	/**
	 * 档案-县
	 */
	@ExcelAttribute(name = "档案-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fileCity")
	@Schema(description = "档案-县", name = "fileTown")
	private Integer fileTown;

	/**
	 * 合同类型
	 */
	@ExcelAttribute(name = "合同类型", maxLength = 50)
	@Length(max = 50, message = "合同类型不能超过50个字符")
	@ExcelProperty("合同类型")
	@Schema(description = "合同类型")
	private String contractName;

	/**
	 * 签订类型
	 */
	@ExcelAttribute(name = "签订类型", maxLength = 50)
	@Length(max = 50, message = "签订类型不能超过50个字符")
	@ExcelProperty("签订类型")
	@Schema(description = "签订类型")
	private String signType;

	/**
	 * 签订期限
	 */
	@ExcelAttribute(name = "签订期限", maxLength = 50)
	@Length(max = 50, message = "签订期限不能超过50个字符")
	@ExcelProperty("签订期限")
	@Schema(description = "签订期限")
	private String contractType;

	/**
	 * 合同起始时间
	 */
	@NotBlank(message = "合同起始时间不能为空")
	@ExcelAttribute(name = "合同起始时间", needExport = true,isNotEmpty = true)
	@Schema(description = "合同起始时间", name = "contractStart")
	@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date contractStart;
	/**
	 * 合同到期时间
	 */
	@ExcelAttribute(name = "合同到期时间", needExport = true)
	@Schema(description = "合同到期时间", name = "contractEnd")
	@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date contractEnd;

	/**
	 * 审核状态（0：待提交；1：待审核；2审核通过；3审核不通过；4签署中；5撤销签署；6签署失败）
	 */
	@ExcelAttribute(name = "审核状态", maxLength = 20)
	@Length(max = 20, message = "审核状态不能超过20个字符")
	@ExcelProperty("审核状态")
	@Schema(description = "审核状态（0：待提交；1：待审核；2审核通过；3审核不通过；4签署中；5撤销签署；6签署失败）")
	private String auditStatus;

	/**
	 * 入职确认信息主表id
	 */
	@ExcelAttribute(name = "入职确认信息主表id", maxLength = 64)
	@Length(max = 64, message = "入职确认信息主表id不能超过64个字符")
	@ExcelProperty("入职确认信息主表id")
	@Schema(description = "入职确认信息主表id")
	private String registerId;
}
