Browse Source

越南的用工审核 - 2

liukai 7 months ago
parent
commit
8b2f6cf55a

+ 68 - 0
packages/cs_domain/lib/entity/response/attendance_review_entity.dart

@@ -0,0 +1,68 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/attendance_review_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/attendance_review_entity.g.dart';
+
+@JsonSerializable()
+class AttendanceReviewEntity {
+	int total = 0;
+	List<AttendanceReviewRows> rows = [];
+
+	AttendanceReviewEntity();
+
+	factory AttendanceReviewEntity.fromJson(Map<String, dynamic> json) => $AttendanceReviewEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $AttendanceReviewEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class AttendanceReviewRows {
+	@JSONField(name: "record_id")
+	int? recordId;
+	@JSONField(name: "order_id")
+	int? orderId;
+	@JSONField(name: "applied_id")
+	int? appliedId;
+	@JSONField(name: "staff_name")
+	String? staffName;
+	@JSONField(name: "job_title")
+	String? jobTitle;
+	@JSONField(name: "department_name")
+	String? departmentName;
+	@JSONField(name: "job_time")
+	String? jobTime;
+	@JSONField(name: "status_show")
+	String? statusShow;
+	@JSONField(name: "adjust_show")
+	String? adjustShow;
+	@JSONField(name: "total_show")
+	String? totalShow;
+	@JSONField(name: "clock_in")
+	String? clockIn;
+	@JSONField(name: "in_class")
+	int? inClass;
+	@JSONField(name: "clock_out")
+	String? clockOut;
+	@JSONField(name: "out_class")
+	int? outClass;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	@JSONField(name: "has_reason")
+	int? hasReason;
+
+	AttendanceReviewRows();
+
+	factory AttendanceReviewRows.fromJson(Map<String, dynamic> json) => $AttendanceReviewRowsFromJson(json);
+
+	Map<String, dynamic> toJson() => $AttendanceReviewRowsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 163 - 0
packages/cs_domain/lib/generated/json/attendance_review_entity.g.dart

@@ -0,0 +1,163 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/response/attendance_review_entity.dart';
+
+AttendanceReviewEntity $AttendanceReviewEntityFromJson(Map<String, dynamic> json) {
+  final AttendanceReviewEntity attendanceReviewEntity = AttendanceReviewEntity();
+  final int? total = jsonConvert.convert<int>(json['total']);
+  if (total != null) {
+    attendanceReviewEntity.total = total;
+  }
+  final List<AttendanceReviewRows>? rows = (json['rows'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<AttendanceReviewRows>(e) as AttendanceReviewRows).toList();
+  if (rows != null) {
+    attendanceReviewEntity.rows = rows;
+  }
+  return attendanceReviewEntity;
+}
+
+Map<String, dynamic> $AttendanceReviewEntityToJson(AttendanceReviewEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['total'] = entity.total;
+  data['rows'] = entity.rows.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension AttendanceReviewEntityExtension on AttendanceReviewEntity {
+  AttendanceReviewEntity copyWith({
+    int? total,
+    List<AttendanceReviewRows>? rows,
+  }) {
+    return AttendanceReviewEntity()
+      ..total = total ?? this.total
+      ..rows = rows ?? this.rows;
+  }
+}
+
+AttendanceReviewRows $AttendanceReviewRowsFromJson(Map<String, dynamic> json) {
+  final AttendanceReviewRows attendanceReviewRows = AttendanceReviewRows();
+  final int? recordId = jsonConvert.convert<int>(json['record_id']);
+  if (recordId != null) {
+    attendanceReviewRows.recordId = recordId;
+  }
+  final int? orderId = jsonConvert.convert<int>(json['order_id']);
+  if (orderId != null) {
+    attendanceReviewRows.orderId = orderId;
+  }
+  final int? appliedId = jsonConvert.convert<int>(json['applied_id']);
+  if (appliedId != null) {
+    attendanceReviewRows.appliedId = appliedId;
+  }
+  final String? staffName = jsonConvert.convert<String>(json['staff_name']);
+  if (staffName != null) {
+    attendanceReviewRows.staffName = staffName;
+  }
+  final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
+  if (jobTitle != null) {
+    attendanceReviewRows.jobTitle = jobTitle;
+  }
+  final String? departmentName = jsonConvert.convert<String>(json['department_name']);
+  if (departmentName != null) {
+    attendanceReviewRows.departmentName = departmentName;
+  }
+  final String? jobTime = jsonConvert.convert<String>(json['job_time']);
+  if (jobTime != null) {
+    attendanceReviewRows.jobTime = jobTime;
+  }
+  final String? statusShow = jsonConvert.convert<String>(json['status_show']);
+  if (statusShow != null) {
+    attendanceReviewRows.statusShow = statusShow;
+  }
+  final String? adjustShow = jsonConvert.convert<String>(json['adjust_show']);
+  if (adjustShow != null) {
+    attendanceReviewRows.adjustShow = adjustShow;
+  }
+  final String? totalShow = jsonConvert.convert<String>(json['total_show']);
+  if (totalShow != null) {
+    attendanceReviewRows.totalShow = totalShow;
+  }
+  final String? clockIn = jsonConvert.convert<String>(json['clock_in']);
+  if (clockIn != null) {
+    attendanceReviewRows.clockIn = clockIn;
+  }
+  final int? inClass = jsonConvert.convert<int>(json['in_class']);
+  if (inClass != null) {
+    attendanceReviewRows.inClass = inClass;
+  }
+  final String? clockOut = jsonConvert.convert<String>(json['clock_out']);
+  if (clockOut != null) {
+    attendanceReviewRows.clockOut = clockOut;
+  }
+  final int? outClass = jsonConvert.convert<int>(json['out_class']);
+  if (outClass != null) {
+    attendanceReviewRows.outClass = outClass;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    attendanceReviewRows.createdAt = createdAt;
+  }
+  final int? hasReason = jsonConvert.convert<int>(json['has_reason']);
+  if (hasReason != null) {
+    attendanceReviewRows.hasReason = hasReason;
+  }
+  return attendanceReviewRows;
+}
+
+Map<String, dynamic> $AttendanceReviewRowsToJson(AttendanceReviewRows entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['record_id'] = entity.recordId;
+  data['order_id'] = entity.orderId;
+  data['applied_id'] = entity.appliedId;
+  data['staff_name'] = entity.staffName;
+  data['job_title'] = entity.jobTitle;
+  data['department_name'] = entity.departmentName;
+  data['job_time'] = entity.jobTime;
+  data['status_show'] = entity.statusShow;
+  data['adjust_show'] = entity.adjustShow;
+  data['total_show'] = entity.totalShow;
+  data['clock_in'] = entity.clockIn;
+  data['in_class'] = entity.inClass;
+  data['clock_out'] = entity.clockOut;
+  data['out_class'] = entity.outClass;
+  data['created_at'] = entity.createdAt;
+  data['has_reason'] = entity.hasReason;
+  return data;
+}
+
+extension AttendanceReviewRowsExtension on AttendanceReviewRows {
+  AttendanceReviewRows copyWith({
+    int? recordId,
+    int? orderId,
+    int? appliedId,
+    String? staffName,
+    String? jobTitle,
+    String? departmentName,
+    String? jobTime,
+    String? statusShow,
+    String? adjustShow,
+    String? totalShow,
+    String? clockIn,
+    int? inClass,
+    String? clockOut,
+    int? outClass,
+    String? createdAt,
+    int? hasReason,
+  }) {
+    return AttendanceReviewRows()
+      ..recordId = recordId ?? this.recordId
+      ..orderId = orderId ?? this.orderId
+      ..appliedId = appliedId ?? this.appliedId
+      ..staffName = staffName ?? this.staffName
+      ..jobTitle = jobTitle ?? this.jobTitle
+      ..departmentName = departmentName ?? this.departmentName
+      ..jobTime = jobTime ?? this.jobTime
+      ..statusShow = statusShow ?? this.statusShow
+      ..adjustShow = adjustShow ?? this.adjustShow
+      ..totalShow = totalShow ?? this.totalShow
+      ..clockIn = clockIn ?? this.clockIn
+      ..inClass = inClass ?? this.inClass
+      ..clockOut = clockOut ?? this.clockOut
+      ..outClass = outClass ?? this.outClass
+      ..createdAt = createdAt ?? this.createdAt
+      ..hasReason = hasReason ?? this.hasReason;
+  }
+}

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

@@ -6,6 +6,7 @@
 import 'package:flutter/material.dart' show debugPrint;
 import 'package:domain/entity/response/add_edit_revise_view_s_g_entity.dart';
 import 'package:domain/entity/response/attendance_entity.dart';
+import 'package:domain/entity/response/attendance_review_entity.dart';
 import 'package:domain/entity/response/check_success_entity.dart';
 import 'package:domain/entity/response/device_list_entity.dart';
 import 'package:domain/entity/response/fiance_report_entity.dart';
@@ -196,6 +197,12 @@ class JsonConvert {
     if (<AttendanceList>[] is M) {
       return data.map<AttendanceList>((Map<String, dynamic> e) => AttendanceList.fromJson(e)).toList() as M;
     }
+    if (<AttendanceReviewEntity>[] is M) {
+      return data.map<AttendanceReviewEntity>((Map<String, dynamic> e) => AttendanceReviewEntity.fromJson(e)).toList() as M;
+    }
+    if (<AttendanceReviewRows>[] is M) {
+      return data.map<AttendanceReviewRows>((Map<String, dynamic> e) => AttendanceReviewRows.fromJson(e)).toList() as M;
+    }
     if (<CheckSuccessEntity>[] is M) {
       return data.map<CheckSuccessEntity>((Map<String, dynamic> e) => CheckSuccessEntity.fromJson(e)).toList() as M;
     }
@@ -549,6 +556,8 @@ class JsonConvertClassCollection {
     (AddEditReviseViewSGEntity).toString(): AddEditReviseViewSGEntity.fromJson,
     (AttendanceEntity).toString(): AttendanceEntity.fromJson,
     (AttendanceList).toString(): AttendanceList.fromJson,
+    (AttendanceReviewEntity).toString(): AttendanceReviewEntity.fromJson,
+    (AttendanceReviewRows).toString(): AttendanceReviewRows.fromJson,
     (CheckSuccessEntity).toString(): CheckSuccessEntity.fromJson,
     (DeviceListEntity).toString(): DeviceListEntity.fromJson,
     (DeviceListRows).toString(): DeviceListRows.fromJson,

+ 8 - 1
packages/cs_domain/lib/generated/json/labour_review_list_entity.g.dart

@@ -76,6 +76,10 @@ LabourReviewListRows $LabourReviewListRowsFromJson(Map<String, dynamic> json) {
   if (btnList != null) {
     labourReviewListRows.btnList = btnList;
   }
+  final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
+  if (isSelected != null) {
+    labourReviewListRows.isSelected = isSelected;
+  }
   return labourReviewListRows;
 }
 
@@ -91,6 +95,7 @@ Map<String, dynamic> $LabourReviewListRowsToJson(LabourReviewListRows entity) {
   data['status_show'] = entity.statusShow;
   data['created_at'] = entity.createdAt;
   data['btn_list'] = entity.btnList;
+  data['isSelected'] = entity.isSelected;
   return data;
 }
 
@@ -106,6 +111,7 @@ extension LabourReviewListRowsExtension on LabourReviewListRows {
     String? statusShow,
     String? createdAt,
     List<String>? btnList,
+    bool? isSelected,
   }) {
     return LabourReviewListRows()
       ..recordId = recordId ?? this.recordId
@@ -117,6 +123,7 @@ extension LabourReviewListRowsExtension on LabourReviewListRows {
       ..needNum = needNum ?? this.needNum
       ..statusShow = statusShow ?? this.statusShow
       ..createdAt = createdAt ?? this.createdAt
-      ..btnList = btnList ?? this.btnList;
+      ..btnList = btnList ?? this.btnList
+      ..isSelected = isSelected ?? this.isSelected;
   }
 }