1,修复Bug-1000665 开锁页-密码-单次 单次密码不能改,星锁点击有弹出修改密码
2,修复Bug-1000660 开锁页-密码-限时 选择的开始时间是整点,显示却有分钟数 3,修复Bug- 1000658 开锁页-密码-清空码 不可修改,星锁点击修改框弹出 4,修复Bug- 1000649 开锁页-密码-单次-密码详情显示时间错误 5,修复Bug- 1000648 开锁页-密码-清空密码-密码详情显示时间错误 6,修改日期代码重构及参数检查
This commit is contained in:
parent
2723c0b058
commit
4297e25b22
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -138,35 +137,49 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
|||||||
have: state.appUnHaveAccount.value ? "2" : "1",
|
have: state.appUnHaveAccount.value ? "2" : "1",
|
||||||
staffName: state.staffNameController.text,
|
staffName: state.staffNameController.text,
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
usernameType:usernameType,
|
usernameType: usernameType,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
eventBus.fire(RefreshCheckInStaffListDataEvent());
|
eventBus.fire(RefreshCheckInStaffListDataEvent());
|
||||||
Get.close(2);
|
Get.close(2);
|
||||||
}else if(entity.errorCode! == 425){
|
} else if (entity.errorCode! == 425) {
|
||||||
Toast.show(msg: entity.errorMsg!);
|
Toast.show(msg: entity.errorMsg!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取密码请求
|
//获取密码请求
|
||||||
void getKeyboardPwdRequest() async {
|
void getKeyboardPwdRequest() async {
|
||||||
if(state.staffNameController.text.isEmpty){
|
if (state.staffNameController.text.isEmpty) {
|
||||||
Toast.show(msg: "请输入姓名");
|
Toast.show(msg: "请输入姓名");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// var entity = await ApiRepository.to.getPasswordKey(
|
||||||
|
// "0",
|
||||||
|
// '0',
|
||||||
|
// state.staffNameController.text,
|
||||||
|
// 2.toString(),
|
||||||
|
// '0',
|
||||||
|
// state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
// '0',
|
||||||
|
// "0",
|
||||||
|
// '0',
|
||||||
|
// 0,
|
||||||
|
// 0,
|
||||||
|
// 1);
|
||||||
var entity = await ApiRepository.to.getPasswordKey(
|
var entity = await ApiRepository.to.getPasswordKey(
|
||||||
"0",
|
endDate: "0",
|
||||||
'0',
|
isExclusive: '0',
|
||||||
state.staffNameController.text,
|
keyboardPwdName: state.staffNameController.text,
|
||||||
2.toString(),
|
keyboardPwdType: 2.toString(),
|
||||||
'0',
|
keyboardPwdVersion: '0',
|
||||||
state.getKeyInfosData.value.lockId.toString(),
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
'0',
|
operatorUid: '0',
|
||||||
"0",
|
startDate: '0',
|
||||||
'0',
|
timezoneRawOffSet: '0',
|
||||||
0,
|
startHours: 0,
|
||||||
0,
|
endHours: 0,
|
||||||
1);
|
isCoerced: 1);
|
||||||
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('获取密码成功');
|
print('获取密码成功');
|
||||||
if (entity.data != null) {
|
if (entity.data != null) {
|
||||||
|
|||||||
@ -0,0 +1,48 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
|
class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||||
|
final ElectronicKeyDetailChangeDateState state =
|
||||||
|
ElectronicKeyDetailChangeDateState();
|
||||||
|
|
||||||
|
//更新密码请求
|
||||||
|
Future<void> updatePwdRequest() async {
|
||||||
|
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
|
||||||
|
lockId: state.itemData.value.lockId!,
|
||||||
|
keyboardPwdId: state.pwdId.value.toString(),
|
||||||
|
keyboardPwdName: state.inputNameController.text,
|
||||||
|
newKeyboardPwd: state.inputPwdController.text,
|
||||||
|
startDate: state.startDate.value,
|
||||||
|
endDate: state.endDate.value,
|
||||||
|
changeType: state.changeType.value,
|
||||||
|
hoursStart: state.hoursStart.value,
|
||||||
|
hoursEnd: state.hoursEnd.value,
|
||||||
|
isCoerced: state.isCoerced.value);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改钥匙名称请求
|
||||||
|
Future<void> updateKeyDateRequest() async {
|
||||||
|
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
||||||
|
state.itemData.value.keyId.toString(),
|
||||||
|
state.itemData.value.lockId.toString(),
|
||||||
|
state.failureDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
state.endDay.value,
|
||||||
|
'',
|
||||||
|
state.effectiveDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
state.startDay.value,
|
||||||
|
state.weekDays.value);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,16 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
// import 'package:flutter_pickers/pickers.dart';
|
|
||||||
// import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_logic.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
|
||||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:star_lock/tools/toast.dart';
|
|
||||||
|
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../tools/commonItem.dart';
|
import '../../../../../tools/commonItem.dart';
|
||||||
@ -27,34 +20,11 @@ class ElectronicKeyDetailChangeDate extends StatefulWidget {
|
|||||||
|
|
||||||
class _ElectronicKeyDetailChangeDateState
|
class _ElectronicKeyDetailChangeDateState
|
||||||
extends State<ElectronicKeyDetailChangeDate> {
|
extends State<ElectronicKeyDetailChangeDate> {
|
||||||
ElectronicKeyListItem itemData = ElectronicKeyListItem();
|
final logic = Get.put(ElectronicKeyDetailChangeDateLogic());
|
||||||
|
final state = Get.find<ElectronicKeyDetailChangeDateLogic>().state;
|
||||||
String _selectEffectiveDate = ''; //生效时间
|
|
||||||
String _selectFailureDate = ''; //失效时间
|
|
||||||
late DateTime _effectiveDateTime;
|
|
||||||
late DateTime _failureDateTime;
|
|
||||||
late String endDay = '';
|
|
||||||
late String startDay = '';
|
|
||||||
late List weekDays = [];
|
|
||||||
late String pwdId = '';
|
|
||||||
late String lockId = '';
|
|
||||||
late String fromType = ''; // 1 从指纹详情进入
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
|
||||||
if (obj != null && (obj["itemData"] != null)) {
|
|
||||||
itemData = obj["itemData"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["pwdId"] != null)) {
|
|
||||||
pwdId = obj["pwdId"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["lockId"] != null)) {
|
|
||||||
lockId = obj["lockId"];
|
|
||||||
}
|
|
||||||
if (obj != null && (obj["fromType"] != null)) {
|
|
||||||
fromType = obj["fromType"];
|
|
||||||
}
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -69,12 +39,12 @@ class _ElectronicKeyDetailChangeDateState
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (fromType == "1") {
|
if (state.fromType.value == "1") {
|
||||||
} else {
|
} else {
|
||||||
if (lockId.isNotEmpty && pwdId.isNotEmpty) {
|
if (state.lockId.value != 0 && state.pwdId.value.isNotEmpty) {
|
||||||
updatePwdRequest();
|
logic.updatePwdRequest();
|
||||||
} else {
|
} else {
|
||||||
updateKeyDateRequest();
|
logic.updateKeyDateRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -88,77 +58,37 @@ class _ElectronicKeyDetailChangeDateState
|
|||||||
Widget buildMainUI() {
|
Widget buildMainUI() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
rightTitle: _selectEffectiveDate,
|
rightTitle: state.selectEffectiveDate.value,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
setState(() {
|
state.selectEffectiveDate.value =
|
||||||
_selectEffectiveDate =
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
state.effectiveDateTime =
|
||||||
_effectiveDateTime = DateTime.parse(_selectEffectiveDate);
|
DateTime.parse(state.selectEffectiveDate.value);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}),
|
})),
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
rightTitle: _selectFailureDate,
|
rightTitle: state.selectFailureDate.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
setState(() {
|
state.selectFailureDate.value =
|
||||||
_selectFailureDate =
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
state.failureDateTime =
|
||||||
_failureDateTime = DateTime.parse(_selectFailureDate);
|
DateTime.parse(state.selectFailureDate.value);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}),
|
})),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改钥匙名称请求
|
|
||||||
Future<void> updateKeyDateRequest() async {
|
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
|
||||||
itemData.keyId.toString(),
|
|
||||||
itemData.lockId.toString(),
|
|
||||||
_failureDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
endDay,
|
|
||||||
'',
|
|
||||||
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
startDay,
|
|
||||||
weekDays);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
print("修改要是名称成功啦啦啦啦啦");
|
|
||||||
Toast.show(msg: "修改成功");
|
|
||||||
setState(() {
|
|
||||||
Navigator.pop(context);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//更新密码请求
|
|
||||||
Future<void> updatePwdRequest() async {
|
|
||||||
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
|
|
||||||
lockId,
|
|
||||||
pwdId,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
_failureDateTime.millisecondsSinceEpoch.toString(),
|
|
||||||
'');
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
|
||||||
Toast.show(msg: "修改成功");
|
|
||||||
setState(() {
|
|
||||||
Navigator.pop(context);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String intToStr(int v) {
|
String intToStr(int v) {
|
||||||
return (v < 10) ? "0$v" : "$v";
|
return (v < 10) ? "0$v" : "$v";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
|
|
||||||
|
class ElectronicKeyDetailChangeDateState {
|
||||||
|
final itemData = ElectronicKeyListItem().obs;
|
||||||
|
final TextEditingController inputPwdController = TextEditingController();
|
||||||
|
final TextEditingController inputNameController = TextEditingController();
|
||||||
|
final changeType = '1'
|
||||||
|
.obs; //1-通过APP走蓝牙修改,不传默认1,必需先通过APP SDK蓝牙修改后调用该接口 2-通过网关或WiFi锁修改,如果是WiFi锁或有连接网关,则可以传2,直接调用该接口修改生效
|
||||||
|
final isCoerced = '1'.obs; //胁迫指纹:1;非胁迫指纹:2(胁迫指纹开锁触发报警)
|
||||||
|
final hoursStart = 0.obs;
|
||||||
|
final hoursEnd = 0.obs;
|
||||||
|
final startDate = 0.obs;
|
||||||
|
final endDate = 0.obs;
|
||||||
|
final pwdId = ''.obs;
|
||||||
|
final lockId = 0.obs;
|
||||||
|
final fromType = ''.obs;
|
||||||
|
final selectEffectiveDate = ''.obs; //生效时间
|
||||||
|
final selectFailureDate = ''.obs; //失效时间
|
||||||
|
DateTime effectiveDateTime = DateTime.now();
|
||||||
|
DateTime failureDateTime = DateTime.now();
|
||||||
|
final endDay = ''.obs;
|
||||||
|
final startDay = ''.obs;
|
||||||
|
final weekDays = [].obs;
|
||||||
|
|
||||||
|
ElectronicKeyDetailChangeDateState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
// itemData.value = map["itemData"];
|
||||||
|
if ((map["itemData"] != null)) {
|
||||||
|
itemData.value = map["itemData"];
|
||||||
|
}
|
||||||
|
if ((map["pwdId"] != null)) {
|
||||||
|
pwdId.value = map["pwdId"];
|
||||||
|
}
|
||||||
|
if ((map["lockId"] != null)) {
|
||||||
|
lockId.value = map["lockId"];
|
||||||
|
}
|
||||||
|
if ((map["fromType"] != null)) {
|
||||||
|
fromType.value = map["fromType"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,13 +23,16 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
|||||||
//更新密码请求
|
//更新密码请求
|
||||||
Future<void> updatePwdRequest() async {
|
Future<void> updatePwdRequest() async {
|
||||||
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
|
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
|
||||||
state.itemData.value.lockId.toString(),
|
lockId: state.itemData.value.lockId!,
|
||||||
state.itemData.value.keyboardPwdId.toString(),
|
keyboardPwdId: state.itemData.value.keyboardPwdId.toString(),
|
||||||
state.inputNameController.text,
|
keyboardPwdName: state.inputNameController.text,
|
||||||
state.inputPwdController.text,
|
newKeyboardPwd: state.inputPwdController.text,
|
||||||
'',
|
startDate: state.startDate.value,
|
||||||
'',
|
endDate: state.endDate.value,
|
||||||
'');
|
changeType: state.changeType.value,
|
||||||
|
hoursStart: state.hoursStart.value,
|
||||||
|
hoursEnd: state.hoursEnd.value,
|
||||||
|
isCoerced: state.isCoerced.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
Toast.show(msg: "修改成功");
|
Toast.show(msg: "修改成功");
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
@ -55,10 +55,19 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
rightTitle: state.inputPwdController.text.isNotEmpty
|
rightTitle: state.inputPwdController.text.isNotEmpty
|
||||||
? state.inputPwdController.text
|
? state.inputPwdController.text
|
||||||
: state.itemData.value.keyboardPwd,
|
: state.itemData.value.keyboardPwd,
|
||||||
isHaveDirection: true,
|
isHaveDirection: (state.itemData.value.keyboardPwdType == 1 ||
|
||||||
|
state.itemData.value.keyboardPwdType == 4)
|
||||||
|
? false
|
||||||
|
: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () {
|
action: () {
|
||||||
showCupertinoAlertDialog(context, state.inputPwdController);
|
if (state.itemData.value.keyboardPwdType == 1 ||
|
||||||
|
state.itemData.value.keyboardPwdType == 4) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
showCupertinoAlertDialog(
|
||||||
|
context, state.inputPwdController);
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||||
|
|||||||
@ -6,6 +6,13 @@ class PasswordKeyDetailState {
|
|||||||
final itemData = PasswordKeyListItem().obs;
|
final itemData = PasswordKeyListItem().obs;
|
||||||
final TextEditingController inputPwdController = TextEditingController();
|
final TextEditingController inputPwdController = TextEditingController();
|
||||||
final TextEditingController inputNameController = TextEditingController();
|
final TextEditingController inputNameController = TextEditingController();
|
||||||
|
final changeType = '1'
|
||||||
|
.obs; //1-通过APP走蓝牙修改,不传默认1,必需先通过APP SDK蓝牙修改后调用该接口 2-通过网关或WiFi锁修改,如果是WiFi锁或有连接网关,则可以传2,直接调用该接口修改生效
|
||||||
|
final isCoerced = '1'.obs; //胁迫指纹:1;非胁迫指纹:2(胁迫指纹开锁触发报警)
|
||||||
|
final hoursStart = 0.obs;
|
||||||
|
final hoursEnd = 0.obs;
|
||||||
|
final startDate = 0.obs;
|
||||||
|
final endDate = 0.obs;
|
||||||
|
|
||||||
PasswordKeyDetailState() {
|
PasswordKeyDetailState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -12,9 +12,8 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
//请求密码钥匙列表
|
//请求密码钥匙列表
|
||||||
void mockNetworkDataRequest() async {
|
void mockNetworkDataRequest() async {
|
||||||
PasswordKeyListEntity entity = await ApiRepository.to.passwordKeyList(
|
PasswordKeyListEntity entity = await ApiRepository.to.passwordKeyList(
|
||||||
'0',
|
state.keyInfo.value.keyStatus.toString(),
|
||||||
state.keyInfo.value.lockId.toString(),
|
state.keyInfo.value.lockId.toString(),
|
||||||
'0',
|
|
||||||
state.pageNum.toString(),
|
state.pageNum.toString(),
|
||||||
state.pageSize.toString(),
|
state.pageSize.toString(),
|
||||||
state.searchController.text);
|
state.searchController.text);
|
||||||
@ -35,9 +34,10 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//删除密码请求 deleteType:1-蓝牙 2-网关
|
//删除密码请求 deleteType:1-蓝牙 2-网关
|
||||||
Future<void> deletePwdRequest(String lockId, String keyboardPwdId, int deleteType) async {
|
Future<void> deletePwdRequest(
|
||||||
PasswordKeyEntity entity = await ApiRepository.to.deleteKeyboardPwd(
|
String lockId, String keyboardPwdId, int deleteType) async {
|
||||||
lockId, keyboardPwdId, deleteType);
|
PasswordKeyEntity entity = await ApiRepository.to
|
||||||
|
.deleteKeyboardPwd(lockId, keyboardPwdId, deleteType);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
Toast.show(msg: "删除成功");
|
Toast.show(msg: "删除成功");
|
||||||
mockNetworkDataRequest();
|
mockNetworkDataRequest();
|
||||||
|
|||||||
@ -90,18 +90,18 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||||
}
|
}
|
||||||
var entity = await ApiRepository.to.getPasswordKey(
|
var entity = await ApiRepository.to.getPasswordKey(
|
||||||
getFailureDateTime,
|
endDate: getFailureDateTime,
|
||||||
'0',
|
isExclusive: '0',
|
||||||
state.nameController.text,
|
keyboardPwdName: state.nameController.text,
|
||||||
getKeyType,
|
keyboardPwdType: getKeyType,
|
||||||
'0',
|
keyboardPwdVersion: '0',
|
||||||
lockId,
|
lockId: lockId,
|
||||||
'0',
|
operatorUid: '0',
|
||||||
getEffectiveDateTime,
|
startDate: getEffectiveDateTime,
|
||||||
'0',
|
timezoneRawOffSet: '0',
|
||||||
state.loopStartHours.value,
|
startHours: state.loopStartHours.value,
|
||||||
state.loopEndHours.value,
|
endHours: state.loopEndHours.value,
|
||||||
1);
|
isCoerced: 1);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('获取密码成功');
|
print('获取密码成功');
|
||||||
state.isSendSuccess.value = true;
|
state.isSendSuccess.value = true;
|
||||||
|
|||||||
@ -362,19 +362,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
Future<Response> getWifiLockServiceIpAndPort() =>
|
Future<Response> getWifiLockServiceIpAndPort() =>
|
||||||
post(getWifiServiceIpURL.toUrl, jsonEncode({}));
|
post(getWifiServiceIpURL.toUrl, jsonEncode({}));
|
||||||
|
|
||||||
Future<Response> passwordKeyList(
|
Future<Response> passwordKeyList(String keyStatus, String lockId,
|
||||||
String keyStatus,
|
String pageNo, String pageSize, String searchStr) =>
|
||||||
String lockId,
|
|
||||||
String operatorUid,
|
|
||||||
String pageNo,
|
|
||||||
String pageSize,
|
|
||||||
String searchStr) =>
|
|
||||||
post(
|
post(
|
||||||
passwordKeyListURL.toUrl,
|
passwordKeyListURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
'keyStatus': keyStatus,
|
'keyStatus': keyStatus,
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
'operatorUid': operatorUid,
|
|
||||||
'pageNo': pageNo,
|
'pageNo': pageNo,
|
||||||
'pageSize': pageSize,
|
'pageSize': pageSize,
|
||||||
'searchStr': searchStr
|
'searchStr': searchStr
|
||||||
@ -436,14 +430,16 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> updateKeyboardPwd(
|
Future<Response> updateKeyboardPwd(
|
||||||
String lockId,
|
int lockId,
|
||||||
String keyboardPwdId,
|
String keyboardPwdId,
|
||||||
String keyboardPwdName,
|
String keyboardPwdName,
|
||||||
String newKeyboardPwd,
|
String newKeyboardPwd,
|
||||||
String startDate,
|
int startDate,
|
||||||
String endDate,
|
int endDate,
|
||||||
String changeType,
|
String changeType,
|
||||||
) =>
|
String isCoerced,
|
||||||
|
int hoursStart,
|
||||||
|
int hoursEnd) =>
|
||||||
post(
|
post(
|
||||||
updatePasswordKeyURL.toUrl,
|
updatePasswordKeyURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -454,6 +450,9 @@ class ApiProvider extends BaseProvider {
|
|||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'endDate': endDate,
|
'endDate': endDate,
|
||||||
'changeType': changeType,
|
'changeType': changeType,
|
||||||
|
'isCoerced': isCoerced,
|
||||||
|
'hoursStart': hoursStart,
|
||||||
|
'hoursEnd': hoursEnd
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> clearOperationRecord(String lockId) =>
|
Future<Response> clearOperationRecord(String lockId) =>
|
||||||
|
|||||||
@ -323,15 +323,10 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//密码列表
|
//密码列表
|
||||||
Future<PasswordKeyListEntity> passwordKeyList(
|
Future<PasswordKeyListEntity> passwordKeyList(String keyStatus, String lockId,
|
||||||
String keyStatus,
|
String pageNo, String pageSize, String searchStr) async {
|
||||||
String lockId,
|
|
||||||
String operatorUid,
|
|
||||||
String pageNo,
|
|
||||||
String pageSize,
|
|
||||||
String searchStr) async {
|
|
||||||
final res = await apiProvider.passwordKeyList(
|
final res = await apiProvider.passwordKeyList(
|
||||||
keyStatus, lockId, operatorUid, pageNo, pageSize, searchStr);
|
keyStatus, lockId, pageNo, pageSize, searchStr);
|
||||||
return PasswordKeyListEntity.fromJson(res.body);
|
return PasswordKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,43 +352,47 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有锁设置信息
|
// 获取所有锁设置信息
|
||||||
Future<LockSetInfoEntity> getLockSettingInfoData({required String lockId}) async {
|
Future<LockSetInfoEntity> getLockSettingInfoData(
|
||||||
|
{required String lockId}) async {
|
||||||
final res = await apiProvider.getLockSettingInfoData(lockId);
|
final res = await apiProvider.getLockSettingInfoData(lockId);
|
||||||
return LockSetInfoEntity.fromJson(res.body);
|
return LockSetInfoEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除锁
|
// 删除锁
|
||||||
Future<LockListInfoEntity> deletOwnerLockData({required String lockId}) async {
|
Future<LockListInfoEntity> deletOwnerLockData(
|
||||||
|
{required String lockId}) async {
|
||||||
final res = await apiProvider.deletLockInfo(lockId);
|
final res = await apiProvider.deletLockInfo(lockId);
|
||||||
return LockListInfoEntity.fromJson(res.body);
|
return LockListInfoEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除钥匙
|
// 删除钥匙
|
||||||
Future<LockListInfoEntity> deletOwnerKeyData({required String lockId, required String keyId}) async {
|
Future<LockListInfoEntity> deletOwnerKeyData(
|
||||||
|
{required String lockId, required String keyId}) async {
|
||||||
final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId);
|
final res = await apiProvider.deletOwnerKeyInfo(lockId, keyId);
|
||||||
return LockListInfoEntity.fromJson(res.body);
|
return LockListInfoEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查账户密码
|
// 检查账户密码
|
||||||
Future<LockListInfoEntity> checkLoginPassword({required String password}) async {
|
Future<LockListInfoEntity> checkLoginPassword(
|
||||||
|
{required String password}) async {
|
||||||
final res = await apiProvider.checkLoginPassword(password);
|
final res = await apiProvider.checkLoginPassword(password);
|
||||||
return LockListInfoEntity.fromJson(res.body);
|
return LockListInfoEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取密码
|
//获取密码
|
||||||
Future<PasswordKeyEntity> getPasswordKey(
|
Future<PasswordKeyEntity> getPasswordKey(
|
||||||
String endDate,
|
{required String endDate,
|
||||||
String isExclusive,
|
required String isExclusive,
|
||||||
String keyboardPwdName,
|
required String keyboardPwdName,
|
||||||
String keyboardPwdType,
|
required String keyboardPwdType,
|
||||||
String keyboardPwdVersion,
|
required String keyboardPwdVersion,
|
||||||
String lockId,
|
required String lockId,
|
||||||
String operatorUid,
|
required String operatorUid,
|
||||||
String startDate,
|
required String startDate,
|
||||||
String timezoneRawOffSet,
|
required String timezoneRawOffSet,
|
||||||
int startHours,
|
required int startHours,
|
||||||
int endHours,
|
required int endHours,
|
||||||
int isCoerced) async {
|
required int isCoerced}) async {
|
||||||
final res = await apiProvider.getKeyboardPwd(
|
final res = await apiProvider.getKeyboardPwd(
|
||||||
endDate,
|
endDate,
|
||||||
isExclusive,
|
isExclusive,
|
||||||
@ -427,16 +426,27 @@ class ApiRepository {
|
|||||||
|
|
||||||
//修改密码
|
//修改密码
|
||||||
Future<PasswordKeyEntity> updatePasswordKey(
|
Future<PasswordKeyEntity> updatePasswordKey(
|
||||||
String lockId,
|
{required int lockId,
|
||||||
String keyboardPwdId,
|
required String keyboardPwdId,
|
||||||
String keyboardPwdName,
|
required String keyboardPwdName,
|
||||||
String newKeyboardPwd,
|
required String newKeyboardPwd,
|
||||||
String startDate,
|
required int startDate,
|
||||||
String endDate,
|
required int endDate,
|
||||||
String changeType,
|
required String changeType,
|
||||||
) async {
|
required String isCoerced,
|
||||||
final res = await apiProvider.updateKeyboardPwd(lockId, keyboardPwdId,
|
required int hoursStart,
|
||||||
keyboardPwdName, newKeyboardPwd, startDate, endDate, changeType);
|
required int hoursEnd}) async {
|
||||||
|
final res = await apiProvider.updateKeyboardPwd(
|
||||||
|
lockId,
|
||||||
|
keyboardPwdId,
|
||||||
|
keyboardPwdName,
|
||||||
|
newKeyboardPwd,
|
||||||
|
startDate,
|
||||||
|
endDate,
|
||||||
|
changeType,
|
||||||
|
isCoerced,
|
||||||
|
hoursStart,
|
||||||
|
hoursEnd);
|
||||||
return PasswordKeyEntity.fromJson(res.body);
|
return PasswordKeyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user