/*
 * @Author: XianKaiQun
 * @Date: 2020-04-28 16:39:20
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-04-28 16:41:53
 * @Descripttion: 
 */

///登录后获取用户信息
class EmployeesInfoModel {
  String? id;
  String? companyId;
  String? companyName;
  String? organId;
  String? organName;
  String? positionId;
  String? positionName;
  String? name;
  String? sex;
  String? birthday;
  String? phone;
  String? account;
  String? password;
  String? identityCard;
  String? employeeNumber;
  String? imgUrl;
  String? onJob;
  String? onJobDesc;
  String? hireDate;
  dynamic leaveDate;
  num? loginPermit;
  dynamic remark;
  dynamic loginCount;
  dynamic loginTime;
  dynamic wechatBind;
  List<RolesOfEmployeesInfoModel>? roles;
  dynamic open;
  dynamic cardQrCode;

  EmployeesInfoModel({
    this.id,
    this.companyId,
    this.companyName,
    this.organId,
    this.organName,
    this.positionId,
    this.positionName,
    this.name,
    this.sex,
    this.birthday,
    this.phone,
    this.account,
    this.password,
    this.identityCard,
    this.employeeNumber,
    this.imgUrl,
    this.onJob,
    this.onJobDesc,
    this.hireDate,
    this.leaveDate,
    this.loginPermit,
    this.remark,
    this.loginCount,
    this.loginTime,
    this.wechatBind,
    this.roles,
    this.open,
    this.cardQrCode,
  });

  EmployeesInfoModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    companyId = map['companyId'];
    companyName = map['companyName'];
    organId = map['organId'];
    organName = map['organName'];
    positionId = map['positionId'];
    positionName = map['positionName'];
    name = map['name'];
    sex = map['sex'];
    birthday = map['birthday'];
    phone = map['phone'];
    account = map['account'];
    password = map['password'];
    identityCard = map['identityCard'];
    employeeNumber = map['employeeNumber'];
    imgUrl = map['imgUrl'];
    onJob = map['onJob'];
    onJobDesc = map['onJobDesc'];
    hireDate = map['hireDate'];
    leaveDate = map['leaveDate'];
    loginPermit = map['loginPermit'];
    remark = map['remark'];
    loginCount = map['loginCount'];
    loginTime = map['loginTime'];
    wechatBind = map['wechatBind'];
    roles = List<RolesOfEmployeesInfoModel>.from(
        (map["roles"] ?? []).map((x) => RolesOfEmployeesInfoModel.fromJson(x)));
    open = map['open'];
    cardQrCode = map['cardQrCode'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['companyId'] = this.companyId;
    json['companyName'] = this.companyName;
    json['organId'] = this.organId;
    json['organName'] = this.organName;
    json['positionId'] = this.positionId;
    json['positionName'] = this.positionName;
    json['name'] = this.name;
    json['sex'] = this.sex;
    json['birthday'] = this.birthday;
    json['phone'] = this.phone;
    json['account'] = this.account;
    json['password'] = this.password;
    json['identityCard'] = this.identityCard;
    json['employeeNumber'] = this.employeeNumber;
    json['imgUrl'] = this.imgUrl;
    json['onJob'] = this.onJob;
    json['onJobDesc'] = this.onJobDesc;
    json['hireDate'] = this.hireDate;
    json['leaveDate'] = this.leaveDate;
    json['loginPermit'] = this.loginPermit;
    json['remark'] = this.remark;
    json['loginCount'] = this.loginCount;
    json['loginTime'] = this.loginTime;
    json['wechatBind'] = this.wechatBind;
    json['roles'] = List<dynamic>.from((roles ?? []).map((x) => x.toJson()));
    json['open'] = this.open;
    json['cardQrCode'] = this.cardQrCode;

    return json;
  }
}

class RolesOfEmployeesInfoModel {
  String? roleId;
  String? roleName;

  RolesOfEmployeesInfoModel({
    this.roleId,
    this.roleName,
  });

  RolesOfEmployeesInfoModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    roleId = map['roleId'];
    roleName = map['roleName'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['roleId'] = this.roleId;
    json['roleName'] = this.roleName;

    return json;
  }
}
