package com.storlead.user.pojo.entity;

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.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.entity.SysBaseField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class UserEntity extends SysBaseField {

    @TableId(type = IdType.INPUT)
    @ApiModelProperty(value = "用户ID")
    private Long id;

    @ApiModelProperty(value = "用户名")
    private String userName;

    private String password;

    private String xworkUserId;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "昵称")
    private String nickName;

    @ApiModelProperty(value = "姓名")
    private String realName;

    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ApiModelProperty(value = "email")
    private String email;

    @ApiModelProperty(value = "岗位ID")
    private Long jobId;

    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "分公司ID")
    private Long subCompanyId;

    @ApiModelProperty(value = "公司ID")
    private Long companyId;

    @ApiModelProperty(value = "直接上级ID")
    private Long managerId;

    @ApiModelProperty(value = "领导路由")
    private String managers;

    private String idNum;
    private String address;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private LocalDate birthday;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private LocalDate entryDate;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private LocalDate permanentDate;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private LocalDate resignDate;
    private String bankName;
    private String bankCardNum;

    @ApiModelProperty(value = "状态 0：试用期 1：正式期 2：临时 3：试用延期 5：离职流程")
    private String status;
    private Integer isShenzhenCensus;
    private String census;
    private String ethnic;
    private String marriage;
    private String education;
    @ApiModelProperty(value = "是否负责人：0 否,1分公司负责人,2部门负责人")
    private Integer isLeader;

    @ApiModelProperty(value = "0：任何都不允许登录，1：允许登录销售管理系统，9:：允许登录许昌监督项目")
    private Integer externalUserType;

    @ApiModelProperty(value = "数据权限")
    @TableField(exist = false)
    private String dataScope;

    @ApiModelProperty(value = "测试")
    @TableField(exist = false)
    private Integer test;

    @ApiModelProperty(value = "是否冻结: 1 冻结,0:未冻结")
    private Integer isFreeze;

    @ApiModelProperty(value = "组织路由")
    private String orgRouteCode;

    @ApiModelProperty(value = "数据来源")
    private Integer dataSource;

    @ApiModelProperty(value = "岗位职责")
    private String jobDes;

    @ApiModelProperty(value = "最近的活动时间")
    private Date lastActivityTime;

    public UserEntity(Long id, String userName, String password) {
        this.id = id;
        this.userName = userName;
        this.password = password;
    }
}
