parent
a9ca0ee61e
commit
bfb113ba3c
@ -0,0 +1,59 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
part 'today_clock_record_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class TodayClockRecordModel {
|
||||
final int id;
|
||||
final String? startClockDate;
|
||||
final String? endClockDate;
|
||||
final String? cardReplacementDate;
|
||||
final String? operatorName;
|
||||
final String clockName;
|
||||
final String clockTel;
|
||||
final String createDate;
|
||||
final String status;
|
||||
final String? firstTimeStart;
|
||||
final String? firstTimeEnd;
|
||||
final String? secondTimeStart;
|
||||
final String? secondTimeEnd;
|
||||
TodayClockRecordModel({
|
||||
required this.id,
|
||||
required this.startClockDate,
|
||||
required this.endClockDate,
|
||||
required this.cardReplacementDate,
|
||||
required this.operatorName,
|
||||
required this.clockName,
|
||||
required this.clockTel,
|
||||
required this.createDate,
|
||||
required this.status,
|
||||
required this.firstTimeStart,
|
||||
required this.firstTimeEnd,
|
||||
required this.secondTimeStart,
|
||||
required this.secondTimeEnd,
|
||||
});
|
||||
factory TodayClockRecordModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$TodayClockRecordModelFromJson(json);
|
||||
|
||||
DateTime? get clockInTime => DateUtil.getDateTime(this.startClockDate ?? '');
|
||||
DateTime? get clockOutTime => DateUtil.getDateTime(this.endClockDate ?? '');
|
||||
DateTime? get startTime {
|
||||
if (firstTimeStart != null) {
|
||||
return DateUtil.getDateTime(firstTimeStart!);
|
||||
} else if (secondTimeStart != null) {
|
||||
return DateUtil.getDateTime(secondTimeStart!);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
DateTime? get endTime {
|
||||
if (firstTimeEnd != null) {
|
||||
return DateUtil.getDateTime(firstTimeEnd!);
|
||||
} else if (secondTimeEnd != null) {
|
||||
return DateUtil.getDateTime(secondTimeEnd!);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'today_clock_record_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TodayClockRecordModel _$TodayClockRecordModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return TodayClockRecordModel(
|
||||
id: json['id'] as int,
|
||||
startClockDate: json['startClockDate'] as String,
|
||||
endClockDate: json['endClockDate'] as String,
|
||||
cardReplacementDate: json['cardReplacementDate'] as String,
|
||||
operatorName: json['operatorName'] as String,
|
||||
clockName: json['clockName'] as String,
|
||||
clockTel: json['clockTel'] as String,
|
||||
createDate: json['createDate'] as String,
|
||||
status: json['status'] as String,
|
||||
firstTimeStart: json['firstTimeStart'] as String,
|
||||
firstTimeEnd: json['firstTimeEnd'] as String,
|
||||
secondTimeStart: json['secondTimeStart'] as String,
|
||||
secondTimeEnd: json['secondTimeEnd'] as String,
|
||||
);
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
// // Flutter imports:
|
||||
// import 'package:flutter/material.dart';
|
||||
|
||||
// // Project imports:
|
||||
// import 'package:aku_community_manager/const/resource.dart';
|
||||
|
||||
// enum DecorationType {
|
||||
// ///待指派
|
||||
// WAIT_HAND_OUT,
|
||||
|
||||
// ///已指派&待执行
|
||||
// HAND_OUT,
|
||||
|
||||
// ///已执行
|
||||
// DONE,
|
||||
// }
|
||||
|
||||
// enum DecorationStatusType {
|
||||
// PROGRESS,
|
||||
// DONE,
|
||||
// }
|
||||
|
||||
// enum CHECK_TYPE {
|
||||
// ELECTRIC,
|
||||
// WATER,
|
||||
// WALL,
|
||||
// DOOR_AND_WINDOWS,
|
||||
// SECURITY,
|
||||
// }
|
||||
|
||||
// Map<CHECK_TYPE, String> checkTypeMap = {
|
||||
// CHECK_TYPE.ELECTRIC: '电路',
|
||||
// CHECK_TYPE.WATER: '水路',
|
||||
// CHECK_TYPE.WALL: '墙面',
|
||||
// CHECK_TYPE.DOOR_AND_WINDOWS: '门窗',
|
||||
// CHECK_TYPE.SECURITY: '安防',
|
||||
// };
|
||||
|
||||
// Map<String, CHECK_TYPE> checkTypeStringMap = {
|
||||
// '电路': CHECK_TYPE.ELECTRIC,
|
||||
// '水路': CHECK_TYPE.WATER,
|
||||
// '墙面': CHECK_TYPE.WALL,
|
||||
// '门窗': CHECK_TYPE.DOOR_AND_WINDOWS,
|
||||
// '安防': CHECK_TYPE.SECURITY,
|
||||
// };
|
||||
|
||||
// Map<CHECK_TYPE, String> checkAssetMap = {
|
||||
// CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG,
|
||||
// CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG,
|
||||
// CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG,
|
||||
// CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG,
|
||||
// CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG,
|
||||
// };
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
// class DecorationModel {
|
||||
// DecorationType type;
|
||||
// DecorationStatusType statusType;
|
||||
// DateTime decorationDate;
|
||||
// UserHomeModel userHomeModel;
|
||||
// DecorationTeamModel decorationTeamModel;
|
||||
// CycleCheck cycleCheck;
|
||||
// WorkFinishCheck workFinishCheck;
|
||||
// List<CheckInfomation> checkInfomations;
|
||||
|
||||
// String get statusTypeValue {
|
||||
// if (statusType == DecorationStatusType.PROGRESS)
|
||||
// return '装修中';
|
||||
// else
|
||||
// return '装修完成';
|
||||
// }
|
||||
|
||||
// DecorationModel({
|
||||
// @required this.type,
|
||||
// @required this.statusType,
|
||||
// @required this.userHomeModel,
|
||||
// @required this.decorationTeamModel,
|
||||
// @required this.decorationDate,
|
||||
// this.cycleCheck,
|
||||
// this.workFinishCheck,
|
||||
// this.checkInfomations,
|
||||
// });
|
||||
// }
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
|
||||
// ///用户家庭信息
|
||||
// class UserHomeModel {
|
||||
// String plot;
|
||||
// String detailAddr;
|
||||
// String userName;
|
||||
// String phone;
|
||||
// UserHomeModel({
|
||||
// this.plot,
|
||||
// this.detailAddr,
|
||||
// this.userName,
|
||||
// this.phone,
|
||||
// });
|
||||
// }
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
|
||||
// ///装修队伍信息
|
||||
// class DecorationTeamModel {
|
||||
// String name;
|
||||
// String userName;
|
||||
// String phone;
|
||||
// DecorationTeamModel({
|
||||
// this.name,
|
||||
// this.userName,
|
||||
// this.phone,
|
||||
// });
|
||||
// }
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
|
||||
// ///周期检查
|
||||
// class CycleCheck {
|
||||
// FixerModel authPerson;
|
||||
// DateTime startDate;
|
||||
|
||||
// ///check cycle in days
|
||||
// int checkCycle;
|
||||
// List<CHECK_TYPE> checkDetails = [
|
||||
// CHECK_TYPE.ELECTRIC,
|
||||
// CHECK_TYPE.WATER,
|
||||
// CHECK_TYPE.WALL,
|
||||
// CHECK_TYPE.DOOR_AND_WINDOWS,
|
||||
// CHECK_TYPE.SECURITY,
|
||||
// ];
|
||||
// CycleCheck({
|
||||
// this.authPerson,
|
||||
// this.startDate,
|
||||
// this.checkCycle,
|
||||
// this.checkDetails,
|
||||
// });
|
||||
// }
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
// class WorkFinishCheck {
|
||||
// FixerModel authPerson;
|
||||
// DateTime startDate;
|
||||
// List<CHECK_TYPE> checkDetails;
|
||||
// WorkFinishCheck({
|
||||
// this.authPerson,
|
||||
// this.startDate,
|
||||
// this.checkDetails,
|
||||
// });
|
||||
// }
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
|
||||
// ///周期检查细节
|
||||
// class CheckInfomation {
|
||||
// DateTime checkDate;
|
||||
// List<CheckDetail> details;
|
||||
// String info;
|
||||
// String checkType;
|
||||
// CheckInfomation({
|
||||
// this.checkDate,
|
||||
// this.info,
|
||||
// this.details,
|
||||
// this.checkType,
|
||||
// });
|
||||
|
||||
// ///检查结果
|
||||
// bool get checkAllResult {
|
||||
// for (var item in details) {
|
||||
// if (!item.status) return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// @Deprecated('under should be removed')
|
||||
// class CheckDetail {
|
||||
// CHECK_TYPE type;
|
||||
// bool status;
|
||||
// String get assetpath => checkAssetMap[type];
|
||||
// CheckDetail({
|
||||
// @required this.type,
|
||||
// this.status = true,
|
||||
// });
|
||||
// String get typeValue => checkTypeMap[type];
|
||||
// }
|
@ -1,86 +0,0 @@
|
||||
enum FIXER_TYPE {
|
||||
///空调组
|
||||
AIR_CONDITION,
|
||||
|
||||
///电力组
|
||||
ELECTRIC,
|
||||
|
||||
///水泥组
|
||||
CEMENT,
|
||||
|
||||
///物业组
|
||||
PROPERTY,
|
||||
}
|
||||
|
||||
//TODO CLEAN BOTTOM CODES.
|
||||
// @Deprecated("fixer_model need to be cleaned.")
|
||||
// class FixerModel {
|
||||
// String name;
|
||||
// String phone;
|
||||
// FixerModel({this.name, this.phone});
|
||||
// }
|
||||
|
||||
// class FixerTypedModel {
|
||||
// FIXER_TYPE type;
|
||||
// String get typeName {
|
||||
// switch (type) {
|
||||
// case FIXER_TYPE.AIR_CONDITION:
|
||||
// return '空调组';
|
||||
// break;
|
||||
// case FIXER_TYPE.ELECTRIC:
|
||||
// return '电力组';
|
||||
// break;
|
||||
// case FIXER_TYPE.CEMENT:
|
||||
// return '水泥组';
|
||||
// break;
|
||||
// case FIXER_TYPE.PROPERTY:
|
||||
// return '物业组';
|
||||
// default:
|
||||
// return '';
|
||||
// }
|
||||
// }
|
||||
|
||||
// List<FixerModel> fixers;
|
||||
// FixerTypedModel({
|
||||
// this.type,
|
||||
// this.fixers,
|
||||
// });
|
||||
|
||||
// static List<FixerTypedModel> models = [
|
||||
// FixerTypedModel(
|
||||
// type: FIXER_TYPE.AIR_CONDITION,
|
||||
// fixers: [
|
||||
// FixerModel(name: '刘能建师傅', phone: '18923747283'),
|
||||
// FixerModel(name: '李惠政师傅', phone: '18910298345'),
|
||||
// FixerModel(name: '李慧珍师傅', phone: '17872342382'),
|
||||
// FixerModel(name: '林 芝师傅', phone: '18292847752'),
|
||||
// ],
|
||||
// ),
|
||||
// FixerTypedModel(
|
||||
// type: FIXER_TYPE.CEMENT,
|
||||
// fixers: [
|
||||
// FixerModel(name: '李雷师傅', phone: '18923747283'),
|
||||
// FixerModel(name: '林智师傅', phone: '18910298345'),
|
||||
// FixerModel(name: '刘凯欣师傅', phone: '17872342382'),
|
||||
// FixerModel(name: '张亮师傅', phone: '18292847752'),
|
||||
// ],
|
||||
// ),
|
||||
// FixerTypedModel(
|
||||
// type: FIXER_TYPE.ELECTRIC,
|
||||
// fixers: [
|
||||
// FixerModel(name: '李建国师傅', phone: '18923747283'),
|
||||
// FixerModel(name: '李历程师傅', phone: '18910298345'),
|
||||
// ],
|
||||
// ),
|
||||
// ];
|
||||
|
||||
// static List<FixerTypedModel> propertyModels = [
|
||||
// FixerTypedModel(
|
||||
// type: FIXER_TYPE.PROPERTY,
|
||||
// fixers: [
|
||||
// FixerModel(name: '李国师傅', phone: '18923747283'),
|
||||
// FixerModel(name: '章则林师傅', phone: '18910298345'),
|
||||
// ],
|
||||
// ),
|
||||
// ];
|
||||
// }
|
@ -1,49 +0,0 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
class TodayClockRecordModel {
|
||||
int? id;
|
||||
String? startClockDate;
|
||||
String? endClockDate;
|
||||
String? cardReplacementDate;
|
||||
String? operatorName;
|
||||
String? clockName;
|
||||
String? clockTel;
|
||||
String? createDate;
|
||||
|
||||
TodayClockRecordModel(
|
||||
{required this.id,
|
||||
this.startClockDate,
|
||||
this.endClockDate,
|
||||
this.cardReplacementDate,
|
||||
this.operatorName,
|
||||
this.clockName,
|
||||
this.clockTel,
|
||||
this.createDate});
|
||||
|
||||
TodayClockRecordModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
startClockDate = json['startClockDate'];
|
||||
endClockDate = json['endClockDate'];
|
||||
cardReplacementDate = json['cardReplacementDate'];
|
||||
operatorName = json['operatorName'];
|
||||
clockName = json['clockName'];
|
||||
clockTel = json['clockTel'];
|
||||
createDate = json['createDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['startClockDate'] = this.startClockDate;
|
||||
data['endClockDate'] = this.endClockDate;
|
||||
data['cardReplacementDate'] = this.cardReplacementDate;
|
||||
data['operatorName'] = this.operatorName;
|
||||
data['clockName'] = this.clockName;
|
||||
data['clockTel'] = this.clockTel;
|
||||
data['createDate'] = this.createDate;
|
||||
return data;
|
||||
}
|
||||
|
||||
DateTime? get clockInTime => DateUtil.getDateTime(this.startClockDate!);
|
||||
DateTime? get clockOutTime => DateUtil.getDateTime(this.endClockDate!);
|
||||
}
|
Loading…
Reference in new issue