修改考勤模块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;
|
String? staffName;
|
||||||
int? staffId;
|
int? staffId;
|
||||||
int? attendanceType;
|
int? attendanceType;
|
||||||
String? countryCode;
|
int? countryCode;
|
||||||
int? openingTimeStart;
|
int? openingTimeStart;
|
||||||
String? attendanceWay;
|
String? attendanceWay;
|
||||||
int? avgTime;
|
int? avgTime;
|
||||||
|
|||||||
@ -71,9 +71,19 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 30.h),
|
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),
|
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),
|
SizedBox(height: 30.h),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@ -295,7 +305,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 30.w,),
|
SizedBox(width: 30.w,),
|
||||||
Text("1", style: TextStyle(fontSize: 20.sp),),
|
Text("${index+1}", style: TextStyle(fontSize: 20.sp),),
|
||||||
SizedBox(width: 20.w,),
|
SizedBox(width: 20.w,),
|
||||||
Image.asset('images/controls_user.png', width: 40.w, height: 40.w,),
|
Image.asset('images/controls_user.png', width: 40.w, height: 40.w,),
|
||||||
// Container(
|
// 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 '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../tools/dateTool.dart';
|
import '../../../../tools/dateTool.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
import 'checkingInSet_state.dart';
|
import 'checkingInSet_state.dart';
|
||||||
|
|
||||||
class CheckingInSetLogic extends BaseGetXController{
|
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;
|
// late StreamSubscription _teamEvent;
|
||||||
// void _initLoadDataAction() {
|
// void _initLoadDataAction() {
|
||||||
// _teamEvent = eventBus.on<RefreshCheckInStaffListDataEvent>().listen((event) {
|
// _teamEvent = eventBus.on<RefreshCheckInStaffListDataEvent>().listen((event) {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -122,7 +123,9 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
|
|||||||
isDelete: true,
|
isDelete: true,
|
||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
|
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 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(
|
Obx(() => Visibility(
|
||||||
visible: (state.seletPrintingMethodType.value != "1" &&
|
visible: (state.seletPrintingMethodType.value != "1" && state.appUnHaveAccount.value)
|
||||||
state.appUnHaveAccount.value)
|
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
@ -135,13 +134,10 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: Row(
|
rightWidget: Row(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => Text(state.getDataPassword.value,
|
Obx(() => Text(state.getDataPassword.value, style: TextStyle(fontSize: 24.sp))),
|
||||||
style: TextStyle(fontSize: 24.sp))),
|
SizedBox(width: 30.w),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 30.w,
|
width: 150.w,
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 130.w,
|
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class CheckingInAddStaffListItemEntity {
|
|||||||
String? staffName;
|
String? staffName;
|
||||||
int? staffId;
|
int? staffId;
|
||||||
int? attendanceType;
|
int? attendanceType;
|
||||||
String? countryCode;
|
int? countryCode;
|
||||||
String? attendanceWay;
|
String? attendanceWay;
|
||||||
|
|
||||||
CheckingInAddStaffListItemEntity(
|
CheckingInAddStaffListItemEntity(
|
||||||
|
|||||||
@ -59,43 +59,43 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsWithParametersReply) {
|
// if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.autoLockTime.value = reply.data[7].toString();
|
// state.autoLockTime.value = reply.data[7].toString();
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -133,30 +133,30 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsWithParameters() async {
|
// Future<void> _readSupportFunctionsWithParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsWithParametersCommand(
|
// IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 29,
|
// featureBit: 29,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendAutoLock() async {
|
Future<void> sendAutoLock() async {
|
||||||
@ -228,7 +228,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsWithParameters();
|
// _readSupportFunctionsWithParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -44,39 +44,39 @@ class BurglarAlarmLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.burglarAlarmEnable.value = reply.data[6];
|
// state.burglarAlarmEnable.value = reply.data[6];
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -114,30 +114,30 @@ class BurglarAlarmLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsNoParameters() async {
|
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 30,
|
// featureBit: 30,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendBurglarAlarm() async {
|
Future<void> sendBurglarAlarm() async {
|
||||||
@ -197,7 +197,7 @@ class BurglarAlarmLogic extends BaseGetXController{
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsNoParameters();
|
// _readSupportFunctionsNoParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -51,9 +51,9 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(不带参数)
|
// 读取支持功能(不带参数)
|
||||||
if ((reply is ReadSupportFunctionsNoParametersReply) && (state.settingUpSupportFeatures == 56)) {
|
// if ((reply is ReadSupportFunctionsNoParametersReply) && (state.settingUpSupportFeatures == 56)) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,33 +176,33 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch (status) {
|
// switch (status) {
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.isOpenBlueBroadcast.value = reply.data[6];
|
// state.isOpenBlueBroadcast.value = reply.data[6];
|
||||||
print("isOpenBlueBroadcast:${state.isOpenBlueBroadcast.value}");
|
// print("isOpenBlueBroadcast:${state.isOpenBlueBroadcast.value}");
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 锁设置数据解析
|
// 锁设置数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
|
|||||||
@ -45,44 +45,44 @@ class LockSoundSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsWithParametersReply) {
|
// if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
// state.autoLockTime.value = reply.data[7].toString();
|
// // state.autoLockTime.value = reply.data[7].toString();
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能解析
|
// 设置支持功能解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -120,30 +120,30 @@ class LockSoundSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsWithParameters() async {
|
// Future<void> _readSupportFunctionsWithParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsWithParametersCommand(
|
// IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 33,
|
// featureBit: 33,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendLockSound() async {
|
Future<void> sendLockSound() async {
|
||||||
@ -212,7 +212,7 @@ class LockSoundSetLogic extends BaseGetXController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsWithParameters();
|
// _readSupportFunctionsWithParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -42,39 +42,39 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.motorTorsion.value = reply.data[6];
|
// state.motorTorsion.value = reply.data[6];
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
|
|||||||
@ -65,44 +65,44 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsWithParametersReply) {
|
// if(reply is ReadSupportFunctionsWithParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.isOpenNormallyOpenMode.value = reply.data[4] == 0 ? false : true;
|
// state.isOpenNormallyOpenMode.value = reply.data[4] == 0 ? false : true;
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -140,30 +140,30 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsWithParameters() async {
|
// Future<void> _readSupportFunctionsWithParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsWithParametersCommand(
|
// IoSenderManage.readSupportFunctionsWithParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 50,
|
// featureBit: 50,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendAutoLock() async {
|
Future<void> sendAutoLock() async {
|
||||||
@ -256,7 +256,7 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsWithParameters();
|
// _readSupportFunctionsWithParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -44,39 +44,39 @@ class OpenDoorDirectionLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.openDirectionValue.value = reply.data[6];
|
// state.openDirectionValue.value = reply.data[6];
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -111,30 +111,30 @@ class OpenDoorDirectionLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsNoParameters() async {
|
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 41,
|
// featureBit: 41,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendOpenDoorDirection() async {
|
Future<void> sendOpenDoorDirection() async {
|
||||||
@ -182,7 +182,7 @@ class OpenDoorDirectionLogic extends BaseGetXController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsNoParameters();
|
// _readSupportFunctionsNoParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -43,39 +43,39 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.remoteEnable.value = reply.data[6];
|
// state.remoteEnable.value = reply.data[6];
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -113,30 +113,30 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsNoParameters() async {
|
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 28,
|
// featureBit: 28,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数) 远程开锁
|
// 设置支持功能(带参数) 远程开锁
|
||||||
Future<void> sendBurglarAlarm() async {
|
Future<void> sendBurglarAlarm() async {
|
||||||
@ -196,7 +196,7 @@ class RemoteUnlockingLogic extends BaseGetXController{
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsNoParameters();
|
// _readSupportFunctionsNoParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -44,39 +44,39 @@ class ResetButtonLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
if(reply is ReadSupportFunctionsNoParametersReply) {
|
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||||
_readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能带参数数据解析
|
// 读取支持功能带参数数据解析
|
||||||
Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
// Future<void> _readSupportFunctionsWithParametersReply(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
switch(status){
|
// switch(status){
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("${reply.commandType}数据解析成功");
|
// print("${reply.commandType}数据解析成功");
|
||||||
state.resetButtonEnable.value = reply.data[6];
|
// state.resetButtonEnable.value = reply.data[6];
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}需要鉴权");
|
// print("${reply.commandType}需要鉴权");
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("${reply.commandType}用户无权限");
|
// print("${reply.commandType}用户无权限");
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("${reply.commandType}权限校验错误");
|
// print("${reply.commandType}权限校验错误");
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("${reply.commandType}失败");
|
// print("${reply.commandType}失败");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置自动落锁数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
Future<void> _replySetSupportFunctionsWithParameters(Reply reply) async {
|
||||||
@ -114,30 +114,30 @@ class ResetButtonLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 读取支持功能-带参数
|
// 读取支持功能-带参数
|
||||||
Future<void> _readSupportFunctionsNoParameters() async {
|
// Future<void> _readSupportFunctionsNoParameters() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected) {
|
// if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.readSupportFunctionsNoParametersCommand(
|
// IoSenderManage.readSupportFunctionsNoParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
userID: await Storage.getUid(),
|
// userID: await Storage.getUid(),
|
||||||
featureBit: 31,
|
// featureBit: 31,
|
||||||
token: getTokenList,
|
// token: getTokenList,
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
// publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList
|
// privateKey: getPrivateKeyList
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 设置支持功能(带参数)
|
// 设置支持功能(带参数)
|
||||||
Future<void> sendBurglarAlarm() async {
|
Future<void> sendBurglarAlarm() async {
|
||||||
@ -197,7 +197,7 @@ class ResetButtonLogic extends BaseGetXController{
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
_readSupportFunctionsNoParameters();
|
// _readSupportFunctionsNoParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -594,8 +594,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
||||||
void getLockNetToken() async {
|
void getLockNetToken() async {
|
||||||
LockNetTokenEntity entity = await ApiRepository.to
|
LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
||||||
.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockNetToken = entity.data!.token!;
|
state.lockNetToken = entity.data!.token!;
|
||||||
print("state.lockNetToken:${state.lockNetToken}");
|
print("state.lockNetToken:${state.lockNetToken}");
|
||||||
|
|||||||
@ -399,6 +399,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockId = entity.data!.lockId!;
|
state.lockId = entity.data!.lockId!;
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
senderCustomPasswords();
|
senderCustomPasswords();
|
||||||
|
|
||||||
// BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
// BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
||||||
@ -459,7 +460,6 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
|
|
||||||
void backAction(){
|
void backAction(){
|
||||||
BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
|
||||||
Get.close(state.isFromMap == 1 ? 6 : 7);
|
Get.close(state.isFromMap == 1 ? 6 : 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,10 +69,9 @@ abstract class Api {
|
|||||||
final String lockDiagnoseUrl = '/room/uploadLockInfo'; // 锁诊断
|
final String lockDiagnoseUrl = '/room/uploadLockInfo'; // 锁诊断
|
||||||
final String getServerDatetimeUrl = '/check/getServerDatetime'; // 获取服务器当前时间
|
final String getServerDatetimeUrl = '/check/getServerDatetime'; // 获取服务器当前时间
|
||||||
final String getLockVersionInfoUrl = '/room/update'; // 获取锁当前版本信息
|
final String getLockVersionInfoUrl = '/room/update'; // 获取锁当前版本信息
|
||||||
final String openCheckingInURL =
|
final String openCheckingInURL = '/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司
|
||||||
'/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司
|
final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; // 设置考勤时创建公司
|
||||||
final String setCheckInCreateCompanyURL =
|
final String deleteCompanyURL = '/vacation/delete'; // 删除公司
|
||||||
'/attendanceCompany/add'; // 设置考勤时创建公司
|
|
||||||
|
|
||||||
final String getAttendanceRecordListByDateURL =
|
final String getAttendanceRecordListByDateURL =
|
||||||
'/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜
|
'/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜
|
||||||
|
|||||||
@ -740,6 +740,14 @@ class ApiProvider extends BaseProvider {
|
|||||||
'workStartTime': workStartTime,
|
'workStartTime': workStartTime,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 删除公司
|
||||||
|
Future<Response> deletCompanyData(int companyId) => post(
|
||||||
|
deleteCompanyURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'companyId': companyId,
|
||||||
|
}),
|
||||||
|
isUnShowLoading: true);
|
||||||
|
|
||||||
// 获取开锁提醒
|
// 获取开锁提醒
|
||||||
Future<Response> setLockPickingReminderData(int lockId, int unlockReminderPush) =>
|
Future<Response> setLockPickingReminderData(int lockId, int unlockReminderPush) =>
|
||||||
post(updateLockSettingUrl.toUrl,
|
post(updateLockSettingUrl.toUrl,
|
||||||
|
|||||||
@ -923,6 +923,13 @@ class ApiRepository {
|
|||||||
return LoginEntity.fromJson(res.body);
|
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({
|
Future<LoginEntity> setLockPickingReminderData({
|
||||||
required int lockId,
|
required int lockId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user