修复添加指纹bug,删除多余引入,人脸模块添加是否是管理员功能,number改为2字节

This commit is contained in:
魏少阳 2024-05-04 17:57:39 +08:00
parent 24fac59ac4
commit c559a37197
33 changed files with 168 additions and 124 deletions

View File

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:get/get.dart';
import 'package:star_lock/tools/dateTool.dart';
import '../../app_settings/app_settings.dart';
import '../io_tool/io_tool.dart';
@ -21,6 +22,8 @@ class SenderAddFaceCommand extends SenderProtocol {
int? faceNo;
int? useCountLimit;
int? isForce;
int? operate;
int? isAdmin;
List<int>? token;
int? isRound;
int? weekRound;
@ -37,6 +40,8 @@ class SenderAddFaceCommand extends SenderProtocol {
this.userID,
this.faceNo,
this.useCountLimit,
this.operate,
this.isAdmin,
this.isForce,
this.token,
this.isRound,
@ -85,6 +90,14 @@ class SenderAddFaceCommand extends SenderProtocol {
// UseCountLimit
subData.addAll(intChangList(useCountLimit!));
// Operate 0: 1 2: 3
subData.add(operate!);
AppLog.log("addFingerprint operate:$operate");
// isAdmin
subData.add(isAdmin!);
AppLog.log("addFingerprint isAdmin:$isAdmin");
// isForce
subData.add(isForce!);
@ -108,6 +121,7 @@ class SenderAddFaceCommand extends SenderProtocol {
subData.add((endDate! & 0xff0000) >> 16);
subData.add((endDate! & 0xff00) >> 8);
subData.add((endDate! & 0xff));
AppLog.log("addFingerprint startDate:${DateTool().dateToYMDHNString(startDate.toString())} endDate:${DateTool().dateToYMDHNString(endDate.toString())}");
// startTime 4
List<int> startTimeList = [0,0,0,0];

View File

@ -496,6 +496,8 @@ class IoSenderManage {
required int? faceNo,
required int? useCountLimit,
required int? isForce,
required int? operate,
required int? isAdmin,
required List<int>? token,
required int? isRound,
required int? weekRound,
@ -514,6 +516,8 @@ class IoSenderManage {
faceNo: faceNo,
useCountLimit: useCountLimit,
isForce: isForce,
operate: operate,
isAdmin: isAdmin,
token: token,
isRound: isRound,
weekRound: weekRound,

View File

@ -139,7 +139,6 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
state.isDeletAll = false;
state.deletKeyID = fingerprintItemData.cardId.toString();
state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
state.fingerprintDeletItem = fingerprintItemData;
logic.senderAddICCard();
});
},

View File

@ -12,7 +12,7 @@ class CardListState {
var deletCardNo = 0;
final fingerprintItemListData = <FingerprintItemData>[].obs;
var fingerprintDeletItem = FingerprintItemData();
// var fingerprintDeletItem = FingerprintItemData();
final TextEditingController searchController = TextEditingController();
var ifCurrentScreen = true.obs; // ,

View File

@ -71,7 +71,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
keyID:state.fingerprintItemData.value.cardId!.toString(),
userID:await Storage.getUid(),
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
useCountLimit:0xff,
useCountLimit:0xffff,
operate: 1, // 0: 1 2: 3
isAdmin:state.fingerprintItemData.value.faceRight!,
isForce:state.fingerprintItemData.value.isCoerced, //
isRound:0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), //
@ -118,7 +120,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
keyID:state.fingerprintItemData.value.cardId!.toString(),
userID:await Storage.getUid(),
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
useCountLimit:0xff,
useCountLimit:0xffff,
operate: 1, // 0: 1 2: 3
isAdmin:state.fingerprintItemData.value.faceRight!,
isForce:state.fingerprintItemData.value.isCoerced, //
isRound:0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), //
@ -419,6 +423,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
faceName: state.fingerprintItemData.value.faceName!,
addType: "1",
isCoerced: state.fingerprintItemData.value.isCoerced!,
faceRight: state.fingerprintItemData.value.faceRight!,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: () {

View File

@ -73,7 +73,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
keyID:state.fingerprintItemData.value.cardId!.toString(),
userID:await Storage.getUid(),
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
useCountLimit:0xff,
useCountLimit:0xffff,
operate: 1, // 0: 1 2: 3
isAdmin:state.fingerprintItemData.value.faceRight!,
isForce:state.fingerprintItemData.value.isCoerced, //
isRound:1, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
@ -120,7 +122,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
keyID:state.fingerprintItemData.value.cardId!.toString(),
userID:await Storage.getUid(),
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
useCountLimit:0xff,
useCountLimit:0xffff,
operate: 1, // 0: 1 2: 3
isAdmin:state.fingerprintItemData.value.faceRight!,
isForce:state.fingerprintItemData.value.isCoerced, //
isRound:1, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
@ -174,7 +178,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
useCountLimit:0xffff,
operate: 1, // 0: 1 2: 3
isAdmin:state.fingerprintItemData.value.isCoerced!,
isAdmin:state.fingerprintItemData.value.cardRight!,
isForce:state.fingerprintItemData.value.isCoerced, //
isRound:1, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
@ -329,7 +333,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
useCountLimit:0xffff,
operate: 1, // 0: 1 2: 3
isAdmin:state.fingerprintItemData.value.isCoerced!,
isAdmin:state.fingerprintItemData.value.cardRight!,
isForce:state.fingerprintItemData.value.isCoerced, //
isRound:1, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
@ -397,7 +401,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
startTime: state.starTimeTimestamp.value,
endTime: state.endTimeTimestamp.value,
cardType: state.fingerprintItemData.value.cardType!,
cardRight: state.fingerprintItemData.value.cardRight!
cardRight: state.fingerprintItemData.value.cardRight!,
);
if(entity.errorCode!.codeIsSuccessful){
showToast("修改成功".tr, something: (){
@ -427,6 +431,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
faceName: state.fingerprintItemData.value.faceName!,
addType: "1",
isCoerced: state.fingerprintItemData.value.isCoerced!,
faceRight: state.fingerprintItemData.value.faceRight!,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: () {

View File

@ -67,9 +67,11 @@ class AddFaceLogic extends BaseGetXController {
IoSenderManage.senderAddFaceCommand(
keyID:"1",
userID:await Storage.getUid(),
faceNo:state.isAdministrator.value == "2" ? 254 : 0,
useCountLimit:0xff,
faceNo:0,
useCountLimit:0xffff,
isForce:state.isCoerced.value == "2" ? 1 : 0, //
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
operate: 0,
isRound:state.selectType.value == "2" ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
startDate: int.parse(state.startDate.value)~/1000,
@ -164,9 +166,11 @@ class AddFaceLogic extends BaseGetXController {
IoSenderManage.senderAddFaceCommand(
keyID:"1",
userID:await Storage.getUid(),
faceNo:state.isAdministrator.value == "2" ? 254 : 0,
useCountLimit:0xff,
faceNo:0,
useCountLimit:0xffff,
isForce:state.isCoerced.value == "2" ? 1 : 0, //
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
operate: 0,
isRound:state.selectType.value == "2" ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
startDate: int.parse(state.startDate.value)~/1000,

View File

@ -40,6 +40,11 @@ class FaceDetailLogic extends BaseGetXController {
state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
if(state.isDeletFace.value == true){
deletFaceData();
}else{
editFaceData();
}
deletFaceData();
break;
case 0x06:
@ -58,7 +63,9 @@ class FaceDetailLogic extends BaseGetXController {
keyID:state.keyId.value.toString(),
userID:await Storage.getUid(),
faceNo:int.parse(state.typeNumber.value),
useCountLimit:state.isDeletFace.value == true ? 0 : 0xff,
useCountLimit:0xffff,
operate:state.isDeletFace.value ? 2 : 1, // 0: 1 2: 3
isAdmin:state.isAdministrator.value == true ? 1 : 0,
isForce:state.isStressFace.value == true ? 1 : 0, //
isRound:state.keyType.value == 4 ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
@ -106,7 +113,9 @@ class FaceDetailLogic extends BaseGetXController {
keyID:state.keyId.value.toString(),
userID:await Storage.getUid(),
faceNo:int.parse(state.typeNumber.value),
useCountLimit:state.isDeletFace.value == true ? 0 : 0xff,
useCountLimit:0xffff,
operate:state.isDeletFace.value ? 2 : 1, // 0: 1 2: 3
isAdmin:state.isAdministrator.value == true ? 1 : 0,
isForce:state.isStressFace.value == true ? 1 : 0, //
isRound:state.keyType.value == 4 ? 1: 0, //
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), //
@ -173,6 +182,7 @@ class FaceDetailLogic extends BaseGetXController {
faceName: state.changeNameController.text,
addType: "1",
isCoerced: state.isStressFace.value ? 2 : 1,
faceRight: state.isAdministrator.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: () {

View File

@ -174,7 +174,15 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
isHaveLine: true,
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFace()))),
Obx(() => CommonItem(
leftTitel: "是否是管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: _isAdmin()))),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
@ -223,6 +231,21 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
);
}
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: state.isAdministrator.value,
onChanged: (value) {
state.isAdministrator.value = value;
state.isDeletFace.value = false;
logic.senderAddFace();
},
);
}
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies

View File

@ -23,6 +23,7 @@ class FaceDetailState {
var sureBtnState = 0.obs; // 0() 1()
var isDeletFace = true.obs;//
var isStressFace = false.obs;//
var isAdministrator = false.obs;//
FaceDetailState() {
Map map = Get.arguments;
@ -40,5 +41,6 @@ class FaceDetailState {
addTime.value = faceItemData.value.createDate!;
weekDay.value = faceItemData.value.cyclicConfig!;
isStressFace.value = faceItemData.value.isCoerced! == 2 ? true : false;
isAdministrator.value = faceItemData.value.faceRight! == 1 ? true : false;
}
}

View File

@ -1,11 +1,9 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
import 'package:star_lock/blue/io_type.dart';
import 'package:star_lock/main/lockDetail/face/faceList/faceList_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../blue/blue_manage.dart';
@ -29,7 +27,7 @@ class FaceListLogic extends BaseGetXController {
_replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((reply) {
// ()
if ((reply is SenderAddFaceReply) && (state.isDeletFaceData == true)) {
if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen == true)) {
_replyAddFaceBegin(reply);
}
@ -51,7 +49,6 @@ class FaceListLogic extends BaseGetXController {
switch (status) {
case 0x00:
//
state.isDeletFaceData = false;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
if (state.isDeletAll == false) {
@ -74,9 +71,11 @@ class FaceListLogic extends BaseGetXController {
IoSenderManage.senderAddFaceCommand(
keyID:state.deletKeyID,
userID:state.deletUserID,
userID:(await Storage.getUid())!,
faceNo:state.deletFaceNo,
useCountLimit:0,
useCountLimit:0xffff,
operate: state.isDeletAll == true ? 3 : 2, // 0: 1 2: 3
isAdmin:0,
isForce:0, //
isRound:0, //
weekRound:0, //
@ -283,9 +282,11 @@ class FaceListLogic extends BaseGetXController {
IoSenderManage.senderAddFaceCommand(
keyID:state.deletKeyID,
userID:state.deletUserID,
userID:(await Storage.getUid())!,
faceNo:state.deletFaceNo,
useCountLimit:0,
useCountLimit:0xffff,
operate: state.isDeletAll == true ? 3 : 2, // 0: 1 2: 3
isAdmin:0,
isForce:0, //
isRound:0, //
weekRound:0, //
@ -298,19 +299,6 @@ class FaceListLogic extends BaseGetXController {
privateKey:getPrivateKeyList,
token: getTokenList,
);
// IoSenderManage.senderAddFaceCommand(
// keyID: state.deletKeyID,
// userID: state.deletUserID,
// faceNo: state.deletFaceNo,
// useCountLimit: 0,
// startTime: 0x11223344,
// endTime: 0x11223344,
// needAuthor: 1,
// publicKey: publicKeyDataList,
// privateKey: getPrivateKeyList,
// token: getTokenList,
// );
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer();
@ -348,7 +336,6 @@ class FaceListLogic extends BaseGetXController {
);
if (entity.errorCode!.codeIsSuccessful) {
showToast("删除成功");
state.isDeletFaceData = false;
getFaceListData();
}
}
@ -366,7 +353,6 @@ class FaceListLogic extends BaseGetXController {
);
if (entity.errorCode!.codeIsSuccessful) {
showToast("重置成功");
state.isDeletFaceData = false;
getFaceListData();
}
}

View File

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
@ -9,8 +10,8 @@ import 'package:star_lock/tools/showTipView.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/noData.dart';
import '../../../../tools/showIosTipView.dart';
import '../../../../tools/storage.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
@ -24,7 +25,7 @@ class FaceListPage extends StatefulWidget {
State<FaceListPage> createState() => _FaceListPageState();
}
class _FaceListPageState extends State<FaceListPage> {
class _FaceListPageState extends State<FaceListPage> with RouteAware {
final logic = Get.put(FaceListLogic());
final state = Get.find<FaceListLogic>().state;
@ -47,11 +48,10 @@ class _FaceListPageState extends State<FaceListPage> {
if (isDemoMode == false) {
// showDeletAlertDialog(context);
ShowTipView().showIosTipWithContentDialog("重置后,该锁的人脸都将被删除哦,确认要重置吗?", () async {
state.isDeletFaceData = true;
state.isDeletAll = true;
state.deletKeyID = "1";
state.deletUserID = "DeleteAll!@#";
state.deletFaceNo = 255;
state.deletFaceNo = 0;
logic.senderAddFace();
});
} else {
@ -144,12 +144,11 @@ class _FaceListPageState extends State<FaceListPage> {
return GestureDetector(
onTap: () {
// :
state.deletKeyID = faceItemData.faceId.toString();
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
state.isDeletFaceData = true;
state.isDeletAll = false;
state.deletUserID = (await Storage.getUid())!;
state.deletKeyID = faceItemData.faceId.toString();
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
logic.senderAddFace();
});
// showIosTipViewDialog(context);
@ -263,36 +262,52 @@ class _FaceListPageState extends State<FaceListPage> {
);
}
// void showDeletAlertDialog(BuildContext context) {
// showCupertinoDialog(
// context: context,
// builder: (context) {
// return CupertinoAlertDialog(
// title: const Text("提示"),
// content: const Text('重置后,该锁的人脸都将被删除哦,确认要重置吗?'),
// actions: [
// CupertinoDialogAction(
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
// onPressed: () {
// Navigator.pop(context);
// },
// ),
// CupertinoDialogAction(
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
// onPressed: () {
// Navigator.pop(context);
// state.isDeletFaceData = true;
// state.isDeletAll = true;
// state.deletKeyID = "1";
// state.deletUserID = "DeleteAll!@#";
// state.deletFaceNo = 255;
// logic.senderAddFace();
// },
// ),
// ],
// );
// },
// );
// }
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
///
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
}
@override
void dispose() {
// TODO: implement dispose
///
AppRouteObserver().routeObserver.unsubscribe(this);
super.dispose();
}
///
@override
void didPush() {
super.didPush();
state.ifCurrentScreen.value = true;
}
///
@override
void didPop() {
super.didPop();
logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
state.ifCurrentScreen.value = false;
}
///
@override
void didPopNext() {
super.didPopNext();
state.ifCurrentScreen.value = true;
}
///
@override
void didPushNext() {
super.didPushNext();
logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
state.ifCurrentScreen.value = false;
}
}

View File

@ -7,10 +7,8 @@ class FaceListState {
final lockId = 0.obs;
//
var isDeletFaceData = false;
var isDeletAll = false;
var deletKeyID = "";
var deletUserID = "DeleteAll!@#";
var deletFaceNo = 0;
final faceItemListData = <FingerprintItemData>[].obs;

View File

@ -1,7 +1,6 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_settings.dart';

View File

@ -28,7 +28,7 @@ class FingerprintListLogic extends BaseGetXController{
void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
// ()
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.isDeletFingerprintData == true)) {
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
_replyAddFingerprintBegin(reply);
}
@ -50,7 +50,6 @@ class FingerprintListLogic extends BaseGetXController{
switch(status){
case 0x00:
//
state.isDeletFingerprintData = false;
cancelBlueConnetctToastTimer();
dismissEasyLoading();
deletAllFingerprintsData();
@ -332,13 +331,11 @@ class FingerprintListLogic extends BaseGetXController{
if(entity.errorCode!.codeIsSuccessful){
if(state.isDeletAll == false){
showToast("删除成功".tr, something:(){
state.isDeletFingerprintData = false;
pageNo = 1;
getFingerprintsListData();
});
}else{
showToast("重置成功".tr, something:(){
state.isDeletFingerprintData = false;
pageNo = 1;
getFingerprintsListData();
});

View File

@ -69,10 +69,9 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
ShowTipView().showIosTipWithContentDialog("重置后,该锁的指纹都将被删除哦,确认要重置吗?".tr, () async {
state.isDeletFingerprintData = true;
state.isDeletAll = true;
state.deletKeyID = "1";
state.deletFingerNo = 255;
state.deletFingerNo = 0;
logic.senderAddFingerprint();
});
} else {
@ -141,9 +140,9 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
SlidableAction(
onPressed: (BuildContext context){
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
state.isDeletFingerprintData = true;
state.isDeletAll = false;
state.deletKeyID = fingerprintItemData.fingerprintId.toString();
state.deletFingerNo = int.parse(fingerprintItemData.faceNumber!);
logic.senderAddFingerprint();
});
},

View File

@ -8,7 +8,6 @@ class FingerprintListState{
final lockId = 0.obs;
//
var isDeletFingerprintData = false;
var isDeletAll = false;
var deletKeyID = "0";
var deletFingerNo = 0;

View File

@ -586,15 +586,6 @@ class LockDetailLogic extends BaseGetXController {
await PermissionDialog.request(Permission.location);
await PermissionDialog.requestBluetooth();
var vendorStr = utf8String([84, 77, 72, 95, 100, 99, 56, 102, 57, 50,
56, 51, 54, 57, 101, 100, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]);
AppLog.log("LockID :$vendorStr");
var userID = utf8String([51, 50, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
AppLog.log("userID :$userID");
}
}

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
import '../../../blue/blue_manage.dart';

View File

@ -1,7 +1,6 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';

View File

@ -1,15 +1,12 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_type.dart';
import '../../../../../blue/blue_manage.dart';
import '../../../../../blue/io_protocol/io_changeAdministratorPassword.dart';
import '../../../../../blue/io_protocol/io_readAdminPassword.dart';
import '../../../../../blue/io_protocol/io_senderCustomPasswords.dart';
import '../../../../../blue/io_reply.dart';
import '../../../../../blue/io_tool/io_tool.dart';
import '../../../../../blue/io_tool/manager_event_bus.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';

View File

@ -3,7 +3,6 @@ import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
import 'package:star_lock/tools/baseGetXController.dart';

View File

@ -2,7 +2,6 @@
import 'dart:async';
import 'dart:io';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:network_info_plus/network_info_plus.dart';

View File

@ -1,7 +1,6 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_getWifiList.dart';

View File

@ -1,8 +1,6 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';

View File

@ -1,6 +1,5 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/talk/udp/udp_manage.dart';

View File

@ -1,7 +1,6 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/resetButton/resetButton_state.dart';

View File

@ -103,7 +103,8 @@ class PasswordKeyDetailLogic extends BaseGetXController {
hoursStart: state.itemData.value.hoursStart!,
hoursEnd: state.itemData.value.hoursEnd!,
isCoerced: state.itemData.value.isCoerced!.toString(),
keyboardPwdType: state.itemData.value.keyboardPwdType!);
keyboardPwdType: state.itemData.value.keyboardPwdType!,
pwdRight: state.isAdministrator.value == true ? 1 : 0);
if (entity.errorCode!.codeIsSuccessful) {
Get.back();
showToast("修改成功".tr, something: (){

View File

@ -97,7 +97,8 @@ class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
hoursStart: state.itemData.value.hoursStart!,
hoursEnd: state.itemData.value.hoursEnd!,
isCoerced: "1",
keyboardPwdType: 3);
keyboardPwdType: 3,
pwdRight: state.itemData.value.pwdRight!);
if (entity.errorCode!.codeIsSuccessful) {
showToast("修改成功", something: (){
eventBus.fire(GetPasswordListRefreshUI());

View File

@ -1,7 +1,4 @@
import 'dart:typed_data';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';

View File

@ -489,7 +489,8 @@ class ApiProvider extends BaseProvider {
String isCoerced,
int hoursStart,
int hoursEnd,
int keyboardPwdType) =>
int keyboardPwdType,
int pwdRight) =>
post(
updatePasswordKeyURL.toUrl,
jsonEncode({
@ -503,7 +504,8 @@ class ApiProvider extends BaseProvider {
'isCoerced': isCoerced,
'hoursStart': hoursStart,
'hoursEnd': hoursEnd,
"keyboardPwdType": keyboardPwdType
"keyboardPwdType": keyboardPwdType,
"pwdRight": pwdRight
}));
Future<Response> clearOperationRecord(String lockId) =>
@ -1245,7 +1247,8 @@ class ApiProvider extends BaseProvider {
List weekDay,
String faceName,
String addType,
int isCoerced) =>
int isCoerced,
int faceRight) =>
post(
updateFaceUserInfoURL.toUrl,
jsonEncode({
@ -1260,6 +1263,7 @@ class ApiProvider extends BaseProvider {
'faceName': faceName,
'addType': addType,
"isCoerced": isCoerced,
"faceRight": faceRight
}));
//

View File

@ -503,7 +503,8 @@ class ApiRepository {
required String isCoerced,
required int hoursStart,
required int hoursEnd,
required int keyboardPwdType}) async {
required int keyboardPwdType,
required int pwdRight}) async {
final res = await apiProvider.updateKeyboardPwd(
lockId,
keyboardPwdId,
@ -515,7 +516,8 @@ class ApiRepository {
isCoerced,
hoursStart,
hoursEnd,
keyboardPwdType);
keyboardPwdType,
pwdRight);
return PasswordKeyEntity.fromJson(res.body);
}
@ -1410,7 +1412,8 @@ class ApiRepository {
required List weekDay,
required String faceName,
required String addType,
required int isCoerced}) async {
required int isCoerced,
required int faceRight}) async {
final res = await apiProvider.updateFaceValidity(
faceId,
lockId,
@ -1422,7 +1425,8 @@ class ApiRepository {
weekDay,
faceName,
addType,
isCoerced);
isCoerced,
faceRight);
return LoginEntity.fromJson(res.body);
}