| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- import 'package:deus_app/model/repair_detail_response_entity.dart';
- repairDetailResponseEntityFromJson(RepairDetailResponseEntity data, Map<String, dynamic> json) {
- if (json['code'] != null) {
- data.code = json['code'] is String
- ? int.tryParse(json['code'])
- : json['code'].toInt();
- }
- if (json['data'] != null) {
- data.data = RepairDetailResponseData().fromJson(json['data']);
- }
- if (json['msg'] != null) {
- data.msg = json['msg'].toString();
- }
- return data;
- }
- Map<String, dynamic> repairDetailResponseEntityToJson(RepairDetailResponseEntity entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['code'] = entity.code;
- data['data'] = entity.data.toJson();
- data['msg'] = entity.msg;
- return data;
- }
- repairDetailResponseDataFromJson(RepairDetailResponseData data, Map<String, dynamic> json) {
- if (json['id'] != null) {
- data.id = json['id'] is String
- ? int.tryParse(json['id'])
- : json['id'].toInt();
- }
- if (json['repNum'] != null) {
- data.repNum = json['repNum'].toString();
- }
- if (json['theme'] != null) {
- data.theme = json['theme'].toString();
- }
- if (json['urg'] != null) {
- data.urg = json['urg'] is String
- ? int.tryParse(json['urg'])
- : json['urg'].toInt();
- }
- if (json['deviceName'] != null) {
- data.deviceName = json['deviceName'];
- }
- if (json['deviceKey'] != null) {
- data.deviceKey = json['deviceKey'];
- }
- if (json['treatment'] != null) {
- data.treatment = json['treatment'] is String
- ? int.tryParse(json['treatment'])
- : json['treatment'].toInt();
- }
- if (json['customerName'] != null) {
- data.customerName = json['customerName'];
- }
- if (json['channelName'] != null) {
- data.channelName = json['channelName'];
- }
- if (json['submitter'] != null) {
- data.submitter = json['submitter'];
- }
- if (json['receiver'] != null) {
- data.receiver = json['receiver'].toString();
- }
- if (json['maintainer'] != null) {
- data.maintainer = json['maintainer'].toString();
- }
- if (json['orderRecTime'] != null) {
- data.orderRecTime = json['orderRecTime'].toString();
- }
- if (json['applicant'] != null) {
- data.applicant = json['applicant'].toString();
- }
- if (json['status'] != null) {
- data.status = json['status'] is String
- ? int.tryParse(json['status'])
- : json['status'].toInt();
- }
- if (json['deviceId'] != null) {
- data.deviceId = json['deviceId'] is String
- ? int.tryParse(json['deviceId'])
- : json['deviceId'].toInt();
- }
- if (json['instructions'] != null) {
- data.instructions = json['instructions'].toString();
- }
- if (json['repResRemarks'] != null) {
- data.repResRemarks = json['repResRemarks'].toString();
- }
- if (json['applicationTime'] != null) {
- data.applicationTime = json['applicationTime'].toString();
- }
- if (json['completeTime'] != null) {
- data.completeTime = json['completeTime'].toString();
- }
- if (json['repairImgUrls'] != null) {
- data.repairImgUrls = (json['repairImgUrls'] as List).map((v) => v).toList().cast<String>();
- }else{
- data.repairImgUrls =[];
- }
- if (json['repairResUrls'] != null) {
- data.repairResUrls = (json['repairResUrls'] as List).map((v) => v).toList().cast<String>();
- }else{
- data.repairResUrls =[];
- }
- if (json['logs'] != null) {
- data.logs = (json['logs'] as List).map((v) => RepairDetailResponseDataLogs().fromJson(v)).toList();
- }
- if (json['device'] != null) {
- data.device = RepairDetailResponseDataDevice().fromJson(json['device']);
- }
- return data;
- }
- Map<String, dynamic> repairDetailResponseDataToJson(RepairDetailResponseData entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = entity.id;
- data['repNum'] = entity.repNum;
- data['theme'] = entity.theme;
- data['urg'] = entity.urg;
- data['deviceName'] = entity.deviceName;
- data['deviceKey'] = entity.deviceKey;
- data['treatment'] = entity.treatment;
- data['customerName'] = entity.customerName;
- data['channelName'] = entity.channelName;
- data['submitter'] = entity.submitter;
- data['receiver'] = entity.receiver;
- data['maintainer'] = entity.maintainer;
- data['orderRecTime'] = entity.orderRecTime;
- data['applicant'] = entity.applicant;
- data['status'] = entity.status;
- data['deviceId'] = entity.deviceId;
- data['instructions'] = entity.instructions;
- data['applicationTime'] = entity.applicationTime;
- data['completeTime'] = entity.completeTime;
- data['repairImgUrls'] = entity.repairImgUrls;
- data['repResRemarks'] = entity.repResRemarks;
- data['repairResUrls'] = entity.repairResUrls;
- data['logs'] = entity.logs.map((v) => v.toJson()).toList();
- data['device'] = entity.device!.toJson();
- return data;
- }
- repairDetailResponseDataLogsFromJson(RepairDetailResponseDataLogs data, Map<String, dynamic> json) {
- if (json['createTime'] != null) {
- data.createTime = json['createTime'].toString();
- }
- if (json['updateTime'] != null) {
- data.updateTime = json['updateTime'].toString();
- }
- if (json['creator'] != null) {
- data.creator = json['creator'] is String
- ? int.tryParse(json['creator'])
- : json['creator'].toInt();
- }
- if (json['updater'] != null) {
- data.updater = json['updater'] is String
- ? int.tryParse(json['updater'])
- : json['updater'].toInt();
- }
- if (json['id'] != null) {
- data.id = json['id'] is String
- ? int.tryParse(json['id'])
- : json['id'].toInt();
- }
- if (json['userName'] != null) {
- data.userName = json['userName'].toString();
- }
- if (json['description'] != null) {
- data.description = json['description'].toString();
- }
- if (json['repairBillId'] != null) {
- data.repairBillId = json['repairBillId'] is String
- ? int.tryParse(json['repairBillId'])
- : json['repairBillId'].toInt();
- }
- return data;
- }
- Map<String, dynamic> repairDetailResponseDataLogsToJson(RepairDetailResponseDataLogs entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['createTime'] = entity.createTime;
- data['updateTime'] = entity.updateTime;
- data['creator'] = entity.creator;
- data['updater'] = entity.updater;
- data['id'] = entity.id;
- data['userName'] = entity.userName;
- data['description'] = entity.description;
- data['repairBillId'] = entity.repairBillId;
- return data;
- }
- repairDetailResponseDataDeviceFromJson(RepairDetailResponseDataDevice data, Map<String, dynamic> json) {
- if (json['id'] != null) {
- data.id = json['id'] is String
- ? int.tryParse(json['id'])
- : json['id'].toInt();
- }
- if (json['showName'] != null) {
- data.showName = json['showName'].toString();
- }
- if (json['deviceName'] != null) {
- data.deviceName = json['deviceName'].toString();
- }
- if (json['deviceKey'] != null) {
- data.deviceKey = json['deviceKey'].toString();
- }
- if (json['repairBillId'] != null) {
- data.repairBillId = json['repairBillId'];
- }
- if (json['prodName'] != null) {
- data.prodName = json['prodName'].toString();
- }
- if (json['isRepaired'] != null) {
- data.isRepaired = json['isRepaired'] is String
- ? int.tryParse(json['isRepaired'])
- : json['isRepaired'].toInt();
- }
- if (json['completeTime'] != null) {
- data.completeTime = json['completeTime'].toString();
- }
- return data;
- }
- Map<String, dynamic> repairDetailResponseDataDeviceToJson(RepairDetailResponseDataDevice entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = entity.id;
- data['showName'] = entity.showName;
- data['deviceName'] = entity.deviceName;
- data['deviceKey'] = entity.deviceKey;
- data['repairBillId'] = entity.repairBillId;
- data['prodName'] = entity.prodName;
- data['isRepaired'] = entity.isRepaired;
- data['completeTime'] = entity.completeTime;
- return data;
- }
|