Merge remote-tracking branch 'origin/develop' into develop_liyi
This commit is contained in:
commit
1ffcf02cad
@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
||||
@ -68,34 +69,38 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
final List uploadList = [];
|
||||
for (int i = 0; i < getList.length; i++) {
|
||||
final List<int> indexList = getList[i];
|
||||
// AppLog.log("indexList:$indexList");
|
||||
final Map indexMap = {};
|
||||
indexMap['type'] = indexList[0].toString();
|
||||
try {
|
||||
// AppLog.log("indexList:$indexList");
|
||||
final Map indexMap = {};
|
||||
indexMap['type'] = indexList[0].toString();
|
||||
|
||||
final int userNo = (indexList[1] * 256) + indexList[2];
|
||||
indexMap['user'] = userNo.toString();
|
||||
// AppLog.log('userNouserNouserNouserNo:$userNo');
|
||||
final int userNo = (indexList[1] * 256) + indexList[2];
|
||||
indexMap['user'] = userNo.toString();
|
||||
// AppLog.log('userNouserNouserNouserNo:$userNo');
|
||||
|
||||
final List<int> passwordData = indexList.sublist(7, 17);
|
||||
final String password = utf8String(passwordData);
|
||||
indexMap['password'] = password.toString();
|
||||
// AppLog.log('passwordpasswordpassword:$password');
|
||||
final List<int> passwordData = indexList.sublist(7, 17);
|
||||
final String password = utf8String(passwordData);
|
||||
indexMap['password'] = password.toString();
|
||||
// AppLog.log('passwordpasswordpassword:$password');
|
||||
|
||||
indexMap['success'] = '1';
|
||||
indexMap['success'] = '1';
|
||||
|
||||
final int time = (0xff & indexList[3]) << 24 |
|
||||
(0xff & indexList[4]) << 16 |
|
||||
(0xff & indexList[5]) << 8 |
|
||||
(0xFF & indexList[6]);
|
||||
final int operateDate = time * 1000;
|
||||
final int serverTime = state.currentDate;
|
||||
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
|
||||
DateTime.fromMillisecondsSinceEpoch(serverTime * 1000))) {
|
||||
// AppLog.log('operateDate:$operateDate state.currentDate:${state.currentDate}');
|
||||
continue;
|
||||
final int time = (0xff & indexList[3]) << 24 |
|
||||
(0xff & indexList[4]) << 16 |
|
||||
(0xff & indexList[5]) << 8 |
|
||||
(0xFF & indexList[6]);
|
||||
final int operateDate = time * 1000;
|
||||
final int serverTime = state.currentDate;
|
||||
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
|
||||
DateTime.fromMillisecondsSinceEpoch(serverTime * 1000))) {
|
||||
// AppLog.log('operateDate:$operateDate state.currentDate:${state.currentDate}');
|
||||
continue;
|
||||
}
|
||||
indexMap['date'] = '$operateDate';
|
||||
uploadList.add(indexMap);
|
||||
} catch (e) {
|
||||
AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。');
|
||||
}
|
||||
indexMap['date'] = '$operateDate';
|
||||
uploadList.add(indexMap);
|
||||
}
|
||||
if (dataLength == state.logCountPage) {
|
||||
state.ifHaveNext = true;
|
||||
|
||||
@ -344,38 +344,43 @@ class LockDetailLogic extends BaseGetXController {
|
||||
final List uploadList = [];
|
||||
for (int i = 0; i < getList.length; i++) {
|
||||
final List<int> indexList = getList[i];
|
||||
AppLog.log('indexList:$indexList');
|
||||
final Map indexMap = {};
|
||||
indexMap['type'] = indexList[0].toString();
|
||||
try {
|
||||
AppLog.log('indexList:$indexList');
|
||||
final Map indexMap = {};
|
||||
indexMap['type'] = indexList[0].toString();
|
||||
|
||||
final int userNo = (indexList[1] * 256) + indexList[2];
|
||||
indexMap['user'] = userNo.toString();
|
||||
// AppLog.log('userNouserNouserNouserNo:$userNo');
|
||||
final int userNo = (indexList[1] * 256) + indexList[2];
|
||||
indexMap['user'] = userNo.toString();
|
||||
// AppLog.log('userNouserNouserNouserNo:$userNo');
|
||||
|
||||
final List<int> passwordData = indexList.sublist(7, 17);
|
||||
final String password = utf8String(passwordData);
|
||||
indexMap['password'] = password.toString();
|
||||
// AppLog.log('passwordpasswordpassword:$password');
|
||||
final List<int> passwordData = indexList.sublist(7, 17);
|
||||
final String password = utf8String(passwordData);
|
||||
indexMap['password'] = password.toString();
|
||||
// AppLog.log('passwordpasswordpassword:$password');
|
||||
|
||||
indexMap['success'] = '1';
|
||||
indexMap['success'] = '1';
|
||||
|
||||
final int time = (0xff & indexList[3]) << 24 |
|
||||
(0xff & indexList[4]) << 16 |
|
||||
(0xff & indexList[5]) << 8 |
|
||||
(0xFF & indexList[6]);
|
||||
int operateDate = time * 1000;
|
||||
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
|
||||
DateTime.fromMillisecondsSinceEpoch(getUTCNetTime() * 1000))) {
|
||||
continue;
|
||||
}
|
||||
final int time = (0xff & indexList[3]) << 24 |
|
||||
(0xff & indexList[4]) << 16 |
|
||||
(0xff & indexList[5]) << 8 |
|
||||
(0xFF & indexList[6]);
|
||||
int operateDate = time * 1000;
|
||||
if (DateTime.fromMillisecondsSinceEpoch(operateDate).isAfter(
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
getUTCNetTime() * 1000))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
indexMap['date'] = '$operateDate';
|
||||
uploadList.add(indexMap);
|
||||
indexMap['date'] = '$operateDate';
|
||||
uploadList.add(indexMap);
|
||||
|
||||
if (i == getList.length - 1) {
|
||||
//设置最后的时间戳
|
||||
if (i == getList.length - 1) {
|
||||
//设置最后的时间戳
|
||||
|
||||
state.operateDate = operateDate;
|
||||
state.operateDate = operateDate;
|
||||
}
|
||||
} catch (e) {
|
||||
AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。');
|
||||
}
|
||||
}
|
||||
lockRecordUploadData(uploadList);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user