package com.ningdatech.pmapi.user.model.vo;

import com.ningdatech.pmapi.common.constant.RegionConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
 * @author liuxinxin
 * @date 2023/2/15 上午8:43
 */
@Data
@ApiModel("获取用户详情请求")
public class ResUserDetailVO {

    @ApiModelProperty("userId")
    private Long userId;

    @ApiModelProperty("用户姓名")
    private String realName;

    @ApiModelProperty("手机号")
    private String phoneNo;

    @ApiModelProperty("用户角色信息列表")
    private List<UserRoleVO> userRoleInfoList;

    @ApiModelProperty("浙政钉 用户编码")
    private String employeeCode;

    @ApiModelProperty("所在单位（主职）")
    private String orgName;

    @ApiModelProperty("所在单位（主职）code")
    private String orgCode;

    @ApiModelProperty("所属区域")
    private Long regionId;
    private String regionCode;
    private Integer regionLevel;
    private String regionName;

    @ApiModelProperty("用户任职所在单位code")
    private String empPosUnitCode;

    @ApiModelProperty("用户任职所在单位")
    private String empPosUnitName;

    @ApiModelProperty("用户角色")
    private List<UserRoleVO> userRoleList;

    @ApiModelProperty("状态 启用 ENABLE/禁用 DISABLE")
    private String status;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

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

    //是否是市级单位
    public Boolean getIsMunicipalOrg(){
        //如果是丽水市本级的code 就是
        if(RegionConst.RC_LS.equals(this.regionCode)){
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }
}
