|
@@ -6,8 +6,7 @@ import 'package:domain/entity/response/job_template_edit_index_entity.dart';
|
|
|
import 'package:domain/entity/response/job_template_s_g_entity.dart';
|
|
|
import 'package:domain/entity/response/job_title_edit_index_entity.dart';
|
|
|
import 'package:domain/entity/response/job_title_s_g_entity.dart';
|
|
|
-import 'package:domain/entity/response/labour_request_s_g_add_index_entity.dart';
|
|
|
-import 'package:domain/entity/response/labour_request_s_g_entity.dart';
|
|
|
+import 'package:domain/entity/response/s_g_labour_request_worl_flow_entity.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:plugin_platform/platform_export.dart';
|
|
|
import 'package:plugin_platform/http/http_provider.dart';
|
|
@@ -15,10 +14,12 @@ import 'package:plugin_platform/http/http_result.dart';
|
|
|
import 'package:shared/utils/util.dart';
|
|
|
|
|
|
import '../constants/api_constants.dart';
|
|
|
+import '../entity/agency_need_number.dart';
|
|
|
import '../entity/response/job_list_s_g_entity.dart';
|
|
|
-import '../entity/response/labour_request_index_entity.dart';
|
|
|
-import '../entity/response/labour_request_s_g_edit_index_entity.dart';
|
|
|
-import '../entity/response/labour_request_s_g_list_entity.dart';
|
|
|
+import '../entity/response/s_g_labour_request_add_option_entity.dart';
|
|
|
+import '../entity/response/s_g_labour_request_detail_entity.dart';
|
|
|
+import '../entity/response/s_g_labour_request_option_entity.dart';
|
|
|
+import '../entity/response/s_g_labour_request_table_entity.dart';
|
|
|
|
|
|
/// 用工相关(新加坡)
|
|
|
class LabourSGRepository extends GetxService {
|
|
@@ -516,58 +517,66 @@ class LabourSGRepository extends GetxService {
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 用工请求的首页数据
|
|
|
- Future<HttpResult<LabourRequestSGCountList?>> fetchLabourRequestMain(
|
|
|
- String? date, {
|
|
|
+ // =================================== LabourRequest ↓ ===================================
|
|
|
+
|
|
|
+ /// 用工请求列表的选项数据
|
|
|
+ Future<HttpResult<SGLabourRequestOptionEntity>> fetchLabourRequestOption({
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
- Map<String, String> params = {};
|
|
|
-
|
|
|
- if (Utils.isNotEmpty(date)) {
|
|
|
- params["date"] = date ?? "";
|
|
|
- }
|
|
|
-
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestMainSG,
|
|
|
- params: params,
|
|
|
+ ApiConstants.apiLabourRequestOptionSG,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
|
- // //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
- // if (result.isSuccess) {
|
|
|
- // //重新赋值data或list
|
|
|
- // final json = result.getDataJson();
|
|
|
- // var data = LabourRequestSGEntity.fromJson(json!);
|
|
|
- // //重新赋值data或list
|
|
|
- // return result.convert<LabourRequestSGEntity>(data: data);
|
|
|
- // }
|
|
|
- // return result.convert();
|
|
|
-
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
if (result.isSuccess) {
|
|
|
- var jsonList = result.getListJson();
|
|
|
-
|
|
|
- var list = jsonList?.map((e) {
|
|
|
- if (e is Map<String, dynamic>) {
|
|
|
- return LabourRequestSGCountList.fromJson(e);
|
|
|
- } else {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }).toList();
|
|
|
-
|
|
|
- return result.convert<LabourRequestSGCountList?>(list: list);
|
|
|
+ //重新赋值data或list
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = SGLabourRequestOptionEntity.fromJson(json!);
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert<SGLabourRequestOptionEntity>(data: data);
|
|
|
}
|
|
|
-
|
|
|
- return result.convert<LabourRequestSGCountList>();
|
|
|
+ return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 添加用工请求的选项数据
|
|
|
- Future<HttpResult<LabourRequestSGAddIndexEntity>> fetchLabourRequestAddIndex({
|
|
|
- bool isShowLoadingDialog = true,
|
|
|
+ /// 用工请求列表 Table
|
|
|
+ Future<HttpResult<SGLabourRequestTableEntity>> fetchLabourRequestTable({
|
|
|
+ String? requestId,
|
|
|
+ String? agencyId,
|
|
|
+ String? startDate,
|
|
|
+ String? endDate,
|
|
|
+ String? outletId,
|
|
|
+ String? status,
|
|
|
+ required int curPage,
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
+ Map<String, String> params = {};
|
|
|
+
|
|
|
+ if (Utils.isNotEmpty(requestId)) {
|
|
|
+ params['request_id'] = requestId ?? "";
|
|
|
+ }
|
|
|
+ if (Utils.isNotEmpty(agencyId)) {
|
|
|
+ params['agency_id'] = agencyId ?? "";
|
|
|
+ }
|
|
|
+ if (Utils.isNotEmpty(startDate)) {
|
|
|
+ params['start_date'] = startDate ?? "";
|
|
|
+ }
|
|
|
+ if (Utils.isNotEmpty(endDate)) {
|
|
|
+ params['end_date'] = endDate ?? "";
|
|
|
+ }
|
|
|
+ if (Utils.isNotEmpty(status)) {
|
|
|
+ params['status'] = status ?? "";
|
|
|
+ }
|
|
|
+ if (Utils.isNotEmpty(outletId)) {
|
|
|
+ params['outlet_id'] = outletId ?? "";
|
|
|
+ }
|
|
|
+
|
|
|
+ params['cur_page'] = curPage.toString();
|
|
|
+ params['page_size'] = "10";
|
|
|
+
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestAddIndexSG,
|
|
|
- isShowLoadingDialog: isShowLoadingDialog,
|
|
|
+ ApiConstants.apiLabourRequestTableSG,
|
|
|
+ params: params,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
@@ -575,28 +584,25 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = LabourRequestSGAddIndexEntity.fromJson(json!);
|
|
|
+ var data = SGLabourRequestTableEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<LabourRequestSGAddIndexEntity>(data: data);
|
|
|
+ return result.convert<SGLabourRequestTableEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 删除工作标题的提交
|
|
|
- Future<HttpResult> submitLabourRequestAdd(
|
|
|
- String? jobTitleId,
|
|
|
- String? startTime,
|
|
|
- String? endTime,
|
|
|
+ /// 用工请求 Add submit
|
|
|
+ Future<HttpResult> addLabourRequestSubmit({
|
|
|
+ required String? jobTitleId,
|
|
|
+ required String? startTime,
|
|
|
+ required String? endTime,
|
|
|
+ required String? outletId,
|
|
|
String? repeatStart,
|
|
|
String? repeatEnd,
|
|
|
- String? outletId,
|
|
|
- int sexLimit,
|
|
|
- String? maleLimit,
|
|
|
- String? femaleLimit,
|
|
|
- String? needNum,
|
|
|
String? requestType,
|
|
|
String? positionId,
|
|
|
- String? remark, {
|
|
|
+ List<AgencyNeedNumberEntity>? list,
|
|
|
+ String? remark,
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
//参数
|
|
@@ -607,36 +613,44 @@ class LabourSGRepository extends GetxService {
|
|
|
params['end_time'] = endTime ?? "";
|
|
|
params['outlet_id'] = outletId ?? "";
|
|
|
|
|
|
- params['sex_limit'] = sexLimit.toString();
|
|
|
-
|
|
|
- if (sexLimit == 1) {
|
|
|
- params['male_limit'] = maleLimit ?? "0";
|
|
|
- params['female_limit'] = femaleLimit ?? "0";
|
|
|
- // params['need_num'] = (int.parse(maleLimit ?? "0") + int.parse(femaleLimit ?? "0")).toString(); //不传 need_num 字段
|
|
|
- } else {
|
|
|
- params['need_num'] = needNum ?? "0";
|
|
|
- }
|
|
|
-
|
|
|
if (Utils.isNotEmpty(repeatStart)) {
|
|
|
params['repeat_start'] = repeatStart ?? "";
|
|
|
}
|
|
|
-
|
|
|
if (Utils.isNotEmpty(repeatEnd)) {
|
|
|
params['repeat_end'] = repeatEnd ?? "";
|
|
|
}
|
|
|
-
|
|
|
if (Utils.isNotEmpty(requestType)) {
|
|
|
params['request_type'] = requestType ?? "";
|
|
|
}
|
|
|
-
|
|
|
if (Utils.isNotEmpty(positionId) && requestType == "1") {
|
|
|
params['position_id'] = positionId ?? "";
|
|
|
}
|
|
|
-
|
|
|
if (Utils.isNotEmpty(remark)) {
|
|
|
params['remark'] = remark ?? "";
|
|
|
}
|
|
|
|
|
|
+ if (list != null && list.isNotEmpty) {
|
|
|
+ for (var item in list) {
|
|
|
+ if (item.isInHouse) {
|
|
|
+ params['sex_limit_0'] = item.sexLimit.toString();
|
|
|
+ if (item.sexLimit == 1) {
|
|
|
+ params['male_limit_0'] = item.maleLimit.toString();
|
|
|
+ params['female_limit_0'] = item.femaleLimit.toString();
|
|
|
+ } else {
|
|
|
+ params['need_num_0'] = item.needNum.toString();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ params['sex_limit_${item.agencyId}'] = item.sexLimit.toString();
|
|
|
+ if (item.sexLimit == 1) {
|
|
|
+ params['male_limit_${item.agencyId}'] = item.maleLimit.toString();
|
|
|
+ params['female_limit_${item.agencyId}'] = item.femaleLimit.toString();
|
|
|
+ } else {
|
|
|
+ params['need_num_${item.agencyId}'] = item.needNum.toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
ApiConstants.apiLabourRequestAddSubmitSG,
|
|
|
method: HttpMethod.POST,
|
|
@@ -654,12 +668,13 @@ class LabourSGRepository extends GetxService {
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- //用工请求的查询选项(Job List)
|
|
|
- Future<HttpResult<JobListIndexSGEntity>> fetchJobListIndex({
|
|
|
+ /// 用工请求 Add Option
|
|
|
+ Future<HttpResult<SGLabourRequestAddOptionEntity>> fetchLabourRequestAddOption({
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListIndexSG,
|
|
|
+ ApiConstants.apiLabourRequestAddOptionSG,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
@@ -667,46 +682,26 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = JobListIndexSGEntity.fromJson(json!);
|
|
|
+ var data = SGLabourRequestAddOptionEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<JobListIndexSGEntity>(data: data);
|
|
|
+ return result.convert<SGLabourRequestAddOptionEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- //用工请求的查询列表(Job List)
|
|
|
- Future<HttpResult<JobListSGEntity>> fetchJobListTable(
|
|
|
- String? startDate,
|
|
|
- String? endDate,
|
|
|
- String? status,
|
|
|
- String? outletId, {
|
|
|
- required int curPage,
|
|
|
+ /// 用工请求 Edit Detail
|
|
|
+ Future<HttpResult<SGLabourRequestDetailEntity>> fetchLabourRequestEditDetail(
|
|
|
+ String? requestId, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
+ //参数
|
|
|
Map<String, String> params = {};
|
|
|
-
|
|
|
- if (Utils.isNotEmpty(startDate)) {
|
|
|
- params['start_date'] = startDate ?? "";
|
|
|
- }
|
|
|
-
|
|
|
- if (Utils.isNotEmpty(endDate)) {
|
|
|
- params['end_date'] = endDate ?? "";
|
|
|
- }
|
|
|
-
|
|
|
- if (Utils.isNotEmpty(status)) {
|
|
|
- params['status'] = status ?? "";
|
|
|
- }
|
|
|
-
|
|
|
- if (Utils.isNotEmpty(outletId)) {
|
|
|
- params['outlet_id'] = outletId ?? "";
|
|
|
- }
|
|
|
-
|
|
|
- params['cur_page'] = curPage.toString();
|
|
|
- params['page_size'] = "10";
|
|
|
+ params['request_id'] = requestId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListTableSG,
|
|
|
+ ApiConstants.apiLabourRequestEditDetailSG,
|
|
|
params: params,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
@@ -714,55 +709,53 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = JobListSGEntity.fromJson(json!);
|
|
|
+ var data = SGLabourRequestDetailEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<JobListSGEntity>(data: data);
|
|
|
+ return result.convert<SGLabourRequestDetailEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 根据ID获取主列表的Item数据,用于刷新Item
|
|
|
- Future<HttpResult<JobListSGEntity>> fetchJobListByIds(
|
|
|
- String? jobId, {
|
|
|
+ /// 新加坡的用工请求 Recall操作
|
|
|
+ Future<HttpResult> recallLabourRequestSG(
|
|
|
+ String? requestId, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
//参数
|
|
|
Map<String, String> params = {};
|
|
|
- params["cur_page"] = "1";
|
|
|
- params["page_size"] = "9999";
|
|
|
-
|
|
|
- if (!Utils.isEmpty(jobId)) {
|
|
|
- params["job_id"] = jobId!;
|
|
|
- }
|
|
|
+ params['request_id'] = requestId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListTableSG,
|
|
|
+ ApiConstants.apiLabourRequestRecallSG,
|
|
|
+ method: HttpMethod.POST,
|
|
|
params: params,
|
|
|
+ networkDebounce: true,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
|
//根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
- final json = result.getDataJson();
|
|
|
- var data = JobListSGEntity.fromJson(json!);
|
|
|
- //重新赋值data或list
|
|
|
- return result.convert<JobListSGEntity>(data: data);
|
|
|
+ return result.convert();
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- //用工请求的编辑详情(Job List)
|
|
|
- Future<HttpResult<JobListEditIndexSGEntity>> fetchJobListEditIndex(
|
|
|
- String? jobId, {
|
|
|
+ /// 删除新加坡的用工请求
|
|
|
+ Future<HttpResult> deleteLabourRequestSG(
|
|
|
+ String? requestId, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
+ //参数
|
|
|
Map<String, String> params = {};
|
|
|
- params['job_id'] = jobId ?? "";
|
|
|
+ params['request_id'] = requestId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListEditIndexSG,
|
|
|
+ ApiConstants.apiLabourRequestDelete,
|
|
|
+ method: HttpMethod.POST,
|
|
|
params: params,
|
|
|
+ networkDebounce: true,
|
|
|
isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
@@ -770,87 +763,54 @@ class LabourSGRepository extends GetxService {
|
|
|
//根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
- final json = result.getDataJson();
|
|
|
- var data = JobListEditIndexSGEntity.fromJson(json!);
|
|
|
- //重新赋值data或list
|
|
|
- return result.convert<JobListEditIndexSGEntity>(data: data);
|
|
|
+ return result.convert();
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- //用工请求的编辑提交(Job List)
|
|
|
- Future<HttpResult> editJobListSubmit(
|
|
|
- String? jobId,
|
|
|
- String? startTime,
|
|
|
- String? endTime,
|
|
|
- String? outletId,
|
|
|
- int sexLimit,
|
|
|
+ /// 用工请求 Edit submit
|
|
|
+ Future<HttpResult> editLabourRequestSubmit({
|
|
|
+ required String? requestId,
|
|
|
+ required String? startTime,
|
|
|
+ required String? endTime,
|
|
|
+ required String? outletId,
|
|
|
+ int sexLimit = 0,
|
|
|
String? maleLimit,
|
|
|
String? femaleLimit,
|
|
|
String? needNum,
|
|
|
String? requestType,
|
|
|
String? positionId,
|
|
|
- String? remark, {
|
|
|
+ String? remark,
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
//参数
|
|
|
Map<String, String> params = {};
|
|
|
|
|
|
- params['job_id'] = jobId ?? "";
|
|
|
+ params['request_id'] = requestId ?? "";
|
|
|
params['start_time'] = startTime ?? "";
|
|
|
params['end_time'] = endTime ?? "";
|
|
|
params['outlet_id'] = outletId ?? "";
|
|
|
|
|
|
- params['sex_limit'] = sexLimit.toString();
|
|
|
-
|
|
|
- if (sexLimit == 1) {
|
|
|
- params['male_limit'] = maleLimit ?? "0";
|
|
|
- params['female_limit'] = femaleLimit ?? "0";
|
|
|
- // params['need_num'] = (int.parse(maleLimit ?? "0") + int.parse(femaleLimit ?? "0")).toString();
|
|
|
- } else {
|
|
|
- params['need_num'] = needNum ?? "0";
|
|
|
- }
|
|
|
-
|
|
|
if (Utils.isNotEmpty(requestType)) {
|
|
|
params['request_type'] = requestType ?? "";
|
|
|
}
|
|
|
-
|
|
|
if (Utils.isNotEmpty(positionId) && requestType == "1") {
|
|
|
params['position_id'] = positionId ?? "";
|
|
|
}
|
|
|
-
|
|
|
if (Utils.isNotEmpty(remark)) {
|
|
|
params['remark'] = remark ?? "";
|
|
|
}
|
|
|
|
|
|
- final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListEditSubmitSG,
|
|
|
- method: HttpMethod.POST,
|
|
|
- params: params,
|
|
|
- networkDebounce: true,
|
|
|
- isShowLoadingDialog: true,
|
|
|
- cancelToken: cancelToken,
|
|
|
- );
|
|
|
-
|
|
|
- //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
- if (result.isSuccess) {
|
|
|
- //重新赋值data或list
|
|
|
- return result.convert();
|
|
|
+ params['sex_limit'] = sexLimit.toString();
|
|
|
+ if (sexLimit == 1) {
|
|
|
+ params['male_limit'] = maleLimit.toString();
|
|
|
+ params['female_limit'] = femaleLimit.toString();
|
|
|
+ } else {
|
|
|
+ params['need_num'] = needNum.toString();
|
|
|
}
|
|
|
- return result.convert();
|
|
|
- }
|
|
|
-
|
|
|
- //用工请求的取消(Job List)
|
|
|
- Future<HttpResult> cancelJobList(
|
|
|
- String? jobId, {
|
|
|
- CancelToken? cancelToken,
|
|
|
- }) async {
|
|
|
- //参数
|
|
|
- Map<String, String> params = {};
|
|
|
- params['job_id'] = jobId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListCancelSG,
|
|
|
+ ApiConstants.apiLabourRequestEditSubmitSG,
|
|
|
method: HttpMethod.POST,
|
|
|
params: params,
|
|
|
networkDebounce: true,
|
|
@@ -866,20 +826,18 @@ class LabourSGRepository extends GetxService {
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- //用工请求的删除(Job List)
|
|
|
- Future<HttpResult> deleteJobList(
|
|
|
- String? jobId, {
|
|
|
- CancelToken? cancelToken,
|
|
|
- }) async {
|
|
|
+ /// 用工请求的工作流列表
|
|
|
+ Future<HttpResult<SGLabourRequestWorlFlowEntity>> fetchLabourRequestWorkFlow(
|
|
|
+ String? requestId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
//参数
|
|
|
Map<String, String> params = {};
|
|
|
- params['job_id'] = jobId ?? "";
|
|
|
+ params['request_id'] = requestId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListDeleteSG,
|
|
|
- method: HttpMethod.POST,
|
|
|
+ ApiConstants.apiLabourRequestWorkflowSG,
|
|
|
params: params,
|
|
|
- networkDebounce: true,
|
|
|
isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
@@ -887,45 +845,22 @@ class LabourSGRepository extends GetxService {
|
|
|
//根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
- return result.convert();
|
|
|
- }
|
|
|
- return result.convert();
|
|
|
- }
|
|
|
-
|
|
|
- //用工请求的考勤确认(Job List)
|
|
|
- Future<HttpResult> confirmJobList(
|
|
|
- String? jobId, {
|
|
|
- CancelToken? cancelToken,
|
|
|
- }) async {
|
|
|
- //参数
|
|
|
- Map<String, String> params = {};
|
|
|
- params['job_id'] = jobId ?? "";
|
|
|
-
|
|
|
- final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiJobListConfirmSG,
|
|
|
- method: HttpMethod.POST,
|
|
|
- params: params,
|
|
|
- networkDebounce: true,
|
|
|
- isShowLoadingDialog: true,
|
|
|
- cancelToken: cancelToken,
|
|
|
- );
|
|
|
-
|
|
|
- //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
- if (result.isSuccess) {
|
|
|
+ final json = result.getDataJson();
|
|
|
+ var data = SGLabourRequestWorlFlowEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert();
|
|
|
+ return result.convert<SGLabourRequestWorlFlowEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- // V2 - 新版的LabourRequest 改动
|
|
|
+ // =================================== Job List ↓ ===================================
|
|
|
|
|
|
- /// 获取用工请求的筛选选项
|
|
|
- Future<HttpResult<LabourRequestIndexEntity>> fetchLabourRequestSGIndex({
|
|
|
+ //用工请求的查询选项(Job List)
|
|
|
+ Future<HttpResult<JobListIndexSGEntity>> fetchJobListIndex({
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestIndex,
|
|
|
+ ApiConstants.apiJobListIndexSG,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
@@ -933,46 +868,45 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = LabourRequestIndexEntity.fromJson(json!);
|
|
|
+ var data = JobListIndexSGEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<LabourRequestIndexEntity>(data: data);
|
|
|
+ return result.convert<JobListIndexSGEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 获取用工请求的主列表
|
|
|
- Future<HttpResult<LabourRequestSGListEntity>> fetchLabourRequestSGList(
|
|
|
- String? keyword,
|
|
|
+ //用工请求的查询列表(Job List)
|
|
|
+ Future<HttpResult<JobListSGEntity>> fetchJobListTable(
|
|
|
String? startDate,
|
|
|
String? endDate,
|
|
|
- String? statusId,
|
|
|
- String? departmentId, {
|
|
|
+ String? status,
|
|
|
+ String? outletId, {
|
|
|
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["job_start"] = startDate!;
|
|
|
+ if (Utils.isNotEmpty(startDate)) {
|
|
|
+ params['start_date'] = startDate ?? "";
|
|
|
}
|
|
|
- if (!Utils.isEmpty(endDate)) {
|
|
|
- params["job_end"] = endDate!;
|
|
|
+
|
|
|
+ if (Utils.isNotEmpty(endDate)) {
|
|
|
+ params['end_date'] = endDate ?? "";
|
|
|
}
|
|
|
- if (!Utils.isEmpty(statusId)) {
|
|
|
- params["status"] = statusId!;
|
|
|
+
|
|
|
+ if (Utils.isNotEmpty(status)) {
|
|
|
+ params['status'] = status ?? "";
|
|
|
}
|
|
|
- if (!Utils.isEmpty(departmentId)) {
|
|
|
- params["outlet_id"] = departmentId!;
|
|
|
+
|
|
|
+ if (Utils.isNotEmpty(outletId)) {
|
|
|
+ params['outlet_id'] = outletId ?? "";
|
|
|
}
|
|
|
|
|
|
+ params['cur_page'] = curPage.toString();
|
|
|
+ params['page_size'] = "10";
|
|
|
+
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestList,
|
|
|
+ ApiConstants.apiJobListTableSG,
|
|
|
params: params,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
@@ -981,31 +915,30 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = LabourRequestSGListEntity.fromJson(json!);
|
|
|
+ var data = JobListSGEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<LabourRequestSGListEntity>(data: data);
|
|
|
+ return result.convert<JobListSGEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
/// 根据ID获取主列表的Item数据,用于刷新Item
|
|
|
- Future<HttpResult<LabourRequestSGListEntity>> fetchItemByRequestId(
|
|
|
- String? requestId, {
|
|
|
+ Future<HttpResult<JobListSGEntity>> fetchJobListByIds(
|
|
|
+ String? jobId, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
//参数
|
|
|
Map<String, String> params = {};
|
|
|
params["cur_page"] = "1";
|
|
|
- params["page_size"] = "1";
|
|
|
+ params["page_size"] = "9999";
|
|
|
|
|
|
- if (!Utils.isEmpty(requestId)) {
|
|
|
- params["request_id"] = requestId!;
|
|
|
+ if (!Utils.isEmpty(jobId)) {
|
|
|
+ params["job_id"] = jobId!;
|
|
|
}
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestList,
|
|
|
+ ApiConstants.apiJobListTableSG,
|
|
|
params: params,
|
|
|
- isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
@@ -1013,94 +946,25 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = LabourRequestSGListEntity.fromJson(json!);
|
|
|
+ var data = JobListSGEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<LabourRequestSGListEntity>(data: data);
|
|
|
+ return result.convert<JobListSGEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 删除工作标题的提交
|
|
|
- // Future<HttpResult> submitLabourRequestAdd(
|
|
|
- // String? jobTitleId,
|
|
|
- // String? startTime,
|
|
|
- // String? endTime,
|
|
|
- // String? repeatStart,
|
|
|
- // String? repeatEnd,
|
|
|
- // String? outletId,
|
|
|
- // int sexLimit,
|
|
|
- // String? maleLimit,
|
|
|
- // String? femaleLimit,
|
|
|
- // String? needNum,
|
|
|
- // String? requestType,
|
|
|
- // String? remark, {
|
|
|
- // CancelToken? cancelToken,
|
|
|
- // }) async {
|
|
|
- // //参数
|
|
|
- // Map<String, String> params = {};
|
|
|
- //
|
|
|
- // params['job_title_id'] = jobTitleId ?? "";
|
|
|
- // params['start_time'] = startTime ?? "";
|
|
|
- // params['end_time'] = endTime ?? "";
|
|
|
- // params['outlet_id'] = outletId ?? "";
|
|
|
- //
|
|
|
- // params['sex_limit'] = sexLimit.toString();
|
|
|
- //
|
|
|
- // if (sexLimit == 1) {
|
|
|
- // params['male_limit'] = maleLimit ?? "0";
|
|
|
- // params['female_limit'] = femaleLimit ?? "0";
|
|
|
- // // params['need_num'] = (int.parse(maleLimit ?? "0") + int.parse(femaleLimit ?? "0")).toString(); //不传 need_num 字段
|
|
|
- // } else {
|
|
|
- // params['need_num'] = needNum ?? "0";
|
|
|
- // }
|
|
|
- //
|
|
|
- // if (Utils.isNotEmpty(repeatStart)) {
|
|
|
- // params['repeat_start'] = repeatStart ?? "";
|
|
|
- // }
|
|
|
- //
|
|
|
- // if (Utils.isNotEmpty(repeatEnd)) {
|
|
|
- // params['repeat_end'] = repeatEnd ?? "";
|
|
|
- // }
|
|
|
- //
|
|
|
- // if (Utils.isNotEmpty(requestType)) {
|
|
|
- // params['request_type'] = requestType ?? "";
|
|
|
- // }
|
|
|
- //
|
|
|
- // if (Utils.isNotEmpty(remark)) {
|
|
|
- // params['remark'] = remark ?? "";
|
|
|
- // }
|
|
|
- //
|
|
|
- // final result = await httpProvider.requestNetResult(
|
|
|
- // ApiConstants.apiLabourRequestAddSubmitSG,
|
|
|
- // 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<LabourRequestSGEditIndexEntity>> fetchLabourRequestEditDetail(
|
|
|
- String? requestId, {
|
|
|
- bool isShowLoadingDialog = true,
|
|
|
+ //用工请求的编辑详情(Job List)
|
|
|
+ Future<HttpResult<JobListEditIndexSGEntity>> fetchJobListEditIndex(
|
|
|
+ String? jobId, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
- //参数
|
|
|
Map<String, String> params = {};
|
|
|
- params['request_id'] = requestId ?? "";
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestEditDetail,
|
|
|
+ ApiConstants.apiJobListEditIndexSG,
|
|
|
params: params,
|
|
|
- isShowLoadingDialog: isShowLoadingDialog,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
cancelToken: cancelToken,
|
|
|
);
|
|
|
|
|
@@ -1108,16 +972,16 @@ class LabourSGRepository extends GetxService {
|
|
|
if (result.isSuccess) {
|
|
|
//重新赋值data或list
|
|
|
final json = result.getDataJson();
|
|
|
- var data = LabourRequestSGEditIndexEntity.fromJson(json!);
|
|
|
+ var data = JobListEditIndexSGEntity.fromJson(json!);
|
|
|
//重新赋值data或list
|
|
|
- return result.convert<LabourRequestSGEditIndexEntity>(data: data);
|
|
|
+ return result.convert<JobListEditIndexSGEntity>(data: data);
|
|
|
}
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 编辑工作标题的提交
|
|
|
- Future<HttpResult> submitLabourRequestEdit(
|
|
|
- String? requestId,
|
|
|
+ //用工请求的编辑提交(Job List)
|
|
|
+ Future<HttpResult> editJobListSubmit(
|
|
|
+ String? jobId,
|
|
|
String? startTime,
|
|
|
String? endTime,
|
|
|
String? outletId,
|
|
@@ -1126,13 +990,14 @@ class LabourSGRepository extends GetxService {
|
|
|
String? femaleLimit,
|
|
|
String? needNum,
|
|
|
String? requestType,
|
|
|
+ String? positionId,
|
|
|
String? remark, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
//参数
|
|
|
Map<String, String> params = {};
|
|
|
|
|
|
- params['request_id'] = requestId ?? "";
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
params['start_time'] = startTime ?? "";
|
|
|
params['end_time'] = endTime ?? "";
|
|
|
params['outlet_id'] = outletId ?? "";
|
|
@@ -1142,7 +1007,7 @@ class LabourSGRepository extends GetxService {
|
|
|
if (sexLimit == 1) {
|
|
|
params['male_limit'] = maleLimit ?? "0";
|
|
|
params['female_limit'] = femaleLimit ?? "0";
|
|
|
- // params['need_num'] = (int.parse(maleLimit ?? "0") + int.parse(femaleLimit ?? "0")).toString(); //不传 need_num 字段
|
|
|
+ // params['need_num'] = (int.parse(maleLimit ?? "0") + int.parse(femaleLimit ?? "0")).toString();
|
|
|
} else {
|
|
|
params['need_num'] = needNum ?? "0";
|
|
|
}
|
|
@@ -1151,12 +1016,16 @@ class LabourSGRepository extends GetxService {
|
|
|
params['request_type'] = requestType ?? "";
|
|
|
}
|
|
|
|
|
|
+ if (Utils.isNotEmpty(positionId) && requestType == "1") {
|
|
|
+ params['position_id'] = positionId ?? "";
|
|
|
+ }
|
|
|
+
|
|
|
if (Utils.isNotEmpty(remark)) {
|
|
|
params['remark'] = remark ?? "";
|
|
|
}
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestEditSubmit,
|
|
|
+ ApiConstants.apiJobListEditSubmitSG,
|
|
|
method: HttpMethod.POST,
|
|
|
params: params,
|
|
|
networkDebounce: true,
|
|
@@ -1172,18 +1041,69 @@ class LabourSGRepository extends GetxService {
|
|
|
return result.convert();
|
|
|
}
|
|
|
|
|
|
- /// 删除新加坡的用工请求
|
|
|
- Future<HttpResult> deleteLabourRequestSG(
|
|
|
- String? requestId, {
|
|
|
+ //用工请求的取消(Job List)
|
|
|
+ Future<HttpResult> cancelJobList(
|
|
|
+ String? jobId, {
|
|
|
CancelToken? cancelToken,
|
|
|
}) async {
|
|
|
//参数
|
|
|
Map<String, String> params = {};
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
|
|
|
- params['request_id'] = requestId ?? "";
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListCancelSG,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ networkDebounce: true,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ //用工请求的删除(Job List)
|
|
|
+ Future<HttpResult> deleteJobList(
|
|
|
+ String? jobId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
|
|
|
final result = await httpProvider.requestNetResult(
|
|
|
- ApiConstants.apiLabourRequestDelete,
|
|
|
+ ApiConstants.apiJobListDeleteSG,
|
|
|
+ method: HttpMethod.POST,
|
|
|
+ params: params,
|
|
|
+ networkDebounce: true,
|
|
|
+ isShowLoadingDialog: true,
|
|
|
+ cancelToken: cancelToken,
|
|
|
+ );
|
|
|
+
|
|
|
+ //根据返回的结果,封装原始数据为Bean/Entity对象
|
|
|
+ if (result.isSuccess) {
|
|
|
+ //重新赋值data或list
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+ return result.convert();
|
|
|
+ }
|
|
|
+
|
|
|
+ //用工请求的考勤确认(Job List)
|
|
|
+ Future<HttpResult> confirmJobList(
|
|
|
+ String? jobId, {
|
|
|
+ CancelToken? cancelToken,
|
|
|
+ }) async {
|
|
|
+ //参数
|
|
|
+ Map<String, String> params = {};
|
|
|
+ params['job_id'] = jobId ?? "";
|
|
|
+
|
|
|
+ final result = await httpProvider.requestNetResult(
|
|
|
+ ApiConstants.apiJobListConfirmSG,
|
|
|
method: HttpMethod.POST,
|
|
|
params: params,
|
|
|
networkDebounce: true,
|