修改卡指纹人脸电子钥匙循环当天结束时间改为晚上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
String toString() {
return 'SenderCustomPasswordsCommand{keyID: $keyID, userID: $userID, '
'pwdNo: $pwdNo, pwd: $pwd, useCountLimit: $useCountLimit, '
'pwdNo: $pwdNo, pwd: $pwd, useCountLimit: $useCountLimit, operate: $operate, isAdmin: $isAdmin,'
'token: $token, '
'startTime: ${DateTool().dateIntToYMDHNString(startTime)}, '
'endTime: ${DateTool().dateIntToYMDHNString(endTime)}, '

View File

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

View File

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

View File

@ -1,6 +1,8 @@
import 'package:get/get.dart';
import '../../../../tools/commonDataManage.dart';
class AddICCardState{
var ifConnectScuess = false.obs;
var ifCurrentScreen = true.obs; // ,
@ -25,7 +27,7 @@ class AddICCardState{
AddICCardState() {
Map map = Get.arguments;
lockId.value = map["lockId"];
endDate.value = map["endDate"];
endDate.value = "${int.parse(map["endDate"]) + CommonDataManage().dayLatestTime}";
addType.value = map["addType"];
cardName.value = map["cardName"];
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 '../../../../app_settings/app_colors.dart';
import '../../../../tools/commonDataManage.dart';
import '../../../../tools/commonItem.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/submitBtn.dart';
@ -49,13 +50,13 @@ class _OtherTypeKeyChangeValidityDatePageState
state.starDateTimestamp.value =
DateTool().dateToTimestamp(state.starDate.value, 1);
state.endDateTimestamp.value =
DateTool().dateToTimestamp(state.endDate.value, 1);
DateTool().dateToTimestamp(state.endDate.value, 1) + CommonDataManage().dayLatestTime;
state.starTimeTimestamp.value =
DateTool().dateToTimestamp(state.starTime.value, 0);
state.endTimeTimestamp.value =
DateTool().dateToTimestamp(state.endTime.value, 0);
if (state.starDateTimestamp.value >=
if (state.starDateTimestamp.value >
state.endDateTimestamp.value) {
logic.showToast("失效日期要大于生效日期".tr);
return;
@ -111,8 +112,7 @@ class _OtherTypeKeyChangeValidityDatePageState
Pickers.showDatePicker(context,
selectDate: selectDate,
mode: DateMode.YMD, onConfirm: (p) {
state.starDate.value =
DateTool().getYMDHNDateString(p, 2);
state.starDate.value = DateTool().getYMDHNDateString(p, 2);
});
})),
Obx(() => CommonItem(

View File

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

View File

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

View File

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

View File

@ -111,7 +111,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
state.endDate.value = data["endDate"];
state.startDate.value = data["starTime"];
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.startDate.value = data["starTime"];
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,
arguments: {
"pushType": 1,
"fingerprintItemData":
state.fingerprintItemData.value,
"fingerprintItemData": state.fingerprintItemData.value,
});
if (data != null) {
setState(() {

View File

@ -24,7 +24,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
void _initReplySubscription() {
_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];
switch (status) {
case 0x00:
@ -54,7 +54,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
keyID:state.itemData.value.keyboardPwdId!.toString(),
userID:await Storage.getUid(),
pwdNo: state.itemData.value.pwdUserNo!,
pwd: state.isDeletPasswordKey.value == true ? "0" : state.inputPwdController.text,
pwd: state.inputPwdController.text,
useCountLimit: 0xffff,
operate: state.isDeletPasswordKey.value == true ? 2 : 1,
isAdmin: state.isAdministrator.value == true ? 1 : 0,
@ -156,7 +156,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
keyID:state.itemData.value.keyboardPwdId!.toString(),
userID:await Storage.getUid(),
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,
operate: state.itemData.value.isCustom == 1 ? state.isDeletPasswordKey.value == true ? 2 : 1 : 3,
isAdmin: state.isAdministrator.value == true ? 1 : 0,

View File

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

View File

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

View File

@ -77,8 +77,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
Pickers.showDatePicker(context,
selectDate: selectDate,
mode: DateMode.YMD, onConfirm: (p) {
state.starDate.value =
DateTool().getYMDHNDateString(p, 2);
state.starDate.value = DateTool().getYMDHNDateString(p, 2);
});
})),
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.31+2024050301 打包鑫锁提审华为
# 1.0.32+2024051001打包给欧阳回归测试
# 1.0.33+2024051401打包给欧阳回归测试
version: 1.0.32+2024051001
version: 1.0.33+2024051401
environment:
sdk: '>=2.12.0 <3.0.0'