修改考勤模块bug
This commit is contained in:
parent
5a6abb5e3f
commit
9678ff9e90
Binary file not shown.
|
Before Width: | Height: | Size: 9.5 KiB |
BIN
star_lock/images/main/icon_lockDetail_checkInRanking_cd.png
Normal file
BIN
star_lock/images/main/icon_lockDetail_checkInRanking_cd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
star_lock/images/main/icon_lockDetail_checkInRanking_qf.png
Normal file
BIN
star_lock/images/main/icon_lockDetail_checkInRanking_qf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
star_lock/images/main/icon_lockDetail_checkInRanking_zd.png
Normal file
BIN
star_lock/images/main/icon_lockDetail_checkInRanking_zd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@ -37,7 +37,7 @@ class AttendanceRecordMonthList {
|
||||
String? staffName;
|
||||
int? staffId;
|
||||
int? attendanceType;
|
||||
String? countryCode;
|
||||
int? countryCode;
|
||||
int? openingTimeStart;
|
||||
String? attendanceWay;
|
||||
int? avgTime;
|
||||
|
||||
@ -71,9 +71,19 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 30.h),
|
||||
Image.asset('images/main/icon_checkInRankingListTop.png', width: 120.w, height: 120.w),
|
||||
Obx(() => Container(
|
||||
width: 110.w,
|
||||
height: 110.w,
|
||||
padding: EdgeInsets.all(10.w),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.mainColor,
|
||||
borderRadius: BorderRadius.circular(60.w),
|
||||
),
|
||||
child: Image.asset(getTopImg(), width: 120.w, height: 120.w)
|
||||
)
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Text(TranslationLoader.lanKeys!.noAttendanceRecord!.tr, style: TextStyle(fontSize: 24.sp)),
|
||||
Obx(() => Text(getTopTitle(), style: TextStyle(color: Colors.black, fontSize: 24.sp))),
|
||||
SizedBox(height: 30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@ -295,7 +305,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 30.w,),
|
||||
Text("1", style: TextStyle(fontSize: 20.sp),),
|
||||
Text("${index+1}", style: TextStyle(fontSize: 20.sp),),
|
||||
SizedBox(width: 20.w,),
|
||||
Image.asset('images/controls_user.png', width: 40.w, height: 40.w,),
|
||||
// Container(
|
||||
@ -387,4 +397,24 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
String getTopImg(){
|
||||
if(state.listType.value == "1"){
|
||||
return "images/main/icon_lockDetail_checkInRanking_zd.png";
|
||||
}else if(state.listType.value == "2"){
|
||||
return "images/main/icon_lockDetail_checkInRanking_cd.png";
|
||||
}else{
|
||||
return "images/main/icon_lockDetail_checkInRanking_qf.png";
|
||||
}
|
||||
}
|
||||
|
||||
String getTopTitle(){
|
||||
if(state.listType.value == "1"){
|
||||
return "无考勤记录";
|
||||
}else if(state.listType.value == "2"){
|
||||
return "大家干劲十足";
|
||||
}else{
|
||||
return "工作时长未出炉";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../../../tools/eventBusEventManage.dart';
|
||||
import 'checkingInSet_state.dart';
|
||||
|
||||
class CheckingInSetLogic extends BaseGetXController{
|
||||
@ -57,6 +60,17 @@ class CheckingInSetLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
// 删除公司
|
||||
void deletCompanyData() async{
|
||||
var entity = await ApiRepository.to.deletCompanyData(
|
||||
companyId:state.checkingInSetInfo.value.companyId!,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, "0"));
|
||||
Get.close(2);
|
||||
}
|
||||
}
|
||||
|
||||
// late StreamSubscription _teamEvent;
|
||||
// void _initLoadDataAction() {
|
||||
// _teamEvent = eventBus.on<RefreshCheckInStaffListDataEvent>().listen((event) {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -122,7 +123,9 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
|
||||
isDelete: true,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
|
||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||
onClick: () {}),
|
||||
onClick: () {
|
||||
showDeletCompanyAlertDialog(context);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -196,4 +199,30 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
|
||||
);
|
||||
}
|
||||
|
||||
void showDeletCompanyAlertDialog(context) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text("提示"),
|
||||
content: const Text('是否删除?'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
logic.deletCompanyData();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,8 +125,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
)),
|
||||
// 当选择密码、卡、指纹时显示
|
||||
Obx(() => Visibility(
|
||||
visible: (state.seletPrintingMethodType.value != "1" &&
|
||||
state.appUnHaveAccount.value)
|
||||
visible: (state.seletPrintingMethodType.value != "1" && state.appUnHaveAccount.value)
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
@ -135,13 +134,10 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: Row(
|
||||
children: [
|
||||
Obx(() => Text(state.getDataPassword.value,
|
||||
style: TextStyle(fontSize: 24.sp))),
|
||||
Obx(() => Text(state.getDataPassword.value, style: TextStyle(fontSize: 24.sp))),
|
||||
SizedBox(width: 30.w),
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 130.w,
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
||||
@ -36,7 +36,7 @@ class CheckingInAddStaffListItemEntity {
|
||||
String? staffName;
|
||||
int? staffId;
|
||||
int? attendanceType;
|
||||
String? countryCode;
|
||||
int? countryCode;
|
||||
String? attendanceWay;
|
||||
|
||||
CheckingInAddStaffListItemEntity(
|
||||
|
||||
@ -59,43 +59,43 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.autoLockTime.value = reply.data[7].toString();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.autoLockTime.value = reply.data[7].toString();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
//
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
//
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -133,30 +133,30 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsWithParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 29,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 29,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数)
|
||||
Future<void> sendAutoLock() async {
|
||||
@ -228,7 +228,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsWithParameters();
|
||||
// _readSupportFunctionsWithParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -44,39 +44,39 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.burglarAlarmEnable.value = reply.data[6];
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.burglarAlarmEnable.value = reply.data[6];
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -114,30 +114,30 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsNoParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 30,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 30,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数)
|
||||
Future<void> sendBurglarAlarm() async {
|
||||
@ -197,7 +197,7 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsNoParameters();
|
||||
// _readSupportFunctionsNoParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -51,9 +51,9 @@ class LockSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能(不带参数)
|
||||
if ((reply is ReadSupportFunctionsNoParametersReply) && (state.settingUpSupportFeatures == 56)) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if ((reply is ReadSupportFunctionsNoParametersReply) && (state.settingUpSupportFeatures == 56)) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -176,33 +176,33 @@ class LockSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.isOpenBlueBroadcast.value = reply.data[6];
|
||||
print("isOpenBlueBroadcast:${state.isOpenBlueBroadcast.value}");
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.isOpenBlueBroadcast.value = reply.data[6];
|
||||
// print("isOpenBlueBroadcast:${state.isOpenBlueBroadcast.value}");
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 锁设置数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
|
||||
@ -45,44 +45,44 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
// state.autoLockTime.value = reply.data[7].toString();
|
||||
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// // state.autoLockTime.value = reply.data[7].toString();
|
||||
//
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
//
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
//
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置支持功能解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -120,30 +120,30 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsWithParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 33,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 33,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数)
|
||||
Future<void> sendLockSound() async {
|
||||
@ -212,7 +212,7 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsWithParameters();
|
||||
// _readSupportFunctionsWithParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -42,39 +42,39 @@ class MotorPowerLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.motorTorsion.value = reply.data[6];
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.motorTorsion.value = reply.data[6];
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
|
||||
@ -65,44 +65,44 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.isOpenNormallyOpenMode.value = reply.data[4] == 0 ? false : true;
|
||||
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.isOpenNormallyOpenMode.value = reply.data[4] == 0 ? false : true;
|
||||
//
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
//
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
//
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -140,30 +140,30 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsWithParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 50,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 50,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数)
|
||||
Future<void> sendAutoLock() async {
|
||||
@ -256,7 +256,7 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsWithParameters();
|
||||
// _readSupportFunctionsWithParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -44,39 +44,39 @@ class OpenDoorDirectionLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.openDirectionValue.value = reply.data[6];
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.openDirectionValue.value = reply.data[6];
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -111,30 +111,30 @@ class OpenDoorDirectionLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsNoParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 41,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 41,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数)
|
||||
Future<void> sendOpenDoorDirection() async {
|
||||
@ -182,7 +182,7 @@ class OpenDoorDirectionLogic extends BaseGetXController {
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsNoParameters();
|
||||
// _readSupportFunctionsNoParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -43,39 +43,39 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.remoteEnable.value = reply.data[6];
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.remoteEnable.value = reply.data[6];
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -113,30 +113,30 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsNoParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 28,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 28,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数) 远程开锁
|
||||
Future<void> sendBurglarAlarm() async {
|
||||
@ -196,7 +196,7 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsNoParameters();
|
||||
// _readSupportFunctionsNoParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -44,39 +44,39 @@ class ResetButtonLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能(带参数)
|
||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
_readSupportFunctionsWithParametersReply(reply);
|
||||
}
|
||||
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||
// _readSupportFunctionsWithParametersReply(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
// 读取支持功能带参数数据解析
|
||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
state.resetButtonEnable.value = reply.data[6];
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// print("${reply.commandType}数据解析成功");
|
||||
// state.resetButtonEnable.value = reply.data[6];
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// print("${reply.commandType}需要鉴权");
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// print("${reply.commandType}用户无权限");
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// print("${reply.commandType}权限校验错误");
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// print("${reply.commandType}失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 设置自动落锁数据解析
|
||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||
@ -114,30 +114,30 @@ class ResetButtonLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> _readSupportFunctionsNoParameters() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
if (connectionState == DeviceConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
featureBit: 31,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||
// if (connectionState == DeviceConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// featureBit: 31,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 设置支持功能(带参数)
|
||||
Future<void> sendBurglarAlarm() async {
|
||||
@ -197,7 +197,7 @@ class ResetButtonLogic extends BaseGetXController{
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
_readSupportFunctionsNoParameters();
|
||||
// _readSupportFunctionsNoParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -594,8 +594,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
||||
void getLockNetToken() async {
|
||||
LockNetTokenEntity entity = await ApiRepository.to
|
||||
.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||
LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.lockNetToken = entity.data!.token!;
|
||||
print("state.lockNetToken:${state.lockNetToken}");
|
||||
|
||||
@ -399,6 +399,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.lockId = entity.data!.lockId!;
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
senderCustomPasswords();
|
||||
|
||||
// BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
||||
@ -459,7 +460,6 @@ class SaveLockLogic extends BaseGetXController {
|
||||
|
||||
void backAction(){
|
||||
BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(state.isFromMap == 1 ? 6 : 7);
|
||||
}
|
||||
|
||||
|
||||
@ -69,10 +69,9 @@ abstract class Api {
|
||||
final String lockDiagnoseUrl = '/room/uploadLockInfo'; // 锁诊断
|
||||
final String getServerDatetimeUrl = '/check/getServerDatetime'; // 获取服务器当前时间
|
||||
final String getLockVersionInfoUrl = '/room/update'; // 获取锁当前版本信息
|
||||
final String openCheckingInURL =
|
||||
'/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司
|
||||
final String setCheckInCreateCompanyURL =
|
||||
'/attendanceCompany/add'; // 设置考勤时创建公司
|
||||
final String openCheckingInURL = '/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司
|
||||
final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; // 设置考勤时创建公司
|
||||
final String deleteCompanyURL = '/vacation/delete'; // 删除公司
|
||||
|
||||
final String getAttendanceRecordListByDateURL =
|
||||
'/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜
|
||||
|
||||
@ -740,6 +740,14 @@ class ApiProvider extends BaseProvider {
|
||||
'workStartTime': workStartTime,
|
||||
}));
|
||||
|
||||
// 删除公司
|
||||
Future<Response> deletCompanyData(int companyId) => post(
|
||||
deleteCompanyURL.toUrl,
|
||||
jsonEncode({
|
||||
'companyId': companyId,
|
||||
}),
|
||||
isUnShowLoading: true);
|
||||
|
||||
// 获取开锁提醒
|
||||
Future<Response> setLockPickingReminderData(int lockId, int unlockReminderPush) =>
|
||||
post(updateLockSettingUrl.toUrl,
|
||||
|
||||
@ -923,6 +923,13 @@ class ApiRepository {
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 删除公司
|
||||
Future<CheckingInInfoDataEntity> deletCompanyData(
|
||||
{required int companyId}) async {
|
||||
final res = await apiProvider.deletCompanyData(companyId);
|
||||
return CheckingInInfoDataEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 设置锁开锁提醒
|
||||
Future<LoginEntity> setLockPickingReminderData({
|
||||
required int lockId,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user