完成bugly添加
This commit is contained in:
parent
e4eaa97046
commit
dbc5c0bfd5
@ -112,7 +112,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡结果,解析数据',
|
||||
detail: '添加卡结果,解析数据 _replyAddICCardConfirmation:${reply.data}',
|
||||
eventStr: '添加卡事件',
|
||||
eventStr: '添加卡事件结果',
|
||||
upload: true
|
||||
);
|
||||
|
||||
@ -201,7 +201,6 @@ class AddICCardLogic extends BaseGetXController{
|
||||
token: getTokenList,
|
||||
).toString();
|
||||
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
@ -214,7 +213,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件',
|
||||
eventStr: '添加卡事件超时',
|
||||
upload: true
|
||||
);
|
||||
|
||||
@ -256,7 +255,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件',
|
||||
eventStr: '添加卡事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import '../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../blue/sender_manage.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../tools/baseGetXController.dart';
|
||||
import '../../../tools/bugly/bugly_tool.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||
|
||||
@ -39,6 +40,13 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
|
||||
// 根据时间查解析数据
|
||||
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
||||
BuglyTool.uploadException(
|
||||
message: '查询锁记录结果,解析数据',
|
||||
detail: '查询锁记录结果,解析数据:${reply.data}',
|
||||
eventStr: '查询锁记录事件结果',
|
||||
upload: true
|
||||
);
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
final int status = reply.data[2];
|
||||
|
||||
@ -108,6 +116,28 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
|
||||
// 查询事件记录(时间查询)
|
||||
Future<void> senderReferEventRecordTime() async {
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
final String command = SenderReferEventRecordTimeCommand(
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
userID: await Storage.getUid(),
|
||||
logsCount: state.logCountPage,
|
||||
// time:DateTime.now().millisecondsSinceEpoch~/1000,
|
||||
time: state.operateDate,
|
||||
currentDate: state.currentDate,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList,
|
||||
).toString();
|
||||
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
dismissEasyLoading();
|
||||
@ -119,22 +149,26 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'open_lock_result':'超时',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '查询锁记录超时-查询锁记录失败',
|
||||
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
||||
eventStr: '查询锁记录事件超时',
|
||||
upload: true
|
||||
);
|
||||
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionStateState) async {
|
||||
if (connectionStateState == BluetoothConnectionState.connected) {
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
final List<String>? publicKey =
|
||||
await Storage.getStringList(saveBluePublicKey);
|
||||
final List<int> getPublicKeyList =
|
||||
changeStringListToIntList(publicKey!);
|
||||
final List<String>? publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
final List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderReferEventRecordTimeCommand(
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
@ -161,6 +195,12 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
'open_lock_result':'断开连接',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '查询锁记录超时-查询锁记录失败',
|
||||
detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command',
|
||||
eventStr: '查询锁记录事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
@ -238,9 +278,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
if(list.isEmpty){
|
||||
return;
|
||||
}
|
||||
final KeyOperationRecordEntity entity = await ApiRepository.to
|
||||
.lockRecordUploadData(
|
||||
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
||||
final KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(lockId: state.keyInfos.value.lockId.toString(), records: list);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (state.ifHaveNext == true) {
|
||||
|
||||
@ -212,8 +212,8 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加指纹确认结果,解析数据',
|
||||
detail: '添加指纹确认结果,解析数据 _replyAddFingerprintConfirmation:${reply.data}',
|
||||
eventStr: '添加指纹事件',
|
||||
detail: '添加指纹确认结果蓝牙返回失败结果,解析数据 _replyAddFingerprintConfirmation:${reply.data}',
|
||||
eventStr: '添加指纹事件蓝牙返回失败结果',
|
||||
upload: true
|
||||
);
|
||||
state.ifAddState.value = false;
|
||||
@ -264,7 +264,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
BuglyTool.uploadException(
|
||||
message: '添加指纹超时处理-添加指纹失败',
|
||||
detail: '添加指纹超时处理,断开连接,添加指纹失败--SenderAddFingerprintWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加指纹事件',
|
||||
eventStr: '添加指纹事件超时',
|
||||
upload: true
|
||||
);
|
||||
Get.close(1);
|
||||
@ -312,7 +312,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
BuglyTool.uploadException(
|
||||
message: '添加指纹断开连接-添加指纹失败',
|
||||
detail: '添加指纹断开连接-添加指纹失败--SenderAddFingerprintWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加指纹事件',
|
||||
eventStr: '添加指纹事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
|
||||
@ -376,8 +376,8 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString());
|
||||
BuglyTool.uploadException(
|
||||
message: '添加指纹调用接口成功',
|
||||
detail: '添加指纹调用接口成功 - ',
|
||||
eventStr: '添加指纹事件',
|
||||
detail: '添加指纹调用接口成功',
|
||||
eventStr: '添加指纹事件用接口成功',
|
||||
upload: true
|
||||
);
|
||||
}else{
|
||||
@ -385,7 +385,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
BuglyTool.uploadException(
|
||||
message: '添加指纹调用接口失败',
|
||||
detail: '添加指纹调用接口添加指纹调用接口失败 - ${entity.errorMsg}',
|
||||
eventStr: '添加指纹事件',
|
||||
eventStr: '添加指纹事件接口失败',
|
||||
upload: true
|
||||
);
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/bugly/bugly_tool.dart';
|
||||
import '../../../../tools/commonDataManage.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
@ -243,11 +244,16 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 设置自定义密码
|
||||
if ((reply is SenderCustomPasswordsReply) &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
if ((reply is SenderCustomPasswordsReply) && (state.ifCurrentScreen.value == true)) {
|
||||
BuglyTool.uploadException(
|
||||
message: '添加密码结果,解析数据',
|
||||
detail: '添加密码结果,解析数据:${reply.data}',
|
||||
eventStr: '添加密码事件结果',
|
||||
upload: true
|
||||
);
|
||||
|
||||
final int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
@ -384,6 +390,32 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
}
|
||||
state.sureBtnState.value = 1;
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
final String command = SenderCustomPasswordsCommand(
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: 0,
|
||||
pwd: state.pwdController.text,
|
||||
operate: 0,
|
||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: startDate ~/ 1000,
|
||||
endTime: endDate ~/ 1000,
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList
|
||||
).toString();
|
||||
|
||||
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
@ -394,20 +426,24 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
'add_password_result':'添加自定义密码超时',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加密码超时处理-添加密码失败',
|
||||
detail: '添加密码超时,添加密码失败--senderCustomPasswordsCommand:$command',
|
||||
eventStr: '添加密码事件超时',
|
||||
upload: true
|
||||
);
|
||||
|
||||
dismissEasyLoading();
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? signKey =
|
||||
await Storage.getStringList(saveBlueSignKey);
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
@ -436,6 +472,13 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
'add_password_result':'添加自定义密码断开',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加密码断开-添加密码失败',
|
||||
detail: '添加密码断开,添加密码失败--senderCustomPasswordsCommand:$command',
|
||||
eventStr: '添加密码事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user