|
@@ -1,5 +1,7 @@
|
|
import 'dart:typed_data';
|
|
import 'dart:typed_data';
|
|
|
|
|
|
|
|
+import 'package:domain/entity/response/job_applied_index_s_g_entity.dart';
|
|
|
|
+import 'package:domain/entity/response/job_applied_list_s_g_entity.dart';
|
|
import 'package:domain/entity/response/job_list_add_staff_entity.dart';
|
|
import 'package:domain/entity/response/job_list_add_staff_entity.dart';
|
|
import 'package:domain/entity/response/job_list_applied_edit_entity.dart';
|
|
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_info_entity.dart';
|
|
@@ -21,6 +23,8 @@ import 'package:shared/utils/util.dart';
|
|
import '../constants/api_constants.dart';
|
|
import '../constants/api_constants.dart';
|
|
import '../entity/response/attendance_entity.dart';
|
|
import '../entity/response/attendance_entity.dart';
|
|
import '../entity/response/check_success_entity.dart';
|
|
import '../entity/response/check_success_entity.dart';
|
|
|
|
+import '../entity/response/job_applied_edit_index_s_g_entity.dart';
|
|
|
|
+import '../entity/response/job_applied_staff_s_g_entity.dart';
|
|
import '../entity/response/job_list_applied_work_flow_entity.dart';
|
|
import '../entity/response/job_list_applied_work_flow_entity.dart';
|
|
|
|
|
|
/// 工作相关(新加坡)
|
|
/// 工作相关(新加坡)
|
|
@@ -29,5 +33,384 @@ class JobSGRepository extends GetxService {
|
|
|
|
|
|
JobSGRepository({required this.httpProvider});
|
|
JobSGRepository({required this.httpProvider});
|
|
|
|
|
|
|
|
+ /// 获取工作已申请的选项
|
|
|
|
+ Future<HttpResult<JobAppliedIndexSGEntity>> fetchJobAppliedIndex(
|
|
|
|
+ String? jobId, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params["job_id"] = jobId ?? "";
|
|
|
|
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedIndexSG,
|
|
|
|
+ params: params,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ final json = result.getDataJson();
|
|
|
|
+ var data = JobAppliedIndexSGEntity.fromJson(json!);
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert<JobAppliedIndexSGEntity>(data: data);
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 获取工作已申请的列表
|
|
|
|
+ Future<HttpResult<JobAppliedListSGEntity>> fetchJobAppliedList(
|
|
|
|
+ String? jobId,
|
|
|
|
+ String? status,
|
|
|
|
+ String? keyword, {
|
|
|
|
+ required int curPage,
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params["cur_page"] = curPage.toString();
|
|
|
|
+ params["page_size"] = "10";
|
|
|
|
+ params["job_id"] = jobId ?? "";
|
|
|
|
+
|
|
|
|
+ if (!Utils.isEmpty(keyword)) {
|
|
|
|
+ params["keyword"] = keyword!;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!Utils.isEmpty(status)) {
|
|
|
|
+ params["status"] = status!;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedListSG,
|
|
|
|
+ params: params,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ final json = result.getDataJson();
|
|
|
|
+ var data = JobAppliedListSGEntity.fromJson(json!);
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert<JobAppliedListSGEntity>(data: data);
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 根据ID获取主列表的Item数据,用于刷新Item
|
|
|
|
+ Future<HttpResult<JobAppliedListSGEntity>> 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.apiJobAppliedListSG,
|
|
|
|
+ params: params,
|
|
|
|
+ isShowLoadingDialog: true,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ final json = result.getDataJson();
|
|
|
|
+ var data = JobAppliedListSGEntity.fromJson(json!);
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert<JobAppliedListSGEntity>(data: data);
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 获取工作已申请的列表中添加的员工搜索
|
|
|
|
+ Future<HttpResult<JobAppliedStaffSGEntity>> searchJobAppliedStaff(
|
|
|
|
+ String? jobId,
|
|
|
|
+ String? keyword, {
|
|
|
|
+ required int curPage,
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params["cur_page"] = curPage.toString();
|
|
|
|
+ params["page_size"] = "10";
|
|
|
|
+ params["job_id"] = jobId ?? "";
|
|
|
|
+
|
|
|
|
+ if (!Utils.isEmpty(keyword)) {
|
|
|
|
+ params["keyword"] = keyword!;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedSearchStaffSG,
|
|
|
|
+ params: params,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ final json = result.getDataJson();
|
|
|
|
+ var data = JobAppliedStaffSGEntity.fromJson(json!);
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert<JobAppliedStaffSGEntity>(data: data);
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 添加员工到申请列表
|
|
|
|
+ Future<HttpResult> addStaff2AppliedJob(
|
|
|
|
+ String? jobId,
|
|
|
|
+ String? staffIds, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
|
+ params['staff_ids'] = staffIds ?? "";
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobListConfirmSG,
|
|
|
|
+ method: HttpMethod.POST,
|
|
|
|
+ params: params,
|
|
|
|
+ networkDebounce: true,
|
|
|
|
+ isShowLoadingDialog: true,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 批量修改员工信息或考勤
|
|
|
|
+ Future<HttpResult> batchEditJobApplied(
|
|
|
|
+ String? appliedIds,
|
|
|
|
+ String? startTime,
|
|
|
|
+ String? endTime,
|
|
|
|
+ String? subtractHours,
|
|
|
|
+ String? status, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['applied_ids'] = appliedIds ?? "";
|
|
|
|
+
|
|
|
|
+ if (!Utils.isEmpty(startTime)) {
|
|
|
|
+ params['start_time'] = startTime ?? "";
|
|
|
|
+ }
|
|
|
|
+ if (!Utils.isEmpty(endTime)) {
|
|
|
|
+ params['end_time'] = endTime ?? "";
|
|
|
|
+ }
|
|
|
|
+ if (!Utils.isEmpty(subtractHours)) {
|
|
|
|
+ params['subtract_hours'] = subtractHours ?? "";
|
|
|
|
+ }
|
|
|
|
+ if (!Utils.isEmpty(status)) {
|
|
|
|
+ params['status'] = status ?? "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedBatchEditSG,
|
|
|
|
+ method: HttpMethod.POST,
|
|
|
|
+ params: params,
|
|
|
|
+ networkDebounce: true,
|
|
|
|
+ isShowLoadingDialog: true,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 编辑员工信息或考勤的选项详情
|
|
|
|
+ Future<HttpResult<JobAppliedEditIndexSGEntity>> fetchEditJobAppliedIndex(
|
|
|
|
+ String? appliedId, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['applied_id'] = appliedId ?? "";
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedEditViewSG,
|
|
|
|
+ params: params,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ final json = result.getDataJson();
|
|
|
|
+ var data = JobAppliedEditIndexSGEntity.fromJson(json!);
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert<JobAppliedEditIndexSGEntity>(data: data);
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 编辑员工信息或考勤的提交
|
|
|
|
+ Future<HttpResult> submitEditJobApplied(
|
|
|
|
+ String? appliedId,
|
|
|
|
+ String? startTime,
|
|
|
|
+ String? endTime,
|
|
|
|
+ String? security_in,
|
|
|
|
+ String? security_out,
|
|
|
|
+ String? work_in,
|
|
|
|
+ String? work_out,
|
|
|
|
+ String? adjustHours,
|
|
|
|
+ String? status, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['applied_id'] = appliedId ?? "";
|
|
|
|
+ params['start_time'] = startTime ?? "";
|
|
|
|
+ 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(adjustHours)) {
|
|
|
|
+ params['subtract_hours'] = adjustHours ?? "";
|
|
|
|
+ }
|
|
|
|
+ if (!Utils.isEmpty(status)) {
|
|
|
|
+ params['status'] = status ?? "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedEditSubmitSG,
|
|
|
|
+ method: HttpMethod.POST,
|
|
|
|
+ params: params,
|
|
|
|
+ networkDebounce: true,
|
|
|
|
+ isShowLoadingDialog: true,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 修改考勤员工的考勤状态
|
|
|
|
+ Future<HttpResult> submitEditAppliedStatus(
|
|
|
|
+ String? appliedId,
|
|
|
|
+ String? status, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['applied_id'] = appliedId ?? "";
|
|
|
|
+ params['status'] = status ?? "";
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedChangeStatusSG,
|
|
|
|
+ method: HttpMethod.POST,
|
|
|
|
+ params: params,
|
|
|
|
+ networkDebounce: true,
|
|
|
|
+ isShowLoadingDialog: true,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 获取员工的评价信息
|
|
|
|
+ Future<HttpResult<JobAppliedStaffSGEntity>> fetchJobAppliedRemarkView(
|
|
|
|
+ String? appliedId, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['applied_id'] = appliedId ?? "";
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedRemarkViewSG,
|
|
|
|
+ params: params,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ final json = result.getDataJson();
|
|
|
|
+ var data = JobAppliedStaffSGEntity.fromJson(json!);
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert<JobAppliedStaffSGEntity>(data: data);
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// 提交员工的评价
|
|
|
|
+ Future<HttpResult> submitAppliedRemark(
|
|
|
|
+ String? appliedId,
|
|
|
|
+ String? attitude_rate,
|
|
|
|
+ String? grooming_rate,
|
|
|
|
+ String? performance_rate,
|
|
|
|
+ String? experience_rate,
|
|
|
|
+ String? feedback, {
|
|
|
|
+ CancelToken? cancelToken,
|
|
|
|
+ }) async {
|
|
|
|
+ //参数
|
|
|
|
+ Map<String, String> params = {};
|
|
|
|
+ params['applied_id'] = appliedId ?? "";
|
|
|
|
+ params['attitude_rate'] = attitude_rate ?? "";
|
|
|
|
+ params['grooming_rate'] = grooming_rate ?? "";
|
|
|
|
+ params['performance_rate'] = performance_rate ?? "";
|
|
|
|
+ params['experience_rate'] = experience_rate ?? "";
|
|
|
|
+
|
|
|
|
+ if (!Utils.isEmpty(feedback)) {
|
|
|
|
+ params['feedback'] = feedback ?? "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
|
+ ApiConstants.apiJobAppliedChangeStatusSG,
|
|
|
|
+ method: HttpMethod.POST,
|
|
|
|
+ params: params,
|
|
|
|
+ networkDebounce: true,
|
|
|
|
+ isShowLoadingDialog: true,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //重新赋值data或list
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
|
|
+ return result.convert();
|
|
|
|
+ }
|
|
}
|
|
}
|