2023-07-27 15:29:37 +08:00
|
|
|
|
import 'package:get/get.dart';
|
2023-08-23 14:27:50 +08:00
|
|
|
|
import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.dart';
|
2023-08-17 18:54:19 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
2023-08-16 17:35:43 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
2023-09-11 09:48:47 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
2023-09-07 18:32:56 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
2023-09-04 15:04:44 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
2023-08-28 17:35:30 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
|
2023-08-23 14:27:50 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
2023-08-25 17:06:42 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
2023-09-15 09:43:20 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
2023-09-13 18:13:36 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
2023-07-29 18:33:48 +08:00
|
|
|
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
|
|
|
|
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
2023-07-29 09:25:21 +08:00
|
|
|
|
import '../login/login/entity/LoginEntity.dart';
|
2023-08-02 09:22:39 +08:00
|
|
|
|
import '../login/register/entity/SendValidationCodeEntity.dart';
|
2023-09-15 16:04:11 +08:00
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSeletKey_entity.dart';
|
|
|
|
|
|
import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart';
|
2023-09-07 18:36:16 +08:00
|
|
|
|
import '../main/lockDetail/lcokSet/configuringWifi/configuringWifiEntity.dart';
|
2023-09-09 18:33:37 +08:00
|
|
|
|
import '../main/lockDetail/lcokSet/lockSet/CheckingInInfoDataEntity.dart';
|
2023-09-07 18:36:16 +08:00
|
|
|
|
import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart';
|
|
|
|
|
|
import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart';
|
2023-09-15 16:04:11 +08:00
|
|
|
|
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
|
2023-08-26 11:40:40 +08:00
|
|
|
|
import '../main/lockMian/entity/lockInfoEntity.dart';
|
2023-08-24 14:25:55 +08:00
|
|
|
|
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
2023-07-27 15:29:37 +08:00
|
|
|
|
import 'api_provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ApiRepository {
|
|
|
|
|
|
final ApiProvider apiProvider;
|
|
|
|
|
|
|
|
|
|
|
|
static ApiRepository get to => Get.find<ApiRepository>();
|
|
|
|
|
|
ApiRepository(this.apiProvider);
|
|
|
|
|
|
|
2023-08-07 10:32:24 +08:00
|
|
|
|
// 发送验证码 1注册,2找回密码,3绑定手机号,4解绑(换绑),5删除账号
|
2023-08-02 09:22:39 +08:00
|
|
|
|
Future<SendValidationCodeEntity> sendValidationCode(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String account,
|
|
|
|
|
|
String channel,
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String codeType,
|
2023-08-02 09:22:39 +08:00
|
|
|
|
String uniqueid,
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String xWidth) async {
|
|
|
|
|
|
final res = await apiProvider.getVerificationCode(
|
|
|
|
|
|
countryCode, account, channel, codeType, uniqueid, xWidth);
|
2023-08-02 09:22:39 +08:00
|
|
|
|
return SendValidationCodeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 注册
|
|
|
|
|
|
Future<LoginEntity> register(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String countryId,
|
|
|
|
|
|
String mobile,
|
|
|
|
|
|
String password,
|
|
|
|
|
|
String uniqueid,
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.register(
|
|
|
|
|
|
countryCode, countryId, mobile, password, uniqueid, verificationCode);
|
2023-07-29 09:25:21 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
|
// 获取图片验证码
|
|
|
|
|
|
Future<SafetyVerificationEntity> getSliderVerifyImg(
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String countryCode, String account) async {
|
2023-07-29 18:33:48 +08:00
|
|
|
|
final res = await apiProvider.getSliderVerifyImg(countryCode, account);
|
|
|
|
|
|
return SafetyVerificationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-02 09:22:39 +08:00
|
|
|
|
// 检验图片验证码
|
|
|
|
|
|
Future<CheckSafetyVerificationEntity> checkSliderVerifyImg(
|
2023-08-07 10:32:24 +08:00
|
|
|
|
String countryCode, String account, String xWidth) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.checkSliderVerifyImg(countryCode, account, xWidth);
|
2023-07-29 18:33:48 +08:00
|
|
|
|
return CheckSafetyVerificationEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-16 17:35:43 +08:00
|
|
|
|
//登录
|
2023-08-07 10:32:24 +08:00
|
|
|
|
Future<LoginEntity> login(String loginType, String password,
|
|
|
|
|
|
String countryCode, String username) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.login(loginType, password, countryCode, username);
|
2023-08-02 09:22:39 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-07-27 15:29:37 +08:00
|
|
|
|
|
2023-08-07 10:32:24 +08:00
|
|
|
|
//重置密码
|
|
|
|
|
|
Future<LoginEntity> resetPassword(
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String account,
|
|
|
|
|
|
String date,
|
|
|
|
|
|
String newPassword,
|
|
|
|
|
|
String uniqueid,
|
|
|
|
|
|
String verificationCode) async {
|
|
|
|
|
|
final res = await apiProvider.resetPassword(
|
|
|
|
|
|
countryCode, account, date, newPassword, uniqueid, verificationCode);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-16 17:35:43 +08:00
|
|
|
|
|
|
|
|
|
|
//获取国家或地区 json文件
|
2023-08-23 14:27:50 +08:00
|
|
|
|
Future<CountryRegionEntity> getCountryRegion(String type) async {
|
2023-08-16 17:35:43 +08:00
|
|
|
|
final res = await apiProvider.getCountryRegion(type);
|
2023-08-23 14:27:50 +08:00
|
|
|
|
return CountryRegionEntity.fromJson(res.body);
|
2023-08-16 17:35:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//电子钥匙列表
|
|
|
|
|
|
Future<ElectronicKeyListEntity> electronicKeyList(
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String keyStatus,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String pageNo,
|
|
|
|
|
|
String pageSize,
|
2023-08-23 14:27:50 +08:00
|
|
|
|
String startDate,
|
|
|
|
|
|
String keyRight) async {
|
2023-08-16 17:35:43 +08:00
|
|
|
|
final res = await apiProvider.electronicKeyList(endDate, keyId, keyStatus,
|
2023-08-23 14:27:50 +08:00
|
|
|
|
lockId, operatorUid, pageNo, pageSize, startDate, keyRight);
|
2023-08-16 17:35:43 +08:00
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//发送电子钥匙
|
|
|
|
|
|
Future<ElectronicKeyListEntity> sendElectronicKey(
|
|
|
|
|
|
String createUser,
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String usernameType,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String faceAuthentication,
|
|
|
|
|
|
String isCameraEnable,
|
|
|
|
|
|
String isRemoteUnlock,
|
|
|
|
|
|
String keyNameForAdmin,
|
|
|
|
|
|
String keyRight,
|
|
|
|
|
|
String keyType,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String receiverUsername,
|
|
|
|
|
|
String remarks,
|
|
|
|
|
|
String startDate,
|
2023-08-17 18:54:19 +08:00
|
|
|
|
List weekDays) async {
|
2023-08-16 17:35:43 +08:00
|
|
|
|
final res = await apiProvider.sendElectronicKey(
|
|
|
|
|
|
createUser,
|
|
|
|
|
|
countryCode,
|
|
|
|
|
|
usernameType,
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
faceAuthentication,
|
|
|
|
|
|
isCameraEnable,
|
|
|
|
|
|
isRemoteUnlock,
|
|
|
|
|
|
keyNameForAdmin,
|
|
|
|
|
|
keyRight,
|
|
|
|
|
|
keyType,
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
operatorUid,
|
|
|
|
|
|
receiverUsername,
|
|
|
|
|
|
remarks,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
weekDays);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-17 18:54:19 +08:00
|
|
|
|
|
|
|
|
|
|
//重置电子钥匙
|
|
|
|
|
|
Future<ElectronicKeyListEntity> resetElectronicKey(
|
|
|
|
|
|
String lockId, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.resetElectronicKey(lockId, operatorUid);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//钥匙详情-操作记录
|
|
|
|
|
|
Future<KeyOperationRecordEntity> lockRecordList(
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String keyStatus,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String pageNo,
|
|
|
|
|
|
String pageSize,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String recordType,
|
|
|
|
|
|
String searchStr,
|
2023-08-31 14:40:50 +08:00
|
|
|
|
String timezoneRawOffSet,
|
|
|
|
|
|
String keyboardPwdId,
|
|
|
|
|
|
String cardId,
|
|
|
|
|
|
String fingerprintId) async {
|
2023-08-17 18:54:19 +08:00
|
|
|
|
final res = await apiProvider.lockRecordList(
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
keyId,
|
|
|
|
|
|
keyStatus,
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
operatorUid,
|
|
|
|
|
|
pageNo,
|
|
|
|
|
|
pageSize,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
recordType,
|
|
|
|
|
|
searchStr,
|
2023-08-31 14:40:50 +08:00
|
|
|
|
timezoneRawOffSet,
|
|
|
|
|
|
keyboardPwdId,
|
|
|
|
|
|
cardId,
|
|
|
|
|
|
fingerprintId);
|
2023-08-17 18:54:19 +08:00
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-24 14:25:55 +08:00
|
|
|
|
|
|
|
|
|
|
// 绑定蓝牙管理员
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<SaveLockEntity> bindingBlueAdmin(
|
|
|
|
|
|
{required String bindingDate,
|
|
|
|
|
|
required String hotelMode,
|
|
|
|
|
|
required String lockAlias,
|
|
|
|
|
|
required Map lockData,
|
|
|
|
|
|
required String nbInitSuccess,
|
|
|
|
|
|
required Map position,
|
|
|
|
|
|
required Map bluetooth,
|
2023-08-31 15:56:01 +08:00
|
|
|
|
required String deviceNo,
|
2023-09-07 18:36:16 +08:00
|
|
|
|
required String lockUserNo,
|
|
|
|
|
|
required String pwdTimestamp}) async {
|
2023-09-04 11:11:14 +08:00
|
|
|
|
final res = await apiProvider.bindingBlueAdmin(
|
|
|
|
|
|
bindingDate,
|
|
|
|
|
|
hotelMode,
|
|
|
|
|
|
lockAlias,
|
|
|
|
|
|
lockData,
|
|
|
|
|
|
nbInitSuccess,
|
|
|
|
|
|
position,
|
|
|
|
|
|
bluetooth,
|
|
|
|
|
|
deviceNo,
|
2023-09-07 18:36:16 +08:00
|
|
|
|
lockUserNo,
|
|
|
|
|
|
pwdTimestamp);
|
2023-08-24 14:25:55 +08:00
|
|
|
|
return SaveLockEntity.fromJson(res.body);
|
2023-08-24 14:34:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-18 18:25:58 +08:00
|
|
|
|
//锁电量更新
|
|
|
|
|
|
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
|
|
|
|
|
String electricQuantity, String lockId) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.uploadElectricQuantity(electricQuantity, lockId);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//锁名称修改
|
|
|
|
|
|
Future<KeyOperationRecordEntity> modifyKeyName(
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String keyName,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.modifyKeyName(keyId, lockId, keyName, operatorUid);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-23 14:27:50 +08:00
|
|
|
|
|
|
|
|
|
|
//编辑电子钥匙名字
|
|
|
|
|
|
Future<KeyOperationRecordEntity> modifyKeyNameForAdmin(
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String keyNameForAdmin,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.modifyKeyNameForAdmin(
|
|
|
|
|
|
keyId, keyNameForAdmin, operatorUid);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-04 11:11:14 +08:00
|
|
|
|
//编辑电子钥匙有效期
|
|
|
|
|
|
Future<KeyOperationRecordEntity> updateKeyDate(
|
|
|
|
|
|
String keyId,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String endDay,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String startDay,
|
|
|
|
|
|
List weekDays) async {
|
|
|
|
|
|
final res = await apiProvider.updateKeyDate(keyId, lockId, endDate, endDay,
|
|
|
|
|
|
operatorUid, startDate, startDay, weekDays);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//密码列表
|
2023-08-23 14:27:50 +08:00
|
|
|
|
Future<PasswordKeyListEntity> passwordKeyList(
|
|
|
|
|
|
String keyStatus,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String pageNo,
|
|
|
|
|
|
String pageSize,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.passwordKeyList(
|
|
|
|
|
|
keyStatus, lockId, operatorUid, pageNo, pageSize);
|
|
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//重置密码钥匙
|
|
|
|
|
|
Future<PasswordKeyListEntity> resetPasswordKey(
|
|
|
|
|
|
String lockId, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.resetPasswordKey(lockId, operatorUid);
|
|
|
|
|
|
return PasswordKeyListEntity.fromJson(res.body);
|
2023-08-24 14:25:55 +08:00
|
|
|
|
}
|
2023-08-26 11:40:40 +08:00
|
|
|
|
|
|
|
|
|
|
// 获取锁信息
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<LockMainEntity> getLockInfo(
|
|
|
|
|
|
{required String lastUpdateDate, required String pageNo}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockInfo(lastUpdateDate, pageNo);
|
2023-08-26 11:40:40 +08:00
|
|
|
|
return LockMainEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-29 17:39:35 +08:00
|
|
|
|
// 删除锁
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<LockMainEntity> deletLockData({required String lockId}) async {
|
2023-08-29 17:39:35 +08:00
|
|
|
|
final res = await apiProvider.deletLockInfo(lockId);
|
|
|
|
|
|
return LockMainEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-25 17:06:42 +08:00
|
|
|
|
//获取密码
|
|
|
|
|
|
Future<PasswordKeyEntity> getPasswordKey(
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String isExclusive,
|
|
|
|
|
|
String keyboardPwdName,
|
|
|
|
|
|
String keyboardPwdType,
|
|
|
|
|
|
String keyboardPwdVersion,
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String operatorUid,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String timezoneRawOffSet,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.getKeyboardPwd(
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
isExclusive,
|
|
|
|
|
|
keyboardPwdName,
|
|
|
|
|
|
keyboardPwdType,
|
|
|
|
|
|
keyboardPwdVersion,
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
operatorUid,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
timezoneRawOffSet);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-08-28 17:35:30 +08:00
|
|
|
|
|
2023-09-07 18:32:56 +08:00
|
|
|
|
//自定义密码
|
|
|
|
|
|
Future<PasswordKeyEntity> addPasswordKey(
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String keyboardPwdName,
|
|
|
|
|
|
String keyboardPwd,
|
|
|
|
|
|
String keyboardPwdType,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String addType,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.addKeyboardPwd(lockId, keyboardPwdName,
|
|
|
|
|
|
keyboardPwd, keyboardPwdType, startDate, endDate, addType);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//修改密码
|
|
|
|
|
|
Future<PasswordKeyEntity> updatePasswordKey(
|
|
|
|
|
|
String lockId,
|
|
|
|
|
|
String keyboardPwdId,
|
|
|
|
|
|
String keyboardPwdName,
|
|
|
|
|
|
String newKeyboardPwd,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String changeType,
|
|
|
|
|
|
) async {
|
|
|
|
|
|
final res = await apiProvider.updateKeyboardPwd(lockId, keyboardPwdId,
|
|
|
|
|
|
keyboardPwdName, newKeyboardPwd, startDate, endDate, changeType);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-28 17:35:30 +08:00
|
|
|
|
//清空操作记录
|
|
|
|
|
|
Future<KeyOperationRecordEntity> clearOperationRecord(String lockId) async {
|
|
|
|
|
|
final res = await apiProvider.clearOperationRecord(lockId);
|
|
|
|
|
|
return KeyOperationRecordEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//创建锁分组
|
2023-09-13 18:13:36 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> addLockGroup(
|
2023-08-28 17:35:30 +08:00
|
|
|
|
String groupName, String operatorUid) async {
|
|
|
|
|
|
final res = await apiProvider.addLockGroup(groupName, operatorUid);
|
2023-09-13 18:13:36 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
2023-08-28 17:35:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-07 18:32:56 +08:00
|
|
|
|
//设置锁分组
|
2023-09-13 18:13:36 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> setLockGroup(
|
2023-09-07 18:32:56 +08:00
|
|
|
|
String lockId, String groupId) async {
|
|
|
|
|
|
final res = await apiProvider.setLockGroup(lockId, groupId);
|
2023-09-13 18:13:36 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
2023-09-07 18:32:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-28 17:35:30 +08:00
|
|
|
|
//锁分组列表
|
2023-09-12 18:38:11 +08:00
|
|
|
|
Future<MassSendLockGroupListEntity> lockGroupList(String type) async {
|
2023-08-28 17:35:30 +08:00
|
|
|
|
final res = await apiProvider.lockGroupList(type);
|
2023-09-12 18:38:11 +08:00
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
2023-08-28 17:35:30 +08:00
|
|
|
|
}
|
2023-08-29 17:41:20 +08:00
|
|
|
|
|
|
|
|
|
|
//删除电子钥匙
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<ElectronicKeyListEntity> deleteElectronicKey(String keyId) async {
|
|
|
|
|
|
final res = await apiProvider.deleteElectronicKey(keyId);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
2023-08-29 17:41:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 09:43:20 +08:00
|
|
|
|
//删除授权管理员
|
|
|
|
|
|
Future<ElectronicKeyListEntity> deleteAdministrator(
|
|
|
|
|
|
String uid, String includeUnderlings) async {
|
|
|
|
|
|
final res = await apiProvider.deleteAdministrator(uid, includeUnderlings);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//更新授权管理员
|
|
|
|
|
|
Future<ElectronicKeyListEntity> updateAdministrator(String uid, String name,
|
|
|
|
|
|
String endDate, String startDate, String isRemoteUnlock) async {
|
|
|
|
|
|
final res = await apiProvider.updateAdministrator(
|
|
|
|
|
|
uid, name, endDate, startDate, isRemoteUnlock);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//即将到期的锁列表
|
|
|
|
|
|
Future<ElectronicKeyListEntity> expireLockList(
|
|
|
|
|
|
String operatorUid, String pageNo, String pageSize) async {
|
|
|
|
|
|
final res = await apiProvider.expireLockList(operatorUid, pageNo, pageSize);
|
|
|
|
|
|
return ElectronicKeyListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-29 17:41:20 +08:00
|
|
|
|
//删除密码
|
2023-08-30 10:58:00 +08:00
|
|
|
|
Future<PasswordKeyEntity> deleteKeyboardPwd(
|
2023-09-04 11:11:14 +08:00
|
|
|
|
String lockId, String keyboardPwdId, String deleteType) async {
|
2023-08-29 17:41:20 +08:00
|
|
|
|
final res =
|
2023-09-04 11:11:14 +08:00
|
|
|
|
await apiProvider.deleteKeyboardPwd(lockId, keyboardPwdId, deleteType);
|
2023-08-30 10:58:00 +08:00
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//标记房态
|
|
|
|
|
|
Future<PasswordKeyEntity> updateSetting(
|
|
|
|
|
|
String lockId, String isOn, String type) async {
|
|
|
|
|
|
final res = await apiProvider.deleteKeyboardPwd(lockId, isOn, type);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
2023-08-29 17:41:20 +08:00
|
|
|
|
}
|
2023-08-31 15:58:29 +08:00
|
|
|
|
|
|
|
|
|
|
//分组列表
|
|
|
|
|
|
Future<PasswordKeyEntity> keyGroupList(String type) async {
|
|
|
|
|
|
final res = await apiProvider.keyGroupList(type);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//分组下的锁
|
|
|
|
|
|
Future<PasswordKeyEntity> lockListByGroup(
|
|
|
|
|
|
String type, String keyGroupId) async {
|
|
|
|
|
|
final res = await apiProvider.lockListByGroup(type, keyGroupId);
|
|
|
|
|
|
return PasswordKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-07 18:36:16 +08:00
|
|
|
|
|
|
|
|
|
|
// 获取Wifi锁服务器
|
|
|
|
|
|
Future<ConfiguringWifiEntity> getWifiLockServiceIpAndPort() async {
|
|
|
|
|
|
final res = await apiProvider.getWifiLockServiceIpAndPort();
|
|
|
|
|
|
return ConfiguringWifiEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-11 09:48:47 +08:00
|
|
|
|
/// 锁设置模块
|
2023-09-07 18:36:16 +08:00
|
|
|
|
// 远程开锁开/关
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<LoginEntity> remoteUnlockingOpenOrClose({
|
2023-09-07 18:36:16 +08:00
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String featureValue,
|
|
|
|
|
|
}) async {
|
2023-09-11 09:48:47 +08:00
|
|
|
|
final res = await apiProvider.remoteUnlockingOpenOrCloseLoadData(
|
|
|
|
|
|
lockId, featureValue);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 自动闭锁
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<LoginEntity> setAutoUnlock({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String autoLockTime,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
}) async {
|
2023-09-07 18:36:16 +08:00
|
|
|
|
final res =
|
2023-09-11 09:48:47 +08:00
|
|
|
|
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取锁的常开模式设置 configPassageMode
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetPassageModeConfigEntity> getPassageModeConfig({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getPassageModeConfigLoadData(lockId);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return GetPassageModeConfigEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 配置锁的常开模式
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetPassageModeConfigEntity> configPassageModeLoadData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String passageMode,
|
|
|
|
|
|
required String autoUnlock,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String isAllDay,
|
|
|
|
|
|
required List weekDays,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.configPassageMode(lockId, passageMode,
|
|
|
|
|
|
autoUnlock, type, startDate, endDate, isAllDay, weekDays);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return GetPassageModeConfigEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 配置锁的常规设置
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<LoginEntity> setLockSetGeneralSettingData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String changeType,
|
|
|
|
|
|
required String isOn,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.setLockSetGeneralSetting(
|
|
|
|
|
|
lockId, changeType, isOn, type);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取锁时间 通过网关
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetPassageModeConfigEntity> getLockTimeFromGateway({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return GetPassageModeConfigEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取服务器当前时间
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetServerDatetimeEntity> getServerDatetimeData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getServerDatetimeLoadData(lockId);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
return GetServerDatetimeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-09 18:33:37 +08:00
|
|
|
|
// 锁诊断上传数据
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<LoginEntity> setLockDiagnoseData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String electricQuantity,
|
|
|
|
|
|
required String firmwareRevision,
|
|
|
|
|
|
required String hardwareRevision,
|
|
|
|
|
|
required String lockDate,
|
|
|
|
|
|
required String modelNum,
|
|
|
|
|
|
required String pwdInfo,
|
|
|
|
|
|
required String timestamp,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.setLockDiagnoseData(
|
|
|
|
|
|
lockId,
|
|
|
|
|
|
electricQuantity,
|
|
|
|
|
|
firmwareRevision,
|
|
|
|
|
|
hardwareRevision,
|
|
|
|
|
|
lockDate,
|
|
|
|
|
|
modelNum,
|
|
|
|
|
|
pwdInfo,
|
|
|
|
|
|
timestamp);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-07 18:36:16 +08:00
|
|
|
|
// 获取锁版本信息
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<GetServerDatetimeEntity> getLockVersionInfoData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.getLockVersionInfoLoadData(lockId);
|
|
|
|
|
|
return GetServerDatetimeEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-07 18:44:05 +08:00
|
|
|
|
|
2023-09-07 18:32:56 +08:00
|
|
|
|
//分组下的锁列表
|
|
|
|
|
|
Future<MassSendLockGroupListEntity> listLockByGroup(
|
|
|
|
|
|
String type, String keyGroupId) async {
|
|
|
|
|
|
final res = await apiProvider.listLockByGroup(type, keyGroupId);
|
|
|
|
|
|
return MassSendLockGroupListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-04 15:04:44 +08:00
|
|
|
|
//获取单把钥匙详情信息
|
|
|
|
|
|
Future<KeyDetailEntity> getKeyDetail(String lockId) async {
|
|
|
|
|
|
final res = await apiProvider.getKeyDetail(lockId);
|
|
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-07 18:32:56 +08:00
|
|
|
|
|
|
|
|
|
|
//锁用户列表
|
|
|
|
|
|
Future<LockUserListEntity> lockUserList(
|
|
|
|
|
|
String pageNo, String pageSize, String searchStr) async {
|
|
|
|
|
|
final res = await apiProvider.lockUserList(pageNo, pageSize, searchStr);
|
|
|
|
|
|
return LockUserListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 09:43:20 +08:00
|
|
|
|
//用户拥有的钥匙
|
2023-09-13 18:13:36 +08:00
|
|
|
|
Future<KeyListByUserEntity> keyListByUser(
|
|
|
|
|
|
String pageNo, String pageSize, String uid) async {
|
|
|
|
|
|
final res = await apiProvider.keyListByUser(pageNo, pageSize, uid);
|
|
|
|
|
|
return KeyListByUserEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//群发电子钥匙检查
|
2023-09-07 18:32:56 +08:00
|
|
|
|
Future<KeyDetailEntity> canSendKey(
|
2023-09-12 18:38:11 +08:00
|
|
|
|
String endDate, List keyGroupIdList, List lockIdList) async {
|
2023-09-07 18:32:56 +08:00
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.canSendKey(endDate, keyGroupIdList, lockIdList);
|
|
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
2023-09-07 18:36:16 +08:00
|
|
|
|
}
|
2023-09-09 18:33:37 +08:00
|
|
|
|
|
2023-09-13 18:13:36 +08:00
|
|
|
|
//群发电子钥匙
|
2023-09-11 09:48:47 +08:00
|
|
|
|
Future<KeyDetailEntity> batchSendKey(
|
|
|
|
|
|
String endDate,
|
2023-09-12 18:38:11 +08:00
|
|
|
|
List keyGroupIdList,
|
|
|
|
|
|
List lockIdList,
|
2023-09-11 09:48:47 +08:00
|
|
|
|
String createUser,
|
|
|
|
|
|
String isRemoteUnlock,
|
|
|
|
|
|
String keyNameForAdmin,
|
|
|
|
|
|
String receiverUsername,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String countryCode,
|
2023-09-12 18:38:11 +08:00
|
|
|
|
String usernameType,
|
|
|
|
|
|
List weekDays) async {
|
2023-09-11 09:48:47 +08:00
|
|
|
|
final res = await apiProvider.batchSendKey(
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
keyGroupIdList,
|
|
|
|
|
|
lockIdList,
|
|
|
|
|
|
createUser,
|
|
|
|
|
|
isRemoteUnlock,
|
|
|
|
|
|
keyNameForAdmin,
|
|
|
|
|
|
receiverUsername,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
countryCode,
|
2023-09-12 18:38:11 +08:00
|
|
|
|
usernameType,
|
|
|
|
|
|
weekDays);
|
2023-09-11 09:48:47 +08:00
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-09-11 10:20:44 +08:00
|
|
|
|
|
2023-09-13 18:13:36 +08:00
|
|
|
|
//增加授权管理员
|
|
|
|
|
|
Future<KeyDetailEntity> addAuthorizedAdmin(
|
|
|
|
|
|
String createUser,
|
|
|
|
|
|
String endDate,
|
|
|
|
|
|
String isRemoteUnlock,
|
|
|
|
|
|
List keyGroupIdList,
|
|
|
|
|
|
List lockIdList,
|
|
|
|
|
|
String name,
|
|
|
|
|
|
String startDate,
|
|
|
|
|
|
String userid,
|
|
|
|
|
|
String countryCode,
|
|
|
|
|
|
String usernameType) async {
|
|
|
|
|
|
final res = await apiProvider.addAuthorizedAdmin(
|
|
|
|
|
|
createUser,
|
|
|
|
|
|
endDate,
|
|
|
|
|
|
isRemoteUnlock,
|
|
|
|
|
|
keyGroupIdList,
|
|
|
|
|
|
lockIdList,
|
|
|
|
|
|
name,
|
|
|
|
|
|
startDate,
|
|
|
|
|
|
userid,
|
|
|
|
|
|
countryCode,
|
|
|
|
|
|
usernameType);
|
|
|
|
|
|
return KeyDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 09:43:20 +08:00
|
|
|
|
//授权管理员列表
|
|
|
|
|
|
Future<AuthorizedAdminListEntity> authorizedAdminList(
|
|
|
|
|
|
String pageNo, String pageSize) async {
|
|
|
|
|
|
final res = await apiProvider.authorizedAdminList(pageNo, pageSize);
|
|
|
|
|
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-09 18:33:37 +08:00
|
|
|
|
// 开启考勤 获取考勤信息
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<CheckingInInfoDataEntity> openCheckingInData(
|
|
|
|
|
|
{required String lockId}) async {
|
2023-09-09 18:33:37 +08:00
|
|
|
|
final res = await apiProvider.openCheckingInGetData(lockId);
|
|
|
|
|
|
return CheckingInInfoDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 设置考勤时创建公司
|
|
|
|
|
|
Future<LoginEntity> setCheckInCreateCompanyData(
|
2023-09-11 10:20:44 +08:00
|
|
|
|
{required String lockId,
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String companyName,
|
|
|
|
|
|
required List workDay,
|
|
|
|
|
|
required String workEndTime,
|
|
|
|
|
|
required String workStartTime}) async {
|
|
|
|
|
|
final res = await apiProvider.setCheckInCreateCompanyData(lockId,
|
|
|
|
|
|
attendanceType, companyName, workDay, workEndTime, workStartTime);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 设置锁开锁提醒
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<LoginEntity> setLockPickingReminderData({
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String keyId,
|
|
|
|
|
|
required String monitorFlag,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.setLockPickingReminderData(
|
|
|
|
|
|
lockId, keyId, monitorFlag);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 16:04:11 +08:00
|
|
|
|
// 获取考勤列表 - 早到榜日榜
|
|
|
|
|
|
Future<CheckingInListDayEntity> getCheckInListEarlyArrivalWithDateData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInListEarlyArrivalWithDateData(companyId, attendanceDate);
|
|
|
|
|
|
return CheckingInListDayEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 早到榜月榜
|
|
|
|
|
|
Future<CheckingInListMonthEntity> getCheckInListEarlyArrivalWithMonthData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInListEarlyArrivalWithMonthData(companyId, attendanceDate);
|
|
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 迟到榜日榜
|
|
|
|
|
|
Future<CheckingInListDayEntity> getCheckInListLateTimesWithDateData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInListLateTimesWithDateData(companyId, attendanceDate);
|
|
|
|
|
|
return CheckingInListDayEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 迟到榜月榜
|
|
|
|
|
|
Future<CheckingInListMonthEntity> getCheckInListLateTimesWithMonthData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInListLateTimesWithMonthData(companyId, attendanceDate);
|
|
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤列表 - 勤奋榜
|
|
|
|
|
|
Future<CheckingInListMonthEntity> getCheckInListHardworkingData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInListHardworkingData(companyId, attendanceDate, type);
|
|
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤详情
|
|
|
|
|
|
Future<CheckingInDetailEntity> getCheckInDetailData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String attendanceDate,
|
|
|
|
|
|
required String staffId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInDetailData(companyId, attendanceDate, staffId);
|
|
|
|
|
|
return CheckingInDetailEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取员工列表
|
|
|
|
|
|
Future<CheckingInAddStaffListEntity> getStaffListData(
|
2023-09-09 18:33:37 +08:00
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getStaffListData(companyId, lockId);
|
2023-09-15 16:04:11 +08:00
|
|
|
|
return CheckingInAddStaffListEntity.fromJson(res.body);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加员工
|
2023-09-11 10:20:44 +08:00
|
|
|
|
Future<LoginEntity> addStaffData({
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String attendanceWay,
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String have,
|
|
|
|
|
|
required String staffName,
|
|
|
|
|
|
required String countryCode,
|
|
|
|
|
|
required String usernameType,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res = await apiProvider.addStaffData(attendanceType, attendanceWay,
|
|
|
|
|
|
companyId, have, staffName, countryCode, usernameType);
|
2023-09-09 18:33:37 +08:00
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-09-15 16:04:11 +08:00
|
|
|
|
// 编辑员工
|
|
|
|
|
|
Future<LoginEntity> editStaffData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String attendanceWay,
|
|
|
|
|
|
required String staffId,
|
|
|
|
|
|
required String have,
|
|
|
|
|
|
required String staffName,
|
|
|
|
|
|
required String countryCode,
|
|
|
|
|
|
required String usernameType,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.editStaffData(attendanceType, attendanceWay, staffId, have, staffName, countryCode, usernameType);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加员工选择钥匙
|
|
|
|
|
|
Future<CheckingInAddStaffSeletKeyEntity> addStaffSeletKeyData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.addStaffSeletKeyData(companyId, type);
|
|
|
|
|
|
return CheckingInAddStaffSeletKeyEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加假期
|
|
|
|
|
|
Future<LoginEntity> addHolidaysData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String fillClassDate,
|
|
|
|
|
|
required String vacationEndDate,
|
|
|
|
|
|
required String vacationName,
|
|
|
|
|
|
required String vacationStartDate,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.addHolidaysData(companyId, fillClassDate, vacationEndDate, vacationName, vacationStartDate);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 假期列表
|
|
|
|
|
|
Future<CheckingInSetHolidaysInfoDataEntity> holidaysListData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String vacationYear,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.holidaysListData(companyId, vacationYear);
|
|
|
|
|
|
return CheckingInSetHolidaysInfoDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除假期
|
|
|
|
|
|
Future<LoginEntity> deletHolidaysData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String vacationId
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.deletHolidaysData(vacationId);
|
|
|
|
|
|
return LoginEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取考勤设置信息
|
|
|
|
|
|
Future<CheckingInSetEntity> getCheckInSetInfoData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getCheckInSetInfoData(companyId);
|
|
|
|
|
|
return CheckingInSetEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 修改考勤设置信息
|
|
|
|
|
|
Future<CheckingInSetEntity> editCheckInSetInfoData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String attendanceType,
|
|
|
|
|
|
required String companyId,
|
|
|
|
|
|
required String type,
|
|
|
|
|
|
required String companyName,
|
|
|
|
|
|
required String workEndTime,
|
|
|
|
|
|
required String workStartTime,
|
|
|
|
|
|
required List<int> workDay,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.editCheckInSetInfoData(attendanceType, companyId, type, companyName, workEndTime, workStartTime, workDay);
|
|
|
|
|
|
return CheckingInSetEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取指纹列表
|
|
|
|
|
|
Future<FingerprintListDataEntity> getFingerprintsListData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String pageNo,
|
|
|
|
|
|
required String pageSize,
|
|
|
|
|
|
required String searchStr,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.getFingerprintsListData(lockId, pageNo, pageSize, searchStr);
|
|
|
|
|
|
return FingerprintListDataEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加指纹
|
|
|
|
|
|
Future<CheckingInListMonthEntity> addFingerprintsData(
|
|
|
|
|
|
{
|
|
|
|
|
|
required String lockId,
|
|
|
|
|
|
required String endDate,
|
|
|
|
|
|
required String addType,
|
|
|
|
|
|
required String fingerprintName,
|
|
|
|
|
|
required String fingerprintNumber,
|
|
|
|
|
|
required String fingerprintType,
|
|
|
|
|
|
required String isCoerced,
|
|
|
|
|
|
required String startDate,
|
|
|
|
|
|
required String cyclicConfig,
|
|
|
|
|
|
}) async {
|
|
|
|
|
|
final res =
|
|
|
|
|
|
await apiProvider.addFingerprintsData(lockId, endDate, addType, fingerprintName, fingerprintNumber, fingerprintType, isCoerced, startDate, cyclicConfig);
|
|
|
|
|
|
return CheckingInListMonthEntity.fromJson(res.body);
|
|
|
|
|
|
}
|
2023-07-27 15:29:37 +08:00
|
|
|
|
}
|