import 'package:special_equipment_flutter/model/day_control_list_sy_bo.dart';

/// date : {"total":2,"rows":[{"id":"79ac3edf3624422bbb206ef234653b43","createBy":{"id":"48d2cda3f7844f8399c0a82dbe93b855","loginFlag":"1","roleNames":"","admin":false},"createDate":"2023-10-25 09:51:59","updateBy":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"updateDate":"2023-10-25 11:39:59","beginTime":"2023-10-25 00:00:00","endTime":"2023-10-25 23:59:59","deviceType":{"id":"7d012f651c7643648b379822b8e19e0b","unitType":"1","name":"起重机械","sort":"6"},"device":{"id":"67a0130bfa9a4a9cb9173387a0f9eb58","name":"塔工起重机001","code":"QZJS001","address":"无"},"userids":"8affd75130794659956ce53b7de3a299,","result":"1","checkTime":"2023-10-25 11:39:58","checkUser":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"office":{"id":"e51b38d54a614d3d81acc86f43b2f4ad","name":"安泰源特种设备检测集团有限公司","sort":30,"hasChildren":false,"parentId":"0"},"taskState":"1","prictures":""},{"id":"4a094d6d78c34171bbd2f2df8e216897","createBy":{"id":"48d2cda3f7844f8399c0a82dbe93b855","loginFlag":"1","roleNames":"","admin":false},"createDate":"2023-10-25 09:51:59","updateBy":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"updateDate":"2023-10-25 11:16:22","beginTime":"2023-10-25 00:00:00","endTime":"2023-10-25 23:59:59","deviceType":{"id":"779d6023cd4148b49288eb3e3616a7e3","unitType":"1","name":"电梯","sort":"5"},"device":{"id":"0081c396754e4e75af778848ffedacea","name":"3号楼西1电梯","code":"DT001","address":"楼西1电梯"},"userids":"8affd75130794659956ce53b7de3a299,a3c979671d544217981fd5189576571e,","result":"1","checkTime":"2023-10-25 11:16:22","checkUser":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"office":{"id":"e51b38d54a614d3d81acc86f43b2f4ad","name":"安泰源特种设备检测集团有限公司","sort":30,"hasChildren":false,"parentId":"0"},"taskState":"1","prictures":""}]}

class CompletedListBo {
  CompletedListBo({
    Date? date,
  }) {
    _date = date;
  }

  CompletedListBo.fromJson(dynamic json) {
    _date = json['date'] != null ? Date.fromJson(json['date']) : null;
  }

  Date? _date;

  CompletedListBo copyWith({
    Date? date,
  }) =>
      CompletedListBo(
        date: date ?? _date,
      );

  Date? get date => _date;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_date != null) {
      map['date'] = _date?.toJson();
    }
    return map;
  }
}

/// total : 2
/// rows : [{"id":"79ac3edf3624422bbb206ef234653b43","createBy":{"id":"48d2cda3f7844f8399c0a82dbe93b855","loginFlag":"1","roleNames":"","admin":false},"createDate":"2023-10-25 09:51:59","updateBy":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"updateDate":"2023-10-25 11:39:59","beginTime":"2023-10-25 00:00:00","endTime":"2023-10-25 23:59:59","deviceType":{"id":"7d012f651c7643648b379822b8e19e0b","unitType":"1","name":"起重机械","sort":"6"},"device":{"id":"67a0130bfa9a4a9cb9173387a0f9eb58","name":"塔工起重机001","code":"QZJS001","address":"无"},"userids":"8affd75130794659956ce53b7de3a299,","result":"1","checkTime":"2023-10-25 11:39:58","checkUser":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"office":{"id":"e51b38d54a614d3d81acc86f43b2f4ad","name":"安泰源特种设备检测集团有限公司","sort":30,"hasChildren":false,"parentId":"0"},"taskState":"1","prictures":""},{"id":"4a094d6d78c34171bbd2f2df8e216897","createBy":{"id":"48d2cda3f7844f8399c0a82dbe93b855","loginFlag":"1","roleNames":"","admin":false},"createDate":"2023-10-25 09:51:59","updateBy":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"updateDate":"2023-10-25 11:16:22","beginTime":"2023-10-25 00:00:00","endTime":"2023-10-25 23:59:59","deviceType":{"id":"779d6023cd4148b49288eb3e3616a7e3","unitType":"1","name":"电梯","sort":"5"},"device":{"id":"0081c396754e4e75af778848ffedacea","name":"3号楼西1电梯","code":"DT001","address":"楼西1电梯"},"userids":"8affd75130794659956ce53b7de3a299,a3c979671d544217981fd5189576571e,","result":"1","checkTime":"2023-10-25 11:16:22","checkUser":{"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false},"office":{"id":"e51b38d54a614d3d81acc86f43b2f4ad","name":"安泰源特种设备检测集团有限公司","sort":30,"hasChildren":false,"parentId":"0"},"taskState":"1","prictures":""}]

