|
@@ -1,5 +1,13 @@
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
+import 'package:domain/entity/response/job_list_applied_edit_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_applied_info_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_applied_staff_list_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_applied_staff_search_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_detail_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_index_entity.dart';
|
|
|
+import 'package:domain/entity/response/job_list_remark_view_entity.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:plugin_platform/dio_export.dart';
|
|
|
import 'package:plugin_platform/http/http_provider.dart';
|
|
@@ -91,4 +99,514 @@ class JobRepository extends GetxService {
|
|
|
return result.convert<CheckSuccessEntity>();
|
|
|
}
|
|
|
|
|
|
+ /// 工作列表的筛选选项
|
|
|
+ Future<HttpResult<JobListIndexEntity>> fetchJobListIndex({
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListIndex,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListIndexEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListIndexEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 获取工作列表的主列表
|
|
|
+ Future<HttpResult<JobListEntity>> fetchJobListTable(
|
|
|
+ String? keyword,
|
|
|
+ String? startDate,
|
|
|
+ String? endDate,
|
|
|
+ String? statusId,
|
|
|
+ String? departmentId, {
|
|
|
+ required int curPage,
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params["cur_page"] = curPage.toString();
|
|
|
+ params["page_size"] = "20";
|
|
|
+
|
|
|
+ if (!Utils.isEmpty(keyword)) {
|
|
|
+ params["job_title"] = keyword!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(startDate)) {
|
|
|
+ params["start_time"] = startDate!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(endDate)) {
|
|
|
+ params["end_time"] = endDate!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(statusId)) {
|
|
|
+ params["status"] = statusId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(departmentId)) {
|
|
|
+ params["co_department_id"] = departmentId!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListTable,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 工作列表的详情
|
|
|
+ Future<HttpResult<JobListDetailEntity>> fetchJobListDetail(
|
|
|
+ String? jobId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListDetail,
|
|
|
+ params: params,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListDetailEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListDetailEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 工作中已申请的工作信息
|
|
|
+ Future<HttpResult<JobListAppliedInfoEntity>> fetchJobAppliedInfo(
|
|
|
+ String? jobId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedJobInfo,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListAppliedInfoEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListAppliedInfoEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 工作中已申请的成员列表
|
|
|
+ Future<HttpResult<JobListAppliedStaffListEntity>> fetchJobAppliedStaffs(
|
|
|
+ String? jobId,
|
|
|
+ String? staffName, {
|
|
|
+ String? appliedId,
|
|
|
+ required int curPage,
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params["cur_page"] = curPage.toString();
|
|
|
+ params["page_size"] = "10";
|
|
|
+
|
|
|
+ if (!Utils.isEmpty(jobId)) {
|
|
|
+ params["job_id"] = jobId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(appliedId)) {
|
|
|
+ params["applied_id"] = appliedId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(staffName)) {
|
|
|
+ params["staff_name"] = staffName!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffList,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListAppliedStaffListEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListAppliedStaffListEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 根据ID获取主列表的Item数据,用于刷新Item
|
|
|
+ Future<HttpResult<JobListAppliedStaffListEntity>> fetchItemByAppliedIds(
|
|
|
+ String? jobId,
|
|
|
+ String? appliedIds, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params["cur_page"] = "1";
|
|
|
+ params["page_size"] = "9999";
|
|
|
+
|
|
|
+ if (!Utils.isEmpty(appliedIds)) {
|
|
|
+ params["applied_ids"] = appliedIds!;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!Utils.isEmpty(jobId)) {
|
|
|
+ params["job_id"] = jobId!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffList,
|
|
|
+ params: params,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListAppliedStaffListEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListAppliedStaffListEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 添加员工的全部员工数据列表
|
|
|
+ Future<HttpResult<JobListAppliedStaffSearchEntity>> searchStaffList(
|
|
|
+ String? jobId,
|
|
|
+ String? keyword, {
|
|
|
+ required int curPage,
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params["cur_page"] = curPage.toString();
|
|
|
+ params["page_size"] = "20";
|
|
|
+
|
|
|
+ if (!Utils.isEmpty(jobId)) {
|
|
|
+ params["job_id"] = jobId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(keyword)) {
|
|
|
+ params["keyword"] = keyword!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffSearch,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListAppliedStaffSearchEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListAppliedStaffSearchEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 添加员工到工作
|
|
|
+ Future<HttpResult> addStaff2Job(
|
|
|
+ String? jobId,
|
|
|
+ String? staffIds, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(jobId)) {
|
|
|
+ params["job_id"] = jobId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(staffIds)) {
|
|
|
+ params["staff_ids"] = staffIds!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffAdd,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 批量修改员工的签到信息与状态
|
|
|
+ Future<HttpResult> batchEditStaffCheckTime(
|
|
|
+ String? jobId,
|
|
|
+ String? appliedIds,
|
|
|
+ String? startTime,
|
|
|
+ String? endTime, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(startTime)) {
|
|
|
+ params["start_time"] = startTime!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(endTime)) {
|
|
|
+ params["end_time"] = endTime!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(appliedIds)) {
|
|
|
+ params["applied_ids"] = appliedIds!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(jobId)) {
|
|
|
+ params["job_id"] = jobId!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffBatchEdit,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 获取单个员工的信息,准备修改
|
|
|
+ Future<HttpResult<JobListAppliedEditEntity>> fetchAppliedStaffInfo(
|
|
|
+ String? appliedId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(appliedId)) {
|
|
|
+ params["applied_id"] = appliedId!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffEditIndex,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListAppliedEditEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListAppliedEditEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 单独修改单个员工的信息
|
|
|
+ Future<HttpResult> editAppliedSingleStaffInfo(
|
|
|
+ String? appliedId,
|
|
|
+ String? startTime,
|
|
|
+ String? endTime,
|
|
|
+ String? security_in,
|
|
|
+ String? security_out,
|
|
|
+ String? work_in,
|
|
|
+ String? work_out,
|
|
|
+ String? total_rooms,
|
|
|
+ String? adjust_hours,
|
|
|
+ String? co_reason_type,
|
|
|
+ String? co_reason, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(appliedId)) {
|
|
|
+ params["applied_id"] = appliedId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(startTime)) {
|
|
|
+ params["start_time"] = startTime!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(endTime)) {
|
|
|
+ params["end_time"] = endTime!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(security_in)) {
|
|
|
+ params["security_in"] = security_in!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(security_out)) {
|
|
|
+ params["security_out"] = security_out!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(work_in)) {
|
|
|
+ params["work_in"] = work_in!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(work_out)) {
|
|
|
+ params["work_out"] = work_out!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(total_rooms)) {
|
|
|
+ params["total_rooms"] = total_rooms!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(adjust_hours)) {
|
|
|
+ params["adjust_hours"] = adjust_hours!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(co_reason_type)) {
|
|
|
+ params["co_reason_type"] = co_reason_type!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(co_reason)) {
|
|
|
+ params["co_reason"] = co_reason!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffEditSubmit,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 给员工评分的详情与选项
|
|
|
+ Future<HttpResult<JobListRemarkViewEntity>> fetchAppliedStaffReviewView(
|
|
|
+ String? appliedId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(appliedId)) {
|
|
|
+ params["applied_id"] = appliedId!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffReviewIndex,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = JobListRemarkViewEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<JobListRemarkViewEntity>(data: data);
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 单独给单个员工评分的提交
|
|
|
+ Future<HttpResult> remarkAppliedSingleStaffSubmit(
|
|
|
+ String? appliedId,
|
|
|
+ String? attitude_rate,
|
|
|
+ String? grooming_rate,
|
|
|
+ String? performance_rate,
|
|
|
+ String? experience_rate,
|
|
|
+ String? content, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(appliedId)) {
|
|
|
+ params["applied_id"] = appliedId!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(attitude_rate)) {
|
|
|
+ params["attitude_rate"] = attitude_rate!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(grooming_rate)) {
|
|
|
+ params["grooming_rate"] = grooming_rate!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(performance_rate)) {
|
|
|
+ params["performance_rate"] = performance_rate!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(experience_rate)) {
|
|
|
+ params["experience_rate"] = experience_rate!;
|
|
|
+ }
|
|
|
+ if (!Utils.isEmpty(content)) {
|
|
|
+ params["content"] = content!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedStaffReviewSubmit,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 批量提交多个员工的考勤
|
|
|
+ Future<HttpResult> submitBatchStaffApprove(
|
|
|
+ String? appliedIds, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ if (!Utils.isEmpty(appliedIds)) {
|
|
|
+ params["applied_ids"] = appliedIds!;
|
|
|
+ }
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListAppliedApprove,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+// 员工状态的工作流
|
|
|
+
|
|
|
+// 员工的信息
|
|
|
+
|
|
|
+// 员工的历史申请记录
|
|
|
+
|
|
|
+// 员工的历史评价记录
|
|
|
}
|