123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840 |
- 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_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:domain/entity/response/revise_list_s_g_entity.dart';
- import 'package:domain/entity/response/revise_log_s_g_entity.dart';
- import 'package:domain/entity/response/staff_detail_entity.dart';
- import 'package:domain/entity/response/staff_detail_s_g_entity.dart';
- import 'package:domain/entity/response/staff_labour_history_entity.dart';
- import 'package:domain/entity/response/staff_remark_history_entity.dart';
- import 'package:domain/entity/response/staff_review_history_s_g_entity.dart';
- import 'package:get/get.dart';
- import 'package:plugin_platform/dio_export.dart';
- import 'package:plugin_platform/http/http_provider.dart';
- import 'package:plugin_platform/http/http_result.dart';
- import 'package:shared/utils/util.dart';
- import '../constants/api_constants.dart';
- import '../entity/response/add_edit_revise_view_s_g_entity.dart';
- import '../entity/response/attendance_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_remark_view_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/revise_index_s_g_entity.dart';
- import '../entity/response/staff_job_history_s_g_entity.dart';
- /// 工作相关(新加坡)
- class JobSGRepository extends GetxService {
- HttpProvider 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"] = "20";
- 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.apiJobAppliedAddStaffSubmitSG,
- 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? jobId,
- String? appliedIds,
- String? startTime,
- String? endTime,
- String? subtractHours,
- String? status, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['applied_ids'] = appliedIds ?? "";
- params['job_id'] = jobId ?? "";
- 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,
- isShowLoadingDialog: true,
- 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['adjust_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<JobAppliedRemarkViewSGEntity>> fetchJobAppliedRemarkView(
- String? appliedId, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['applied_id'] = appliedId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobAppliedRemarkViewSG,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = JobAppliedRemarkViewSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<JobAppliedRemarkViewSGEntity>(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'] = (double.parse(attitude_rate ?? "5.0")).toInt().toString();
- params['grooming_rate'] = (double.parse(grooming_rate ?? "5.0")).toInt().toString();
- params['performance_rate'] = (double.parse(performance_rate ?? "5.0")).toInt().toString();
- params['experience_rate'] = (double.parse(experience_rate ?? "5.0")).toInt().toString();
- if (!Utils.isEmpty(feedback)) {
- params['feedback'] = feedback ?? "";
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobAppliedRemarkSubmitSG,
- 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<StaffDetailSGEntity>> fetchStaffDetail(
- String? memberId, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['member_id'] = memberId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobListStaffDetailSG,
- params: params,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = StaffDetailSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<StaffDetailSGEntity>(data: data);
- }
- return result.convert();
- }
- /// 获取员工的做工历史列表
- Future<HttpResult<StaffJobHistorySGEntity>> fetchStaffJobHistory(
- String? memberId, {
- required int curPage,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['member_id'] = memberId ?? "";
- params['cur_page'] = curPage.toString();
- params['page_size'] = "10";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobListStaffLabourHistorySG,
- params: params,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = StaffJobHistorySGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<StaffJobHistorySGEntity>(data: data);
- }
- return result.convert();
- }
- /// 获取员工的做工评价历史列表
- Future<HttpResult<StaffReviewHistorySGEntity>> fetchStaffReviewHeadView(
- String? memberId, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['member_id'] = memberId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobListStaffReviewHeadSG,
- params: params,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = StaffReviewHistorySGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<StaffReviewHistorySGEntity>(data: data);
- }
- return result.convert();
- }
- /// 获取员工的做工评价历史列表
- Future<HttpResult<StaffReviewHistorySGEntity>> fetchStaffReviewHistory(
- String? memberId, {
- required int curPage,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['cur_page'] = curPage.toString();
- params['page_size'] = "10";
- params['member_id'] = memberId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobListStaffReViewHistorySG,
- params: params,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = StaffReviewHistorySGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<StaffReviewHistorySGEntity>(data: data);
- }
- return result.convert();
- }
- /// Revise 列表选项
- Future<HttpResult<ReviseIndexSGEntity>> fetchReviseIndex({
- CancelToken? cancelToken,
- }) async {
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiReviseIndexSG,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = ReviseIndexSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<ReviseIndexSGEntity>(data: data);
- }
- return result.convert();
- }
- /// Revise 列表选项
- Future<HttpResult<ReviseListSGEntity>> fetchReviseList(
- String? applied_id,
- String? status,
- String? keyword,
- String? start_date,
- String? end_date, {
- required int curPage,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params["cur_page"] = curPage.toString();
- params["page_size"] = "10";
- if (!Utils.isEmpty(applied_id)) {
- params["applied_id"] = applied_id!;
- }
- if (!Utils.isEmpty(status)) {
- params["status"] = status!;
- }
- if (!Utils.isEmpty(keyword)) {
- params["keyword"] = keyword!;
- }
- if (!Utils.isEmpty(start_date)) {
- params["start_date"] = start_date!;
- }
- if (!Utils.isEmpty(end_date)) {
- params["end_date"] = end_date!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiReviseListSG,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = ReviseListSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<ReviseListSGEntity>(data: data);
- }
- return result.convert();
- }
- /// 根据ID获取主列表的Item数据,用于刷新Item
- Future<HttpResult<ReviseListSGEntity>> fetchReviseListByIds(
- String? reviseId, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params["cur_page"] = "1";
- params["page_size"] = "9999";
- if (!Utils.isEmpty(reviseId)) {
- params["revise_id"] = reviseId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiReviseListSG,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = ReviseListSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<ReviseListSGEntity>(data: data);
- }
- return result.convert();
- }
- /// Revise 添加选项
- Future<HttpResult<AddEditReviseViewSGEntity>> fetchReviseAddIndex(
- String? applied_id, {
- CancelToken? cancelToken,
- }) async {
- Map<String, String> params = {};
- params["applied_id"] = applied_id ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAddReviseViewSG,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = AddEditReviseViewSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<AddEditReviseViewSGEntity>(data: data);
- }
- return result.convert();
- }
- /// Revise 编辑选项
- Future<HttpResult<AddEditReviseViewSGEntity>> fetchReviseEditIndex(
- String? revise_id, {
- CancelToken? cancelToken,
- }) async {
- Map<String, String> params = {};
- params["revise_id"] = revise_id ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiEditReviseViewSG,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = AddEditReviseViewSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<AddEditReviseViewSGEntity>(data: data);
- }
- return result.convert();
- }
- /// Review Add 提交
- Future<HttpResult> submitReviseAdd(
- String? appliedId,
- String? revise_hours,
- String? revise_msg, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['applied_id'] = appliedId ?? "";
- if (!Utils.isEmpty(revise_hours)) {
- params['revise_hours'] = revise_hours ?? "";
- }
- if (!Utils.isEmpty(revise_msg)) {
- params['revise_msg'] = revise_msg ?? "";
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAddReviseSubmitSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// Review Edit 提交
- Future<HttpResult> submitReviseEdit(
- String? revise_id,
- String? revise_hours,
- String? revise_msg, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = revise_id ?? "";
- if (!Utils.isEmpty(revise_hours)) {
- params['revise_hours'] = revise_hours ?? "";
- }
- if (!Utils.isEmpty(revise_msg)) {
- params['revise_msg'] = revise_msg ?? "";
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiEditReviseSubmitSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// Review Recall
- Future<HttpResult> recallRevise(
- String? revise_id, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = revise_id ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiRecallReviseSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// Review Delete
- Future<HttpResult> deleteRevise(
- String? revise_id, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = revise_id ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiDeleteReviseSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// Review Logs
- Future<HttpResult<ReviseLogSGEntity>> fetchReviseLogs(
- String? revise_id, {
- CancelToken? cancelToken,
- }) async {
- Map<String, String> params = {};
- params["revise_id"] = revise_id ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiReviseLogListSG,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = ReviseLogSGEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<ReviseLogSGEntity>(data: data);
- }
- return result.convert();
- }
- }
|