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