diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart index c4d94fbe..0b74adc8 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart @@ -22,6 +22,8 @@ class LockGroupListPage extends StatefulWidget { class _LockGroupListPageState extends State { TextEditingController _changeNameController = TextEditingController(); + List itemDataList = []; + int lockNum = 0; @override void initState() { @@ -60,35 +62,43 @@ class _LockGroupListPageState extends State { } Widget _buildMainUI() { + for (int i = 0; i < itemDataList.length; i++) { + GroupListItem itemData = itemDataList[i]; + lockNum += itemData.lockList!.length; + } return ListView.builder( - itemCount: 2, + itemCount: itemDataList.length + 1, itemBuilder: (c, index) { - if (index == 1) { + if (index == itemDataList.length) { return Center( child: Column( children: [ SizedBox( - height: 10.h, + height: 20.h, ), SizedBox( height: 40.h, - child: const Text( - '锁数量:1', + child: Text( + '锁数量:${lockNum.toString()}', style: TextStyle( - color: AppColors.darkGrayTextColor, fontSize: 14), + color: AppColors.darkGrayTextColor, fontSize: 20.sp), ), ) ], ), ); } else { + GroupListItem itemData = itemDataList[index]; + return CommonItem( - leftTitel: "未分组(1)", + leftTitel: + '${itemData.keyGroupName}(${itemData.lockList?.length})', rightTitle: "", allHeight: 70.h, isHaveLine: true, action: () { - Navigator.pushNamed(context, Routers.lockItemListPage); + Navigator.pushNamed(context, Routers.lockItemListPage, + arguments: {'lockList': itemData.lockList}); }); } }); @@ -98,16 +108,16 @@ class _LockGroupListPageState extends State { Future> mockNetworkDataRequest() async { MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('1'); + List dataList = []; if (entity.errorCode!.codeIsSuccessful) { if (entity.data != null) { - return entity.data!.groupList!; - } else { - List dataList = []; - return dataList; + dataList = entity.data!.groupList!; } - } else { - return []; } + setState(() { + itemDataList = dataList; + }); + return dataList; } //创建锁分组请求 diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart index 07491526..ac7e2f66 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/commonItem.dart'; import '../../../../../tools/titleAppBar.dart'; import '../../../../../translations/trans_lib.dart'; @@ -15,8 +15,14 @@ class LockItemListPage extends StatefulWidget { } class _LockItemListPageState extends State { + List lockList = []; @override Widget build(BuildContext context) { + dynamic obj = ModalRoute.of(context)?.settings.arguments; + if (obj != null && (obj["lockList"] != null)) { + lockList = obj["lockList"]; + } + return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( @@ -35,22 +41,25 @@ class _LockItemListPageState extends State { ), ], backgroundColor: AppColors.mainColor), - body: ListView.separated( - itemBuilder: (context, index) { - return _listItemView(); - }, - itemCount: 2, - separatorBuilder: (BuildContext context, int index) { - return Divider( - height: 1.h, - color: AppColors.greyLineColor, - ); - }, - ), + body: lockList.isNotEmpty + ? ListView.separated( + itemBuilder: (context, index) { + LockListItem itemData = lockList[index]; + return _listItemView(itemData); + }, + itemCount: lockList.length, + separatorBuilder: (BuildContext context, int index) { + return Divider( + height: 1.h, + color: AppColors.greyLineColor, + ); + }, + ) + : Container(), ); } - Widget _listItemView() { + Widget _listItemView(LockListItem itemData) { return GestureDetector( child: Container( color: Colors.white, @@ -72,7 +81,7 @@ class _LockItemListPageState extends State { width: 10.w, ), Text( - 'Daisy', + itemData.lockAlias ?? '', style: TextStyle(fontSize: 24.sp), ) ], diff --git a/star_lock/lib/mine/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet_page.dart index 58e3258a..99b04481 100644 --- a/star_lock/lib/mine/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet_page.dart @@ -2,6 +2,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart'; +import 'package:star_lock/network/api_repository.dart'; +import 'package:star_lock/tools/baseGetXController.dart'; import '../../appRouters.dart'; import '../../app_settings/app_colors.dart'; @@ -18,7 +21,16 @@ class MineSetPage extends StatefulWidget { } class _MineSetPageState extends State { - bool _isOn = false; + late bool _isPrompTone = false; //提示音 + late bool _isTouchUnlock = false; //触摸开锁 + late bool _isPushNotification = false; //消息推送 + + @override + void initState() { + super.initState(); + + userSettingsInfoRequest(); + } @override Widget build(BuildContext context) { @@ -39,21 +51,21 @@ class _MineSetPageState extends State { isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox( - width: 60.w, height: 50.h, child: _switch())), + width: 60.w, height: 50.h, child: _switch(0))), CommonItem( leftTitel: TranslationLoader.lanKeys!.touchUnlock!.tr, rightTitle: "", isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox( - width: 60.w, height: 50.h, child: _switch())), + width: 60.w, height: 50.h, child: _switch(1))), CommonItem( leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr, rightTitle: "", isHaveRightWidget: true, rightWidget: SizedBox( - width: 60.w, height: 50.h, child: _switch())), + width: 60.w, height: 50.h, child: _switch(2))), SizedBox( height: 10.h, ), @@ -232,15 +244,45 @@ class _MineSetPageState extends State { ); } - CupertinoSwitch _switch() { + Future userSettingsInfoRequest() async { + ExpireLockListEntity entity = await ApiRepository.to.userSettingsInfo(); + if (entity.errorCode!.codeIsSuccessful) { + setState(() {}); + } + } + + //更新提示音 + Future updatePrompToneRequest() async { + ExpireLockListEntity entity = await ApiRepository.to + .setAlertMode('1', _isPrompTone == true ? '1' : '2'); + if (entity.errorCode!.codeIsSuccessful) { + setState(() {}); + } + } + + CupertinoSwitch _switch(int switchIndex) { + bool isOn = false; + if (switchIndex == 0) { + isOn = _isPrompTone; + } else if (switchIndex == 1) { + isOn = _isTouchUnlock; + } else if (switchIndex == 2) { + isOn = _isPushNotification; + } return CupertinoSwitch( activeColor: CupertinoColors.activeBlue, trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, - value: _isOn, + value: isOn, onChanged: (value) { setState(() { - _isOn = value; + if (switchIndex == 0) { + _isPrompTone = !_isPrompTone; + } else if (switchIndex == 1) { + _isTouchUnlock = !_isTouchUnlock; + } else if (switchIndex == 2) { + _isPushNotification = !_isPushNotification; + } }); }, ); diff --git a/star_lock/lib/mine/mineSet/userSettingInfoEntity.dart b/star_lock/lib/mine/mineSet/userSettingInfoEntity.dart new file mode 100644 index 00000000..069f207b --- /dev/null +++ b/star_lock/lib/mine/mineSet/userSettingInfoEntity.dart @@ -0,0 +1,159 @@ +class UserSettingInfoEntity { + int? errorCode; + String? description; + String? errorMsg; + UserSettingInfoData? data; + + UserSettingInfoEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + UserSettingInfoEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null + ? UserSettingInfoData.fromJson(json['data']) + : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class UserSettingInfoData { + UserSettings? userSettings; + Null? hasXmeyeLock; + Null? hasMoreService; + Null? isReply; + Null? paidUserStatus; + Null? hasAdvert; + Null? hasAlexa; + Null? isUserSettingCompleted; + Null? hasPaidFeature; + Null? hasCameraLock; + Null? hasGoogleHome; + Null? alertMode; + + UserSettingInfoData( + {this.userSettings, + this.hasXmeyeLock, + this.hasMoreService, + this.isReply, + this.paidUserStatus, + this.hasAdvert, + this.hasAlexa, + this.isUserSettingCompleted, + this.hasPaidFeature, + this.hasCameraLock, + this.hasGoogleHome, + this.alertMode}); + + UserSettingInfoData.fromJson(Map json) { + userSettings = json['userSettings'] != null + ? UserSettings.fromJson(json['userSettings']) + : null; + hasXmeyeLock = json['hasXmeyeLock']; + hasMoreService = json['hasMoreService']; + isReply = json['isReply']; + paidUserStatus = json['paidUserStatus']; + hasAdvert = json['hasAdvert']; + hasAlexa = json['hasAlexa']; + isUserSettingCompleted = json['isUserSettingCompleted']; + hasPaidFeature = json['hasPaidFeature']; + hasCameraLock = json['hasCameraLock']; + hasGoogleHome = json['hasGoogleHome']; + alertMode = json['alertMode']; + } + + Map toJson() { + final Map data = {}; + if (userSettings != null) { + data['userSettings'] = userSettings!.toJson(); + } + data['hasXmeyeLock'] = hasXmeyeLock; + data['hasMoreService'] = hasMoreService; + data['isReply'] = isReply; + data['paidUserStatus'] = paidUserStatus; + data['hasAdvert'] = hasAdvert; + data['hasAlexa'] = hasAlexa; + data['isUserSettingCompleted'] = isUserSettingCompleted; + data['hasPaidFeature'] = hasPaidFeature; + data['hasCameraLock'] = hasCameraLock; + data['hasGoogleHome'] = hasGoogleHome; + data['alertMode'] = alertMode; + return data; + } +} + +class UserSettings { + Null? touchUnlockFlag; + Null? modifyManagePwdFlag; + Null? gesturePassword; + Null? resetFlag; + Null? delManagerFlag; + Null? hideExpiredAccessFlag; + Null? sendKeyFlag; + Null? viberateFlag; + Null? lockScreen; + Null? authorizeFlag; + Null? sendPwdFlag; + Null? alertToneFlag; + Null? status; + + UserSettings( + {this.touchUnlockFlag, + this.modifyManagePwdFlag, + this.gesturePassword, + this.resetFlag, + this.delManagerFlag, + this.hideExpiredAccessFlag, + this.sendKeyFlag, + this.viberateFlag, + this.lockScreen, + this.authorizeFlag, + this.sendPwdFlag, + this.alertToneFlag, + this.status}); + + UserSettings.fromJson(Map json) { + touchUnlockFlag = json['touchUnlockFlag']; + modifyManagePwdFlag = json['modifyManagePwdFlag']; + gesturePassword = json['gesturePassword']; + resetFlag = json['resetFlag']; + delManagerFlag = json['delManagerFlag']; + hideExpiredAccessFlag = json['hideExpiredAccessFlag']; + sendKeyFlag = json['sendKeyFlag']; + viberateFlag = json['viberateFlag']; + lockScreen = json['lockScreen']; + authorizeFlag = json['authorizeFlag']; + sendPwdFlag = json['sendPwdFlag']; + alertToneFlag = json['alertToneFlag']; + status = json['status']; + } + + Map toJson() { + final Map data = {}; + data['touchUnlockFlag'] = touchUnlockFlag; + data['modifyManagePwdFlag'] = modifyManagePwdFlag; + data['gesturePassword'] = gesturePassword; + data['resetFlag'] = resetFlag; + data['delManagerFlag'] = delManagerFlag; + data['hideExpiredAccessFlag'] = hideExpiredAccessFlag; + data['sendKeyFlag'] = sendKeyFlag; + data['viberateFlag'] = viberateFlag; + data['lockScreen'] = lockScreen; + data['authorizeFlag'] = authorizeFlag; + data['sendPwdFlag'] = sendPwdFlag; + data['alertToneFlag'] = alertToneFlag; + data['status'] = status; + return data; + } +} diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index f7007b6e..7c4e3220 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -91,4 +91,6 @@ abstract class Api { final String updateAdministratorURL = '/authorizedAdmin/update'; //管理员姓名/有效期/远程开锁修改 final String expireLockListURL = '/keyUser/listExpireUser'; //即将到期的锁列表 + final String setAlertModeURL = '/user/setAlertMode'; //提示音 + final String userSettingsInfoURL = '/user/userSettingsInfo'; //个人设置信息 } diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index e84b3b6f..636a821d 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -566,8 +566,7 @@ class ApiProvider extends BaseProvider { jsonEncode({ 'lockId': lockId, }), - isUnShowLoading: true - ); + isUnShowLoading: true); // 设置考勤时创建公司 Future setCheckInCreateCompanyData( @@ -630,13 +629,13 @@ class ApiProvider extends BaseProvider { // 编辑员工 addHolidaysData Future editStaffData( - String attendanceType, - String attendanceWay, - String staffId, - String have, - String staffName, - String countryCode, - String usernameType) => + String attendanceType, + String attendanceWay, + String staffId, + String have, + String staffName, + String countryCode, + String usernameType) => post( editStaffURL.toUrl, jsonEncode({ @@ -650,23 +649,20 @@ class ApiProvider extends BaseProvider { })); // 添加员工选择钥匙 - Future addStaffSeletKeyData( - String companyId, - String type) => - post( - addStaffSeletKeyURL.toUrl, - jsonEncode({ - 'companyId': companyId, - 'type': type, - })); + Future addStaffSeletKeyData(String companyId, String type) => post( + addStaffSeletKeyURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'type': type, + })); // 添加假期 Future addHolidaysData( - String companyId, - String fillClassDate, - String vacationEndDate, - String vacationName, - String vacationStartDate) => + String companyId, + String fillClassDate, + String vacationEndDate, + String vacationName, + String vacationStartDate) => post( addHolidaysURL.toUrl, jsonEncode({ @@ -678,9 +674,7 @@ class ApiProvider extends BaseProvider { })); // 假期列表 - Future holidaysListData( - String companyId, - String vacationYear) => + Future holidaysListData(String companyId, String vacationYear) => post( holidaysListURL.toUrl, jsonEncode({ @@ -689,32 +683,28 @@ class ApiProvider extends BaseProvider { })); // 删除假期 - Future deletHolidaysData( - String vacationId) => - post( - holidaysDeleteURL.toUrl, - jsonEncode({ - 'vacationId': vacationId, - })); + Future deletHolidaysData(String vacationId) => post( + holidaysDeleteURL.toUrl, + jsonEncode({ + 'vacationId': vacationId, + })); // 获取考勤设置信息 - Future getCheckInSetInfoData( - String companyId) => - post( - getCheckInSetInfoURL.toUrl, - jsonEncode({ - 'companyId': companyId, - })); + Future getCheckInSetInfoData(String companyId) => post( + getCheckInSetInfoURL.toUrl, + jsonEncode({ + 'companyId': companyId, + })); // 修改考勤设置信息 Future editCheckInSetInfoData( - String attendanceType, - String companyId, - String type, - String companyName, - String workEndTime, - String workStartTime, - List workDay) => + String attendanceType, + String companyId, + String type, + String companyName, + String workEndTime, + String workStartTime, + List workDay) => post( editCheckInSetInfoURL.toUrl, jsonEncode({ @@ -728,7 +718,8 @@ class ApiProvider extends BaseProvider { })); // 获取考勤列表 -- 早到榜日榜 - Future getCheckInListEarlyArrivalWithDateData(String companyId, String attendanceDate) => + Future getCheckInListEarlyArrivalWithDateData( + String companyId, String attendanceDate) => post( getAttendanceRecordListByDateURL.toUrl, jsonEncode({ @@ -737,7 +728,8 @@ class ApiProvider extends BaseProvider { })); // 获取考勤列表 -- 早到榜月榜 - Future getCheckInListEarlyArrivalWithMonthData(String companyId, String attendanceDate) => + Future getCheckInListEarlyArrivalWithMonthData( + String companyId, String attendanceDate) => post( getAttendanceRecordListByMonthURL.toUrl, jsonEncode({ @@ -746,7 +738,8 @@ class ApiProvider extends BaseProvider { })); // 获取考勤列表 -- 迟到榜日榜 - Future getCheckInListLateTimesWithDateData(String companyId, String attendanceDate) => + Future getCheckInListLateTimesWithDateData( + String companyId, String attendanceDate) => post( getAttendanceRecordListLateTimesByDateURL.toUrl, jsonEncode({ @@ -755,7 +748,8 @@ class ApiProvider extends BaseProvider { })); // 获取考勤列表 -- 迟到榜月榜 - Future getCheckInListLateTimesWithMonthData(String companyId, String attendanceDate) => + Future getCheckInListLateTimesWithMonthData( + String companyId, String attendanceDate) => post( getAttendanceRecordListLateTimesByMonthURL.toUrl, jsonEncode({ @@ -764,7 +758,8 @@ class ApiProvider extends BaseProvider { })); // 获取考勤列表 -- 勤奋榜 - Future getCheckInListHardworkingData(String companyId, String attendanceDate, String type) => + Future getCheckInListHardworkingData( + String companyId, String attendanceDate, String type) => post( getAttendanceRecordHardworkingListURL.toUrl, jsonEncode({ @@ -774,7 +769,8 @@ class ApiProvider extends BaseProvider { })); // 获取考勤详情 - Future getCheckInDetailData(String companyId, String attendanceDate, String staffId) => + Future getCheckInDetailData( + String companyId, String attendanceDate, String staffId) => post( getAttendanceRecordDtailURL.toUrl, jsonEncode({ @@ -784,7 +780,8 @@ class ApiProvider extends BaseProvider { })); // 获取指纹列表 - Future getFingerprintsListData(String lockId, String pageNo, String pageSize, String searchStr) => + Future getFingerprintsListData( + String lockId, String pageNo, String pageSize, String searchStr) => post( getFingerprintListURL.toUrl, jsonEncode({ @@ -796,15 +793,16 @@ class ApiProvider extends BaseProvider { // 添加指纹 Future addFingerprintsData( - String lockId, - String endDate, - String addType, - String fingerprintName, - String fingerprintNumber, - String fingerprintType, - String isCoerced, - String startDate, - String cyclicConfig,) => + String lockId, + String endDate, + String addType, + String fingerprintName, + String fingerprintNumber, + String fingerprintType, + String isCoerced, + String startDate, + String cyclicConfig, + ) => post( addFingerprintURL.toUrl, jsonEncode({ @@ -830,8 +828,11 @@ class ApiProvider extends BaseProvider { String pageNo, String pageSize, String searchStr) => post( lockUserListURL.toUrl, - jsonEncode( - {'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr})); + jsonEncode({ + 'pageNo': pageNo, + 'pageSize': pageSize, + 'searchStr': searchStr + })); Future keyListByUser(String pageNo, String pageSize, String uid) => post(keyListByUserURL.toUrl, @@ -841,6 +842,13 @@ class ApiProvider extends BaseProvider { authorizedAdminListURL.toUrl, jsonEncode({'pageNo': pageNo, 'pageSize': pageSize})); + Future setAlertMode(String alertMode, String isOn) => post( + setAlertModeURL.toUrl, + jsonEncode({'alertMode': alertMode, 'isOn': isOn})); + + Future userSettingsInfo() => + post(userSettingsInfoURL.toUrl, jsonEncode({})); + Future canSendKey( String endDate, List keyGroupIdList, List lockIdList) => post( diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index c08a2182..c1a88fcd 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -649,6 +649,19 @@ class ApiRepository { return AuthorizedAdminListEntity.fromJson(res.body); } + //提示音 + Future setAlertMode( + String alertMode, String isOn) async { + final res = await apiProvider.setAlertMode(alertMode, isOn); + return ExpireLockListEntity.fromJson(res.body); + } + + //个人设置信息 + Future userSettingsInfo() async { + final res = await apiProvider.userSettingsInfo(); + return ExpireLockListEntity.fromJson(res.body); + } + // 开启考勤 获取考勤信息 Future openCheckingInData( {required String lockId}) async { @@ -681,81 +694,73 @@ class ApiRepository { } // 获取考勤列表 - 早到榜日榜 - Future getCheckInListEarlyArrivalWithDateData( - { - required String companyId, - required String attendanceDate, - }) async { - final res = - await apiProvider.getCheckInListEarlyArrivalWithDateData(companyId, attendanceDate); + Future getCheckInListEarlyArrivalWithDateData({ + required String companyId, + required String attendanceDate, + }) async { + final res = await apiProvider.getCheckInListEarlyArrivalWithDateData( + companyId, attendanceDate); return CheckingInListDayEntity.fromJson(res.body); } // 获取考勤列表 - 早到榜月榜 - Future getCheckInListEarlyArrivalWithMonthData( - { - required String companyId, - required String attendanceDate, - }) async { - final res = - await apiProvider.getCheckInListEarlyArrivalWithMonthData(companyId, attendanceDate); + Future getCheckInListEarlyArrivalWithMonthData({ + required String companyId, + required String attendanceDate, + }) async { + final res = await apiProvider.getCheckInListEarlyArrivalWithMonthData( + companyId, attendanceDate); return CheckingInListMonthEntity.fromJson(res.body); } // 获取考勤列表 - 迟到榜日榜 - Future getCheckInListLateTimesWithDateData( - { - required String companyId, - required String attendanceDate, - }) async { - final res = - await apiProvider.getCheckInListLateTimesWithDateData(companyId, attendanceDate); + Future getCheckInListLateTimesWithDateData({ + required String companyId, + required String attendanceDate, + }) async { + final res = await apiProvider.getCheckInListLateTimesWithDateData( + companyId, attendanceDate); return CheckingInListDayEntity.fromJson(res.body); } // 获取考勤列表 - 迟到榜月榜 - Future getCheckInListLateTimesWithMonthData( - { - required String companyId, - required String attendanceDate, - }) async { - final res = - await apiProvider.getCheckInListLateTimesWithMonthData(companyId, attendanceDate); + Future getCheckInListLateTimesWithMonthData({ + required String companyId, + required String attendanceDate, + }) async { + final res = await apiProvider.getCheckInListLateTimesWithMonthData( + companyId, attendanceDate); return CheckingInListMonthEntity.fromJson(res.body); } // 获取考勤列表 - 勤奋榜 - Future getCheckInListHardworkingData( - { - required String companyId, - required String attendanceDate, - required String type, - }) async { - final res = - await apiProvider.getCheckInListHardworkingData(companyId, attendanceDate, type); + Future 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 getCheckInDetailData( - { - required String companyId, - required String attendanceDate, - required String staffId, - }) async { - final res = - await apiProvider.getCheckInDetailData(companyId, attendanceDate, staffId); + Future 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 getStaffListData( - { - required String companyId, - required String lockId, - }) async { - final res = - await apiProvider.getStaffListData(companyId, lockId); + Future getStaffListData({ + required String companyId, + required String lockId, + }) async { + final res = await apiProvider.getStaffListData(companyId, lockId); return CheckingInAddStaffListEntity.fromJson(res.body); } @@ -775,121 +780,114 @@ class ApiRepository { } // 编辑员工 - Future 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); + Future 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 addStaffSeletKeyData( - { - required String companyId, - required String type, - }) async { - final res = - await apiProvider.addStaffSeletKeyData(companyId, type); + Future addStaffSeletKeyData({ + required String companyId, + required String type, + }) async { + final res = await apiProvider.addStaffSeletKeyData(companyId, type); return CheckingInAddStaffSeletKeyEntity.fromJson(res.body); } // 添加假期 - Future 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); + Future 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 holidaysListData( - { - required String companyId, - required String vacationYear, - }) async { - final res = - await apiProvider.holidaysListData(companyId, vacationYear); + Future holidaysListData({ + required String companyId, + required String vacationYear, + }) async { + final res = await apiProvider.holidaysListData(companyId, vacationYear); return CheckingInSetHolidaysInfoDataEntity.fromJson(res.body); } // 删除假期 - Future deletHolidaysData( - { - required String vacationId - }) async { - final res = - await apiProvider.deletHolidaysData(vacationId); + Future deletHolidaysData({required String vacationId}) async { + final res = await apiProvider.deletHolidaysData(vacationId); return LoginEntity.fromJson(res.body); } // 获取考勤设置信息 - Future getCheckInSetInfoData( - { - required String companyId, - }) async { - final res = - await apiProvider.getCheckInSetInfoData(companyId); + Future getCheckInSetInfoData({ + required String companyId, + }) async { + final res = await apiProvider.getCheckInSetInfoData(companyId); return CheckingInSetEntity.fromJson(res.body); } // 修改考勤设置信息 - Future editCheckInSetInfoData( - { - required String attendanceType, - required String companyId, - required String type, - required String companyName, - required String workEndTime, - required String workStartTime, - required List workDay, - }) async { - final res = - await apiProvider.editCheckInSetInfoData(attendanceType, companyId, type, companyName, workEndTime, workStartTime, workDay); + Future editCheckInSetInfoData({ + required String attendanceType, + required String companyId, + required String type, + required String companyName, + required String workEndTime, + required String workStartTime, + required List workDay, + }) async { + final res = await apiProvider.editCheckInSetInfoData(attendanceType, + companyId, type, companyName, workEndTime, workStartTime, workDay); return CheckingInSetEntity.fromJson(res.body); } // 获取指纹列表 - Future getFingerprintsListData( - { - required String lockId, - required String pageNo, - required String pageSize, - required String searchStr, - }) async { - final res = - await apiProvider.getFingerprintsListData(lockId, pageNo, pageSize, searchStr); + Future 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 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); + Future 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); } }