package com.zcloud.basic.info.domain.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.jjb.saas.framework.domain.model.BaseE;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * web-domain
 *
 * @Author zhaokai
 * @Date 2025-12-02 11:13:33
 */
@Data
public class UserCorpE extends BaseE {
    //主键id
    private Long id;
    //业务主键id
    private String userCorpId;
    //用户id
    private Long userId;
    //企业id
    private Long corpinfoId;
    //部门id
    private Long departmentId;
    //岗位id
    private Long postId;
    //岗位名称
    private String postName;
    //角色id
    private Long roleId;
    //人员在部门中的排序
    private Integer sort;
    //是否部门领导0否1是
    private Integer departmentLeaderFlag;
    //入职状态，1-在职 0-离职, 2-入职待审核, 3-离职待审核
    private Integer employmentFlag;
    //乐观锁
    private Integer version;
    //创建人
    private Long createId;
    //创建人姓名
    private String createName;
    //创建时间
    private LocalDateTime createTime;
    //更新人
    private Long updateId;
    //修改人名称
    private String updateName;
    //更新时间
    private LocalDateTime updateTime;
    //描述
    private String remarks;
    //是否删除
    private String deleteEnum;
    //租户ID
    private Long tenantId;
    //机构ID
    private Long orgId;
    //环境
    private String env;
    private String corpinfoName;

    private String departmentName;

    public void initAdd(Long tenantId, UserE userE) {
        this.corpinfoId = tenantId;
        this.userId = userE.getId();
        this.departmentId = userE.getDepartmentId();
        this.postName = userE.getPostName();
        this.roleId = userE.getRoleId();
        this.sort = userE.getSort();
        this.departmentLeaderFlag = userE.getDepartmentLeaderFlag();
        this.employmentFlag = userE.getEmploymentFlag();
    }

    public void initUpdate(UserE userE) {
        this.setDepartmentId(userE.getDepartmentId());
        this.setPostId(userE.getPostId());
        this.setPostName(userE.getPostName());
        this.setRoleId(userE.getRoleId());
        this.setSort(userE.getSort());
        this.setDepartmentLeaderFlag(userE.getDepartmentLeaderFlag());
    }

}

