12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028 |
- import 'package:get/get.dart';
- import 'package:plugin_platform/http/http_provider.dart';
- import 'package:plugin_platform/http/http_result.dart';
- import 'package:plugin_platform/platform_export.dart';
- import 'package:shared/utils/util.dart';
- import '../constants/api_constants.dart';
- import '../entity/response/uk_attendance_review_entity.dart';
- import '../entity/response/uk_attendance_review_remark_entity.dart';
- import '../entity/response/uk_job_applied_revise_add_detail_entity.dart';
- import '../entity/response/uk_job_applied_revise_edit_detail_entity.dart';
- import '../entity/response/uk_job_applied_revise_info_entity.dart';
- import '../entity/response/uk_job_applied_revise_log_entity.dart';
- import '../entity/response/uk_job_applied_staff_list_entity.dart';
- import '../entity/response/uk_job_list_applied_staff_search_entity.dart';
- import '../entity/response/uk_job_list_applied_staff_selectoptions_entity.dart';
- import '../entity/response/uk_job_template_detail_by_select_title_entity.dart';
- import '../entity/response/uk_report_outlet_entity.dart';
- import '../entity/response/uk_staff_detail_entity.dart';
- import '../entity/response/uk_staff_labour_history_entity.dart';
- import '../entity/response/uk_template_detail_entity.dart';
- import '../entity/response/uk_template_detail_index_entity.dart';
- import '../entity/response/uk_template_table_entity.dart';
- import '../entity/response/uk_template_title_option_entity.dart';
- /// UK工作相关数据仓库
- class UKJobRepository extends GetxService {
- HttpProvider httpProvider;
- UKJobRepository({required this.httpProvider});
- /// 用工模版中的工作标题列表
- Future<HttpResult<UkTemplateTableEntity>> fetchJobTemplateList(
- String? keyword, {
- required int curPage,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params["cur_page"] = curPage.toString();
- params["page_size"] = "10";
- if (!Utils.isEmpty(keyword)) {
- params["job_title"] = keyword!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateListSG,
- params: params,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- final json = result.getDataJson();
- var data = UkTemplateTableEntity.fromJson(json!);
- return result.convert<UkTemplateTableEntity>(data: data);
- }
- return result.convert();
- }
- /// 添加用工模版 时详情里面的 数据源
- Future<HttpResult<UkTemplateDetailIndexEntity>> fetchJobTemplateIndex({
- CancelToken? cancelToken,
- }) async {
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateAddIndexUK,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- final json = result.getDataJson();
- var data = UkTemplateDetailIndexEntity.fromJson(json!);
- return result.convert<UkTemplateDetailIndexEntity>(data: data);
- }
- return result.convert();
- }
- /// 添加用工模版 时详情里 根据所选template 获取工作标题选项
- Future<HttpResult<UkTemplateTitleOptionEntity>> fetchJobTitleOptiosByTemplate(
- String templateTitle,
- {
- CancelToken? cancelToken,
- }) async {
- Map<String, String> params = {};
- params['template_title'] = templateTitle;
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateTitleOptionsUK,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- final jsonList = result.getListJson();
- var list = jsonList?.map((e) {
- if (e is Map<String, dynamic>) {
- return UkTemplateTitleOptionEntity.fromJson(e);
- } else {
- return null;
- }
- }).whereType<UkTemplateTitleOptionEntity>().toList();
- return result.convert<UkTemplateTitleOptionEntity>(list: list);
- }
- return result.convert<UkTemplateTitleOptionEntity>();
- }
- /// 编辑时获取的用工模版中的详情
- Future<HttpResult<UkTemplateDetailEntity>> fetchJobTemplateDetail({
- required String? templateId,
- CancelToken? cancelToken,
- }) async {
- Map<String, String> params = {};
- params['template_id'] = templateId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateDetailUK,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- final json = result.getDataJson();
- var data = UkTemplateDetailEntity.fromJson(json!);
- return result.convert<UkTemplateDetailEntity>(data: data);
- }
- return result.convert();
- }
- /// 新增时 选择了 jobtitle 后 获取该title对应的模板详情 用于回显当前title 的模板数据
- Future<HttpResult<UkJobTemplateDetailBySelectTitleEntity>> fetchSelectJobTitleGetTemplateDetail({
- required String? templateId,
- CancelToken? cancelToken,
- }) async {
- Map<String, String> params = {};
- params['template_id'] = templateId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateDetailBySelectTitleUK,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- final json = result.getDataJson();
- var data = UkJobTemplateDetailBySelectTitleEntity.fromJson(json!);
- return result.convert<UkJobTemplateDetailBySelectTitleEntity>(data: data);
- }
- return result.convert();
- }
- /// 工作模板的添加提交
- Future<HttpResult> addJobTemplateSubmit({
- required String jobTemplateId ,
- required String jobTitle,
- String? clientName,
- List<String>? certificate,
- List<String>? vehicle,
- String? challenge25, // 1.yes,0.no
- String? note,
- String? desc,
- String? contactName,
- String? contactNo,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, dynamic> params = {};
- params['job_template_id'] = jobTemplateId;
- params['job_title'] = jobTitle;
- if (Utils.isNotEmpty(clientName)) {
- params['client_name'] = clientName ?? "";
- }
- if (certificate != null && certificate.isNotEmpty) {
- params['certificate[]'] = certificate;
- }
- if (vehicle != null && vehicle.isNotEmpty) {
- params['vehicle[]'] = vehicle;
- }
- if (Utils.isNotEmpty(challenge25)) {
- params['challenge_25'] = challenge25 ?? "";
- }
- if (Utils.isNotEmpty(note)) {
- params['note'] = note ?? "";
- }
- if (Utils.isNotEmpty(contactName)) {
- params['contact_name'] = contactName ?? "";
- }
- if (Utils.isNotEmpty(contactNo)) {
- params['contact_no'] = contactNo ?? "";
- }
- if (Utils.isNotEmpty(desc)) {
- params['description'] = desc ?? "";
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateAddSubmitSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- return result.convert();
- }
- return result.convert();
- }
- /// 工作模板的编辑提交
- Future<HttpResult> editJobTemplateSubmit({
- required String templateId,
- required String jobTemplateId,
- required String jobTitle,
- String? clientName,
- List<String>? certificate,
- List<String>? vehicle,
- String? challenge25, // 1 yse 0 no
- String? note,
- String? desc,
- String? contactName,
- String? contactNo,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, dynamic> params = {};
- params['job_title'] = jobTitle;
- params['template_id'] = templateId;
- params['job_template_id'] = jobTemplateId;
- if (Utils.isNotEmpty(clientName)) {
- params['client_name'] = clientName ?? "";
- }
- if (certificate != null && certificate.isNotEmpty) {
- params['certificate[]'] = certificate;
- }
- if (vehicle != null && vehicle.isNotEmpty) {
- params['vehicle[]'] = vehicle;
- }
- if (Utils.isNotEmpty(challenge25)) {
- params['challenge_25'] = challenge25 ?? "";
- }
- if (Utils.isNotEmpty(note)) {
- params['note'] = note ?? "";
- }
- if (Utils.isNotEmpty(contactName)) {
- params['contact_name'] = contactName ?? "";
- }
- if (Utils.isNotEmpty(contactNo)) {
- params['contact_no'] = contactNo ?? "";
- }
- if (Utils.isNotEmpty(desc)) {
- params['description'] = desc ?? "";
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateEditSubmitSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- return result.convert();
- }
- return result.convert();
- }
- ///工作模板的删除
- Future<HttpResult> deleteJobTemplate({
- required String? templateId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['template_id'] = templateId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobTemplateDeleteSG,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- if (result.isSuccess) {
- return result.convert();
- }
- return result.convert();
- }
- /// 添加用工请求发布
- Future<HttpResult> addLabourRequestSubmit({
- required String? templateId,
- required String? jobDate,
- required String? startTime,
- required String? endTime,
- required String? departmentId,
- required String? needNum,
- required String? salaryBy,
- String? amount,
- String? repeatDate,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['template_id'] = templateId ?? "";
- params['job_date'] = jobDate ?? "";
- params['start_time'] = startTime ?? "";
- params['end_time'] = endTime ?? "";
- params['need_num'] = needNum ?? "";
- params['salary_by'] = salaryBy ?? "";
- if (!Utils.isEmpty(departmentId)) {
- params["co_department_id"] = departmentId!;
- }
- if (!Utils.isEmpty(amount)) {
- params["amount"] = amount!;
- }
- if (!Utils.isEmpty(repeatDate)) {
- params["select"] = repeatDate!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiLabourRequestAddSubmit,
- 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<UkJobAppliedStaffListEntity>> 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 = UkJobAppliedStaffListEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedStaffListEntity>(data: data);
- }
- return result.convert();
- }
- /// 根据ID获取主列表的Item数据,用于刷新Item
- Future<HttpResult<UkJobAppliedStaffListEntity>> 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 = UkJobAppliedStaffListEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedStaffListEntity>(data: data);
- }
- return result.convert();
- }
- /// 设置小费
- Future<HttpResult> appliedStaffBatchSetTipSubmit(
- {
- // 多个applied_ids 以逗号分隔
- String? appliedIds ,
- // 设置小费
- String? gratuity,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['applied_ids'] = appliedIds ?? "";
- params['gratuity'] = gratuity ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffBatchSetTipUK,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// 获取 添加员工 时的 industry options
- Future<HttpResult<UkJobListAppliedStaffSelectoptionsEntity>> fetchAddStaffIndustryOptions(
- {
- CancelToken? cancelToken,
- }
- ) async {
- //参数
- Map<String, String> params = {};
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffIndustryListUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final listJson = result.getListJson();
- var list = listJson
- ?.map((e) => UkJobListAppliedStaffSelectoptionsEntity.fromJson(e as Map<String, dynamic>))
- .toList();
- //重新赋值data或list
- return result.convert<UkJobListAppliedStaffSelectoptionsEntity>(list: list);
- }
- return result.convert();
- }
- /// 获取 添加员工 时根据 industry id 获取jobtitle options
- Future<HttpResult<UkJobListAppliedStaffSelectoptionsEntity>> fetchAddStaffJobTitleOptions(
- String industryId,
- {
- CancelToken? cancelToken,
- }
- ) async {
- //参数
- Map<String, String> params = {};
- params["industry_id"] = industryId;
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffJobTitleListUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final listJson = result.getListJson();
- var list = listJson
- ?.map((e) => UkJobListAppliedStaffSelectoptionsEntity.fromJson(e as Map<String, dynamic>))
- .toList();
- //重新赋值data或list
- return result.convert<UkJobListAppliedStaffSelectoptionsEntity>(list: list);
- }
- return result.convert();
- }
- /// 添加员工的全部员工数据列表
- Future<HttpResult<UkJobListAppliedStaffSearchEntity>> searchStaffList(
- String? jobId,
- String? keyword,
- String? industryId,
- String? skillId,
- {
- 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(keyword)) {
- params["keyword"] = keyword!;
- }
- if (!Utils.isEmpty(industryId)) {
- params["industry_id"] = industryId!;
- }
- if (!Utils.isEmpty(skillId)) {
- params["skill_id"] = skillId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiJobListAppliedStaffSearch,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkJobListAppliedStaffSearchEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobListAppliedStaffSearchEntity>(data: data);
- }
- return result.convert();
- }
- /// 添加员工 时 给员工 打标记
- Future<HttpResult> staffSetFavourite(
- String? memberId,
- String? isFavourite, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- if (!Utils.isEmpty(memberId)) {
- params["member_id"] = memberId!;
- }
- if (!Utils.isEmpty(isFavourite)) {
- params["is_favourite"] = isFavourite!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffSetFavouriteUK,
- method: HttpMethod.POST,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// 获取revise 列表
- Future<HttpResult<UkJobAppliedReviseInfoEntity>> fetchJobAppliedReviseList(
- {
- String? appliedId,
- required int curPage,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params["cur_page"] = curPage.toString();
- params["page_size"] = "10";
- if (!Utils.isEmpty(appliedId)) {
- params["applied_id"] = appliedId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseListUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkJobAppliedReviseInfoEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedReviseInfoEntity>(data: data);
- }
- return result.convert();
- }
- /// 根据ID获取主列表的Item数据,用于刷新Item
- Future<HttpResult<UkJobAppliedReviseInfoEntity>> fetchJobAppliedReviseListById(
- {
- String? appliedId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params["cur_page"] = "1";
- params["page_size"] = "9999";
- if (!Utils.isEmpty(appliedId)) {
- params["applied_id"] = appliedId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseListUK,
- params: params,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkJobAppliedReviseInfoEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedReviseInfoEntity>(data: data);
- }
- return result.convert();
- }
- /// revise add 时 获取详情
- Future<HttpResult<UkJobAppliedReviseEditDetailEntity>> fetchAddReviseDetailInfo(
- {
- String? appliedId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- if (!Utils.isEmpty(appliedId)) {
- params["applied_id"] = appliedId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseAddUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkJobAppliedReviseEditDetailEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedReviseEditDetailEntity>(data: data);
- }
- return result.convert();
- }
- /// revise edit 时 获取详情
- Future<HttpResult<UkJobAppliedReviseEditDetailEntity>> fetchEditReviseDetailInfo(
- {
- String? reviseId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- if (!Utils.isEmpty(reviseId)) {
- params["revise_id"] = reviseId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseEditUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkJobAppliedReviseEditDetailEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedReviseEditDetailEntity>(data: data);
- }
- return result.convert();
- }
- /// revise add 提交
- Future<HttpResult> reviseAddSubmit(
- {
- String? appliedId,
- String? reviseHours,
- String? reason,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['applied_id'] = appliedId ?? "";
- params['revise_hours'] = reviseHours ?? "";
- params['reason'] = reason ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseAddSubmitUK,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// revise edit 提交
- Future<HttpResult> reviseEditSubmit(
- {
- String? reviseId,
- String? reviseHours,
- String? reason,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = reviseId ?? "";
- params['revise_hours'] = reviseHours ?? "";
- params['reason'] = reason ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseEditSubmitUK,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// revise recall
- Future<HttpResult> reviseRecall(
- {
- String? reviseId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = reviseId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseRecallUK,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// revise delete
- Future<HttpResult> reviseDelete(
- {
- String? reviseId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = reviseId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseDeleteUK,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- /// revise logs
- Future<HttpResult<UkJobAppliedReviseLogEntity>> featchReviseLogs(
- {
- String? reviseId,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['revise_id'] = reviseId ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAppliedStaffReviseLogsUK,
- method: HttpMethod.GET,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkJobAppliedReviseLogEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkJobAppliedReviseLogEntity>(data: data);
- }
- return result.convert();
- }
- // -------staff-------
- // 员工的信息
- Future<HttpResult<UkStaffDetailEntity>> fetchStaffDetail(
- String? memberId, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- if (!Utils.isEmpty(memberId)) {
- params["member_id"] = memberId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiStaffDetailUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkStaffDetailEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkStaffDetailEntity>(data: data);
- }
- return result.convert();
- }
- // 员工的历史申请记录
- Future<HttpResult<UkStaffLabourHistoryEntity>> fetchStaffLabourHistory(
- String? memberId,
- String? keyword, {
- required int curPage,
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params["cur_page"] = curPage.toString();
- params["page_size"] = "10";
- if (!Utils.isEmpty(memberId)) {
- params["member_id"] = memberId!;
- }
- if (!Utils.isEmpty(keyword)) {
- params["keyword"] = keyword!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiStaffLabourHistoryUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkStaffLabourHistoryEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkStaffLabourHistoryEntity>(data: data);
- }
- return result.convert();
- }
- // --------attentance review---------
- /// 考勤审核列表
- Future<HttpResult<UkAttendanceReviewEntity>> fetchAttendanceReviewList(
- String? keyword, {
- 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!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAttendanceReviewTableUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkAttendanceReviewEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkAttendanceReviewEntity>(data: data);
- }
- return result.convert();
- }
- // attendance review 获取Remarks 考勤的批量备注
- Future<HttpResult<UkAttendanceReviewRemarkEntity>> fetchAttendanceReviewRemarkInfo(
- String? appliedId, {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- if (!Utils.isEmpty(appliedId)) {
- params["applied_id"] = appliedId!;
- }
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAttendanceReviewRemarksUK,
- params: params,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- final json = result.getDataJson();
- var data = UkAttendanceReviewRemarkEntity.fromJson(json!);
- //重新赋值data或list
- return result.convert<UkAttendanceReviewRemarkEntity>(data: data);
- }
- return result.convert();
- }
- /// 考勤的批量同意/批量拒绝
- Future<HttpResult> attendanceReviewsBatchSubmit(
- String? recordIds,
- String? type, //审核类型Type【approve|reject】
- String? auditMark, // 拒绝原因
- {
- CancelToken? cancelToken,
- }) async {
- //参数
- Map<String, String> params = {};
- params['record_ids'] = recordIds ?? "";
- params['type'] = type ?? "";
- params['audit_mark'] = auditMark ?? "";
- final result = await httpProvider.requestNetResult(
- ApiConstants.apiAttendanceReviewBatchSubmitUK,
- method: HttpMethod.POST,
- params: params,
- networkDebounce: true,
- isShowLoadingDialog: true,
- cancelToken: cancelToken,
- );
- //根据返回的结果,封装原始数据为Bean/Entity对象
- if (result.isSuccess) {
- //重新赋值data或list
- return result.convert();
- }
- return result.convert();
- }
- }
|