|
|
|
@ -1,6 +1,5 @@
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:developer';
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
@ -16,7 +15,6 @@ import 'package:mohem_flutter_app/models/dashboard/get_accural_ticket_balance_mo
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/itg_forms_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/eit_attachment_ticket_model.dart';
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/courses_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/dashboard/courses_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_parking_details_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_parking_details_model.dart';
|
|
|
|
@ -24,7 +22,6 @@ import 'package:mohem_flutter_app/models/greetings/greeting_card_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/itg/itg_main_response.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/itg/itg_main_response.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/sso_auth_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/sso_auth_model.dart';
|
|
|
|
// import 'package:platform_device_id/platform_device_id.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:uuid/uuid.dart';
|
|
|
|
import 'package:uuid/uuid.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -37,7 +34,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GetAttendanceTracking?> getAttendanceTracking() async {
|
|
|
|
Future<GetAttendanceTracking?> getAttendanceTracking() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_Attendance_Tracking";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_Attendance_Tracking";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{};
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -51,7 +48,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> getOpenNotifications() async {
|
|
|
|
Future<GenericResponseModel?> getOpenNotifications() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_OPEN_NOTIFICATIONS";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{};
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -65,7 +62,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> getCOCNotifications() async {
|
|
|
|
Future<GenericResponseModel?> getCOCNotifications() async {
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks";
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_ReviewerAdmin_Pending_Tasks";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
Map<String, dynamic> postParams = {"Date": DateUtil.getISODateFormat(DateTime.now()), "EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -79,7 +76,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<ItgFormsModel?> getItgFormsPendingTask() async {
|
|
|
|
Future<ItgFormsModel?> getItgFormsPendingTask() async {
|
|
|
|
String url = "${ApiConsts.cocRest}ITGFormsPendingTasks";
|
|
|
|
String url = "${ApiConsts.cocRest}ITGFormsPendingTasks";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{};
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -93,13 +90,13 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate, {String? empID}) async {
|
|
|
|
Future<List<GetAccrualBalancesList>> getAccrualBalances(String effectiveDate, {String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_ACCRUAL_BALANCES";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"P_EFFECTIVE_DATE": effectiveDate};
|
|
|
|
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.getAccrualBalancesList ?? <GetAccrualBalancesList>[];
|
|
|
|
return responseData.getAccrualBalancesList ?? [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
postParams,
|
|
|
|
postParams,
|
|
|
|
@ -108,13 +105,13 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<List<GetTicketAccuralBalanceModel>> getTicketAccuralBalance(String effectiveDate, {String? empID}) async {
|
|
|
|
Future<List<GetTicketAccuralBalanceModel>> getTicketAccuralBalance(String effectiveDate, {String? empID}) async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_TICKET_ACCRUAL_BALANCES";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_TICKET_ACCRUAL_BALANCES";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"P_EFFECTIVE_DATE": effectiveDate};
|
|
|
|
Map<String, dynamic> postParams = {"P_EFFECTIVE_DATE": effectiveDate};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
if (empID != null) postParams["P_SELECTED_EMPLOYEE_NUMBER"] = empID;
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.getAccrualBalancesTicketList ?? <GetTicketAccuralBalanceModel>[];
|
|
|
|
return responseData.getAccrualBalancesTicketList ?? [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
postParams,
|
|
|
|
postParams,
|
|
|
|
@ -123,7 +120,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> getOpenMissingSwipes() async {
|
|
|
|
Future<GenericResponseModel?> getOpenMissingSwipes() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_OPEN_MISSING_SWIPES";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{};
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -138,12 +135,12 @@ class DashboardApiClient {
|
|
|
|
//Menus List
|
|
|
|
//Menus List
|
|
|
|
Future<List<ListMenu>> getListMenu() async {
|
|
|
|
Future<List<ListMenu>> getListMenu() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_MENU";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_MENU";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{};
|
|
|
|
Map<String, dynamic> postParams = {};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
return responseData.listMenu ?? <ListMenu>[];
|
|
|
|
return responseData.listMenu ?? [];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
postParams,
|
|
|
|
postParams,
|
|
|
|
@ -153,7 +150,7 @@ class DashboardApiClient {
|
|
|
|
//GET_MENU_ENTRIES
|
|
|
|
//GET_MENU_ENTRIES
|
|
|
|
Future<GenericResponseModel?> getGetMenuEntries() async {
|
|
|
|
Future<GenericResponseModel?> getGetMenuEntries() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_MENU_ENTRIES";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
|
|
|
|
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -167,7 +164,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> getEventActivity() async {
|
|
|
|
Future<GenericResponseModel?> getEventActivity() async {
|
|
|
|
String url = "${ApiConsts.erpRest}Get_EventActivity";
|
|
|
|
String url = "${ApiConsts.erpRest}Get_EventActivity";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
|
|
|
|
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E"};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -181,7 +178,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> getTicketBookingRedirection() async {
|
|
|
|
Future<GenericResponseModel?> getTicketBookingRedirection() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_PORTAL_REDIRECTION";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_PORTAL_REDIRECTION";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
@ -195,7 +192,7 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<GenericResponseModel?> getTicketBalance() async {
|
|
|
|
Future<GenericResponseModel?> getTicketBalance() async {
|
|
|
|
String url = "${ApiConsts.erpRest}GET_TICKET_BALANCE";
|
|
|
|
String url = "${ApiConsts.erpRest}GET_TICKET_BALANCE";
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
|
|
|
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
@ -212,7 +209,7 @@ class DashboardApiClient {
|
|
|
|
String url = "${ApiConsts.ssoAuthRedirection}?grantType=mohemm";
|
|
|
|
String url = "${ApiConsts.ssoAuthRedirection}?grantType=mohemm";
|
|
|
|
//https://sso-uat.hmg.com/api/auth/connect?grantType=mohemm'
|
|
|
|
//https://sso-uat.hmg.com/api/auth/connect?grantType=mohemm'
|
|
|
|
// Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
// Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"ClientId": clientID,
|
|
|
|
"ClientId": clientID,
|
|
|
|
// "ClientId": "a9f4d1a0596d4aea8f830992ec4bdac1",
|
|
|
|
// "ClientId": "a9f4d1a0596d4aea8f830992ec4bdac1",
|
|
|
|
"PersonId": AppState().memberInformationList?.eMPLOYEENUMBER,
|
|
|
|
"PersonId": AppState().memberInformationList?.eMPLOYEENUMBER,
|
|
|
|
@ -231,35 +228,20 @@ class DashboardApiClient {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<GetEitAttachmentTicket?> getTicketEitPDFDownload({required String peiExtraInfoId}) async {
|
|
|
|
|
|
|
|
String url = "${ApiConsts.erpRest}GET_EIT_ATTACHMENTS";
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
|
|
|
|
"P_PERSON_EXTRA_INFO_ID": peiExtraInfoId,
|
|
|
|
|
|
|
|
"PersonId": AppState().memberInformationList?.eMPLOYEENUMBER,
|
|
|
|
|
|
|
|
"Username": AppState().memberInformationList?.eMPLOYEENUMBER,
|
|
|
|
|
|
|
|
"Language": "US",
|
|
|
|
|
|
|
|
"SessionId": AppState().postParamsObject?.pSessionId,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
|
|
|
|
(json) {
|
|
|
|
|
|
|
|
GetEitAttachmentTicket responseData = GetEitAttachmentTicket.fromJson(json);
|
|
|
|
|
|
|
|
return responseData;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
url,
|
|
|
|
|
|
|
|
postParams,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<dynamic> getBookingSSOFinalRedirection({required String token}) async {
|
|
|
|
Future<dynamic> getBookingSSOFinalRedirection({required String token}) async {
|
|
|
|
// token =
|
|
|
|
// token =
|
|
|
|
// "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ";
|
|
|
|
// "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ";
|
|
|
|
http.MultipartRequest request = http.MultipartRequest('POST', Uri.parse('https://www.paxes.com/sso/hmg'));
|
|
|
|
// // var request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG'));
|
|
|
|
// http.MultipartRequest request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG'));
|
|
|
|
var request = http.MultipartRequest('POST', Uri.parse('https://Paxes-release.techmaster.in/SSO/HMG')); // UAT
|
|
|
|
request.fields.addAll(<String, String>{'JWTToken': token});
|
|
|
|
// var request = http.MultipartRequest('POST', Uri.parse('https://paxes.com/sso/hmg')); // Prod
|
|
|
|
|
|
|
|
request.fields.addAll({'JWTToken': token});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// request.headers.addAll(headers);
|
|
|
|
|
|
|
|
|
|
|
|
http.StreamedResponse response = await request.send();
|
|
|
|
http.StreamedResponse response = await request.send();
|
|
|
|
if (response.statusCode == 302) {
|
|
|
|
if (response.statusCode == 302) {
|
|
|
|
String res = await response.stream.bytesToString();
|
|
|
|
print("================== post ==========");
|
|
|
|
|
|
|
|
var res = await response.stream.bytesToString();
|
|
|
|
return response.headers["location"];
|
|
|
|
return response.headers["location"];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
print(response.reasonPhrase);
|
|
|
|
print(response.reasonPhrase);
|
|
|
|
@ -279,7 +261,7 @@ class DashboardApiClient {
|
|
|
|
var _mobileDeviceIdentifierPlugin = MobileDeviceIdentifier();
|
|
|
|
var _mobileDeviceIdentifierPlugin = MobileDeviceIdentifier();
|
|
|
|
Codec<String, String> stringToBase64 = utf8.fuse(base64);
|
|
|
|
Codec<String, String> stringToBase64 = utf8.fuse(base64);
|
|
|
|
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
|
|
|
|
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
|
|
|
|
Uuid uuid = Uuid();
|
|
|
|
var uuid = Uuid();
|
|
|
|
String? deviceId = "";
|
|
|
|
String? deviceId = "";
|
|
|
|
// Generate a v4 (random) id
|
|
|
|
// Generate a v4 (random) id
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
@ -291,7 +273,7 @@ class DashboardApiClient {
|
|
|
|
IosDeviceInfo iosInfo = await DeviceInfoPlugin().iosInfo;
|
|
|
|
IosDeviceInfo iosInfo = await DeviceInfoPlugin().iosInfo;
|
|
|
|
deviceId = iosInfo.identifierForVendor;
|
|
|
|
deviceId = iosInfo.identifierForVendor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"UID": deviceId, //uuid.v4(), //Mobile Id
|
|
|
|
"UID": deviceId, //uuid.v4(), //Mobile Id
|
|
|
|
// "UID": uuid.v4(), //Mobile Id
|
|
|
|
// "UID": uuid.v4(), //Mobile Id
|
|
|
|
"Latitude": lat,
|
|
|
|
"Latitude": lat,
|
|
|
|
@ -317,10 +299,10 @@ class DashboardApiClient {
|
|
|
|
//Mark Fake Location
|
|
|
|
//Mark Fake Location
|
|
|
|
Future<GenericResponseModel?> markFakeLocation({String lat = "0", String? long = "0", required String sourceName}) async {
|
|
|
|
Future<GenericResponseModel?> markFakeLocation({String lat = "0", String? long = "0", required String sourceName}) async {
|
|
|
|
String url = "${ApiConsts.swpRest}CreateIssueInfo";
|
|
|
|
String url = "${ApiConsts.swpRest}CreateIssueInfo";
|
|
|
|
Uuid uuid = Uuid();
|
|
|
|
var uuid = Uuid();
|
|
|
|
// Generate a v4 (random) id
|
|
|
|
// Generate a v4 (random) id
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"UID": uuid.v4(), //Mobile Id
|
|
|
|
"UID": uuid.v4(), //Mobile Id
|
|
|
|
"Latitude": lat,
|
|
|
|
"Latitude": lat,
|
|
|
|
"Longitude": long,
|
|
|
|
"Longitude": long,
|
|
|
|
@ -344,7 +326,7 @@ class DashboardApiClient {
|
|
|
|
Future<MohemmItgResponseItem?> getITGPageNotification() async {
|
|
|
|
Future<MohemmItgResponseItem?> getITGPageNotification() async {
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotification";
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotification";
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"EmployeeNumber": AppState().getUserName,
|
|
|
|
"EmployeeNumber": AppState().getUserName,
|
|
|
|
"ItgEnableAt": "After Service Submission", //Mobile Id
|
|
|
|
"ItgEnableAt": "After Service Submission", //Mobile Id
|
|
|
|
"ItgServiceName": "Login",
|
|
|
|
"ItgServiceName": "Login",
|
|
|
|
@ -362,26 +344,11 @@ class DashboardApiClient {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<String?> getENSATItgToken() async {
|
|
|
|
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ENSAT_GetItgToken";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{"EmployeeNumber": AppState().getUserName};
|
|
|
|
|
|
|
|
postParams.addAll(AppState().postParamsJson);
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
|
|
|
|
(json) {
|
|
|
|
|
|
|
|
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
|
|
|
|
|
|
|
return responseData.Mohemm_ENSAT_GetItgToken_Response;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
url,
|
|
|
|
|
|
|
|
postParams,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Submit ITG
|
|
|
|
//Submit ITG
|
|
|
|
Future<ItgMainRes?> submitItgForm({required String comment, required String masterId, required List<Map<String, dynamic>> itgList, required int serviceId}) async {
|
|
|
|
Future<ItgMainRes?> submitItgForm({required String comment, required String masterId, required List<Map<String, dynamic>> itgList, required int serviceId}) async {
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_Survey_Response";
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_Survey_Response";
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"EmployeeNumber": AppState().getUserName,
|
|
|
|
"EmployeeNumber": AppState().getUserName,
|
|
|
|
"ItgComments": comment,
|
|
|
|
"ItgComments": comment,
|
|
|
|
"ItgNotificationMasterId": masterId,
|
|
|
|
"ItgNotificationMasterId": masterId,
|
|
|
|
@ -402,7 +369,7 @@ class DashboardApiClient {
|
|
|
|
Future<ItgMainRes?> getAdvertisementDetail(String masterID) async {
|
|
|
|
Future<ItgMainRes?> getAdvertisementDetail(String masterID) async {
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotificationDetails";
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotificationDetails";
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"EmployeeNumber": AppState().getUserName,
|
|
|
|
"EmployeeNumber": AppState().getUserName,
|
|
|
|
"ItgNotificationMasterId": masterID, //Mobile Id
|
|
|
|
"ItgNotificationMasterId": masterID, //Mobile Id
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -420,7 +387,7 @@ class DashboardApiClient {
|
|
|
|
Future setAdvertisementViewed(String masterID, int advertisementId, String? ackValue) async {
|
|
|
|
Future setAdvertisementViewed(String masterID, int advertisementId, String? ackValue) async {
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateAdvertisementAsViewed";
|
|
|
|
String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateAdvertisementAsViewed";
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = <String, dynamic>{
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
"ItgNotificationMasterId": masterID,
|
|
|
|
"ItgNotificationMasterId": masterID,
|
|
|
|
"EmployeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
|
|
|
|
"EmployeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
|
|
|
|
"ItgAdvertisementId": advertisementId,
|
|
|
|
"ItgAdvertisementId": advertisementId,
|
|
|
|
@ -468,14 +435,16 @@ class DashboardApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
//Fetch All Courses Status
|
|
|
|
//Fetch All Courses Status
|
|
|
|
Future<CoursesResponseModel?> fetchAllCoursesStatus() async {
|
|
|
|
Future<CoursesResponseModel?> fetchAllCoursesStatus() async {
|
|
|
|
String url = ApiConsts.eLearningBaseUrl + "Fetch_All_Courses_Status.php";
|
|
|
|
String url = ApiConsts.eLearningBaseUrl +"Fetch_All_Courses_Status.php";
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> headers = {
|
|
|
|
Map<String, String> headers = {
|
|
|
|
'x-api-key': 'bLi@mbXJeXTHd/)h&LFh%25+%25(Nbnaq6hBg%7d%5dyQbthY%7bv6ew6-5UT\$NASwucn%7d,_PSJpuwNCCen2%7djj%7b00HR2T-%5b,k7W%7d-0yepK?%258',
|
|
|
|
'x-api-key': 'bLi@mbXJeXTHd/)h&LFh%25+%25(Nbnaq6hBg%7d%5dyQbthY%7bv6ew6-5UT\$NASwucn%7d,_PSJpuwNCCen2%7djj%7b00HR2T-%5b,k7W%7d-0yepK?%258',
|
|
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> postParams = {"username": AppState().memberInformationList?.eMPLOYEENUMBER ?? ""};
|
|
|
|
Map<String, dynamic> postParams = {
|
|
|
|
|
|
|
|
"username": AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
|