Просмотр исходного кода

报表的考勤与用工列表

liukai 1 неделя назад
Родитель
Сommit
75648b8c8c

+ 19 - 22
packages/cpt_uk/lib/modules/report/attendance_report/attendance_report_controller.dart

@@ -1,26 +1,22 @@
 import 'package:domain/entity/response/attendance_entity.dart';
 import 'package:domain/entity/response/labour_request_index_entity.dart';
-import 'package:domain/entity/response/labour_review_list_entity.dart';
-import 'package:domain/repository/job_repository.dart';
-import 'package:domain/repository/labour_repository.dart';
+import 'package:domain/entity/response/u_k_report_attendance_entity.dart';
+import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
+import 'package:domain/repository/uk_report_repository.dart';
 import 'package:get/get.dart';
 import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
-import 'package:plugin_platform/engine/notify/notify_engine.dart';
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-import 'package:widgets/dialog/app_default_dialog.dart';
+
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 import 'widget/attendance_report_filter.dart';
 import 'attendance_report_state.dart';
 
 class AttendanceReportController extends GetxController with DioCancelableMixin {
-  final LabourRepository _labourRepository = Get.find();
-  final JobRepository _jobRepository = Get.find();
+  final UKReportRepository _reportRepository = Get.find();
   final AttendanceReportState state = AttendanceReportState();
 
   var _curPage = 1;
@@ -69,25 +65,25 @@ class AttendanceReportController extends GetxController with DioCancelableMixin
 
     // 并发执行两个请求,拿到选项数据与列表数据
     var futures = [
-      _jobRepository.fetchAttendanceList(
-        state.staffName,
-        DateTimeUtils.formatDate(state.selectedStartDate, format: "yyyy-MM-dd"),
-        DateTimeUtils.formatDate(state.selectedEndDate, format: "yyyy-MM-dd"),
+      _reportRepository.fetchReportAttendanceList(
+        keyword: state.staffName,
+        startDate: DateTimeUtils.formatDate(state.selectedStartDate, format: "yyyy-MM-dd"),
+        endDate: DateTimeUtils.formatDate(state.selectedEndDate, format: "yyyy-MM-dd"),
+        departmentId: state.selectedDepartmentId,
         curPage: _curPage,
-        pageSize: 10,
         cancelToken: cancelToken,
       ),
       state.indexOptions == null
-          ? _labourRepository.fetchLabourReviewIndex(
-              cancelToken: cancelToken,
-            )
+          ? _reportRepository.fetchReportOptions(
+        cancelToken: cancelToken,
+      )
           : Future(() => HttpResult(isSuccess: true).convert(data: state.indexOptions!)),
     ];
 
     //拿到结果
     var results = await Future.wait(futures);
-    var listResult = results[0] as HttpResult<AttendanceEntity>;
-    var optionResult = results[1] as HttpResult<LabourRequestIndexEntity>;
+    var listResult = results[0] as HttpResult<UKReportAttendanceEntity>;
+    var optionResult = results[1] as HttpResult<UKSecurityAttendanceOptionEntity>;
 
     //选项数据
     if (state.indexOptions == null && optionResult.isSuccess) {
@@ -107,7 +103,7 @@ class AttendanceReportController extends GetxController with DioCancelableMixin
   }
 
   // 处理数据与展示的逻辑
-  void handleList(List<AttendanceList>? list) {
+  void handleList(List<UKReportAttendanceRows>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_curPage == 1) {
@@ -159,13 +155,13 @@ class AttendanceReportController extends GetxController with DioCancelableMixin
           selectedEndDate: state.selectedEndDate,
           selectedDepartmentId: state.selectedDepartmentId,
           staffName: state.staffName,
-          onFilterAction: (startDate, endDate, departmentId,staffName) {
+          onFilterAction: (startDate, endDate, departmentId, staffName) {
             state.selectedStartDate = startDate;
             state.selectedEndDate = endDate;
             state.selectedDepartmentId = departmentId;
             state.staffName = staffName;
 
-            Log.d("筛选的值为:startDate:$startDate endDate:$endDate departmentId:$departmentId staffName:$staffName");
+            Log.d("筛选的值为:startDate:$startDate endDate:$endDate departmentId:$departmentId title:$staffName");
 
             //赋值之后刷新
             refreshController.callRefresh();
@@ -176,4 +172,5 @@ class AttendanceReportController extends GetxController with DioCancelableMixin
       );
     }
   }
+
 }

+ 30 - 7
packages/cpt_uk/lib/modules/report/attendance_report/attendance_report_item.dart

@@ -1,5 +1,5 @@
 import 'package:cs_resources/constants/color_constants.dart';
-import 'package:domain/entity/response/attendance_entity.dart';
+import 'package:domain/entity/response/u_k_report_attendance_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
@@ -12,7 +12,7 @@ import 'package:widgets/my_text_view.dart';
  */
 class AttendanceReportItem extends StatelessWidget {
   final int index;
-  final AttendanceList item;
+  final UKReportAttendanceRows item;
 
   AttendanceReportItem({
     required this.index,
@@ -55,6 +55,29 @@ class AttendanceReportItem extends StatelessWidget {
             ],
           ),
 
+          // IC 身份证
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "IC No:".tr,
+                isFontRegular: true,
+                textColor: ColorConstants.textGrayAECAE5,
+                fontSize: 14,
+              ),
+
+              //
+              MyTextView(
+                item.icNo ?? "-",
+                marginLeft: 5,
+                isFontRegular: true,
+                textColor: Colors.white,
+                fontSize: 14,
+              ).expanded(),
+            ],
+          ).marginOnly(top: 15),
+
           // 部门
           Row(
             mainAxisSize: MainAxisSize.max,
@@ -69,7 +92,7 @@ class AttendanceReportItem extends StatelessWidget {
 
               //部门
               MyTextView(
-                "等待部门返回字段",
+                item.departmentName ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -161,7 +184,7 @@ class AttendanceReportItem extends StatelessWidget {
 
               //文本
               MyTextView(
-                item.checkInTime.toString(),
+                item.workIn?.time ?? "",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -184,7 +207,7 @@ class AttendanceReportItem extends StatelessWidget {
 
               //文本
               MyTextView(
-                item.checkOutTime ?? "-",
+                item.workOut?.time ?? "",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -207,7 +230,7 @@ class AttendanceReportItem extends StatelessWidget {
 
               //文本
               MyTextView(
-               "等待修改时间的字段",
+                item.reviseHours ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -230,7 +253,7 @@ class AttendanceReportItem extends StatelessWidget {
 
               //文本
               MyTextView(
-                 "等待总时长的字段",
+                item.totalShow ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,

+ 5 - 4
packages/cpt_uk/lib/modules/report/attendance_report/attendance_report_state.dart

@@ -1,5 +1,6 @@
-import 'package:domain/entity/response/attendance_entity.dart';
-import 'package:domain/entity/response/labour_request_index_entity.dart';
+
+import 'package:domain/entity/response/u_k_report_attendance_entity.dart';
+import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
 
 class AttendanceReportState {
   String? staffName;
@@ -8,6 +9,6 @@ class AttendanceReportState {
   String? selectedDepartmentId;
 
   //页面的列表数据
-  List<AttendanceList> datas = [];
-  LabourRequestIndexEntity? indexOptions;
+  List<UKReportAttendanceRows> datas = [];
+  UKSecurityAttendanceOptionEntity? indexOptions;
 }

+ 2 - 2
packages/cpt_uk/lib/modules/report/attendance_report/widget/attendance_report_filter.dart

@@ -2,12 +2,12 @@ import 'dart:typed_data';
 import 'dart:ui';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:domain/entity/response/labour_request_index_entity.dart';
+import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:get/get.dart';
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/screen_util.dart';
 import 'package:shared/utils/util.dart';
@@ -26,7 +26,7 @@ import 'package:widgets/widget_export.dart';
  */
 class AttendanceReportFilter extends StatefulWidget {
   void Function(DateTime? selectedStartDate, DateTime? selectedEndDate, String? selectedDepartmentId, String? staffName)? onFilterAction;
-  LabourRequestIndexEntity optionResult;
+  UKSecurityAttendanceOptionEntity optionResult;
   DateTime? selectedStartDate;
   DateTime? selectedEndDate;
   String? selectedDepartmentId;

+ 16 - 18
packages/cpt_uk/lib/modules/report/labour_report/labour_report_controller.dart

@@ -1,23 +1,21 @@
 import 'package:domain/entity/response/labour_request_index_entity.dart';
 import 'package:domain/entity/response/labour_review_list_entity.dart';
-import 'package:domain/repository/labour_repository.dart';
+import 'package:domain/entity/response/u_k_report_labour_entity.dart';
+import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
+import 'package:domain/repository/uk_report_repository.dart';
 import 'package:get/get.dart';
 import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
-import 'package:plugin_platform/engine/notify/notify_engine.dart';
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-import 'package:widgets/dialog/app_default_dialog.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 import 'widget/labour_report_filter.dart';
 import 'labour_report_state.dart';
 
 class LabourReportController extends GetxController with DioCancelableMixin {
-  final LabourRepository _labourRepository = Get.find();
+  final UKReportRepository _reportRepository = Get.find();
   final LabourReviewState state = LabourReviewState();
 
   var _curPage = 1;
@@ -66,16 +64,16 @@ class LabourReportController extends GetxController with DioCancelableMixin {
 
     // 并发执行两个请求,拿到选项数据与列表数据
     var futures = [
-      _labourRepository.fetchLabourReviewList(
-        state.title,
-        DateTimeUtils.formatDate(state.selectedStartDate, format: "yyyy-MM-dd"),
-        DateTimeUtils.formatDate(state.selectedEndDate, format: "yyyy-MM-dd"),
-        state.selectedDepartmentId,
+      _reportRepository.fetchReportLabourList(
+        keyword: state.keyword,
+        startDate: DateTimeUtils.formatDate(state.selectedStartDate, format: "yyyy-MM-dd"),
+        endDate: DateTimeUtils.formatDate(state.selectedEndDate, format: "yyyy-MM-dd"),
+        departmentId: state.selectedDepartmentId,
         curPage: _curPage,
         cancelToken: cancelToken,
       ),
       state.indexOptions == null
-          ? _labourRepository.fetchLabourReviewIndex(
+          ? _reportRepository.fetchReportOptions(
               cancelToken: cancelToken,
             )
           : Future(() => HttpResult(isSuccess: true).convert(data: state.indexOptions!)),
@@ -83,8 +81,8 @@ class LabourReportController extends GetxController with DioCancelableMixin {
 
     //拿到结果
     var results = await Future.wait(futures);
-    var listResult = results[0] as HttpResult<LabourReviewListEntity>;
-    var optionResult = results[1] as HttpResult<LabourRequestIndexEntity>;
+    var listResult = results[0] as HttpResult<UKReportLabourEntity>;
+    var optionResult = results[1] as HttpResult<UKSecurityAttendanceOptionEntity>;
 
     //选项数据
     if (state.indexOptions == null && optionResult.isSuccess) {
@@ -104,7 +102,7 @@ class LabourReportController extends GetxController with DioCancelableMixin {
   }
 
   // 处理数据与展示的逻辑
-  void handleList(List<LabourReviewListRows>? list) {
+  void handleList(List<UKReportLabourRows>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_curPage == 1) {
@@ -155,12 +153,12 @@ class LabourReportController extends GetxController with DioCancelableMixin {
           selectedStartDate: state.selectedStartDate,
           selectedEndDate: state.selectedEndDate,
           selectedDepartmentId: state.selectedDepartmentId,
-          title: state.title,
-          onFilterAction: (startDate, endDate, departmentId,title) {
+          title: state.keyword,
+          onFilterAction: (startDate, endDate, departmentId, title) {
             state.selectedStartDate = startDate;
             state.selectedEndDate = endDate;
             state.selectedDepartmentId = departmentId;
-            state.title = title;
+            state.keyword = title;
 
             Log.d("筛选的值为:startDate:$startDate endDate:$endDate departmentId:$departmentId title:$title");
 

+ 7 - 10
packages/cpt_uk/lib/modules/report/labour_report/labour_report_item.dart

@@ -1,13 +1,10 @@
 import 'package:cs_resources/constants/color_constants.dart';
-import 'package:cs_resources/generated/assets.dart';
-import 'package:domain/entity/response/labour_review_list_entity.dart';
+import 'package:domain/entity/response/u_k_report_labour_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:plugin_basic/basic_export.dart';
 import 'package:widgets/ext/ex_widget.dart';
-import 'package:widgets/my_button.dart';
-import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
 /*
@@ -15,7 +12,7 @@ import 'package:widgets/my_text_view.dart';
  */
 class LabourReportItem extends StatelessWidget {
   final int index;
-  final LabourReviewListRows item;
+  final UKReportLabourRows item;
 
   LabourReportItem({
     required this.index,
@@ -49,7 +46,7 @@ class LabourReportItem extends StatelessWidget {
 
               //部门
               MyTextView(
-                item.jobTime ?? "-",
+                item.jobDate ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -118,7 +115,7 @@ class LabourReportItem extends StatelessWidget {
 
               //日期时间
               MyTextView(
-                item.jobTime ?? "-",
+                item.startTime ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -141,7 +138,7 @@ class LabourReportItem extends StatelessWidget {
 
               //日期时间
               MyTextView(
-                item.jobTime ?? "-",
+                item.endTime ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -187,7 +184,7 @@ class LabourReportItem extends StatelessWidget {
 
               //发布状态
               MyTextView(
-                item.needNum ?? "-",
+                item.realNum.toString(),
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,
@@ -233,7 +230,7 @@ class LabourReportItem extends StatelessWidget {
 
               //发布状态
               MyTextView(
-                item.createdAt ?? "-",
+                item.approvedAt ?? "-",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,

+ 5 - 4
packages/cpt_uk/lib/modules/report/labour_report/labour_report_state.dart

@@ -1,13 +1,14 @@
-import 'package:domain/entity/response/labour_request_index_entity.dart';
 import 'package:domain/entity/response/labour_review_list_entity.dart';
+import 'package:domain/entity/response/u_k_report_labour_entity.dart';
+import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
 
 class LabourReviewState {
-  String? title;
+  String? keyword;
   DateTime? selectedStartDate;
   DateTime? selectedEndDate;
   String? selectedDepartmentId;
 
   //页面的列表数据
-  List<LabourReviewListRows> datas = [];
-  LabourRequestIndexEntity? indexOptions;
+  List<UKReportLabourRows> datas = [];
+  UKSecurityAttendanceOptionEntity? indexOptions;
 }

+ 2 - 1
packages/cpt_uk/lib/modules/report/labour_report/widget/labour_report_filter.dart

@@ -2,6 +2,7 @@ import 'dart:typed_data';
 import 'dart:ui';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:domain/entity/response/labour_request_index_entity.dart';
+import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
@@ -26,7 +27,7 @@ import 'package:widgets/widget_export.dart';
  */
 class LabourReportFilter extends StatefulWidget {
   void Function(DateTime? selectedStartDate, DateTime? selectedEndDate, String? selectedDepartmentId, String? title)? onFilterAction;
-  LabourRequestIndexEntity optionResult;
+  UKSecurityAttendanceOptionEntity optionResult;
   DateTime? selectedStartDate;
   DateTime? selectedEndDate;
   String? selectedDepartmentId;

+ 9 - 0
packages/cs_domain/lib/constants/api_constants.dart

@@ -295,6 +295,15 @@ class ApiConstants {
   //电子考勤列表
   static const apiEAttendanceListUK = "/index.php/api/v1/hotel/eattendance/table";
 
+  //UK的报表筛选条件
+  static const apiReportOptionUK = "/index.php/api/v1/hotel/report/index";
+
+  //UK的用工报表
+  static const apiReportLabourUK = "/index.php/api/v1/hotel/report/labour-request";
+
+  //UK的电子考勤报表
+  static const apiReportAttendanceUK = "/index.php/api/v1/hotel/report/attendance";
+
   // =========================== 报表与其他 ↓=========================================
 
   // 设备列表

+ 64 - 0
packages/cs_domain/lib/entity/response/u_k_report_attendance_entity.dart

@@ -0,0 +1,64 @@
+import 'package:domain/entity/response/u_k_attendance_entity.dart';
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/u_k_report_attendance_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/u_k_report_attendance_entity.g.dart';
+
+@JsonSerializable()
+class UKReportAttendanceEntity {
+	int total = 0;
+	List<UKReportAttendanceRows> rows = [];
+
+	UKReportAttendanceEntity();
+
+	factory UKReportAttendanceEntity.fromJson(Map<String, dynamic> json) => $UKReportAttendanceEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $UKReportAttendanceEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UKReportAttendanceRows {
+	String? id;
+	@JSONField(name: "staff_name")
+	String? staffName;
+	@JSONField(name: "ic_no")
+	String? icNo;
+	@JSONField(name: "department_name")
+	String? departmentName;
+	@JSONField(name: "job_date")
+	String? jobDate;
+	@JSONField(name: "start_time")
+	String? startTime;
+	@JSONField(name: "end_time")
+	String? endTime;
+	@JSONField(name: "adjust_show")
+	String? adjustShow;
+	@JSONField(name: "total_show")
+	String? totalShow;
+	@JSONField(name: "work_in")
+	UKAttendanceInOut? workIn;
+	@JSONField(name: "work_out")
+	UKAttendanceInOut? workOut;
+	@JSONField(name: "w_in")
+	int wIn = 0;
+	@JSONField(name: "w_out")
+	int wOut = 0;
+	@JSONField(name: "revise_hours")
+	String? reviseHours;
+
+	UKReportAttendanceRows();
+
+	factory UKReportAttendanceRows.fromJson(Map<String, dynamic> json) => $UKReportAttendanceRowsFromJson(json);
+
+	Map<String, dynamic> toJson() => $UKReportAttendanceRowsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 55 - 0
packages/cs_domain/lib/entity/response/u_k_report_labour_entity.dart

@@ -0,0 +1,55 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/u_k_report_labour_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/u_k_report_labour_entity.g.dart';
+
+@JsonSerializable()
+class UKReportLabourEntity {
+	int total = 0;
+	List<UKReportLabourRows> rows = [];
+
+	UKReportLabourEntity();
+
+	factory UKReportLabourEntity.fromJson(Map<String, dynamic> json) => $UKReportLabourEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $UKReportLabourEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class UKReportLabourRows {
+	String? id;
+	@JSONField(name: "job_date")
+	String? jobDate;
+	@JSONField(name: "department_name")
+	String? departmentName;
+	@JSONField(name: "job_title")
+	String? jobTitle;
+	@JSONField(name: "start_time")
+	String? startTime;
+	@JSONField(name: "end_time")
+	String? endTime;
+	@JSONField(name: "need_num")
+	int needNum = 0;
+	@JSONField(name: "real_num")
+	int realNum = 0;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	@JSONField(name: "approved_at")
+	String? approvedAt;
+
+	UKReportLabourRows();
+
+	factory UKReportLabourRows.fromJson(Map<String, dynamic> json) => $UKReportLabourRowsFromJson(json);
+
+	Map<String, dynamic> toJson() => $UKReportLabourRowsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 18 - 0
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -79,6 +79,8 @@ import 'package:domain/entity/response/staff_report_v_n_entity.dart';
 import 'package:domain/entity/response/staff_request_report_entity.dart';
 import 'package:domain/entity/response/staff_review_history_s_g_entity.dart';
 import 'package:domain/entity/response/u_k_attendance_entity.dart';
+import 'package:domain/entity/response/u_k_report_attendance_entity.dart';
+import 'package:domain/entity/response/u_k_report_labour_entity.dart';
 import 'package:domain/entity/response/u_k_security_attendance_entity.dart';
 import 'package:domain/entity/response/u_k_security_attendance_option_entity.dart';
 import 'package:domain/entity/server_time.dart';
@@ -685,6 +687,18 @@ class JsonConvert {
     if (<UKAttendanceInOut>[] is M) {
       return data.map<UKAttendanceInOut>((Map<String, dynamic> e) => UKAttendanceInOut.fromJson(e)).toList() as M;
     }
+    if (<UKReportAttendanceEntity>[] is M) {
+      return data.map<UKReportAttendanceEntity>((Map<String, dynamic> e) => UKReportAttendanceEntity.fromJson(e)).toList() as M;
+    }
+    if (<UKReportAttendanceRows>[] is M) {
+      return data.map<UKReportAttendanceRows>((Map<String, dynamic> e) => UKReportAttendanceRows.fromJson(e)).toList() as M;
+    }
+    if (<UKReportLabourEntity>[] is M) {
+      return data.map<UKReportLabourEntity>((Map<String, dynamic> e) => UKReportLabourEntity.fromJson(e)).toList() as M;
+    }
+    if (<UKReportLabourRows>[] is M) {
+      return data.map<UKReportLabourRows>((Map<String, dynamic> e) => UKReportLabourRows.fromJson(e)).toList() as M;
+    }
     if (<UKSecurityAttendanceEntity>[] is M) {
       return data.map<UKSecurityAttendanceEntity>((Map<String, dynamic> e) => UKSecurityAttendanceEntity.fromJson(e)).toList() as M;
     }
@@ -880,6 +894,10 @@ class JsonConvertClassCollection {
     (UKAttendanceEntity).toString(): UKAttendanceEntity.fromJson,
     (UKAttendanceRows).toString(): UKAttendanceRows.fromJson,
     (UKAttendanceInOut).toString(): UKAttendanceInOut.fromJson,
+    (UKReportAttendanceEntity).toString(): UKReportAttendanceEntity.fromJson,
+    (UKReportAttendanceRows).toString(): UKReportAttendanceRows.fromJson,
+    (UKReportLabourEntity).toString(): UKReportLabourEntity.fromJson,
+    (UKReportLabourRows).toString(): UKReportLabourRows.fromJson,
     (UKSecurityAttendanceEntity).toString(): UKSecurityAttendanceEntity.fromJson,
     (UKSecurityAttendanceRows).toString(): UKSecurityAttendanceRows.fromJson,
     (UKSecurityInOut).toString(): UKSecurityInOut.fromJson,

+ 151 - 0
packages/cs_domain/lib/generated/json/u_k_report_attendance_entity.g.dart

@@ -0,0 +1,151 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/response/u_k_report_attendance_entity.dart';
+import 'package:domain/entity/response/u_k_attendance_entity.dart';
+
+
+UKReportAttendanceEntity $UKReportAttendanceEntityFromJson(Map<String, dynamic> json) {
+  final UKReportAttendanceEntity uKReportAttendanceEntity = UKReportAttendanceEntity();
+  final int? total = jsonConvert.convert<int>(json['total']);
+  if (total != null) {
+    uKReportAttendanceEntity.total = total;
+  }
+  final List<UKReportAttendanceRows>? rows = (json['rows'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UKReportAttendanceRows>(e) as UKReportAttendanceRows).toList();
+  if (rows != null) {
+    uKReportAttendanceEntity.rows = rows;
+  }
+  return uKReportAttendanceEntity;
+}
+
+Map<String, dynamic> $UKReportAttendanceEntityToJson(UKReportAttendanceEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['total'] = entity.total;
+  data['rows'] = entity.rows.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension UKReportAttendanceEntityExtension on UKReportAttendanceEntity {
+  UKReportAttendanceEntity copyWith({
+    int? total,
+    List<UKReportAttendanceRows>? rows,
+  }) {
+    return UKReportAttendanceEntity()
+      ..total = total ?? this.total
+      ..rows = rows ?? this.rows;
+  }
+}
+
+UKReportAttendanceRows $UKReportAttendanceRowsFromJson(Map<String, dynamic> json) {
+  final UKReportAttendanceRows uKReportAttendanceRows = UKReportAttendanceRows();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    uKReportAttendanceRows.id = id;
+  }
+  final String? staffName = jsonConvert.convert<String>(json['staff_name']);
+  if (staffName != null) {
+    uKReportAttendanceRows.staffName = staffName;
+  }
+  final String? icNo = jsonConvert.convert<String>(json['ic_no']);
+  if (icNo != null) {
+    uKReportAttendanceRows.icNo = icNo;
+  }
+  final String? departmentName = jsonConvert.convert<String>(json['department_name']);
+  if (departmentName != null) {
+    uKReportAttendanceRows.departmentName = departmentName;
+  }
+  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
+  if (jobDate != null) {
+    uKReportAttendanceRows.jobDate = jobDate;
+  }
+  final String? startTime = jsonConvert.convert<String>(json['start_time']);
+  if (startTime != null) {
+    uKReportAttendanceRows.startTime = startTime;
+  }
+  final String? endTime = jsonConvert.convert<String>(json['end_time']);
+  if (endTime != null) {
+    uKReportAttendanceRows.endTime = endTime;
+  }
+  final String? adjustShow = jsonConvert.convert<String>(json['adjust_show']);
+  if (adjustShow != null) {
+    uKReportAttendanceRows.adjustShow = adjustShow;
+  }
+  final String? totalShow = jsonConvert.convert<String>(json['total_show']);
+  if (totalShow != null) {
+    uKReportAttendanceRows.totalShow = totalShow;
+  }
+  final UKAttendanceInOut? workIn = jsonConvert.convert<UKAttendanceInOut>(json['work_in']);
+  if (workIn != null) {
+    uKReportAttendanceRows.workIn = workIn;
+  }
+  final UKAttendanceInOut? workOut = jsonConvert.convert<UKAttendanceInOut>(json['work_out']);
+  if (workOut != null) {
+    uKReportAttendanceRows.workOut = workOut;
+  }
+  final int? wIn = jsonConvert.convert<int>(json['w_in']);
+  if (wIn != null) {
+    uKReportAttendanceRows.wIn = wIn;
+  }
+  final int? wOut = jsonConvert.convert<int>(json['w_out']);
+  if (wOut != null) {
+    uKReportAttendanceRows.wOut = wOut;
+  }
+  final String? reviseHours = jsonConvert.convert<String>(json['revise_hours']);
+  if (reviseHours != null) {
+    uKReportAttendanceRows.reviseHours = reviseHours;
+  }
+  return uKReportAttendanceRows;
+}
+
+Map<String, dynamic> $UKReportAttendanceRowsToJson(UKReportAttendanceRows entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['staff_name'] = entity.staffName;
+  data['ic_no'] = entity.icNo;
+  data['department_name'] = entity.departmentName;
+  data['job_date'] = entity.jobDate;
+  data['start_time'] = entity.startTime;
+  data['end_time'] = entity.endTime;
+  data['adjust_show'] = entity.adjustShow;
+  data['total_show'] = entity.totalShow;
+  data['work_in'] = entity.workIn?.toJson();
+  data['work_out'] = entity.workOut?.toJson();
+  data['w_in'] = entity.wIn;
+  data['w_out'] = entity.wOut;
+  data['revise_hours'] = entity.reviseHours;
+  return data;
+}
+
+extension UKReportAttendanceRowsExtension on UKReportAttendanceRows {
+  UKReportAttendanceRows copyWith({
+    String? id,
+    String? staffName,
+    String? icNo,
+    String? departmentName,
+    String? jobDate,
+    String? startTime,
+    String? endTime,
+    String? adjustShow,
+    String? totalShow,
+    UKAttendanceInOut? workIn,
+    UKAttendanceInOut? workOut,
+    int? wIn,
+    int? wOut,
+    String? reviseHours,
+  }) {
+    return UKReportAttendanceRows()
+      ..id = id ?? this.id
+      ..staffName = staffName ?? this.staffName
+      ..icNo = icNo ?? this.icNo
+      ..departmentName = departmentName ?? this.departmentName
+      ..jobDate = jobDate ?? this.jobDate
+      ..startTime = startTime ?? this.startTime
+      ..endTime = endTime ?? this.endTime
+      ..adjustShow = adjustShow ?? this.adjustShow
+      ..totalShow = totalShow ?? this.totalShow
+      ..workIn = workIn ?? this.workIn
+      ..workOut = workOut ?? this.workOut
+      ..wIn = wIn ?? this.wIn
+      ..wOut = wOut ?? this.wOut
+      ..reviseHours = reviseHours ?? this.reviseHours;
+  }
+}

+ 121 - 0
packages/cs_domain/lib/generated/json/u_k_report_labour_entity.g.dart

@@ -0,0 +1,121 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/response/u_k_report_labour_entity.dart';
+
+UKReportLabourEntity $UKReportLabourEntityFromJson(Map<String, dynamic> json) {
+  final UKReportLabourEntity uKReportLabourEntity = UKReportLabourEntity();
+  final int? total = jsonConvert.convert<int>(json['total']);
+  if (total != null) {
+    uKReportLabourEntity.total = total;
+  }
+  final List<UKReportLabourRows>? rows = (json['rows'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<UKReportLabourRows>(e) as UKReportLabourRows).toList();
+  if (rows != null) {
+    uKReportLabourEntity.rows = rows;
+  }
+  return uKReportLabourEntity;
+}
+
+Map<String, dynamic> $UKReportLabourEntityToJson(UKReportLabourEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['total'] = entity.total;
+  data['rows'] = entity.rows.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension UKReportLabourEntityExtension on UKReportLabourEntity {
+  UKReportLabourEntity copyWith({
+    int? total,
+    List<UKReportLabourRows>? rows,
+  }) {
+    return UKReportLabourEntity()
+      ..total = total ?? this.total
+      ..rows = rows ?? this.rows;
+  }
+}
+
+UKReportLabourRows $UKReportLabourRowsFromJson(Map<String, dynamic> json) {
+  final UKReportLabourRows uKReportLabourRows = UKReportLabourRows();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    uKReportLabourRows.id = id;
+  }
+  final String? jobDate = jsonConvert.convert<String>(json['job_date']);
+  if (jobDate != null) {
+    uKReportLabourRows.jobDate = jobDate;
+  }
+  final String? departmentName = jsonConvert.convert<String>(json['department_name']);
+  if (departmentName != null) {
+    uKReportLabourRows.departmentName = departmentName;
+  }
+  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
+  if (jobTitle != null) {
+    uKReportLabourRows.jobTitle = jobTitle;
+  }
+  final String? startTime = jsonConvert.convert<String>(json['start_time']);
+  if (startTime != null) {
+    uKReportLabourRows.startTime = startTime;
+  }
+  final String? endTime = jsonConvert.convert<String>(json['end_time']);
+  if (endTime != null) {
+    uKReportLabourRows.endTime = endTime;
+  }
+  final int? needNum = jsonConvert.convert<int>(json['need_num']);
+  if (needNum != null) {
+    uKReportLabourRows.needNum = needNum;
+  }
+  final int? realNum = jsonConvert.convert<int>(json['real_num']);
+  if (realNum != null) {
+    uKReportLabourRows.realNum = realNum;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    uKReportLabourRows.createdAt = createdAt;
+  }
+  final String? approvedAt = jsonConvert.convert<String>(json['approved_at']);
+  if (approvedAt != null) {
+    uKReportLabourRows.approvedAt = approvedAt;
+  }
+  return uKReportLabourRows;
+}
+
+Map<String, dynamic> $UKReportLabourRowsToJson(UKReportLabourRows entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['job_date'] = entity.jobDate;
+  data['department_name'] = entity.departmentName;
+  data['job_title'] = entity.jobTitle;
+  data['start_time'] = entity.startTime;
+  data['end_time'] = entity.endTime;
+  data['need_num'] = entity.needNum;
+  data['real_num'] = entity.realNum;
+  data['created_at'] = entity.createdAt;
+  data['approved_at'] = entity.approvedAt;
+  return data;
+}
+
+extension UKReportLabourRowsExtension on UKReportLabourRows {
+  UKReportLabourRows copyWith({
+    String? id,
+    String? jobDate,
+    String? departmentName,
+    String? jobTitle,
+    String? startTime,
+    String? endTime,
+    int? needNum,
+    int? realNum,
+    String? createdAt,
+    String? approvedAt,
+  }) {
+    return UKReportLabourRows()
+      ..id = id ?? this.id
+      ..jobDate = jobDate ?? this.jobDate
+      ..departmentName = departmentName ?? this.departmentName
+      ..jobTitle = jobTitle ?? this.jobTitle
+      ..startTime = startTime ?? this.startTime
+      ..endTime = endTime ?? this.endTime
+      ..needNum = needNum ?? this.needNum
+      ..realNum = realNum ?? this.realNum
+      ..createdAt = createdAt ?? this.createdAt
+      ..approvedAt = approvedAt ?? this.approvedAt;
+  }
+}

+ 110 - 0
packages/cs_domain/lib/repository/uk_report_repository.dart

@@ -1,5 +1,13 @@
+import 'package:domain/entity/response/u_k_report_attendance_entity.dart';
 import 'package:get/get.dart';
 import 'package:plugin_platform/http/http_provider.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:shared/utils/util.dart';
+
+import '../constants/api_constants.dart';
+import '../entity/response/u_k_report_labour_entity.dart';
+import '../entity/response/u_k_security_attendance_option_entity.dart';
 
 /// UK报表与统计相关的数据仓库
 class UKReportRepository extends GetxService {
@@ -7,4 +15,106 @@ class UKReportRepository extends GetxService {
 
   UKReportRepository({required this.httpProvider});
 
+
+  /// 获取报表的筛选选项
+  Future<HttpResult<UKSecurityAttendanceOptionEntity>> fetchReportOptions({
+    CancelToken? cancelToken,
+  }) async {
+    final result = await httpProvider.requestNetResult(
+      ApiConstants.apiReportOptionUK,
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = UKSecurityAttendanceOptionEntity.fromJson(json!);
+      return result.convert<UKSecurityAttendanceOptionEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+  /// 获取报表的用工数据列表
+  Future<HttpResult<UKReportLabourEntity>> fetchReportLabourList({
+    String? keyword,
+    String? startDate,
+    String? endDate,
+    String? departmentId,
+    int curPage = 1,
+    int pageSize = 10,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params["cur_page"] = curPage.toString();
+    params["page_size"] = pageSize.toString();
+
+    if (!Utils.isEmpty(keyword)) {
+      params["job_title"] = keyword!;
+    }
+    if (!Utils.isEmpty(departmentId)) {
+      params["co_department_id"] = departmentId!;
+    }
+    if (!Utils.isEmpty(startDate)) {
+      params["start_date"] = startDate!;
+    }
+    if (!Utils.isEmpty(endDate)) {
+      params["end_date"] = endDate!;
+    }
+
+    final result = await httpProvider.requestNetResult(
+      ApiConstants.apiReportLabourUK,
+      params: params,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = UKReportLabourEntity.fromJson(json!);
+      return result.convert<UKReportLabourEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+  /// 获取报表的电子考勤数据列表
+  Future<HttpResult<UKReportAttendanceEntity>> fetchReportAttendanceList({
+    String? keyword,
+    String? startDate,
+    String? endDate,
+    String? departmentId,
+    int curPage = 1,
+    int pageSize = 10,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params["cur_page"] = curPage.toString();
+    params["page_size"] = pageSize.toString();
+
+    if (!Utils.isEmpty(keyword)) {
+      params["staff_name"] = keyword!;
+    }
+    if (!Utils.isEmpty(departmentId)) {
+      params["co_department_id"] = departmentId!;
+    }
+    if (!Utils.isEmpty(startDate)) {
+      params["start_date"] = startDate!;
+    }
+    if (!Utils.isEmpty(endDate)) {
+      params["end_date"] = endDate!;
+    }
+
+    final result = await httpProvider.requestNetResult(
+      ApiConstants.apiReportAttendanceUK,
+      params: params,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = UKReportAttendanceEntity.fromJson(json!);
+      return result.convert<UKReportAttendanceEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+
 }