class Date {
  Date({
    int? total,
    int? last,
    List<Rows>? rows,
  }) {
    _total = total;
    _last = last;
    _rows = rows;
  }

  Date.fromJson(dynamic json) {
    _total = json['total'];
    _last = json['last'];
    if (json['rows'] != null) {
      _rows = [];
      json['rows'].forEach((v) {
        _rows?.add(Rows.fromJson(v));
      });
    }
  }

  int? _total;
  int? _last;
  List<Rows>? _rows;

  Date copyWith({
    int? total,
    int? last,
    List<Rows>? rows,
  }) =>
      Date(
        total: total ?? _total,
        last: last ?? _last,
        rows: rows ?? _rows,
      );

  int? get total => _total;

  int? get last => _last;

  List<Rows>? get rows => _rows;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['total'] = _total;
    map['last'] = _last;
    if (_rows != null) {
      map['rows'] = _rows?.map((v) => v.toJson()).toList();
    }
    return map;
  }
}

/// id : "79ac3edf3624422bbb206ef234653b43"
/// createBy : {"id":"48d2cda3f7844f8399c0a82dbe93b855","loginFlag":"1","roleNames":"","admin":false}
/// createDate : "2023-10-25 09:51:59"
/// updateBy : {"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false}
/// updateDate : "2023-10-25 11:39:59"
/// beginTime : "2023-10-25 00:00:00"
/// endTime : "2023-10-25 23:59:59"
/// deviceType : {"id":"7d012f651c7643648b379822b8e19e0b","unitType":"1","name":"起重机械","sort":"6"}
/// device : {"id":"67a0130bfa9a4a9cb9173387a0f9eb58","name":"塔工起重机001","code":"QZJS001","address":"无"}
/// userids : "8affd75130794659956ce53b7de3a299,"
/// result : "1"
/// checkTime : "2023-10-25 11:39:58"
/// checkUser : {"id":"8affd75130794659956ce53b7de3a299","loginFlag":"1","roleNames":"","admin":false}
/// office : {"id":"e51b38d54a614d3d81acc86f43b2f4ad","name":"安泰源特种设备检测集团有限公司","sort":30,"hasChildren":false,"parentId":"0"}
/// taskState : "1"
/// prictures : ""

class Rows {
  Rows({
    String? id,
    String? createDate,
    String? updateDate,
    String? beginTime,
    String? endTime,
    DeviceType? deviceType,
    Device? device,
    String? userids,
    String? result,
    String? checkTime,
    CheckUsers? checkUser,
    Office? office,
    String? taskState,
    String? prictures,
    DeviceInfoCheck? deviceInfoCheck,
    int? weekNum,
  }) {
    _id = id;
    _createDate = createDate;
    _updateDate = updateDate;
    _beginTime = beginTime;
    _endTime = endTime;
    _deviceType = deviceType;
    _device = device;
    _userids = userids;
    _result = result;
    _checkTime = checkTime;
    _checkUser = checkUser;
    _office = office;
    _taskState = taskState;
    _prictures = prictures;
    _deviceInfoCheck = deviceInfoCheck;
    _weekNum = weekNum;
  }

