1,新增人脸部分命令协议调试
2,新增人脸相关接口处理 更新人脸信息、删除人脸、清空人脸(未完成) 3,部分人脸详情处理(待完善)
This commit is contained in:
parent
6e88b01f6d
commit
a5817cffeb
BIN
star_lock/images/icon_face.png
Normal file
BIN
star_lock/images/icon_face.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
@ -10,7 +10,7 @@ import 'package:crypto/crypto.dart' as crypto;
|
||||
///TODO:添加人脸
|
||||
/*
|
||||
备注:
|
||||
删除单个人脸规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
||||
删除单个人脸规则:UseCountLimit 设置为 0。删除全部人脸规则: UseCountLimit 设置为 0,FaceNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
||||
**/
|
||||
class SenderAddFaceCommand extends SenderProtocol {
|
||||
String? keyID;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
//TODO:查询指纹状态
|
||||
//TODO:查询人脸状态
|
||||
import 'dart:convert';
|
||||
|
||||
import '../io_reply.dart';
|
||||
@ -12,8 +12,8 @@ class SenderQueryingFaceStatusCommand extends SenderProtocol {
|
||||
String? keyID;
|
||||
String? userID;
|
||||
int? role;
|
||||
int? fingerCount;
|
||||
int? fingerNo;
|
||||
int? faceCount;
|
||||
int? faceNo;
|
||||
List<int>? token;
|
||||
int? needAuthor;
|
||||
List<int>? publicKey;
|
||||
@ -23,8 +23,8 @@ class SenderQueryingFaceStatusCommand extends SenderProtocol {
|
||||
this.keyID,
|
||||
this.userID,
|
||||
this.role,
|
||||
this.fingerCount,
|
||||
this.fingerNo,
|
||||
this.faceCount,
|
||||
this.faceNo,
|
||||
this.token,
|
||||
this.needAuthor,
|
||||
this.publicKey,
|
||||
@ -62,10 +62,10 @@ class SenderQueryingFaceStatusCommand extends SenderProtocol {
|
||||
subData.add(role!);
|
||||
|
||||
// fingerCount
|
||||
subData.add(fingerCount!);
|
||||
subData.add(faceCount!);
|
||||
|
||||
// FingerNo
|
||||
subData.add(fingerNo!);
|
||||
subData.add(faceNo!);
|
||||
|
||||
if (needAuthor == 0) {
|
||||
//AuthCodeLen 1
|
||||
|
||||
@ -568,8 +568,8 @@ class IoSenderManage {
|
||||
{required String? keyID,
|
||||
required String? userID,
|
||||
required int? role,
|
||||
required int? fingerCount,
|
||||
required int? fingerNo,
|
||||
required int? faceCount,
|
||||
required int? faceNo,
|
||||
required List<int>? token,
|
||||
required int? needAuthor,
|
||||
required List<int>? publicKey,
|
||||
@ -580,8 +580,8 @@ class IoSenderManage {
|
||||
keyID: keyID,
|
||||
userID: userID,
|
||||
role: role,
|
||||
fingerCount: fingerCount,
|
||||
fingerNo: fingerNo,
|
||||
faceCount: faceCount,
|
||||
faceNo: faceNo,
|
||||
token: token,
|
||||
needAuthor: needAuthor,
|
||||
publicKey: publicKey,
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
class AddFaceEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
AddFaceEntity({this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
AddFaceEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? faceId;
|
||||
|
||||
Data({this.faceId});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
faceId = json['faceId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['faceId'] = faceId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -24,7 +24,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加指纹开始
|
||||
// 添加人脸开始
|
||||
if (reply is SenderAddFaceReply) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
@ -105,14 +105,14 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
Future<void> _replyAddFaceProcess(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("33 status:$status");
|
||||
print("******33 status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 注册人脸过程数据解析成功");
|
||||
if (reply.data[5] == 255) {
|
||||
// 注册指纹失败
|
||||
// 注册人脸失败
|
||||
print("${reply.commandType!.typeValue} 注册人脸过程失败");
|
||||
showToast("添加失败");
|
||||
Get.close(2);
|
||||
@ -121,7 +121,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
// 当前注册数
|
||||
state.regIndex.value = reply.data[6];
|
||||
print("state.regIndex.value:${state.regIndex.value}");
|
||||
print("注册人脸过程state.regIndex.value:${state.regIndex.value}");
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
@ -203,6 +203,8 @@ class AddFaceLogic extends BaseGetXController {
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print(
|
||||
"openDoorTokenPubToken:$getTokenList state.startDate.value:${state.startDate.value}");
|
||||
print(
|
||||
"限时人脸开始时间:${state.startDate.value ~/ 1000} 限时人脸结束时间:${state.endDate.value ~/ 1000}");
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID: "1",
|
||||
@ -244,23 +246,25 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// Toast.show(msg: "添加成功");
|
||||
updateFaceUserNoLoadData(entity.data!.fingerprintId.toString());
|
||||
print('更新人脸用户账号成功了么1');
|
||||
updateFaceUserNoLoadData(entity.data!.faceId!);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新人脸用户账号
|
||||
void updateFaceUserNoLoadData(String faceId) async {
|
||||
var entity = await ApiRepository.to.updateFaceUserNoLoadData(
|
||||
void updateFaceUserNoLoadData(int faceId) async {
|
||||
var entity = await ApiRepository.to.updateFaceUserNo(
|
||||
faceId: faceId,
|
||||
lockId: state.lockId.value.toString(),
|
||||
lockId: state.lockId.value,
|
||||
faceUserNo: state.faceNumber.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('更新人脸用户账号成功了么2');
|
||||
showToast("添加成功");
|
||||
if (state.fromType.value == 2) {
|
||||
// 回调人脸号
|
||||
eventBus
|
||||
.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(faceId));
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
|
||||
faceId.toString()));
|
||||
} else if (state.fromType.value == 1) {
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
|
||||
@ -33,12 +33,14 @@ class _AddFacePageState extends State<AddFacePage> {
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/main/icon_addFace_step1.png',
|
||||
width: 100.w,
|
||||
height: 457.h,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Obx(() => Image.asset(
|
||||
state.isClickAddFace.value == false
|
||||
? 'images/main/icon_addFace_step1.png'
|
||||
: 'images/main/icon_addFace_step2.png',
|
||||
width: 100.w,
|
||||
height: 457.h,
|
||||
fit: BoxFit.fitHeight,
|
||||
)),
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
),
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -11,19 +10,23 @@ import '../addFaceType_page.dart';
|
||||
class AddFaceTypeManageTabbar extends StatefulWidget {
|
||||
var initialIndex = 1;
|
||||
|
||||
AddFaceTypeManageTabbar({Key? key, required this.initialIndex}) : super(key: key);
|
||||
AddFaceTypeManageTabbar({Key? key, required this.initialIndex})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
State<AddFaceTypeManageTabbar> createState() => _AddFaceTypeManageTabbarState();
|
||||
State<AddFaceTypeManageTabbar> createState() =>
|
||||
_AddFaceTypeManageTabbarState();
|
||||
}
|
||||
|
||||
class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar> with SingleTickerProviderStateMixin {
|
||||
class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
|
||||
final List<ItemView> _itemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
ItemView(
|
||||
title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
];
|
||||
|
||||
@override
|
||||
@ -34,17 +37,24 @@ class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar> with
|
||||
vsync: this,
|
||||
length: _itemTabs.length,
|
||||
initialIndex: widget.initialIndex);
|
||||
|
||||
_tabController.addListener(() {
|
||||
// print("_tabController.animation!.value:${_tabController.animation!.value} _tabController.index:${_tabController.index}");
|
||||
if (_tabController.animation!.value == _tabController.index) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
_tabBar(),
|
||||
_pageWidget(),
|
||||
],
|
||||
));
|
||||
children: [
|
||||
_tabBar(),
|
||||
_pageWidget(),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
TabBar _tabBar() {
|
||||
@ -83,7 +93,9 @@ class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar> with
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
children: _itemTabs
|
||||
.map((ItemView item) => AddFaceTypePage(selectType: item.selectType,))
|
||||
.map((ItemView item) => AddFaceTypePage(
|
||||
selectType: item.selectType,
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
|
||||
@ -69,6 +69,8 @@ class AddFaceTypeLogic extends BaseGetXController {
|
||||
faceType = 4;
|
||||
}
|
||||
|
||||
print(
|
||||
"传出去的给你限时人脸开始时间:${int.parse(startDate) ~/ 1000} 限时人脸结束时间:${int.parse(endDate) ~/ 1000}");
|
||||
// 人脸
|
||||
Get.toNamed(Routers.addFacePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -28,6 +27,8 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
state.seletType.value = widget.selectType;
|
||||
|
||||
return indexChangeWidget();
|
||||
}
|
||||
|
||||
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceDetail/faceDetail_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addFingerprint.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -22,30 +22,30 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加指纹开始(此处用作删除指纹)
|
||||
if ((reply is SenderAddFingerprintReply)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
// 添加人脸开始(此处用作删除人脸)
|
||||
if ((reply is SenderAddFaceReply)) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加指纹开始
|
||||
Future<void> _replyAddFingerprintBegin(Reply reply) async {
|
||||
// 添加人脸开始
|
||||
Future<void> _replyAddFaceBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
print("${reply.commandType!.typeValue} 删除人脸数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletFingerprintsData();
|
||||
deletFaceData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
print("${reply.commandType!.typeValue} 删除人脸需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -56,10 +56,10 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
fingerNo: int.parse(state.typeNumber.value),
|
||||
faceNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: state.effectiveDateTime.value,
|
||||
endTime: state.failureDateTime.value,
|
||||
@ -81,14 +81,14 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
print("${reply.commandType!.typeValue} 删除人脸失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 删除指纹
|
||||
Future<void> senderAddFingerprint() async {
|
||||
// 删除人脸
|
||||
Future<void> senderAddFace() async {
|
||||
if (state.sureBtnState.value == 1) {
|
||||
return;
|
||||
}
|
||||
@ -113,10 +113,10 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
fingerNo: int.parse(state.typeNumber.value),
|
||||
faceNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: state.effectiveDateTime.value,
|
||||
endTime: state.failureDateTime.value,
|
||||
@ -136,13 +136,12 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
});
|
||||
}
|
||||
|
||||
// 删除指纹
|
||||
void deletFingerprintsData() async {
|
||||
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||
fingerprintId: state.faceItemData.value.faceId.toString(),
|
||||
lockId: state.faceItemData.value.lockId.toString(),
|
||||
type: "0",
|
||||
deleteType: "1");
|
||||
// 删除人脸
|
||||
void deletFaceData() async {
|
||||
var entity = await ApiRepository.to.deleteFaceData(
|
||||
faceId: state.faceItemData.value.faceId!,
|
||||
lockId: state.faceItemData.value.lockId!,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功", something: () {
|
||||
Get.back(result: "addScuess");
|
||||
@ -150,17 +149,28 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑指纹
|
||||
void editFingerprintsData() async {
|
||||
var entity = await ApiRepository.to.editFingerprintsData(
|
||||
fingerprintId: state.keyId.value.toString(),
|
||||
lockId: state.faceItemData.value.lockId.toString(),
|
||||
weekDay: state.weekDay.value,
|
||||
startDate: state.effectiveDateTime.value.toString(),
|
||||
endDate: state.failureDateTime.value.toString(),
|
||||
isCoerced: state.isStressFingerprint.value ? "2" : "1",
|
||||
fingerprintName: state.changeNameController.text,
|
||||
changeType: "1",
|
||||
// 修改人脸名称
|
||||
void updateFaceNameData() async {
|
||||
var entity = await ApiRepository.to.updateFaceName(
|
||||
lockId: state.faceItemData.value.lockId!,
|
||||
faceId: state.faceItemData.value.faceId!,
|
||||
faceName: state.changeNameController.text,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.typeName.value = state.changeNameController.text;
|
||||
showToast("修改成功", something: () {
|
||||
Get.back(result: "addScuess");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 修改人脸有效期
|
||||
void updateFaceValidityData() async {
|
||||
var entity = await ApiRepository.to.updateFaceValidity(
|
||||
lockId: state.faceItemData.value.lockId!,
|
||||
faceId: state.faceItemData.value.faceId!,
|
||||
startDate: state.effectiveDateTime.value,
|
||||
endDate: state.failureDateTime.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
|
||||
@ -20,11 +20,10 @@ class FaceDetailPage extends StatefulWidget {
|
||||
const FaceDetailPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<FaceDetailPage> createState() => _FingerprintDetailPageState();
|
||||
State<FaceDetailPage> createState() => _FaceDetailPageState();
|
||||
}
|
||||
|
||||
class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
with RouteAware {
|
||||
class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
final logic = Get.put(FaceDetailLogic());
|
||||
final state = Get.find<FaceDetailLogic>().state;
|
||||
|
||||
@ -33,7 +32,7 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "指纹详情",
|
||||
barTitle: "人脸详情",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
// actionsList: [
|
||||
@ -48,8 +47,7 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
body: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
"${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
leftTitel: "人脸号",
|
||||
rightTitle: state.typeNumber.value,
|
||||
isHaveDirection: false,
|
||||
isHaveLine: true)),
|
||||
@ -87,7 +85,7 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeDatePage,
|
||||
arguments: {
|
||||
"fingerprintItemData": state.faceItemData.value,
|
||||
"faceItemData": state.faceItemData.value,
|
||||
"pushType": 1,
|
||||
});
|
||||
if (data != null) {
|
||||
@ -103,7 +101,7 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"fingerprintItemData": state.faceItemData.value,
|
||||
"faceItemData": state.faceItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
@ -123,11 +121,11 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
rightTitle: state.weekDay.value.join(','),
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
// 当是指纹的时候
|
||||
// 当是人脸的时候
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"fingerprintItemData": state.faceItemData.value,
|
||||
"faceItemData": state.faceItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
@ -286,8 +284,8 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
return;
|
||||
}
|
||||
Get.back();
|
||||
// 指纹
|
||||
logic.editFingerprintsData();
|
||||
// 面容
|
||||
logic.updateFaceNameData();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
@ -305,8 +303,8 @@ class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
tipTitle: "确定要删除吗?",
|
||||
sureClick: () {
|
||||
Get.back();
|
||||
// 指纹
|
||||
logic.senderAddFingerprint();
|
||||
// 人脸
|
||||
logic.senderAddFace();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||
|
||||
class FaceDetailState {
|
||||
final faceItemData = FaceItemData().obs;
|
||||
final faceItemData = FingerprintItemData().obs;
|
||||
|
||||
final TextEditingController changeNameController = TextEditingController();
|
||||
|
||||
final typeNumber = "".obs; // 指纹号
|
||||
final typeName = "".obs; // 指纹名字
|
||||
final typeNumber = "".obs; // 人脸号
|
||||
final typeName = "".obs; // 人脸名字
|
||||
var effectiveDateTime = 0.obs; // 生效时间
|
||||
var failureDateTime = 0.obs; // 失效时间
|
||||
final keyType = 0.obs; // 永久:1;限时2,单次3,循环:4
|
||||
@ -20,7 +20,6 @@ class FaceDetailState {
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
|
||||
final isStressFingerprint = false.obs;
|
||||
FaceDetailState() {
|
||||
Map map = Get.arguments;
|
||||
faceItemData.value = map["faceItemData"];
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
class FaceListDataEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
FaceListDataEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
FaceListDataEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
List<FaceItemData>? list;
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? pages;
|
||||
int? total;
|
||||
|
||||
Data({this.list, this.pageNo, this.pageSize, this.pages, this.total});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
if (json['list'] != null) {
|
||||
list = <FaceItemData>[];
|
||||
json['list'].forEach((v) {
|
||||
list!.add(FaceItemData.fromJson(v));
|
||||
});
|
||||
}
|
||||
pageNo = json['pageNo'];
|
||||
pageSize = json['pageSize'];
|
||||
pages = json['pages'];
|
||||
total = json['total'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (list != null) {
|
||||
data['list'] = list!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['pageNo'] = pageNo;
|
||||
data['pageSize'] = pageSize;
|
||||
data['pages'] = pages;
|
||||
data['total'] = total;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class FaceItemData {
|
||||
int? lockId;
|
||||
int? faceId;
|
||||
String? faceName;
|
||||
String? faceNumber;
|
||||
int? startDate;
|
||||
int? endDate;
|
||||
int? status;
|
||||
int? addType;
|
||||
int? faceType;
|
||||
List? cyclicConfig;
|
||||
String? featureData;
|
||||
int? createDate;
|
||||
String? senderUsername;
|
||||
String? validTimeStr;
|
||||
|
||||
FaceItemData(
|
||||
{this.lockId,
|
||||
this.faceId,
|
||||
this.faceName,
|
||||
this.faceNumber,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.status,
|
||||
this.addType,
|
||||
this.faceType,
|
||||
this.cyclicConfig,
|
||||
this.featureData,
|
||||
this.createDate,
|
||||
this.senderUsername,
|
||||
this.validTimeStr});
|
||||
|
||||
FaceItemData.fromJson(Map<String, dynamic> json) {
|
||||
lockId = json['lockId'];
|
||||
faceId = json['faceId'];
|
||||
faceName = json['faceName'];
|
||||
faceNumber = json['faceNumber'];
|
||||
startDate = json['startDate'];
|
||||
endDate = json['endDate'];
|
||||
status = json['status'];
|
||||
addType = json['addType'];
|
||||
faceType = json['faceType'];
|
||||
cyclicConfig = json['cyclicConfig'];
|
||||
featureData = json['featureData'];
|
||||
createDate = json['createDate'];
|
||||
senderUsername = json['senderUsername'];
|
||||
validTimeStr = json['validTimeStr'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['lockId'] = lockId;
|
||||
data['faceId'] = faceId;
|
||||
data['faceName'] = faceName;
|
||||
data['faceNumber'] = faceNumber;
|
||||
data['startDate'] = startDate;
|
||||
data['endDate'] = endDate;
|
||||
data['status'] = status;
|
||||
data['addType'] = addType;
|
||||
data['faceType'] = faceType;
|
||||
data['cyclicConfig'] = cyclicConfig;
|
||||
data['featureData'] = featureData;
|
||||
data['createDate'] = createDate;
|
||||
data['senderUsername'] = senderUsername;
|
||||
data['validTimeStr'] = validTimeStr;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -52,7 +52,11 @@ class FaceListLogic extends BaseGetXController {
|
||||
state.isDeletFaceData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletAllFacesData();
|
||||
if (state.isDeletAll == false) {
|
||||
deletFacesData();
|
||||
} else {
|
||||
clearAllFacesData();
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -255,8 +259,8 @@ class FaceListLogic extends BaseGetXController {
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
userID: await Storage.getUid(),
|
||||
role: 0xff,
|
||||
fingerCount: 20,
|
||||
fingerNo: 1,
|
||||
faceCount: 20,
|
||||
faceNo: 1,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
@ -347,27 +351,40 @@ class FaceListLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 重置所有的人脸
|
||||
void deletAllFacesData() async {
|
||||
var fingerprintId = "";
|
||||
// 删除的人脸
|
||||
void deletFacesData() async {
|
||||
var faceId = "";
|
||||
var type = "1";
|
||||
if (state.isDeletAll == false) {
|
||||
fingerprintId = state.deletKeyID;
|
||||
faceId = state.deletKeyID;
|
||||
type = "0";
|
||||
}
|
||||
print("delet fingerprintId $fingerprintId");
|
||||
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||
fingerprintId: fingerprintId,
|
||||
lockId: state.lockId.value.toString(),
|
||||
type: type,
|
||||
deleteType: "1");
|
||||
print("delet faceId $faceId");
|
||||
var entity = await ApiRepository.to.deleteFaceData(
|
||||
faceId: int.parse(faceId),
|
||||
lockId: state.lockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (state.isDeletAll == false) {
|
||||
showToast("删除成功");
|
||||
} else {
|
||||
showToast("重置成功");
|
||||
}
|
||||
showToast("删除成功");
|
||||
state.isDeletFaceData = false;
|
||||
getFaceListData();
|
||||
}
|
||||
}
|
||||
|
||||
// 重置所有的人脸
|
||||
void clearAllFacesData() async {
|
||||
var faceId = "";
|
||||
var type = "1";
|
||||
if (state.isDeletAll == false) {
|
||||
faceId = state.deletKeyID;
|
||||
type = "0";
|
||||
}
|
||||
print("delet faceId $faceId");
|
||||
var entity = await ApiRepository.to.clearFaceData(
|
||||
lockId: state.lockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("重置成功");
|
||||
state.isDeletFaceData = false;
|
||||
getFaceListData();
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||
import 'package:star_lock/tools/keySearchWidget.dart';
|
||||
import 'package:star_lock/tools/left_slide_actions.dart';
|
||||
|
||||
@ -91,7 +91,7 @@ class _FaceListState extends State<FaceList> {
|
||||
? ListView.separated(
|
||||
itemCount: state.faceItemListData.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
FaceItemData getFaceItemData =
|
||||
FingerprintItemData getFaceItemData =
|
||||
state.faceItemListData.value[index];
|
||||
// 人脸
|
||||
if (index < state.faceItemListData.value.length) {
|
||||
@ -105,7 +105,7 @@ class _FaceListState extends State<FaceList> {
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: _keyItem(
|
||||
'images/icon_fingerprint.png',
|
||||
'images/icon_face.png',
|
||||
getFaceItemData.faceName!,
|
||||
(getFaceItemData.faceType! != 1)
|
||||
? (getFaceItemData.endDate! <
|
||||
@ -141,7 +141,7 @@ class _FaceListState extends State<FaceList> {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildDeleteBtn(FaceItemData faceItemData) {
|
||||
Widget _buildDeleteBtn(FingerprintItemData faceItemData) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// 省略: 弹出是否删除的确认对话框。
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||
|
||||
class FaceListState {
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
@ -13,7 +13,7 @@ class FaceListState {
|
||||
var deletUserID = "DeleteAll!@#";
|
||||
var deletFaceNo = 0;
|
||||
|
||||
final faceItemListData = <FaceItemData>[].obs;
|
||||
final faceItemListData = <FingerprintItemData>[].obs;
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
|
||||
@ -82,26 +82,44 @@ class FingerprintItemData {
|
||||
String? cardNumber;
|
||||
int? cardType;
|
||||
int? cardId;
|
||||
|
||||
int? faceId;
|
||||
String? faceName;
|
||||
String? faceNumber;
|
||||
int? status;
|
||||
int? addType;
|
||||
int? faceType;
|
||||
List? cyclicConfig;
|
||||
String? featureData;
|
||||
|
||||
FingerprintItemData(
|
||||
{ this.fingerprintStatus,
|
||||
this.lockId,
|
||||
this.createDate,
|
||||
this.fingerprintName,
|
||||
this.endDate,
|
||||
this.apiUserId,
|
||||
this.nickName,
|
||||
this.isCoerced,
|
||||
this.startDate,
|
||||
this.fingerprintNumber,
|
||||
this.fingerprintType,
|
||||
this.fingerprintId,
|
||||
this.senderUsername,
|
||||
this.weekDay,
|
||||
this.validTimeStr,
|
||||
this.cardName,
|
||||
this.cardNumber,
|
||||
this.cardType,
|
||||
this.cardId});
|
||||
{this.fingerprintStatus,
|
||||
this.lockId,
|
||||
this.createDate,
|
||||
this.fingerprintName,
|
||||
this.endDate,
|
||||
this.apiUserId,
|
||||
this.nickName,
|
||||
this.isCoerced,
|
||||
this.startDate,
|
||||
this.fingerprintNumber,
|
||||
this.fingerprintType,
|
||||
this.fingerprintId,
|
||||
this.senderUsername,
|
||||
this.weekDay,
|
||||
this.validTimeStr,
|
||||
this.cardName,
|
||||
this.cardNumber,
|
||||
this.cardType,
|
||||
this.cardId,
|
||||
this.faceId,
|
||||
this.faceName,
|
||||
this.faceNumber,
|
||||
this.status,
|
||||
this.addType,
|
||||
this.faceType,
|
||||
this.cyclicConfig,
|
||||
this.featureData});
|
||||
|
||||
FingerprintItemData.fromJson(Map<String, dynamic> json) {
|
||||
fingerprintStatus = json['fingerprintStatus'];
|
||||
@ -123,6 +141,14 @@ class FingerprintItemData {
|
||||
cardNumber = json['cardNumber'];
|
||||
cardType = json['cardType'];
|
||||
cardId = json['cardId'];
|
||||
faceId = json['faceId'];
|
||||
faceName = json['faceName'];
|
||||
faceNumber = json['faceNumber'];
|
||||
status = json['status'];
|
||||
addType = json['addType'];
|
||||
faceType = json['faceType'];
|
||||
cyclicConfig = json['cyclicConfig'];
|
||||
featureData = json['featureData'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -146,6 +172,15 @@ class FingerprintItemData {
|
||||
data['cardNumber'] = cardNumber;
|
||||
data['cardType'] = cardType;
|
||||
data['cardId'] = cardId;
|
||||
data['faceId'] = faceId;
|
||||
data['faceName'] = faceName;
|
||||
data['faceNumber'] = faceNumber;
|
||||
data['status'] = status;
|
||||
data['addType'] = addType;
|
||||
data['faceType'] = faceType;
|
||||
data['cyclicConfig'] = cyclicConfig;
|
||||
data['featureData'] = featureData;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
|
||||
super.initState();
|
||||
|
||||
//写一个定时器,三十秒后页面自动返回
|
||||
Timer(const Duration(seconds: 30), () {
|
||||
state.autoBackTimer = Timer(const Duration(seconds: 30), () {
|
||||
Get.back();
|
||||
});
|
||||
|
||||
@ -380,6 +380,7 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
|
||||
// 在这里处理失败的逻辑
|
||||
CallTalk().stopPcmSound();
|
||||
state.realTimePicTimer.cancel();
|
||||
state.autoBackTimer.cancel();
|
||||
if (state.animationController != null) {
|
||||
state.animationController.stop();
|
||||
}
|
||||
@ -388,6 +389,9 @@ class _RealTimePicturePageState extends State<RealTimePicturePage>
|
||||
@override
|
||||
void dispose() {
|
||||
state.animationController.dispose();
|
||||
state.realTimePicTimer.cancel();
|
||||
state.autoBackTimer.cancel();
|
||||
CallTalk().stopPcmSound();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,8 @@ class RealTimePictureState {
|
||||
late Timer openDoorTimer;
|
||||
late AnimationController animationController;
|
||||
|
||||
late Timer autoBackTimer =
|
||||
Timer(const Duration(seconds: 1), () {}); //发送30秒监视后自动返回
|
||||
late Timer realTimePicTimer =
|
||||
Timer(const Duration(seconds: 1), () {}); //监视命令定时器
|
||||
var elapsedSeconds = 0.obs;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
abstract class Api {
|
||||
static String baseAddress = "https://pre.lock.star-lock.cn"; //预发布环境
|
||||
// static String baseAddress = "https://dev.lock.star-lock.cn"; //联调环境
|
||||
// static String baseAddress = "https://pre.lock.star-lock.cn"; //预发布环境
|
||||
static String baseAddress = "https://dev.lock.star-lock.cn"; //联调环境
|
||||
// static String baseAddress = "http://192.168.1.15:8022"; //谢总本地
|
||||
// static String baseAddress = "https://ge.lock.star-lock.cn"; //葛工开发环境地址
|
||||
|
||||
@ -110,6 +110,9 @@ abstract class Api {
|
||||
final String addFaceURL = '/face/add'; // 添加人脸
|
||||
final String checkFaceNameURL = '/face/checkFaceName'; // 校验人脸名称是否重复
|
||||
final String updateFaceUserNoURL = '/face/updateFaceUserNo'; // 更新人脸用户序号
|
||||
final String updateFaceUserInfoURL = '/face/update'; // 更新人脸信息--有效期、名称
|
||||
final String deleteFaceURL = '/face/delete'; // 删除人脸
|
||||
final String clearFaceURL = '/face/clear'; // 清空人脸
|
||||
|
||||
final String getICCardListURL = '/identityCard/list'; // IC卡列表
|
||||
final String addICCardURL = '/identityCard/add'; // 添加IC卡
|
||||
|
||||
@ -1069,13 +1069,47 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({'lockId': lockId, 'faceName': faceName}));
|
||||
|
||||
// 更新人脸用户序号
|
||||
Future<Response> updateFaceUserNoLoadData(
|
||||
String faceId, String lockId, String faceUserNo) =>
|
||||
Future<Response> updateFaceUserNo(
|
||||
int faceId, int lockId, String faceUserNo) =>
|
||||
post(
|
||||
updateFaceUserNoURL.toUrl,
|
||||
jsonEncode(
|
||||
{'faceId': faceId, 'lockId': lockId, 'faceUserNo': faceUserNo}));
|
||||
|
||||
// 更新人脸用户信息--人脸名称、有效期
|
||||
Future<Response> updateFaceName(int faceId, int lockId, String faceName) =>
|
||||
post(
|
||||
updateFaceUserInfoURL.toUrl,
|
||||
jsonEncode(
|
||||
{'faceId': faceId, 'lockId': lockId, 'faceName': faceName}));
|
||||
|
||||
// 更新人脸用户信息--有效期
|
||||
Future<Response> updateFaceValidity(
|
||||
int faceId, int lockId, int startDate, int endDate) =>
|
||||
post(
|
||||
updateFaceUserInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'faceId': faceId,
|
||||
'lockId': lockId,
|
||||
'startDate': startDate,
|
||||
'endDate': endDate
|
||||
}));
|
||||
|
||||
// 删除人脸
|
||||
Future<Response> deleteFaceData(int faceId, int lockId) => post(
|
||||
deleteFaceURL.toUrl,
|
||||
jsonEncode({
|
||||
'faceId': faceId,
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 清空人脸
|
||||
Future<Response> clearFaceData(int lockId) => post(
|
||||
clearFaceURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
// 获取IC卡列表
|
||||
Future<Response> getICCardListData(
|
||||
String lockId, String pageNo, String pageSize, String searchStr) =>
|
||||
|
||||
@ -31,8 +31,8 @@ class BaseProvider extends GetConnect with Api {
|
||||
bool? isUnShowLoading = false}) async {
|
||||
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}");
|
||||
if (isUnShowLoading == false) EasyLoading.show();
|
||||
|
||||
print('星锁请求body体为:${body}');
|
||||
// print('请求url======>$url');
|
||||
// print('请求body体======>$body');
|
||||
var res = await super.post(url, body,
|
||||
contentType: contentType,
|
||||
headers: headers,
|
||||
@ -56,7 +56,7 @@ class BaseProvider extends GetConnect with Api {
|
||||
statusText: res.statusText,
|
||||
);
|
||||
} else {}
|
||||
// print('得到的数据======>bodyString:${res.bodyString} body:${res.body} bodyBytes:${res.bodyBytes} status:${res.status} statusText:${res.statusText} statusCode:${res.statusCode}');
|
||||
// print('得到的数据======>${res.bodyString}');
|
||||
getDataResult(res.body);
|
||||
return res;
|
||||
}
|
||||
@ -67,19 +67,19 @@ class BaseProvider extends GetConnect with Api {
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
|
||||
break;
|
||||
case 500:
|
||||
EasyLoading.showToast("服务器错误",duration: 2000.milliseconds);
|
||||
EasyLoading.showToast("服务器错误", duration: 2000.milliseconds);
|
||||
break;
|
||||
case 421:
|
||||
case 422:
|
||||
case 430: //与葛工约定弹出ErrorMsg
|
||||
EasyLoading.showToast(T["errorMsg"],duration: 2000.milliseconds);
|
||||
EasyLoading.showToast(T["errorMsg"], duration: 2000.milliseconds);
|
||||
break;
|
||||
//已单独处理,暂不做全局弹窗
|
||||
// case 425:
|
||||
// Toast.show(msg: "用户不存在");
|
||||
// break;
|
||||
case 10001:
|
||||
EasyLoading.showToast("数据不存在",duration: 2000.milliseconds);
|
||||
EasyLoading.showToast("数据不存在", duration: 2000.milliseconds);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyO
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||
@ -1168,7 +1168,7 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 获取人脸列表
|
||||
Future<FaceListDataEntity> getFaceListData({
|
||||
Future<FingerprintListDataEntity> getFaceListData({
|
||||
required String lockId,
|
||||
required String pageNo,
|
||||
required String pageSize,
|
||||
@ -1176,11 +1176,11 @@ class ApiRepository {
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getFaceListData(lockId, pageNo, pageSize, searchStr);
|
||||
return FaceListDataEntity.fromJson(res.body);
|
||||
return FingerprintListDataEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 添加人脸
|
||||
Future<AddFingerprintEntity> addFaceData({
|
||||
Future<AddFaceEntity> addFaceData({
|
||||
required int lockId,
|
||||
required String faceName,
|
||||
required String faceNumber,
|
||||
@ -1193,7 +1193,7 @@ class ApiRepository {
|
||||
}) async {
|
||||
final res = await apiProvider.addFaceData(lockId, faceName, faceNumber,
|
||||
faceType, startDate, endDate, featureData, addType, cyclicConfig);
|
||||
return AddFingerprintEntity.fromJson(res.body);
|
||||
return AddFaceEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 校验人脸名字是否重复
|
||||
@ -1204,12 +1204,48 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 更新人脸用户序号
|
||||
Future<LoginEntity> updateFaceUserNoLoadData(
|
||||
{required String faceId,
|
||||
required String lockId,
|
||||
Future<LoginEntity> updateFaceUserNo(
|
||||
{required int faceId,
|
||||
required int lockId,
|
||||
required String faceUserNo}) async {
|
||||
final res =
|
||||
await apiProvider.updateFaceUserNoLoadData(faceId, lockId, faceUserNo);
|
||||
final res = await apiProvider.updateFaceUserNo(faceId, lockId, faceUserNo);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 更新人脸用户信息--人脸名称
|
||||
Future<LoginEntity> updateFaceName(
|
||||
{required int faceId,
|
||||
required int lockId,
|
||||
required String faceName}) async {
|
||||
final res = await apiProvider.updateFaceName(faceId, lockId, faceName);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 更新人脸用户信息--有效期
|
||||
Future<LoginEntity> updateFaceValidity(
|
||||
{required int faceId,
|
||||
required int lockId,
|
||||
required int startDate,
|
||||
required int endDate}) async {
|
||||
final res = await apiProvider.updateFaceValidity(
|
||||
faceId, lockId, startDate, endDate);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 删除人脸
|
||||
Future<LoginEntity> deleteFaceData({
|
||||
required int faceId,
|
||||
required int lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.deleteFaceData(faceId, lockId);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 清空人脸
|
||||
Future<LoginEntity> clearFaceData({
|
||||
required int lockId,
|
||||
}) async {
|
||||
final res = await apiProvider.clearFaceData(lockId);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user