parent
103b1dffe2
commit
b79b6c7ec5
@ -0,0 +1,46 @@
|
|||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'house_keeping_process_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class HouseKeepingProcessModel extends Equatable {
|
||||||
|
final int id;
|
||||||
|
final int housekeepingServiceId;
|
||||||
|
final String operationDate;
|
||||||
|
final int operationType;
|
||||||
|
@JsonKey(name: 'operator')
|
||||||
|
final int opName;
|
||||||
|
final int operatorType;
|
||||||
|
final String operatorContent;
|
||||||
|
HouseKeepingProcessModel({
|
||||||
|
required this.id,
|
||||||
|
required this.housekeepingServiceId,
|
||||||
|
required this.operationDate,
|
||||||
|
required this.operationType,
|
||||||
|
required this.opName,
|
||||||
|
required this.operatorType,
|
||||||
|
required this.operatorContent,
|
||||||
|
});
|
||||||
|
factory HouseKeepingProcessModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$HouseKeepingProcessModelFromJson(json);
|
||||||
|
factory HouseKeepingProcessModel.fail() => HouseKeepingProcessModel(
|
||||||
|
id: -1,
|
||||||
|
housekeepingServiceId: -1,
|
||||||
|
operationDate: '',
|
||||||
|
opName: 0,
|
||||||
|
operationType: 0,
|
||||||
|
operatorContent: '',
|
||||||
|
operatorType: 1);
|
||||||
|
@override
|
||||||
|
List<Object> get props {
|
||||||
|
return [
|
||||||
|
id,
|
||||||
|
housekeepingServiceId,
|
||||||
|
operationDate,
|
||||||
|
operationType,
|
||||||
|
operatorType,
|
||||||
|
operatorContent,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'house_keeping_process_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
HouseKeepingProcessModel _$HouseKeepingProcessModelFromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
return HouseKeepingProcessModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
housekeepingServiceId: json['housekeepingServiceId'] as int,
|
||||||
|
operationDate: json['operationDate'] as String,
|
||||||
|
operationType: json['operationType'] as int,
|
||||||
|
opName: json['operator'] as int,
|
||||||
|
operatorType: json['operatorType'] as int,
|
||||||
|
operatorContent: json['operatorContent'] as String,
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
import 'package:aku_community_manager/const/api.dart';
|
||||||
|
import 'package:aku_community_manager/json_models/manager/house_keeping/house_keeping_process_model.dart';
|
||||||
|
import 'package:aku_community_manager/utils/network/base_model.dart';
|
||||||
|
import 'package:aku_community_manager/utils/network/net_util.dart';
|
||||||
|
|
||||||
|
class HouseKeepingFunc {
|
||||||
|
///获取家政服务进程
|
||||||
|
static Future getHouseKeepingProcess(int id) async {
|
||||||
|
BaseModel baseModel = await NetUtil().get(API.manage.newHouseKeepingProcess,
|
||||||
|
params: {"housekeepingServiceId": id});
|
||||||
|
if (baseModel.status ?? false) {
|
||||||
|
return (baseModel.data as List)
|
||||||
|
.map((e) => HouseKeepingProcessModel.fromJson(e))
|
||||||
|
.toList();
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue