diff --git a/star_lock/images/main/icon_checkInRankingListTop.png b/star_lock/images/main/icon_checkInRankingListTop.png deleted file mode 100644 index 0a6070e0..00000000 Binary files a/star_lock/images/main/icon_checkInRankingListTop.png and /dev/null differ diff --git a/star_lock/images/main/icon_lockDetail_checkInRanking_cd.png b/star_lock/images/main/icon_lockDetail_checkInRanking_cd.png new file mode 100644 index 00000000..f70a3ddd Binary files /dev/null and b/star_lock/images/main/icon_lockDetail_checkInRanking_cd.png differ diff --git a/star_lock/images/main/icon_lockDetail_checkInRanking_qf.png b/star_lock/images/main/icon_lockDetail_checkInRanking_qf.png new file mode 100644 index 00000000..58825d9f Binary files /dev/null and b/star_lock/images/main/icon_lockDetail_checkInRanking_qf.png differ diff --git a/star_lock/images/main/icon_lockDetail_checkInRanking_zd.png b/star_lock/images/main/icon_lockDetail_checkInRanking_zd.png new file mode 100644 index 00000000..0b23413d Binary files /dev/null and b/star_lock/images/main/icon_lockDetail_checkInRanking_zd.png differ diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart index 859c5002..ec6fc9ae 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart @@ -37,7 +37,7 @@ class AttendanceRecordMonthList { String? staffName; int? staffId; int? attendanceType; - String? countryCode; + int? countryCode; int? openingTimeStart; String? attendanceWay; int? avgTime; diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart index 8cea4db3..9f3a965f 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart @@ -71,9 +71,19 @@ class _CheckingInListPageState extends State { 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 { 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 { }); }); } + + 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 "工作时长未出炉"; + } + } } diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart index 89aad458..8d93cd34 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart @@ -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().listen((event) { diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart index 17d89e9f..f80251fe 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart @@ -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 { 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 { ); } + 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(); + }, + ), + ], + ); + }, + ); + } } diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart index de196a7d..a7b4cdf4 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart @@ -125,8 +125,7 @@ class _CheckingInAddStaffPageState extends State { )), // 当选择密码、卡、指纹时显示 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 { 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( diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart index d52c0140..d34af350 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart @@ -36,7 +36,7 @@ class CheckingInAddStaffListItemEntity { String? staffName; int? staffId; int? attendanceType; - String? countryCode; + int? countryCode; String? attendanceWay; CheckingInAddStaffListItemEntity( diff --git a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart index 8bd033a7..d84e3fa0 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart @@ -59,43 +59,43 @@ class AutomaticBlockingLogic extends BaseGetXController{ } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsWithParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsWithParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -133,30 +133,30 @@ class AutomaticBlockingLogic extends BaseGetXController{ } // 读取支持功能-带参数 - Future _readSupportFunctionsWithParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsWithParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendAutoLock() async { @@ -228,7 +228,7 @@ class AutomaticBlockingLogic extends BaseGetXController{ super.onInit(); print("onInit()"); - _readSupportFunctionsWithParameters(); + // _readSupportFunctionsWithParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart index 9f0a0179..e312ab26 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart @@ -44,39 +44,39 @@ class BurglarAlarmLogic extends BaseGetXController{ } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsNoParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsNoParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -114,30 +114,30 @@ class BurglarAlarmLogic extends BaseGetXController{ } // 读取支持功能-带参数 - Future _readSupportFunctionsNoParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsNoParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendBurglarAlarm() async { @@ -197,7 +197,7 @@ class BurglarAlarmLogic extends BaseGetXController{ super.onInit(); print("onInit()"); - _readSupportFunctionsNoParameters(); + // _readSupportFunctionsNoParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart index e7cea7c2..1e911a59 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart @@ -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 _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart index 344dc8b4..0784dcc2 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart @@ -45,44 +45,44 @@ class LockSoundSetLogic extends BaseGetXController { } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsWithParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsWithParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -120,30 +120,30 @@ class LockSoundSetLogic extends BaseGetXController { } // 读取支持功能-带参数 - Future _readSupportFunctionsWithParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsWithParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendLockSound() async { @@ -212,7 +212,7 @@ class LockSoundSetLogic extends BaseGetXController { super.onInit(); print("onInit()"); - _readSupportFunctionsWithParameters(); + // _readSupportFunctionsWithParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart index acb35164..8556b6f8 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart @@ -42,39 +42,39 @@ class MotorPowerLogic extends BaseGetXController { } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsNoParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsNoParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { diff --git a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart index 75ab6c3f..adb18730 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart @@ -65,44 +65,44 @@ class NormallyOpenModeLogic extends BaseGetXController{ } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsWithParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsWithParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -140,30 +140,30 @@ class NormallyOpenModeLogic extends BaseGetXController{ } // 读取支持功能-带参数 - Future _readSupportFunctionsWithParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsWithParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendAutoLock() async { @@ -256,7 +256,7 @@ class NormallyOpenModeLogic extends BaseGetXController{ super.onInit(); print("onInit()"); - _readSupportFunctionsWithParameters(); + // _readSupportFunctionsWithParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart index fac236c9..0f782546 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart @@ -44,39 +44,39 @@ class OpenDoorDirectionLogic extends BaseGetXController { } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsNoParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsNoParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -111,30 +111,30 @@ class OpenDoorDirectionLogic extends BaseGetXController { } // 读取支持功能-带参数 - Future _readSupportFunctionsNoParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsNoParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendOpenDoorDirection() async { @@ -182,7 +182,7 @@ class OpenDoorDirectionLogic extends BaseGetXController { super.onInit(); print("onInit()"); - _readSupportFunctionsNoParameters(); + // _readSupportFunctionsNoParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_logic.dart index 1f26a280..a40fe439 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_logic.dart @@ -43,39 +43,39 @@ class RemoteUnlockingLogic extends BaseGetXController{ } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsNoParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsNoParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -113,30 +113,30 @@ class RemoteUnlockingLogic extends BaseGetXController{ } // 读取支持功能-带参数 - Future _readSupportFunctionsNoParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsNoParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendBurglarAlarm() async { @@ -196,7 +196,7 @@ class RemoteUnlockingLogic extends BaseGetXController{ super.onInit(); print("onInit()"); - _readSupportFunctionsNoParameters(); + // _readSupportFunctionsNoParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart index f9fe02aa..da0580cb 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart @@ -44,39 +44,39 @@ class ResetButtonLogic extends BaseGetXController{ } // 读取支持功能(带参数) - if(reply is ReadSupportFunctionsNoParametersReply) { - _readSupportFunctionsWithParametersReply(reply); - } + // if(reply is ReadSupportFunctionsNoParametersReply) { + // _readSupportFunctionsWithParametersReply(reply); + // } }); } // 读取支持功能带参数数据解析 - Future _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 _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 _replySetSupportFunctionsWithParameters(Reply reply) async { @@ -114,30 +114,30 @@ class ResetButtonLogic extends BaseGetXController{ } // 读取支持功能-带参数 - Future _readSupportFunctionsNoParameters() async { - BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { - if (connectionState == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List 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 _readSupportFunctionsNoParameters() async { + // BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async { + // if (connectionState == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var token = await Storage.getStringList(saveBlueToken); + // List getTokenList = changeStringListToIntList(token!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List 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 sendBurglarAlarm() async { @@ -197,7 +197,7 @@ class ResetButtonLogic extends BaseGetXController{ super.onInit(); print("onInit()"); - _readSupportFunctionsNoParameters(); + // _readSupportFunctionsNoParameters(); } @override diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 66cd304d..b7d9343d 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -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}"); diff --git a/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart b/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart index 593ad4c1..296fc809 100644 --- a/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart +++ b/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart @@ -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); } diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index 68145668..ef58acb2 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -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'; // 获取考勤列表-早到榜日榜 diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index 7cdd771f..6ec68b45 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -740,6 +740,14 @@ class ApiProvider extends BaseProvider { 'workStartTime': workStartTime, })); + // 删除公司 + Future deletCompanyData(int companyId) => post( + deleteCompanyURL.toUrl, + jsonEncode({ + 'companyId': companyId, + }), + isUnShowLoading: true); + // 获取开锁提醒 Future setLockPickingReminderData(int lockId, int unlockReminderPush) => post(updateLockSettingUrl.toUrl, diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index c5c3a563..f13b04c6 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -923,6 +923,13 @@ class ApiRepository { return LoginEntity.fromJson(res.body); } + // 删除公司 + Future deletCompanyData( + {required int companyId}) async { + final res = await apiProvider.deletCompanyData(companyId); + return CheckingInInfoDataEntity.fromJson(res.body); + } + // 设置锁开锁提醒 Future setLockPickingReminderData({ required int lockId,