

class MaintJobDetailResponse {
  int? code;
  MaintJobDetailData? data;
  String? msg;

  MaintJobDetailResponse({this.code, this.data, this.msg});

  MaintJobDetailResponse.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    data = json['data'] != null ? new MaintJobDetailData.fromJson(json['data']) : null;
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    data['msg'] = this.msg;
    return data;
  }
}

class MaintJobDetailData {
  int? id;
  String? jobName;
  String? jobNum;
  String? planName;
  String? planNum;
  int? status;
  String? startTime;
  String? endTime;
  int? cycleType;
  List<FileUrls>? fileUrls;
  String? creator;
  List<ItemsList>? itemsList;
  // List<Logs>? logs;
  String? maintStaffName;
  String? finishTime;
  String? prodCount;
  int? deviceCount;
  List<DeviceList>? deviceList;
  String? remarks;

  MaintJobDetailData(
      {this.id,
        this.jobName,
        this.jobNum,
        this.planName,
        this.planNum,
        this.status,
        this.startTime,
        this.endTime,
        this.cycleType,
        this.fileUrls,
        this.creator,
        this.itemsList,
        // this.logs,
        this.maintStaffName,
        this.finishTime,
        this.prodCount,
        this.deviceCount,
        this.deviceList,
        this.remarks});

  MaintJobDetailData.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    jobName = json['jobName'];
    jobNum = json['jobNum'];
    planName = json['planName'];
    planNum = json['planNum'];
    status = json['status'];
    startTime = json['startTime'];
    endTime = json['endTime'];
    cycleType = json['cycleType'];
    if (json['fileUrls'] != null) {
      fileUrls = <FileUrls>[];
      json['fileUrls'].forEach((v) {
        fileUrls!.add(new FileUrls.fromJson(v));
      });
    }
    creator = json['creator'];
    // if (json['logs'] != null) {
    //   logs = <Logs>[];
    //   json['logs'].forEach((v) {
    //     logs!.add(new Logs.fromJson(v));
    //   });
    // }
    maintStaffName = json['maintStaffName'];
    finishTime = json['finishTime'];
    prodCount = json['prodCount'];
    deviceCount = json['deviceCount'];
    if (json['deviceList'] != null) {
      deviceList = <DeviceList>[];
      json['deviceList'].forEach((v) {
        deviceList!.add(new DeviceList.fromJson(v));
      });
    }
    if (json['itemsList'] != null) {
      itemsList = <ItemsList>[];
      json['itemsList'].forEach((v) { itemsList!.add(new ItemsList.fromJson(v)); });
    }
    remarks = json['remarks'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['jobName'] = this.jobName;
    data['jobNum'] = this.jobNum;
    data['planName'] = this.planName;
    data['planNum'] = this.planNum;
    data['status'] = this.status;
    data['startTime'] = this.startTime;
    data['endTime'] = this.endTime;
    data['cycleType'] = this.cycleType;
    if (this.fileUrls != null) {
      data['fileUrls'] = this.fileUrls!.map((v) => v.toJson()).toList();
    }
    data['creator'] = this.creator;
    if (this.itemsList != null) {
      data['itemsList'] = this.itemsList!.map((v) => v.toJson()).toList();
    }
    // if (this.logs != null) {
    //   data['logs'] = this.logs!.map((v) => v.toJson()).toList();
    // }
    data['maintStaffName'] = this.maintStaffName;
    data['finishTime'] = this.finishTime;
    data['prodCount'] = this.prodCount;
    data['deviceCount'] = this.deviceCount;
    if (this.deviceList != null) {
      data['deviceList'] = this.deviceList!.map((v) => v.toJson()).toList();
    }
    data['remarks'] = this.remarks;
    return data;
  }
}

class FileUrls {
  int? imgId;
  String? url;
  String? file;
  String? step;
  String? files;
  String? imgIds;
  String? urls;

  FileUrls(
      {this.imgId,
        this.url,
        this.file,
        this.step,
        this.files,
        this.imgIds,
        this.urls});

  FileUrls.fromJson(Map<String, dynamic> json) {
    imgId = json['imgId'];
    url = json['url'];
    file = json['file'];
    step = json['step'];
    files = json['files'];
    imgIds = json['imgIds'];
    urls = json['urls'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['imgId'] = this.imgId;
    data['url'] = this.url;
    data['file'] = this.file;
    data['step'] = this.step;
    data['files'] = this.files;
    data['imgIds'] = this.imgIds;
    data['urls'] = this.urls;
    return data;
  }
}

class Logs {
  String? createTime;
  String? updateTime;
  int? creator;
  String? updater;
  int? id;
  String? userName;
  String? description;
  int? maintJobId;

  Logs(
      {this.createTime,
        this.updateTime,
        this.creator,
        this.updater,
        this.id,
        this.userName,
        this.description,
        this.maintJobId});

  Logs.fromJson(Map<String, dynamic> json) {
    createTime = json['createTime'];
    updateTime = json['updateTime'];
    creator = json['creator'];
    updater = json['updater'];
    id = json['id'];
    userName = json['userName'];
    description = json['description'];
    maintJobId = json['maintJobId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['createTime'] = this.createTime;
    data['updateTime'] = this.updateTime;
    data['creator'] = this.creator;
    data['updater'] = this.updater;
    data['id'] = this.id;
    data['userName'] = this.userName;
    data['description'] = this.description;
    data['maintJobId'] = this.maintJobId;
    return data;
  }
}

class DeviceList {
  int? id;
  int? deviceId;
  String? name;
  String? showName;
  String? deviceKey;
  String? productName;
  String? productKey;
  String? finishTime;
  String? maintPerson;
  int? maintJobId;
  int? isMainted;

  DeviceList(
      {this.id,
        this.deviceId,
        this.name,
        this.showName,
        this.deviceKey,
        this.productName,
        this.productKey,
        this.finishTime,
        this.maintPerson,
        this.maintJobId,
        this.isMainted});

  DeviceList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    deviceId = json['deviceId'];
    name = json['name'];
    showName = json['showName'];
    deviceKey = json['deviceKey'];
    productName = json['productName'];
    productKey = json['productKey'];
    if(null==json['finishTime']){
      finishTime='--';
    }else{
      finishTime = json['finishTime'];
    }
    maintPerson = json['maintPerson'];
    maintJobId = json['maintJobId'];
    isMainted = json['isMainted'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['deviceId'] = this.deviceId;
    data['name'] = this.name;
    data['showName'] = this.showName;
    data['deviceKey'] = this.deviceKey;
    data['productName'] = this.productName;
    data['productKey'] = this.productKey;
    data['finishTime'] = this.finishTime;
    data['maintPerson'] = this.maintPerson;
    data['maintJobId'] = this.maintJobId;
    data['isMainted'] = this.isMainted;
    return data;
  }
}

class ItemsList {
  int? id;
  int? level;
  String? name='';
  String? num;
  String? remarks;
  String? requirements;
  int? status;

  ItemsList({this.id, this.level, this.name, this.num, this.remarks, this.requirements, this.status});

  ItemsList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    level = json['level'];
    if(null!=json['name']){
      name = json['name'];
    }
    num = json['num'];
    remarks = json['remarks'];
    requirements = json['requirements'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['level'] = this.level;
    data['name'] = this.name;
    data['num'] = this.num;
    data['remarks'] = this.remarks;
    data['requirements'] = this.requirements;
    data['status'] = this.status;
    return data;
  }
}