update models

hmxc
张萌 3 years ago
parent 813772e020
commit bb2cd11ac6

@ -0,0 +1,120 @@
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:equatable/equatable.dart';
import 'package:aku_community_manager/models/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'house_keeping_list_model.g.dart';
@JsonSerializable()
class HouseKeepingListModel extends Equatable {
final int id;
final String proposerName;
final String proposerTel;
final String roomName;
final int type;
final String content;
final int status;
final int? completion;
final String? handlerName;
final String? handlerTel;
final String? processDescription;
final String? handlingTime;
final List<ImgModel> handlerImgList;
final num? payFee;
final int? evaluation;
final String? evaluationContent;
final String? evaluationTime;
final List<ImgModel> evaluationImgList;
final String createDate;
final List<ImgModel> submitImgList;
HouseKeepingListModel({
required this.id,
required this.proposerName,
required this.proposerTel,
required this.roomName,
required this.type,
required this.content,
required this.status,
this.completion,
this.handlerName,
this.handlerTel,
this.processDescription,
this.handlingTime,
required this.handlerImgList,
this.payFee,
this.evaluation,
this.evaluationContent,
this.evaluationTime,
required this.evaluationImgList,
required this.createDate,
required this.submitImgList,
});
factory HouseKeepingListModel.fromJson(Map<String, dynamic> json) =>
_$HouseKeepingListModelFromJson(json);
String get statusString {
switch (this.status) {
case 1:
return '待派单';
case 2:
if (UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.PICK) {
return '已派单';
} else {
return '待接单';
}
case 3:
return '处理中';
case 4:
return '待支付';
case 5:
return '待评价';
case 6:
return '已完成';
case 9:
return '已取消';
case 10:
return '已作废';
default:
return '未知';
}
}
String get typeString {
switch (this.type) {
case 1:
return '室内清洁';
case 2:
return '洗涤护理';
default:
return '未知';
}
}
@override
List<Object?> get props {
return [
id,
proposerName,
proposerTel,
roomName,
type,
content,
status,
completion,
handlerName,
handlerTel,
processDescription,
handlingTime,
handlerImgList,
payFee,
evaluation,
evaluationContent,
evaluationTime,
evaluationImgList,
createDate,
submitImgList,
];
}
}

@ -0,0 +1,39 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'house_keeping_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HouseKeepingListModel _$HouseKeepingListModelFromJson(
Map<String, dynamic> json) {
return HouseKeepingListModel(
id: json['id'] as int,
proposerName: json['proposerName'] as String,
proposerTel: json['proposerTel'] as String,
roomName: json['roomName'] as String,
type: json['type'] as int,
content: json['content'] as String,
status: json['status'] as int,
completion: json['completion'] as int?,
handlerName: json['handlerName'] as String?,
handlerTel: json['handlerTel'] as String?,
processDescription: json['processDescription'] as String?,
handlingTime: json['handlingTime'] as String?,
handlerImgList: (json['handlerImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
payFee: json['payFee'] as num?,
evaluation: json['evaluation'] as int?,
evaluationContent: json['evaluationContent'] as String?,
evaluationTime: json['evaluationTime'] as String?,
evaluationImgList: (json['evaluationImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
createDate: json['createDate'] as String,
submitImgList: (json['submitImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

@ -15,12 +15,3 @@ SystemMessageGreenModel _$SystemMessageGreenModelFromJson(
areaName: json['areaName'] as String,
);
}
Map<String, dynamic> _$SystemMessageGreenModelToJson(
SystemMessageGreenModel instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'tel': instance.tel,
'areaName': instance.areaName,
};

@ -15,12 +15,3 @@ SystemMessageHygineceModel _$SystemMessageHygineceModelFromJson(
areaName: json['areaName'] as String,
);
}
Map<String, dynamic> _$SystemMessageHygineceModelToJson(
SystemMessageHygineceModel instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'tel': instance.tel,
'areaName': instance.areaName,
};

@ -1,44 +0,0 @@
class HouseKeepingListModel {
int? id;
String? roomName;
int? num;
String? leaderName;
String? leaderTel;
String? content;
String? createName;
String? createDate;
HouseKeepingListModel(
{required this.id,
this.roomName,
this.num,
this.leaderName,
this.leaderTel,
this.content,
this.createName,
this.createDate});
HouseKeepingListModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
roomName = json['roomName'];
num = json['num'];
leaderName = json['leaderName'];
leaderTel = json['leaderTel'];
content = json['content'];
createName = json['createName'];
createDate = json['createDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['roomName'] = this.roomName;
data['num'] = this.num;
data['leaderName'] = this.leaderName;
data['leaderTel'] = this.leaderTel;
data['content'] = this.content;
data['createName'] = this.createName;
data['createDate'] = this.createDate;
return data;
}
}
Loading…
Cancel
Save