添加电子钥匙开锁成功上报功能
This commit is contained in:
parent
e34841ad87
commit
caac5f2a55
@ -88,7 +88,10 @@ class LockDetailLogic extends BaseGetXController {
|
||||
state.electricQuantityStandby.value = powerStandby;
|
||||
}
|
||||
// 更新电量
|
||||
uploadElectricQuantityRequest();
|
||||
await uploadElectricQuantityRequest();
|
||||
|
||||
// 开锁成功上报
|
||||
lockReportLockSuccessfullyUploadData();
|
||||
//锁数据更新
|
||||
// getLockRecordLastUploadDataTime();
|
||||
resetOpenDoorState();
|
||||
@ -491,6 +494,22 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 电子钥匙开锁成功上报
|
||||
Future<void> lockReportLockSuccessfullyUploadData() async {
|
||||
final KeyOperationRecordEntity entity = await ApiRepository.to.lockReportLockSuccessfullyUploadData(
|
||||
lockId: state.keyInfos.value.lockId ?? 0,
|
||||
keyId: state.keyInfos.value.keyId ?? 0
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// mockNetworkDataRequest();
|
||||
AppLog.log('state.keyInfos.value.keyType:${state.keyInfos.value.keyType}');
|
||||
if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
// 单次删除
|
||||
deletKeyData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 普通用户或者授权管理员删除钥匙
|
||||
Future<void> deletKeyData() async {
|
||||
final ElectronicKeyListEntity entity = await ApiRepository.to
|
||||
|
||||
@ -339,6 +339,15 @@ class ApiProvider extends BaseProvider {
|
||||
isShowErrMsg: false,
|
||||
);
|
||||
|
||||
// 锁记录上传
|
||||
Future<Response> lockReportLockSuccessfullyUploadData(int lockId, int keyId) => post(
|
||||
lockRecordUploadURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'keyId': keyId,
|
||||
}),
|
||||
isUnShowLoading: true);
|
||||
|
||||
// 获取手机联网token
|
||||
Future<Response> getLockNetToken(String lockId) => post(
|
||||
getLockNetTokenURL.toUrl,
|
||||
|
||||
@ -308,6 +308,13 @@ class ApiRepository {
|
||||
return LockOperatingRecordGetLastRecordTimeEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 电子钥匙开锁成功上报
|
||||
Future<KeyOperationRecordEntity> lockReportLockSuccessfullyUploadData(
|
||||
{required int lockId, required int keyId}) async {
|
||||
final res = await apiProvider.lockReportLockSuccessfullyUploadData(lockId, keyId);
|
||||
return KeyOperationRecordEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取手机联网token
|
||||
Future<LockNetTokenEntity> getLockNetToken({required String lockId}) async {
|
||||
final res = await apiProvider.getLockNetToken(lockId);
|
||||
|
||||
0
pre_build.sh
Normal file → Executable file
0
pre_build.sh
Normal file → Executable file
@ -78,7 +78,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.69+2024070301:xhj 线上环境,提交测试:周常 bug 修复
|
||||
# 1.0.69+2024070302:xhj 线上环境,提交测试:周常 bug 修复
|
||||
|
||||
version: 1.0.69+2024070302
|
||||
version: 1.0.70+2024072401
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user