Merge branch 'optimized_startup_wei' into develop

This commit is contained in:
Liuyf 2024-09-18 10:28:56 +08:00
commit 70b178a4b9
4 changed files with 224 additions and 180 deletions

View File

@ -25,6 +25,7 @@ class DoorLockLogLogic extends BaseGetXController {
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) { EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
@ -75,7 +76,12 @@ class DoorLockLogLogic extends BaseGetXController {
(0xff & indexList[4]) << 16 | (0xff & indexList[4]) << 16 |
(0xff & indexList[5]) << 8 | (0xff & indexList[5]) << 8 |
(0xFF & indexList[6]); (0xFF & indexList[6]);
indexMap['date'] = '${time * 1000}'; final operateDate = time * 1000;
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
DateTime.fromMillisecondsSinceEpoch(state.currentDate))) {
continue;
}
indexMap['date'] = '$operateDate';
uploadList.add(indexMap); uploadList.add(indexMap);
} }
if (dataLength == state.logCountPage) { if (dataLength == state.logCountPage) {
@ -102,16 +108,19 @@ class DoorLockLogLogic extends BaseGetXController {
showBlueConnetctToastTimer(action: () { showBlueConnetctToastTimer(action: () {
dismissEasyLoading(); dismissEasyLoading();
}); });
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async { BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionStateState) async {
if (connectionStateState == BluetoothConnectionState.connected) { if (connectionStateState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey); final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!); changeStringListToIntList(privateKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken); final List<String>? token = await Storage.getStringList(saveBlueToken);
final List<int> getTokenList = changeStringListToIntList(token!); final List<int> getTokenList = changeStringListToIntList(token!);
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey); final List<String>? publicKey =
await Storage.getStringList(saveBluePublicKey);
final List<int> getPublicKeyList = final List<int> getPublicKeyList =
changeStringListToIntList(publicKey!); changeStringListToIntList(publicKey!);
@ -163,6 +172,7 @@ class DoorLockLogLogic extends BaseGetXController {
/// ///
StreamSubscription? _getDoorLockLogListRefreshUIEvent; StreamSubscription? _getDoorLockLogListRefreshUIEvent;
void _getDoorLockLogListRefreshUIAction() { void _getDoorLockLogListRefreshUIAction() {
_getDoorLockLogListRefreshUIEvent = eventBus _getDoorLockLogListRefreshUIEvent = eventBus
.on<DoorLockLogListRefreshUI>() .on<DoorLockLogListRefreshUI>()
@ -195,7 +205,8 @@ class DoorLockLogLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.operateDate = entity.data!.operateDate! ~/ 1000; state.operateDate = entity.data!.operateDate! ~/ 1000;
state.currentDate = entity.data!.currentDate! ~/ 1000; state.currentDate = entity.data!.currentDate! ~/ 1000;
AppLog.log('entity.data!.currentDate!:${entity.data!.currentDate!} currentDate:${state.currentDate}'); AppLog.log(
'entity.data!.currentDate!:${entity.data!.currentDate!} currentDate:${state.currentDate}');
senderReferEventRecordTime(); senderReferEventRecordTime();
} }
} }

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
@ -18,6 +17,7 @@ import 'package:star_lock/widget/permission/permission_dialog.dart';
import '../../../app_settings/app_settings.dart'; import '../../../app_settings/app_settings.dart';
import '../../../blue/blue_manage.dart'; import '../../../blue/blue_manage.dart';
import '../../../blue/io_protocol/io_openLock.dart'; import '../../../blue/io_protocol/io_openLock.dart';
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
import '../../../blue/io_reply.dart'; import '../../../blue/io_reply.dart';
import '../../../blue/io_tool/io_tool.dart'; import '../../../blue/io_tool/io_tool.dart';
import '../../../blue/io_tool/manager_event_bus.dart'; import '../../../blue/io_tool/manager_event_bus.dart';
@ -28,6 +28,7 @@ import '../../../tools/commonDataManage.dart';
import '../../../tools/eventBusEventManage.dart'; import '../../../tools/eventBusEventManage.dart';
import '../../../tools/storage.dart'; import '../../../tools/storage.dart';
import '../lockOperatingRecord/keyOperationRecord_entity.dart'; import '../lockOperatingRecord/keyOperationRecord_entity.dart';
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
import '../lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_entity.dart'; import '../lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_entity.dart';
import 'lockDetail_state.dart'; import 'lockDetail_state.dart';
import 'lockNetToken_entity.dart'; import 'lockNetToken_entity.dart';
@ -41,17 +42,18 @@ class LockDetailLogic extends BaseGetXController {
// //
void initReplySubscription() { void initReplySubscription() {
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async { state.replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
// //
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
_replyOpenLock(reply); _replyOpenLock(reply);
} }
// //
// if (reply is SenderReferEventRecordTimeReply && if (reply is SenderReferEventRecordTimeReply &&
// state.ifCurrentScreen.value == true) { state.ifCurrentScreen.value == true) {
// _replyReferEventRecordTime(reply); _replyReferEventRecordTime(reply);
// } }
}); });
} }
@ -94,7 +96,7 @@ class LockDetailLogic extends BaseGetXController {
state.animationController!.stop(); state.animationController!.stop();
// //
// getLockRecordLastUploadDataTime(); getLockRecordLastUploadDataTime();
break; break;
case 0x06: case 0x06:
// //
@ -177,7 +179,9 @@ class LockDetailLogic extends BaseGetXController {
} }
} }
Future<void> loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async { Future<void> loadData(
{required LockListInfoItemEntity lockListInfoItemEntity,
required bool isOnlyOneData}) async {
state.keyInfos.value = lockListInfoItemEntity; state.keyInfos.value = lockListInfoItemEntity;
CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!; CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!;
CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!; CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!;
@ -185,7 +189,8 @@ class LockDetailLogic extends BaseGetXController {
state.lockUserNo = state.keyInfos.value.lockUserNo!; state.lockUserNo = state.keyInfos.value.lockUserNo!;
if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || if (state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitIneffective ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
@ -252,72 +257,78 @@ class LockDetailLogic extends BaseGetXController {
} }
// //
// Future<void> _replyReferEventRecordTime(Reply reply) async { Future<void> _replyReferEventRecordTime(Reply reply) async {
// final int status = reply.data[2]; final int status = reply.data[2];
// switch (status) { switch (status) {
// case 0x00: case 0x00:
// // //
// final int dataLength = (reply.data[5] << 8) + reply.data[6]; final int dataLength = (reply.data[5] << 8) + reply.data[6];
// AppLog.log('dataLength:$dataLength'); AppLog.log('dataLength:$dataLength');
// if (dataLength > 0) { if (dataLength > 0) {
// reply.data.removeRange(0, 7); reply.data.removeRange(0, 7);
// // 17 // 17
// if (reply.data.length < 17) { if (reply.data.length < 17) {
// return; return;
// } }
// final List<List<int>> getList = splitList(reply.data, 17); final List<List<int>> getList = splitList(reply.data, 17);
// AppLog.log('getList:$getList'); AppLog.log('getList:$getList');
// final List uploadList = []; final List uploadList = [];
// for (int i = 0; i < getList.length; i++) { for (int i = 0; i < getList.length; i++) {
// final List<int> indexList = getList[i]; final List<int> indexList = getList[i];
// AppLog.log('indexList:$indexList'); AppLog.log('indexList:$indexList');
// final Map indexMap = {}; final Map indexMap = {};
// indexMap['type'] = indexList[0].toString(); indexMap['type'] = indexList[0].toString();
// int operateDate = 0; int operateDate = 0;
// // if (indexList[0] == 2) { // if (indexList[0] == 2) {
// final List<int> passwordData = indexList.sublist(7, 17); final List<int> passwordData = indexList.sublist(7, 17);
// final String password = utf8String(passwordData); final String password = utf8String(passwordData);
// AppLog.log('passwordData:$passwordData password:$password'); AppLog.log('passwordData:$passwordData password:$password');
// indexMap['user'] = password.toString(); indexMap['user'] = password.toString();
// // } else {
// // final int userNo = (indexList[1] * 256) + indexList[2];
// // indexMap['user'] = userNo.toString();
// // }
//
// indexMap['success'] = '1';
//
// final int time = (0xff & indexList[3]) << 24 |
// (0xff & indexList[4]) << 16 |
// (0xff & indexList[5]) << 8 |
// (0xFF & indexList[6]);
// operateDate = time * 1000;
// indexMap['date'] = '$operateDate';
// uploadList.add(indexMap);
//
// if (i == getList.length - 1) {
// //
// state.operateDate = operateDate;
// }
// }
// lockRecordUploadData(uploadList);
//
// if (dataLength == state.logCountPage) {
// senderReferEventRecordTime();
// } else { // } else {
// await blueManageDisconnect(); // final int userNo = (indexList[1] * 256) + indexList[2];
// } // indexMap['user'] = userNo.toString();
// }
// break;
// case 0x06:
// //
// blueManageDisconnect();
// break;
// default:
// blueManageDisconnect();
// break;
// }
// } // }
indexMap['success'] = '1';
final int time = (0xff & indexList[3]) << 24 |
(0xff & indexList[4]) << 16 |
(0xff & indexList[5]) << 8 |
(0xFF & indexList[6]);
operateDate = time * 1000;
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
DateTime.fromMillisecondsSinceEpoch(getUTCNetTime() * 1000))) {
continue;
}
indexMap['date'] = '$operateDate';
uploadList.add(indexMap);
if (i == getList.length - 1) {
//
state.operateDate = operateDate;
}
}
lockRecordUploadData(uploadList);
if (dataLength == state.logCountPage) {
senderReferEventRecordTime();
} else {
await blueManageDisconnect();
}
}
break;
case 0x06:
//
blueManageDisconnect();
break;
default:
blueManageDisconnect();
break;
}
}
// //
Future<void> openDoorAction() async { Future<void> openDoorAction() async {
showBlueConnetctToastTimer( showBlueConnetctToastTimer(
@ -372,42 +383,43 @@ class LockDetailLogic extends BaseGetXController {
} }
// () // ()
// void senderReferEventRecordTime() { void senderReferEventRecordTime() {
// showBlueConnetctToastTimer( showBlueConnetctToastTimer(
// isShowBlueConnetctToast: false, isShowBlueConnetctToast: false,
// action: () { action: () {
// blueManageDisconnect(); blueManageDisconnect();
// }); });
// BlueManage().blueSendData(BlueManage().connectDeviceName, BlueManage().blueSendData(BlueManage().connectDeviceName,
// (BluetoothConnectionState connectionState) async { (BluetoothConnectionState connectionState) async {
// if (connectionState == BluetoothConnectionState.connected) { if (connectionState == BluetoothConnectionState.connected) {
// final List<String>? privateKey = final List<String>? privateKey =
// await Storage.getStringList(saveBluePrivateKey); await Storage.getStringList(saveBluePrivateKey);
// final List<int> getPrivateKeyList = final List<int> getPrivateKeyList =
// changeStringListToIntList(privateKey!); changeStringListToIntList(privateKey!);
//
// final List<String>? token = await Storage.getStringList(saveBlueToken); final List<String>? token = await Storage.getStringList(saveBlueToken);
// final List<int> getTokenList = changeStringListToIntList(token!); final List<int> getTokenList = changeStringListToIntList(token!);
//
// final List<String>? publicKey = final List<String>? publicKey =
// await Storage.getStringList(saveBluePublicKey); await Storage.getStringList(saveBluePublicKey);
// final List<int> getPublicKeyList = final List<int> getPublicKeyList =
// changeStringListToIntList(publicKey!); changeStringListToIntList(publicKey!);
//
// IoSenderManage.senderReferEventRecordTimeCommand( IoSenderManage.senderReferEventRecordTimeCommand(
// keyID: BlueManage().connectDeviceName, keyID: BlueManage().connectDeviceName,
// userID: await Storage.getUid(), userID: await Storage.getUid(),
// logsCount: state.logCountPage, logsCount: state.logCountPage,
// // time:DateTime.now().millisecondsSinceEpoch~/1000, // time:DateTime.now().millisecondsSinceEpoch~/1000,
// time: state.operateDate, time: state.operateDate,
// token: getTokenList, currentDate: state.currentDate,
// needAuthor: 1, token: getTokenList,
// publicKey: getPublicKeyList, needAuthor: 1,
// privateKey: getPrivateKeyList, publicKey: getPublicKeyList,
// ); privateKey: getPrivateKeyList,
// } );
// }); }
// } });
}
// //
Future<void> getServerDatetime() async { Future<void> getServerDatetime() async {
@ -465,15 +477,16 @@ class LockDetailLogic extends BaseGetXController {
} }
// //
// Future<void> getLockRecordLastUploadDataTime() async { Future<void> getLockRecordLastUploadDataTime() async {
// final LockOperatingRecordGetLastRecordTimeEntity entity = final LockOperatingRecordGetLastRecordTimeEntity entity =
// await ApiRepository.to.getLockRecordLastUploadDataTime( await ApiRepository.to.getLockRecordLastUploadDataTime(
// lockId: state.keyInfos.value.lockId.toString()); lockId: state.keyInfos.value.lockId.toString());
// if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// state.operateDate = entity.data!.operateDate! ~/ 1000; state.operateDate = entity.data!.operateDate! ~/ 1000;
// senderReferEventRecordTime(); state.currentDate = entity.data!.currentDate! ~/ 1000;
// } senderReferEventRecordTime();
// } }
}
// //
Future<void> lockRecordUploadData(List list) async { Future<void> lockRecordUploadData(List list) async {
@ -493,13 +506,14 @@ class LockDetailLogic extends BaseGetXController {
// //
Future<void> lockReportLockSuccessfullyUploadData() async { Future<void> lockReportLockSuccessfullyUploadData() async {
final KeyOperationRecordEntity entity = await ApiRepository.to.lockReportLockSuccessfullyUploadData( final KeyOperationRecordEntity entity = await ApiRepository.to
.lockReportLockSuccessfullyUploadData(
lockId: state.keyInfos.value.lockId ?? 0, lockId: state.keyInfos.value.lockId ?? 0,
keyId: state.keyInfos.value.keyId ?? 0 keyId: state.keyInfos.value.keyId ?? 0);
);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
// mockNetworkDataRequest(); // mockNetworkDataRequest();
AppLog.log('state.keyInfos.value.keyType:${state.keyInfos.value.keyType}'); AppLog.log(
'state.keyInfos.value.keyType:${state.keyInfos.value.keyType}');
if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) { if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) {
// //
deletKeyData(); deletKeyData();
@ -608,7 +622,6 @@ class LockDetailLogic extends BaseGetXController {
getServerDatetime(); getServerDatetime();
await PermissionDialog.request(Permission.location); await PermissionDialog.request(Permission.location);
await PermissionDialog.requestBluetooth(); await PermissionDialog.requestBluetooth();
} }
@override @override

View File

@ -50,6 +50,8 @@ class LockDetailState {
RxInt currentPage = 0.obs; RxInt currentPage = 0.obs;
int operateDate = 0; // int operateDate = 0; //
int currentDate = 0; // UTC毫秒时间戳
int logCountPage = 10; // int logCountPage = 10; //
RxInt nextAuthTime = 0.obs; // RxInt nextAuthTime = 0.obs; //

View File

@ -22,8 +22,10 @@ class LockOperatingRecordLogic extends BaseGetXController {
// //
late StreamSubscription<Reply> _replySubscription; late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) { _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
if (reply is SenderReferEventRecordTimeReply) { if (reply is SenderReferEventRecordTimeReply) {
_replyReferEventRecordTime(reply); _replyReferEventRecordTime(reply);
} }
@ -56,7 +58,6 @@ class LockOperatingRecordLogic extends BaseGetXController {
indexMap['type'] = indexList[0].toString(); indexMap['type'] = indexList[0].toString();
final int userNo = (indexList[1] * 256) + indexList[2]; final int userNo = (indexList[1] * 256) + indexList[2];
indexMap['user'] = userNo.toString(); indexMap['user'] = userNo.toString();
AppLog.log('userNouserNouserNouserNo:$userNo'); AppLog.log('userNouserNouserNouserNo:$userNo');
@ -72,7 +73,12 @@ class LockOperatingRecordLogic extends BaseGetXController {
(0xff & indexList[4]) << 16 | (0xff & indexList[4]) << 16 |
(0xff & indexList[5]) << 8 | (0xff & indexList[5]) << 8 |
(0xFF & indexList[6]); (0xFF & indexList[6]);
indexMap['date'] = '${time * 1000}'; final operateDate = time * 1000;
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
DateTime.fromMillisecondsSinceEpoch(state.currentDate))) {
continue;
}
indexMap['date'] = '$operateDate';
uploadList.add(indexMap); uploadList.add(indexMap);
} }
if (dataLength == state.logCountPage) { if (dataLength == state.logCountPage) {
@ -99,16 +105,21 @@ class LockOperatingRecordLogic extends BaseGetXController {
showBlueConnetctToastTimer(action: () { showBlueConnetctToastTimer(action: () {
dismissEasyLoading(); dismissEasyLoading();
}); });
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async { BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionStateState) async {
if (connectionStateState == BluetoothConnectionState.connected) { if (connectionStateState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey); final List<String>? privateKey =
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList =
changeStringListToIntList(privateKey!);
final List<String>? token = await Storage.getStringList(saveBlueToken); final List<String>? token = await Storage.getStringList(saveBlueToken);
final List<int> getTokenList = changeStringListToIntList(token!); final List<int> getTokenList = changeStringListToIntList(token!);
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey); final List<String>? publicKey =
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!); await Storage.getStringList(saveBluePublicKey);
final List<int> getPublicKeyList =
changeStringListToIntList(publicKey!);
IoSenderManage.senderReferEventRecordTimeCommand( IoSenderManage.senderReferEventRecordTimeCommand(
keyID: BlueManage().connectDeviceName, keyID: BlueManage().connectDeviceName,
@ -122,7 +133,8 @@ class LockOperatingRecordLogic extends BaseGetXController {
publicKey: getPublicKeyList, publicKey: getPublicKeyList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
); );
} else if (connectionStateState == BluetoothConnectionState.disconnected) { } else if (connectionStateState ==
BluetoothConnectionState.disconnected) {
dismissEasyLoading(); dismissEasyLoading();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
if (state.ifCurrentScreen.value == true) { if (state.ifCurrentScreen.value == true) {
@ -134,7 +146,8 @@ class LockOperatingRecordLogic extends BaseGetXController {
// //
Future<KeyOperationRecordEntity> mockNetworkDataRequest() async { Future<KeyOperationRecordEntity> mockNetworkDataRequest() async {
final KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList( final KeyOperationRecordEntity entity =
await ApiRepository.to.lockRecordList(
lockId: CommonDataManage().currentKeyInfo.lockId.toString(), lockId: CommonDataManage().currentKeyInfo.lockId.toString(),
pageNo: pageNo.toString(), pageNo: pageNo.toString(),
recordType: '', recordType: '',
@ -156,7 +169,8 @@ class LockOperatingRecordLogic extends BaseGetXController {
pageNo++; pageNo++;
} else { } else {
if (entity.data!.itemList!.isNotEmpty) { if (entity.data!.itemList!.isNotEmpty) {
state.lockOperatingRecordListData.value.addAll(entity.data!.itemList!); state.lockOperatingRecordListData.value
.addAll(entity.data!.itemList!);
pageNo++; pageNo++;
} }
} }
@ -166,8 +180,8 @@ class LockOperatingRecordLogic extends BaseGetXController {
// //
Future<void> getLockRecordLastUploadDataTime() async { Future<void> getLockRecordLastUploadDataTime() async {
final LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to final LockOperatingRecordGetLastRecordTimeEntity entity =
.getLockRecordLastUploadDataTime( await ApiRepository.to.getLockRecordLastUploadDataTime(
lockId: CommonDataManage().currentKeyInfo.lockId.toString()); lockId: CommonDataManage().currentKeyInfo.lockId.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.operateDate = entity.data!.operateDate! ~/ 1000; state.operateDate = entity.data!.operateDate! ~/ 1000;
@ -179,7 +193,9 @@ class LockOperatingRecordLogic extends BaseGetXController {
// //
Future<void> lockRecordUploadData(List list) async { Future<void> lockRecordUploadData(List list) async {
final KeyOperationRecordEntity entity = await ApiRepository.to final KeyOperationRecordEntity entity = await ApiRepository.to
.lockRecordUploadData(lockId: CommonDataManage().currentKeyInfo.lockId.toString(), records: list); .lockRecordUploadData(
lockId: CommonDataManage().currentKeyInfo.lockId.toString(),
records: list);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (state.ifHaveNext == true) { if (state.ifHaveNext == true) {
getLockRecordLastUploadDataTime(); getLockRecordLastUploadDataTime();
@ -192,7 +208,9 @@ class LockOperatingRecordLogic extends BaseGetXController {
// //
Future<void> clearOperationRecordRequest() async { Future<void> clearOperationRecordRequest() async {
final KeyOperationRecordEntity entity = await ApiRepository.to.clearOperationRecord(CommonDataManage().currentKeyInfo.lockId.toString()); final KeyOperationRecordEntity entity = await ApiRepository.to
.clearOperationRecord(
CommonDataManage().currentKeyInfo.lockId.toString());
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('清除数据成功', something: () { showToast('清除数据成功', something: () {
pageNo = 1; pageNo = 1;