/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.domain.dto;

import com.crunii.micro.common.dto.TreeNode;
import com.crunii.micro.common.dto.WorkerId;
import com.crunii.micro.domain.dto.sys.MenuExtend;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author 田平 create 2018年10月31日下午2:49:59
 */
@Getter
@Setter
@ToString
@ApiModel(description = "工号对象")
public class Worker extends WorkerId implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "登录Id")
	private int loginId;

	@ApiModelProperty(value = "登录工号")
	private String loginCode;

	@ApiModelProperty(value = "组织id")
	private String orgId;

	@ApiModelProperty(value = "组织名称")
	private String orgName;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "生日")
	private Date birthday;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	@ApiModelProperty(value = "邮件地址")
	private String email;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "最后一次修改密码时间")
	private Date lastChgPwdTime;

	@ApiModelProperty(value = "登录次数")
	private int loginNum;

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

	@ApiModelProperty(value = "电话")
	private String phone;

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

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

	@ApiModelProperty(value = "状态")
	private int state;

	@ApiModelProperty(value = "是否超级管理员")
	private boolean superWorker;

	@ApiModelProperty(value = "令牌（token）")
	private String token;

	@ApiModelProperty(value = "作用域 WEB|PHONE")
	private String scope;

	@ApiModelProperty(value = "角色list")
	private List<TsmRoleDto> roles;

	@ApiModelProperty(value = "按钮列表")
	private List<String> authButtons = new ArrayList<>();

	@ApiModelProperty(value = "是否第一次登录")
	private boolean firstLogin;

	@ApiModelProperty(value = "验证key")
	private String secretKey;

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

	@ApiModelProperty(value = "主题")
	private Integer sysTheme;

	/**
	 * 后端拦截使用，不会返回给前端，前端不需要这个属性
	 */
	@ApiModelProperty(value = "授权Url")
	private List<TsmUrlDto> urls;

	@ApiModelProperty(value = "授权菜单")
	private List<TreeNode<MenuExtend>> treeNodes;

	private String openid;

	@ApiModelProperty(value = "是否需要修改密码(true表示用户需要修改密码,页面做提示框.false表示不需要修改密码, 默认值为false")
	private boolean updatePassword = false;

	@ApiModelProperty(value = "个人签名照片id")
	private String signatureFileId;

	@ApiModelProperty(value = "个人签名照片url")
	private String signatureUrl;

	@ApiModelProperty(value = "是否需要强制签名(true表示需要,false表示不需要, 默认值为false")
	private boolean sign = false;
	@ApiModelProperty(value = "个人签名照片url")
	private List<String> authButton;
	@ApiModelProperty(value = "个人签名照片url")
	private List<String> authUrl;

	@ApiModelProperty(value = "所在部门")
	private String department;
	//渝快政跳转必传accountId 20204/1/26 xiangxin
	@ApiModelProperty(value = "accountId")
	private String accountId;

	@Override
	public String workerId() {
		return String.valueOf(this.loginId);
	}
}
