修改卡指纹人脸电子钥匙循环当天结束时间改为晚上12点

This commit is contained in:
魏少阳 2024-05-14 15:11:14 +08:00
parent 76347a27ee
commit 19b2352ea9
14 changed files with 48 additions and 37 deletions

View File

@ -49,7 +49,7 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
@override @override
String toString() { String toString() {
return 'SenderCustomPasswordsCommand{keyID: $keyID, userID: $userID, ' return 'SenderCustomPasswordsCommand{keyID: $keyID, userID: $userID, '
'pwdNo: $pwdNo, pwd: $pwd, useCountLimit: $useCountLimit, ' 'pwdNo: $pwdNo, pwd: $pwd, useCountLimit: $useCountLimit, operate: $operate, isAdmin: $isAdmin,'
'token: $token, ' 'token: $token, '
'startTime: ${DateTool().dateIntToYMDHNString(startTime)}, ' 'startTime: ${DateTool().dateIntToYMDHNString(startTime)}, '
'endTime: ${DateTool().dateIntToYMDHNString(endTime)}, ' 'endTime: ${DateTool().dateIntToYMDHNString(endTime)}, '

View File

@ -1,16 +1,12 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart'; import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
import 'package:star_lock/blue/sender_manage.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
import 'package:star_lock/network/api_provider.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/dateTool.dart'; import 'package:star_lock/tools/dateTool.dart';
import 'package:star_lock/tools/eventBusEventManage.dart'; import 'package:star_lock/tools/eventBusEventManage.dart';
import '../app_settings/app_settings.dart';
import '../main/lockDetail/lockDetail/lockNetToken_entity.dart'; import '../main/lockDetail/lockDetail/lockNetToken_entity.dart';
import '../network/api_repository.dart'; import '../network/api_repository.dart';
import '../tools/commonDataManage.dart'; import '../tools/commonDataManage.dart';
@ -43,12 +39,12 @@ class SenderBeforeDataManage {
// //
StreamSubscription<Reply>? _replySubscription; StreamSubscription<Reply>? _replySubscription;
bool isBeforeAddUser = true;
// //
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription ??= EventBusManager().eventBus!.on<Reply>().listen((reply) async { _replySubscription ??= EventBusManager().eventBus!.on<Reply>().listen((reply) async {
// //
if (reply is AddUserReply) { if (reply is AddUserReply && isBeforeAddUser == false) {
_replyAddUserKey(reply); _replyAddUserKey(reply);
} }
@ -160,21 +156,26 @@ class SenderBeforeDataManage {
} }
LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo; LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
DateTime startTime = DateTime startTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.startDate! ~/ 1000);
DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.startDate! ~/ 1000); DateTime endTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.endDate! ~/ 1000);
DateTime endTime = bool isRound = currentKeyInfo.keyType == XSConstantMacro.keyTypeLoop;
DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.endDate! ~/ 1000);
bool isRound = currentKeyInfo.keyType == 2;
var startDateTime = currentKeyInfo.startDate! ~/ 1000;
var endDateTime = currentKeyInfo.endDate! ~/ 1000;
if (isRound) {
//
startDateTime = DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.startDate!.toString()), 1) ~/ 1000;
endDateTime = (DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.endDate!.toString()), 1) + CommonDataManage().dayLatestTime) ~/ 1000;
}
var addUserData = AddUserCommand( var addUserData = AddUserCommand(
lockID: BlueManage().connectDeviceName, lockID: BlueManage().connectDeviceName,
authUserID: currentKeyInfo.senderUserId!.toString(), authUserID: currentKeyInfo.senderUserId!.toString(),
keyID: currentKeyInfo.keyId.toString(), keyID: currentKeyInfo.keyId.toString(),
userID: await Storage.getUid(), userID: await Storage.getUid(),
openMode: 1, openMode: 1,
keyType: currentKeyInfo.keyType, keyType: 0,
startDate: currentKeyInfo.startDate! ~/ 1000, startDate: startDateTime,
expireDate: currentKeyInfo.endDate! ~/ 1000, expireDate: endDateTime,
useCountLimit: 0xFFFF, useCountLimit: 0xFFFF,
isRound: isRound ? 1 : 0, isRound: isRound ? 1 : 0,
weekRound: isRound weekRound: isRound

View File

@ -55,6 +55,7 @@ class CommandSenderManager {
return; return;
} }
SenderBeforeDataManage().isBeforeAddUser = isBeforeAddUser;
List<int> value = command.packageData(); List<int> value = command.packageData();
if (isBeforeAddUser == true) { if (isBeforeAddUser == true) {
// //

View File

@ -1,6 +1,8 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../../tools/commonDataManage.dart';
class AddICCardState{ class AddICCardState{
var ifConnectScuess = false.obs; var ifConnectScuess = false.obs;
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
@ -25,7 +27,7 @@ class AddICCardState{
AddICCardState() { AddICCardState() {
Map map = Get.arguments; Map map = Get.arguments;
lockId.value = map["lockId"]; lockId.value = map["lockId"];
endDate.value = map["endDate"]; endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"]; addType.value = map["addType"];
cardName.value = map["cardName"]; cardName.value = map["cardName"];
cardNumber.value = map["cardNumber"]; cardNumber.value = map["cardNumber"];

View File

@ -6,6 +6,7 @@ import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart'; import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/commonDataManage.dart';
import '../../../../tools/commonItem.dart'; import '../../../../tools/commonItem.dart';
import '../../../../tools/dateTool.dart'; import '../../../../tools/dateTool.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
@ -49,13 +50,13 @@ class _OtherTypeKeyChangeValidityDatePageState
state.starDateTimestamp.value = state.starDateTimestamp.value =
DateTool().dateToTimestamp(state.starDate.value, 1); DateTool().dateToTimestamp(state.starDate.value, 1);
state.endDateTimestamp.value = state.endDateTimestamp.value =
DateTool().dateToTimestamp(state.endDate.value, 1); DateTool().dateToTimestamp(state.endDate.value, 1) + CommonDataManage().dayLatestTime;
state.starTimeTimestamp.value = state.starTimeTimestamp.value =
DateTool().dateToTimestamp(state.starTime.value, 0); DateTool().dateToTimestamp(state.starTime.value, 0);
state.endTimeTimestamp.value = state.endTimeTimestamp.value =
DateTool().dateToTimestamp(state.endTime.value, 0); DateTool().dateToTimestamp(state.endTime.value, 0);
if (state.starDateTimestamp.value >= if (state.starDateTimestamp.value >
state.endDateTimestamp.value) { state.endDateTimestamp.value) {
logic.showToast("失效日期要大于生效日期".tr); logic.showToast("失效日期要大于生效日期".tr);
return; return;
@ -111,8 +112,7 @@ class _OtherTypeKeyChangeValidityDatePageState
Pickers.showDatePicker(context, Pickers.showDatePicker(context,
selectDate: selectDate, selectDate: selectDate,
mode: DateMode.YMD, onConfirm: (p) { mode: DateMode.YMD, onConfirm: (p) {
state.starDate.value = state.starDate.value = DateTool().getYMDHNDateString(p, 2);
DateTool().getYMDHNDateString(p, 2);
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(

View File

@ -1,5 +1,7 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../../tools/commonDataManage.dart';
class AddFaceState { class AddFaceState {
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
var ifAddState = false.obs;// var ifAddState = false.obs;//
@ -31,7 +33,7 @@ class AddFaceState {
AddFaceState() { AddFaceState() {
Map map = Get.arguments; Map map = Get.arguments;
lockId.value = map["lockId"]; lockId.value = map["lockId"];
endDate.value = map["endDate"]; endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"]; addType.value = map["addType"];
faceName.value = map["faceName"]; faceName.value = map["faceName"];
faceType.value = map["faceType"]; faceType.value = map["faceType"];

View File

@ -270,7 +270,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
isTipsImg: false, isTipsImg: false,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: SizedBox( rightWidget: SizedBox(
width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))))), width: 60.w, height: 50.h, child: _isAdmin())))),
SizedBox(height: 30.h), SizedBox(height: 30.h),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.next!.tr, btnName: TranslationLoader.lanKeys!.next!.tr,

View File

@ -1,5 +1,6 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/tools/commonDataManage.dart';
class AddFingerprintState{ class AddFingerprintState{
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
@ -28,7 +29,7 @@ class AddFingerprintState{
AddFingerprintState() { AddFingerprintState() {
Map map = Get.arguments; Map map = Get.arguments;
lockId.value = map["lockId"]; lockId.value = map["lockId"];
endDate.value = map["endDate"]; endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"]; addType.value = map["addType"];
fingerprintName.value = map["fingerprintName"]; fingerprintName.value = map["fingerprintName"];
fingerprintType.value = map["fingerprintType"]; fingerprintType.value = map["fingerprintType"];

View File

@ -111,7 +111,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
state.endDate.value = data["endDate"]; state.endDate.value = data["endDate"];
state.startDate.value = data["starTime"]; state.startDate.value = data["starTime"];
state.endTime.value = data["endTime"]; state.endTime.value = data["endTime"];
state.weekDay.value = data["weekDay"]; state.weekDay.value = data["validityValue"];
}); });
} }
} }
@ -137,7 +137,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
state.endDate.value = data["endDate"]; state.endDate.value = data["endDate"];
state.startDate.value = data["starTime"]; state.startDate.value = data["starTime"];
state.endTime.value = data["endTime"]; state.endTime.value = data["endTime"];
state.weekDay.value = data["weekDay"]; state.weekDay.value = data["validityValue"];
}); });
} }
})))), })))),
@ -153,8 +153,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
Routers.otherTypeKeyChangeValidityDatePage, Routers.otherTypeKeyChangeValidityDatePage,
arguments: { arguments: {
"pushType": 1, "pushType": 1,
"fingerprintItemData": "fingerprintItemData": state.fingerprintItemData.value,
state.fingerprintItemData.value,
}); });
if (data != null) { if (data != null) {
setState(() { setState(() {

View File

@ -24,7 +24,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
void _initReplySubscription() { void _initReplySubscription() {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async { _replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
// //
if ((reply is SenderCustomPasswordsReply) && (state.ifCurrentScreen.value == true)) { if (reply is SenderCustomPasswordsReply) {
int status = reply.data[2]; int status = reply.data[2];
switch (status) { switch (status) {
case 0x00: case 0x00:
@ -54,7 +54,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
keyID:state.itemData.value.keyboardPwdId!.toString(), keyID:state.itemData.value.keyboardPwdId!.toString(),
userID:await Storage.getUid(), userID:await Storage.getUid(),
pwdNo: state.itemData.value.pwdUserNo!, pwdNo: state.itemData.value.pwdUserNo!,
pwd: state.isDeletPasswordKey.value == true ? "0" : state.inputPwdController.text, pwd: state.inputPwdController.text,
useCountLimit: 0xffff, useCountLimit: 0xffff,
operate: state.isDeletPasswordKey.value == true ? 2 : 1, operate: state.isDeletPasswordKey.value == true ? 2 : 1,
isAdmin: state.isAdministrator.value == true ? 1 : 0, isAdmin: state.isAdministrator.value == true ? 1 : 0,
@ -156,7 +156,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
keyID:state.itemData.value.keyboardPwdId!.toString(), keyID:state.itemData.value.keyboardPwdId!.toString(),
userID:await Storage.getUid(), userID:await Storage.getUid(),
pwdNo: state.itemData.value.pwdUserNo!, pwdNo: state.itemData.value.pwdUserNo!,
pwd: state.itemData.value.isCustom == 1 ? state.inputPwdController.text :state.isDeletPasswordKey.value == true ? "0" : state.inputPwdController.text, pwd: state.inputPwdController.text,
useCountLimit: 0xffff, useCountLimit: 0xffff,
operate: state.itemData.value.isCustom == 1 ? state.isDeletPasswordKey.value == true ? 2 : 1 : 3, operate: state.itemData.value.isCustom == 1 ? state.isDeletPasswordKey.value == true ? 2 : 1 : 3,
isAdmin: state.isAdministrator.value == true ? 1 : 0, isAdmin: state.isAdministrator.value == true ? 1 : 0,

View File

@ -571,10 +571,13 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
child: TextField( child: TextField(
// //
maxLines: 1, maxLines: 1,
inputFormatters: <TextInputFormatter>[ inputFormatters: editController == state.pwdController ? <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(9),
editController == state.nameController ? 50 : 9), FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
]:<TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(50),
], ],
keyboardType: editController == state.nameController keyboardType: editController == state.nameController
? TextInputType.text ? TextInputType.text

View File

@ -32,6 +32,8 @@ class CommonDataManage {
// get getCurrentLockUserNo => _currentLockUserNo; // get getCurrentLockUserNo => _currentLockUserNo;
LockSetInfoData currentLockSetInfoData = LockSetInfoData(); LockSetInfoData currentLockSetInfoData = LockSetInfoData();
int dayLatestTime = (86400-1)*1000;
} }

View File

@ -77,8 +77,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
Pickers.showDatePicker(context, Pickers.showDatePicker(context,
selectDate: selectDate, selectDate: selectDate,
mode: DateMode.YMD, onConfirm: (p) { mode: DateMode.YMD, onConfirm: (p) {
state.starDate.value = state.starDate.value = DateTool().getYMDHNDateString(p, 2);
DateTool().getYMDHNDateString(p, 2);
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(

View File

@ -40,8 +40,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.30+2024043001 打包鑫锁提审ios # 1.0.30+2024043001 打包鑫锁提审ios
# 1.0.31+2024050301 打包鑫锁提审华为 # 1.0.31+2024050301 打包鑫锁提审华为
# 1.0.32+2024051001打包给欧阳回归测试 # 1.0.32+2024051001打包给欧阳回归测试
# 1.0.33+2024051401打包给欧阳回归测试
version: 1.0.32+2024051001 version: 1.0.33+2024051401
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'