门锁日志部分提交
This commit is contained in:
parent
ea530d5b95
commit
3a8faadfc9
@ -18,4 +18,11 @@ class XSConstantMacro {
|
||||
static int keyTypeTime = 2;
|
||||
static int keyTypeOnce = 3;
|
||||
static int keyTypeLoop = 4;
|
||||
|
||||
// 门锁事件类型 lockEventType 事件类型:0-全部事件;10-开门事件20-异常事件30-门铃事件40-视频事件
|
||||
static int lockEventTypeAll = 0;
|
||||
static int lockEventTypeOpenDoor = 10;
|
||||
static int lockEventTypeAbnormal = 20;
|
||||
static int lockEventTypeDoorbell = 30;
|
||||
static int lockEventTypeVideo = 40;
|
||||
}
|
||||
|
||||
@ -183,23 +183,15 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
});
|
||||
}
|
||||
|
||||
//请求操作记录列表
|
||||
//请求操作记录列表(门锁日志)
|
||||
void mockNetworkDataRequest() async {
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
||||
'',
|
||||
"",
|
||||
'0',
|
||||
state.keyInfos.value.lockId.toString(),
|
||||
'1',
|
||||
'1',
|
||||
'20',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'');
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.lockEventList(
|
||||
lockId: state.keyInfos.value.lockId!,
|
||||
lockEventType: state.dropdownValue.value,
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
startDate: state.startDate.value,
|
||||
endDate: state.endDate.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("操作记录列表成功:${entity.data?.itemList}");
|
||||
state.lockOperatingRecordListData.value = entity.data!.itemList!;
|
||||
@ -248,6 +240,8 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
|
||||
// mockNetworkDataRequest();
|
||||
}
|
||||
|
||||
mockNetworkDataRequest();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -131,8 +131,11 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
|
||||
children: [
|
||||
Obx(() => XSDropDownWidget(
|
||||
items: state.getDropDownItemList,
|
||||
value: state.dropdownValue.value,
|
||||
valueChanged: (value) {})),
|
||||
value: state.dropdownTitle.value,
|
||||
valueChanged: (value) {
|
||||
print('dropdownValue选中了$value');
|
||||
state.dropdownValue.value = int.parse(value);
|
||||
})),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/tools/advancedCalendar/src/controller.dart';
|
||||
import 'package:star_lock/tools/menuItem/dropDownItem.dart';
|
||||
|
||||
@ -15,16 +15,35 @@ class DoorLockLogState {
|
||||
DateTime.now(),
|
||||
DateTime(2024, 10, 10),
|
||||
];
|
||||
var dropdownValue = '全部事件'.obs;
|
||||
List<DropDownItem> getDropDownItemList = [
|
||||
DropDownItem(itemTitle: "全部事件", itemValue: '0', isCheked: false),
|
||||
DropDownItem(itemTitle: "开锁事件", itemValue: '1', isCheked: false),
|
||||
DropDownItem(itemTitle: "异常事件", itemValue: '2', isCheked: false),
|
||||
DropDownItem(itemTitle: "门锁事件", itemValue: '3', isCheked: false),
|
||||
DropDownItem(itemTitle: "视频事件", itemValue: '4', isCheked: false),
|
||||
];
|
||||
|
||||
var currentStep = 0.obs;
|
||||
final startDate = 0.obs;
|
||||
final endDate = 0.obs;
|
||||
|
||||
var dropdownTitle = '全部事件'.obs;
|
||||
var dropdownValue = XSConstantMacro.lockEventTypeAll.obs;
|
||||
|
||||
List<DropDownItem> getDropDownItemList = [
|
||||
DropDownItem(
|
||||
itemTitle: "全部事件",
|
||||
itemValue: XSConstantMacro.lockEventTypeAll.toString(),
|
||||
isCheked: false),
|
||||
DropDownItem(
|
||||
itemTitle: "开锁事件",
|
||||
itemValue: XSConstantMacro.lockEventTypeOpenDoor.toString(),
|
||||
isCheked: false),
|
||||
DropDownItem(
|
||||
itemTitle: "异常事件",
|
||||
itemValue: XSConstantMacro.lockEventTypeAbnormal.toString(),
|
||||
isCheked: false),
|
||||
DropDownItem(
|
||||
itemTitle: "门铃事件",
|
||||
itemValue: XSConstantMacro.lockEventTypeDoorbell.toString(),
|
||||
isCheked: false),
|
||||
DropDownItem(
|
||||
itemTitle: "视频事件",
|
||||
itemValue: XSConstantMacro.lockEventTypeVideo.toString(),
|
||||
isCheked: false),
|
||||
];
|
||||
|
||||
DoorLockLogState() {
|
||||
keyInfos.value = Get.arguments["keyInfo"];
|
||||
|
||||
@ -11,6 +11,8 @@ abstract class Api {
|
||||
final String sendElectronicKeyURL = '/key/send'; //发送电子钥匙
|
||||
final String resetElectronicKeyURL = '/key/reset'; //重置电子钥匙
|
||||
final String keyOperationRecordURL = '/lockRecords/list'; //操作记录
|
||||
final String lockEventListURL = '/lockRecords/lockEventList'; // 门锁事件日志
|
||||
|
||||
final String uploadElectricQuantityURL =
|
||||
'/room/uploadElectricQuantity'; //锁电量更新
|
||||
|
||||
|
||||
@ -254,6 +254,19 @@ class ApiProvider extends BaseProvider {
|
||||
'fingerprintId': fingerprintId
|
||||
}));
|
||||
|
||||
// 门锁事件日志
|
||||
Future<Response> lockEventList(int lockId, int lockEventType, int pageNo,
|
||||
int pageSize, int startDate, int endDate) =>
|
||||
post(
|
||||
lockEventListURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'lockEventType': lockEventType,
|
||||
"pageNo": pageNo,
|
||||
'pageSize': pageSize,
|
||||
"startDate": startDate,
|
||||
'endDate': endDate,
|
||||
}));
|
||||
// 锁记录上传
|
||||
Future<Response> lockRecordUploadData(String lockId, List records) => post(
|
||||
lockRecordUploadURL.toUrl,
|
||||
|
||||
@ -125,18 +125,16 @@ class ApiRepository {
|
||||
|
||||
//电子钥匙列表
|
||||
Future<ElectronicKeyListEntity> electronicKeyList(
|
||||
{
|
||||
required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String keyRight,
|
||||
required String searchStr
|
||||
}) async {
|
||||
{required String endDate,
|
||||
required String keyId,
|
||||
required String keyStatus,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
required String startDate,
|
||||
required String keyRight,
|
||||
required String searchStr}) async {
|
||||
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
|
||||
lockId, operatorUid, pageNo, pageSize, startDate, keyRight, searchStr);
|
||||
return ElectronicKeyListEntity.fromJson(res.body);
|
||||
@ -221,6 +219,26 @@ class ApiRepository {
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//门锁事件日志
|
||||
Future<KeyOperationRecordEntity> lockEventList({
|
||||
required int lockId,
|
||||
required int lockEventType,
|
||||
required int pageNo,
|
||||
required int pageSize,
|
||||
required int startDate,
|
||||
required int endDate,
|
||||
}) async {
|
||||
final res = await apiProvider.lockEventList(
|
||||
lockId,
|
||||
lockEventType,
|
||||
pageNo,
|
||||
pageSize,
|
||||
startDate,
|
||||
endDate,
|
||||
);
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//操作记录上传
|
||||
Future<KeyOperationRecordEntity> lockRecordUploadData(
|
||||
{required String lockId, required List records}) async {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user