一次大的提交
This commit is contained in:
207
lib/features/v2/work_order/data/models/work_order_model.dart
Normal file
207
lib/features/v2/work_order/data/models/work_order_model.dart
Normal file
@@ -0,0 +1,207 @@
|
||||
import 'package:maibu_satabot_v2/features/v2/work_order/domain/entities/work_order_entity.dart';
|
||||
|
||||
class WorkOrderModel {
|
||||
final int? id;
|
||||
final String? orderNo;
|
||||
final String? orderTitle;
|
||||
final int? sourceType;
|
||||
final int? orderType;
|
||||
final int? priorityLevel;
|
||||
final int? deviceId;
|
||||
final String? deviceName;
|
||||
final int? deviceType;
|
||||
final int? siteId;
|
||||
final String? siteName;
|
||||
final int? orgId;
|
||||
final int? assigneeId;
|
||||
final String? assigneeName;
|
||||
final String? collaboratorIds;
|
||||
final String? collaboratorNames;
|
||||
final String? planStartTime;
|
||||
final String? planEndTime;
|
||||
final String? deadlineTime;
|
||||
final String? actualStartTime;
|
||||
final String? actualEndTime;
|
||||
final int? orderStatus;
|
||||
final int? alarmId;
|
||||
final String? alarmNo;
|
||||
final String? taskDescription;
|
||||
final String? aiSuggestion;
|
||||
final String? requiredEquipment;
|
||||
final double? estimatedImpact;
|
||||
final String? handleResult;
|
||||
final String? handleRemark;
|
||||
|
||||
WorkOrderModel({
|
||||
this.id,
|
||||
this.orderNo,
|
||||
this.orderTitle,
|
||||
this.sourceType,
|
||||
this.orderType,
|
||||
this.priorityLevel,
|
||||
this.deviceId,
|
||||
this.deviceName,
|
||||
this.deviceType,
|
||||
this.siteId,
|
||||
this.siteName,
|
||||
this.orgId,
|
||||
this.assigneeId,
|
||||
this.assigneeName,
|
||||
this.collaboratorIds,
|
||||
this.collaboratorNames,
|
||||
this.planStartTime,
|
||||
this.planEndTime,
|
||||
this.deadlineTime,
|
||||
this.actualStartTime,
|
||||
this.actualEndTime,
|
||||
this.orderStatus,
|
||||
this.alarmId,
|
||||
this.alarmNo,
|
||||
this.taskDescription,
|
||||
this.aiSuggestion,
|
||||
this.requiredEquipment,
|
||||
this.estimatedImpact,
|
||||
this.handleResult,
|
||||
this.handleRemark,
|
||||
});
|
||||
|
||||
factory WorkOrderModel.fromJson(Map<String, dynamic> json) {
|
||||
return WorkOrderModel(
|
||||
id: json['id'] as int?,
|
||||
orderNo: json['orderNo'] as String?,
|
||||
orderTitle: json['orderTitle'] as String?,
|
||||
sourceType: json['sourceType'] as int?,
|
||||
orderType: json['orderType'] as int?,
|
||||
priorityLevel: json['priorityLevel'] as int?,
|
||||
deviceId: json['deviceId'] as int?,
|
||||
deviceName: json['deviceName'] as String?,
|
||||
deviceType: json['deviceType'] as int?,
|
||||
siteId: json['siteId'] as int?,
|
||||
siteName: json['siteName'] as String?,
|
||||
orgId: json['orgId'] as int?,
|
||||
assigneeId: json['assigneeId'] as int?,
|
||||
assigneeName: json['assigneeName'] as String?,
|
||||
collaboratorIds: json['collaboratorIds'] as String?,
|
||||
collaboratorNames: json['collaboratorNames'] as String?,
|
||||
planStartTime: json['planStartTime'] as String?,
|
||||
planEndTime: json['planEndTime'] as String?,
|
||||
deadlineTime: json['deadlineTime'] as String?,
|
||||
actualStartTime: json['actualStartTime'] as String?,
|
||||
actualEndTime: json['actualEndTime'] as String?,
|
||||
orderStatus: json['orderStatus'] as int?,
|
||||
alarmId: json['alarmId'] as int?,
|
||||
alarmNo: json['alarmNo'] as String?,
|
||||
taskDescription: json['taskDescription'] as String?,
|
||||
aiSuggestion: json['aiSuggestion'] as String?,
|
||||
requiredEquipment: json['requiredEquipment'] as String?,
|
||||
estimatedImpact: json['estimatedImpact'] as double?,
|
||||
handleResult: json['handleResult'] as String?,
|
||||
handleRemark: json['handleRemark'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'orderNo': orderNo,
|
||||
'orderTitle': orderTitle,
|
||||
'sourceType': sourceType,
|
||||
'orderType': orderType,
|
||||
'priorityLevel': priorityLevel,
|
||||
'deviceId': deviceId,
|
||||
'deviceName': deviceName,
|
||||
'deviceType': deviceType,
|
||||
'siteId': siteId,
|
||||
'siteName': siteName,
|
||||
'orgId': orgId,
|
||||
'assigneeId': assigneeId,
|
||||
'assigneeName': assigneeName,
|
||||
'collaboratorIds': collaboratorIds,
|
||||
'collaboratorNames': collaboratorNames,
|
||||
'planStartTime': planStartTime,
|
||||
'planEndTime': planEndTime,
|
||||
'deadlineTime': deadlineTime,
|
||||
'actualStartTime': actualStartTime,
|
||||
'actualEndTime': actualEndTime,
|
||||
'orderStatus': orderStatus,
|
||||
'alarmId': alarmId,
|
||||
'alarmNo': alarmNo,
|
||||
'taskDescription': taskDescription,
|
||||
'aiSuggestion': aiSuggestion,
|
||||
'requiredEquipment': requiredEquipment,
|
||||
'estimatedImpact': estimatedImpact,
|
||||
'handleResult': handleResult,
|
||||
'handleRemark': handleRemark,
|
||||
};
|
||||
}
|
||||
|
||||
WorkOrderEntity toEntity() {
|
||||
return WorkOrderEntity(
|
||||
id: id,
|
||||
orderNo: orderNo,
|
||||
orderTitle: orderTitle,
|
||||
sourceType: sourceType,
|
||||
orderType: orderType,
|
||||
priorityLevel: priorityLevel,
|
||||
deviceId: deviceId,
|
||||
deviceName: deviceName,
|
||||
deviceType: deviceType,
|
||||
siteId: siteId,
|
||||
siteName: siteName,
|
||||
orgId: orgId,
|
||||
assigneeId: assigneeId,
|
||||
assigneeName: assigneeName,
|
||||
collaboratorIds: collaboratorIds,
|
||||
collaboratorNames: collaboratorNames,
|
||||
planStartTime: planStartTime,
|
||||
planEndTime: planEndTime,
|
||||
deadlineTime: deadlineTime,
|
||||
actualStartTime: actualStartTime,
|
||||
actualEndTime: actualEndTime,
|
||||
orderStatus: orderStatus,
|
||||
alarmId: alarmId,
|
||||
alarmNo: alarmNo,
|
||||
taskDescription: taskDescription,
|
||||
aiSuggestion: aiSuggestion,
|
||||
requiredEquipment: requiredEquipment,
|
||||
estimatedImpact: estimatedImpact,
|
||||
handleResult: handleResult,
|
||||
handleRemark: handleRemark,
|
||||
);
|
||||
}
|
||||
|
||||
factory WorkOrderModel.fromEntity(WorkOrderEntity entity) {
|
||||
return WorkOrderModel(
|
||||
id: entity.id,
|
||||
orderNo: entity.orderNo,
|
||||
orderTitle: entity.orderTitle,
|
||||
sourceType: entity.sourceType,
|
||||
orderType: entity.orderType,
|
||||
priorityLevel: entity.priorityLevel,
|
||||
deviceId: entity.deviceId,
|
||||
deviceName: entity.deviceName,
|
||||
deviceType: entity.deviceType,
|
||||
siteId: entity.siteId,
|
||||
siteName: entity.siteName,
|
||||
orgId: entity.orgId,
|
||||
assigneeId: entity.assigneeId,
|
||||
assigneeName: entity.assigneeName,
|
||||
collaboratorIds: entity.collaboratorIds,
|
||||
collaboratorNames: entity.collaboratorNames,
|
||||
planStartTime: entity.planStartTime,
|
||||
planEndTime: entity.planEndTime,
|
||||
deadlineTime: entity.deadlineTime,
|
||||
actualStartTime: entity.actualStartTime,
|
||||
actualEndTime: entity.actualEndTime,
|
||||
orderStatus: entity.orderStatus,
|
||||
alarmId: entity.alarmId,
|
||||
alarmNo: entity.alarmNo,
|
||||
taskDescription: entity.taskDescription,
|
||||
aiSuggestion: entity.aiSuggestion,
|
||||
requiredEquipment: entity.requiredEquipment,
|
||||
estimatedImpact: entity.estimatedImpact,
|
||||
handleResult: entity.handleResult,
|
||||
handleRemark: entity.handleRemark,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user