  Rows.fromJson(dynamic json) {
    _id = json['id'];
    _createDate = json['createDate'];
    _updateDate = json['updateDate'];
    _beginTime = json['beginTime'];
    _endTime = json['endTime'];
    _deviceType = json['deviceType'] != null
        ? DeviceType.fromJson(json['deviceType'])
        : null;
    _device = json['device'] != null ? Device.fromJson(json['device']) : null;
    _userids = json['userids'];
    _result = json['result'];
    _checkTime = json['checkTime'];
    _checkUser = json['checkUser'] != null
        ? CheckUsers.fromJson(json['checkUser'])
        : null;
    _office = json['office'] != null ? Office.fromJson(json['office']) : null;
    _taskState = json['taskState'];
    _prictures = json['prictures'];
    _deviceInfoCheck = json['deviceInfoCheck'] != null
        ? DeviceInfoCheck.fromJson(json['deviceInfoCheck'])
        : null;
    _weekNum = json['weekNum'];
  }

  String? _id;
  String? _createDate;
  String? _updateDate;
  String? _beginTime;
  String? _endTime;
  DeviceType? _deviceType;
  Device? _device;
  String? _userids;
  String? _result;
  String? _checkTime;
  CheckUsers? _checkUser;
  Office? _office;
  String? _taskState;
  String? _prictures;
  DeviceInfoCheck? _deviceInfoCheck;
  int? _weekNum;

  Rows copyWith({
    String? id,
    String? createDate,
    String? updateDate,
    String? beginTime,
    String? endTime,
    DeviceType? deviceType,
    Device? device,
    String? userids,
    String? result,
    String? checkTime,
    CheckUsers? checkUser,
    Office? office,
    String? taskState,
    String? prictures,
    DeviceInfoCheck? deviceInfoCheck,
    int? weekNum,
  }) =>
      Rows(
        id: id ?? _id,
        createDate: createDate ?? _createDate,
        updateDate: updateDate ?? _updateDate,
        beginTime: beginTime ?? _beginTime,
        endTime: endTime ?? _endTime,
        deviceType: deviceType ?? _deviceType,
        device: device ?? _device,
        userids: userids ?? _userids,
        result: result ?? _result,
        checkTime: checkTime ?? _checkTime,
        checkUser: checkUser ?? _checkUser,
        office: office ?? _office,
        taskState: taskState ?? _taskState,
        prictures: prictures ?? _prictures,
        deviceInfoCheck: deviceInfoCheck ?? _deviceInfoCheck,
        weekNum: weekNum ?? _weekNum,
      );

  String? get id => _id;

  String? get createDate => _createDate;

  String? get updateDate => _updateDate;

  String? get beginTime => _beginTime;

  String? get endTime => _endTime;

  DeviceType? get deviceType => _deviceType;

  Device? get device => _device;

  String? get userids => _userids;

  String? get result => _result;

  String? get checkTime => _checkTime;

  CheckUsers? get checkUser => _checkUser;

  Office? get office => _office;

  String? get taskState => _taskState;

  String? get prictures => _prictures;

  int? get weekNum => _weekNum;

  set prictures(String? prictures) {
    _prictures = prictures;
  }

  DeviceInfoCheck? get deviceInfoCheck => _deviceInfoCheck;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['createDate'] = _createDate;
    map['updateDate'] = _updateDate;
    map['beginTime'] = _beginTime;
    map['endTime'] = _endTime;
    if (_deviceType != null) {
      map['deviceType'] = _deviceType?.toJson();
    }
    if (_device != null) {
      map['device'] = _device?.toJson();
    }
    map['userids'] = _userids;
    map['result'] = _result;
    map['checkTime'] = _checkTime;
    if (_checkUser != null) {
      map['checkUser'] = _checkUser?.toJson();
    }
    if (_office != null) {
      map['office'] = _office?.toJson();
    }
    map['taskState'] = _taskState;
    map['weekNum'] = _weekNum;
    map['prictures'] = _prictures;

    return map;
  }
}
