1,锁分组接口对接
2,个人设置信息接口调试
This commit is contained in:
parent
e9cf543e89
commit
782dfa16f1
@ -22,6 +22,8 @@ class LockGroupListPage extends StatefulWidget {
|
||||
|
||||
class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
TextEditingController _changeNameController = TextEditingController();
|
||||
List<GroupListItem> itemDataList = [];
|
||||
int lockNum = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -60,35 +62,43 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
}
|
||||
|
||||
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<LockGroupListPage> {
|
||||
Future<List<GroupListItem>> mockNetworkDataRequest() async {
|
||||
MassSendLockGroupListEntity entity =
|
||||
await ApiRepository.to.lockGroupList('1');
|
||||
List<GroupListItem> dataList = [];
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (entity.data != null) {
|
||||
return entity.data!.groupList!;
|
||||
} else {
|
||||
List<GroupListItem> dataList = [];
|
||||
return dataList;
|
||||
dataList = entity.data!.groupList!;
|
||||
}
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
setState(() {
|
||||
itemDataList = dataList;
|
||||
});
|
||||
return dataList;
|
||||
}
|
||||
|
||||
//创建锁分组请求
|
||||
|
||||
@ -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<LockItemListPage> {
|
||||
List<LockListItem> 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<LockItemListPage> {
|
||||
),
|
||||
],
|
||||
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<LockItemListPage> {
|
||||
width: 10.w,
|
||||
),
|
||||
Text(
|
||||
'Daisy',
|
||||
itemData.lockAlias ?? '',
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
)
|
||||
],
|
||||
|
||||
@ -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<MineSetPage> {
|
||||
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<MineSetPage> {
|
||||
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<MineSetPage> {
|
||||
);
|
||||
}
|
||||
|
||||
CupertinoSwitch _switch() {
|
||||
Future<void> userSettingsInfoRequest() async {
|
||||
ExpireLockListEntity entity = await ApiRepository.to.userSettingsInfo();
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
//更新提示音
|
||||
Future<void> 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;
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
159
star_lock/lib/mine/mineSet/userSettingInfoEntity.dart
Normal file
159
star_lock/lib/mine/mineSet/userSettingInfoEntity.dart
Normal file
@ -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<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null
|
||||
? UserSettingInfoData.fromJson(json['data'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -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'; //个人设置信息
|
||||
}
|
||||
|
||||
@ -566,8 +566,7 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}),
|
||||
isUnShowLoading: true
|
||||
);
|
||||
isUnShowLoading: true);
|
||||
|
||||
// 设置考勤时创建公司
|
||||
Future<Response> setCheckInCreateCompanyData(
|
||||
@ -630,13 +629,13 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
// 编辑员工 addHolidaysData
|
||||
Future<Response> 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<Response> addStaffSeletKeyData(
|
||||
String companyId,
|
||||
String type) =>
|
||||
post(
|
||||
addStaffSeletKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
'companyId': companyId,
|
||||
'type': type,
|
||||
}));
|
||||
Future<Response> addStaffSeletKeyData(String companyId, String type) => post(
|
||||
addStaffSeletKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
'companyId': companyId,
|
||||
'type': type,
|
||||
}));
|
||||
|
||||
// 添加假期
|
||||
Future<Response> 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<Response> holidaysListData(
|
||||
String companyId,
|
||||
String vacationYear) =>
|
||||
Future<Response> holidaysListData(String companyId, String vacationYear) =>
|
||||
post(
|
||||
holidaysListURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -689,32 +683,28 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 删除假期
|
||||
Future<Response> deletHolidaysData(
|
||||
String vacationId) =>
|
||||
post(
|
||||
holidaysDeleteURL.toUrl,
|
||||
jsonEncode({
|
||||
'vacationId': vacationId,
|
||||
}));
|
||||
Future<Response> deletHolidaysData(String vacationId) => post(
|
||||
holidaysDeleteURL.toUrl,
|
||||
jsonEncode({
|
||||
'vacationId': vacationId,
|
||||
}));
|
||||
|
||||
// 获取考勤设置信息
|
||||
Future<Response> getCheckInSetInfoData(
|
||||
String companyId) =>
|
||||
post(
|
||||
getCheckInSetInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'companyId': companyId,
|
||||
}));
|
||||
Future<Response> getCheckInSetInfoData(String companyId) => post(
|
||||
getCheckInSetInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'companyId': companyId,
|
||||
}));
|
||||
|
||||
// 修改考勤设置信息
|
||||
Future<Response> editCheckInSetInfoData(
|
||||
String attendanceType,
|
||||
String companyId,
|
||||
String type,
|
||||
String companyName,
|
||||
String workEndTime,
|
||||
String workStartTime,
|
||||
List<int> workDay) =>
|
||||
String attendanceType,
|
||||
String companyId,
|
||||
String type,
|
||||
String companyName,
|
||||
String workEndTime,
|
||||
String workStartTime,
|
||||
List<int> workDay) =>
|
||||
post(
|
||||
editCheckInSetInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -728,7 +718,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取考勤列表 -- 早到榜日榜
|
||||
Future<Response> getCheckInListEarlyArrivalWithDateData(String companyId, String attendanceDate) =>
|
||||
Future<Response> getCheckInListEarlyArrivalWithDateData(
|
||||
String companyId, String attendanceDate) =>
|
||||
post(
|
||||
getAttendanceRecordListByDateURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -737,7 +728,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取考勤列表 -- 早到榜月榜
|
||||
Future<Response> getCheckInListEarlyArrivalWithMonthData(String companyId, String attendanceDate) =>
|
||||
Future<Response> getCheckInListEarlyArrivalWithMonthData(
|
||||
String companyId, String attendanceDate) =>
|
||||
post(
|
||||
getAttendanceRecordListByMonthURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -746,7 +738,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取考勤列表 -- 迟到榜日榜
|
||||
Future<Response> getCheckInListLateTimesWithDateData(String companyId, String attendanceDate) =>
|
||||
Future<Response> getCheckInListLateTimesWithDateData(
|
||||
String companyId, String attendanceDate) =>
|
||||
post(
|
||||
getAttendanceRecordListLateTimesByDateURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -755,7 +748,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取考勤列表 -- 迟到榜月榜
|
||||
Future<Response> getCheckInListLateTimesWithMonthData(String companyId, String attendanceDate) =>
|
||||
Future<Response> getCheckInListLateTimesWithMonthData(
|
||||
String companyId, String attendanceDate) =>
|
||||
post(
|
||||
getAttendanceRecordListLateTimesByMonthURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -764,7 +758,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取考勤列表 -- 勤奋榜
|
||||
Future<Response> getCheckInListHardworkingData(String companyId, String attendanceDate, String type) =>
|
||||
Future<Response> getCheckInListHardworkingData(
|
||||
String companyId, String attendanceDate, String type) =>
|
||||
post(
|
||||
getAttendanceRecordHardworkingListURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -774,7 +769,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取考勤详情
|
||||
Future<Response> getCheckInDetailData(String companyId, String attendanceDate, String staffId) =>
|
||||
Future<Response> getCheckInDetailData(
|
||||
String companyId, String attendanceDate, String staffId) =>
|
||||
post(
|
||||
getAttendanceRecordDtailURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -784,7 +780,8 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取指纹列表
|
||||
Future<Response> getFingerprintsListData(String lockId, String pageNo, String pageSize, String searchStr) =>
|
||||
Future<Response> getFingerprintsListData(
|
||||
String lockId, String pageNo, String pageSize, String searchStr) =>
|
||||
post(
|
||||
getFingerprintListURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -796,15 +793,16 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
// 添加指纹
|
||||
Future<Response> 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<Response> 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<Response> setAlertMode(String alertMode, String isOn) => post(
|
||||
setAlertModeURL.toUrl,
|
||||
jsonEncode({'alertMode': alertMode, 'isOn': isOn}));
|
||||
|
||||
Future<Response> userSettingsInfo() =>
|
||||
post(userSettingsInfoURL.toUrl, jsonEncode({}));
|
||||
|
||||
Future<Response> canSendKey(
|
||||
String endDate, List keyGroupIdList, List lockIdList) =>
|
||||
post(
|
||||
|
||||
@ -649,6 +649,19 @@ class ApiRepository {
|
||||
return AuthorizedAdminListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//提示音
|
||||
Future<ExpireLockListEntity> setAlertMode(
|
||||
String alertMode, String isOn) async {
|
||||
final res = await apiProvider.setAlertMode(alertMode, isOn);
|
||||
return ExpireLockListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//个人设置信息
|
||||
Future<ExpireLockListEntity> userSettingsInfo() async {
|
||||
final res = await apiProvider.userSettingsInfo();
|
||||
return ExpireLockListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 开启考勤 获取考勤信息
|
||||
Future<CheckingInInfoDataEntity> openCheckingInData(
|
||||
{required String lockId}) async {
|
||||
@ -681,81 +694,73 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 获取考勤列表 - 早到榜日榜
|
||||
Future<CheckingInListDayEntity> getCheckInListEarlyArrivalWithDateData(
|
||||
{
|
||||
required String companyId,
|
||||
required String attendanceDate,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getCheckInListEarlyArrivalWithDateData(companyId, attendanceDate);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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(
|
||||
{
|
||||
required String companyId,
|
||||
required String lockId,
|
||||
}) async {
|
||||
final res =
|
||||
await apiProvider.getStaffListData(companyId, lockId);
|
||||
Future<CheckingInAddStaffListEntity> 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<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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user