修改考勤模块bug

This commit is contained in:
魏少阳 2024-01-19 18:15:42 +08:00
parent 5a6abb5e3f
commit 9678ff9e90
24 changed files with 554 additions and 472 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -37,7 +37,7 @@ class AttendanceRecordMonthList {
String? staffName;
int? staffId;
int? attendanceType;
String? countryCode;
int? countryCode;
int? openingTimeStart;
String? attendanceWay;
int? avgTime;

View File

@ -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 "工作时长未出炉";
}
}
}

View File

@ -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) {

View File

@ -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();
},
),
],
);
},
);
}
}

View File

@ -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(

View File

@ -36,7 +36,7 @@ class CheckingInAddStaffListItemEntity {
String? staffName;
int? staffId;
int? attendanceType;
String? countryCode;
int? countryCode;
String? attendanceWay;
CheckingInAddStaffListItemEntity(

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}");

View File

@ -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);
}

View File

@ -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'; // -

View File

@ -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,

View File

@ -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,