diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index b836a93..e17edaa 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -418,6 +418,7 @@ "child":"طفل", "adult": "بالغ", "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", + "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 22ccc96..d16cfa1 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -418,6 +418,7 @@ "child":"Child", "adult": "Adult", "updateMember": "Are You Sure You Want to Update this Member?", + "fieldIsEmpty": "'{data}' Field is empty. Please select", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/api/termination_dff_api_client.dart b/lib/api/termination_dff_api_client.dart new file mode 100644 index 0000000..0933dea --- /dev/null +++ b/lib/api/termination_dff_api_client.dart @@ -0,0 +1,74 @@ +import 'dart:async'; + +import 'package:mohem_flutter_app/api/api_client.dart'; +import 'package:mohem_flutter_app/app_state/app_state.dart'; +import 'package:mohem_flutter_app/classes/consts.dart'; +import 'package:mohem_flutter_app/models/generic_response_model.dart'; +import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart'; +import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/start_term_approval_process_list_model.dart'; + +class TerminationDffApiClient { + static final TerminationDffApiClient _instance = TerminationDffApiClient._internal(); + + TerminationDffApiClient._internal(); + + factory TerminationDffApiClient() => _instance; + + Future?> getTermColsStructure() async { + String url = "${ApiConsts.erpRest}GET_TERM_COLS_STRUCTURE"; + Map postParams = {}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json); + return genericResponseModel.getTermColsStructureList ?? []; + }, url, postParams); + } + + Future?> getTermDffStructure(String functionName, String? pDescFlexContextCode) async { + String url = "${ApiConsts.erpRest}GET_TERM_DFF_STRUCTURE"; + Map postParams = {'P_FUNCTION_NAME': functionName, "P_DESC_FLEX_CONTEXT_CODE": pDescFlexContextCode}; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json); + return genericResponseModel.getTermDffStructureList ?? []; + }, url, postParams); + } + + Future submitTermTransaction(String functionName, List> list) async { + String url = "${ApiConsts.erpRest}SUBMIT_TERM_TRANSACTION"; + Map postParams = { + "P_SELECTED_RESP_ID": -999, + "P_MENU_TYPE": "E", + "P_FUNCTION_NAME": functionName, + "EITTransactionTBL": list, + }; + postParams.addAll(AppState().postParamsJson); + + for (var abc in list) { + print(abc); + } + return await ApiClient().postJsonForObject((json) { + GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json); + return genericResponseModel.submitTermTransactionList!; + }, url, postParams); + } + + Future startTermApprovalProcess(String action, String comments, String itemKey, int transactionId) async { + String url = "${ApiConsts.erpRest}START_TERM_APPROVAL_PROCESS"; + Map postParams = { + "P_SELECTED_RESP_ID": -999, + "P_MENU_TYPE": "E", + "P_ACTION_MODE": action, + "P_COMMENTS": comments, + "P_ITEM_KEY": itemKey, + "P_TRANSACTION_ID": transactionId, + }; + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json); + return genericResponseModel.startTermApprovalProcessList!; + }, url, postParams); + } +} diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index 94bcc18..098f65c 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -25,7 +25,7 @@ class Utils { static bool get isLoading => _isLoadingVisible; - static void showToast(String message, {bool longDuration = false}) { + static void showToast(String message, {bool longDuration = true}) { Fluttertoast.showToast( msg: message, toastLength: longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT, diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 099342b..21058ad 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -56,6 +56,7 @@ import 'package:mohem_flutter_app/ui/screens/offers_and_discounts/offers_and_dis import 'package:mohem_flutter_app/ui/screens/pending_transactions/pending_transactions.dart'; import 'package:mohem_flutter_app/ui/screens/pending_transactions/pending_transactions_details.dart'; import 'package:mohem_flutter_app/ui/screens/submenu_screen.dart'; +import 'package:mohem_flutter_app/ui/termination/end_employement.dart'; import 'package:mohem_flutter_app/ui/work_list/item_history_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/itg_detail_screen.dart'; import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart'; @@ -151,6 +152,9 @@ class AppRoutes { static const String performanceEvaluation = "/performanceEvaluation"; + + static const String endEmploymentScreen = "/endEmploymentScreen"; + //My Team static const String myTeam = "/myTeam"; static const String employeeDetails = "/employeeDetails"; @@ -245,6 +249,9 @@ class AppRoutes { monthlyPaySlip: (context) => MonthlyPaySlipScreen(), performanceEvaluation: (context) => PerformanceAppraisal(), + + endEmploymentScreen: (context) => EndEmploymentScreen(), + //My Team myTeam: (context) => MyTeam(), employeeDetails: (context) => EmployeeDetails(), diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 117011b..b35e780 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -432,6 +432,7 @@ class CodegenLoader extends AssetLoader{ "child": "طفل", "adult": "بالغ", "updateMember": "هل انت متأكد تريد تحديث بيانات هذا العضو؟", + "fieldIsEmpty": "'{data}' الحقل فارغ. الرجاء التحديد", "profile": { "reset_password": { "label": "Reset Password", @@ -884,6 +885,7 @@ static const Map en_US = { "child": "Child", "adult": "Adult", "updateMember": "Are You Sure You Want to Update this Member?", + "fieldIsEmpty": "'{data}' Field is empty. Please select", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 5cdaef9..88d0468 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -419,6 +419,7 @@ abstract class LocaleKeys { static const child = 'child'; static const adult = 'adult'; static const updateMember = 'updateMember'; + static const fieldIsEmpty = 'fieldIsEmpty'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index d12cb09..b96098e 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -83,7 +83,10 @@ import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart'; import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart'; +import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/subordinates_on_leaves_model.dart'; +import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart'; import 'package:mohem_flutter_app/models/update_item_type_success_list.dart'; import 'package:mohem_flutter_app/models/update_user_item_type_list.dart'; import 'package:mohem_flutter_app/models/vacation_rule/create_vacation_rule_list_model.dart'; @@ -101,6 +104,7 @@ import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_bo import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart'; import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; +import 'package:mohem_flutter_app/start_term_approval_process_list_model.dart'; class GenericResponseModel { String? date; @@ -154,8 +158,7 @@ class GenericResponseModel { List? getConcurrentProgramsList; List? getAbsenceAttachmentsList; List? getAbsenceAttendanceTypesList; - List? - getAbsenceCollectionNotificationBodyList; + List? getAbsenceCollectionNotificationBodyList; List? getAbsenceDffStructureList; List? getAbsenceTransactionList; List? getAccrualBalancesList; @@ -180,8 +183,7 @@ class GenericResponseModel { List? getDayHoursTypeDetailsList; List? getDeductionsList; GetDefaultValueList? getDefaultValueList; - List? - getEITCollectionNotificationBodyList; + List? getEITCollectionNotificationBodyList; List? getEITDFFStructureList; List? getEITTransactionList; List? getEarningsList; @@ -235,12 +237,11 @@ class GenericResponseModel { List? getCCPDFFStructureModel; List? getSubordinatesAttdStatusList; List? getSubordinatesLeavesList; - List? - getSubordinatesLeavesTotalVacationsList; + List? getSubordinatesLeavesTotalVacationsList; List? getSummaryOfPaymentList; List? getSwipesList; - List? getTermColsStructureList; - List? getTermDffStructureList; + List? getTermColsStructureList; + List? getTermDffStructureList; List? getTermNotificationBodyList; List? getTimeCardSummaryList; List? getTicketsByEmployeeList; @@ -298,8 +299,7 @@ class GenericResponseModel { String? mohemmWifiPassword; String? mohemmWifiSSID; NotificationAction? notificationAction; - List? - notificationGetRespondAttributesList; + List? notificationGetRespondAttributesList; List? notificationRespondRolesList; int? oracleOutPutNumber; String? pASSWORDEXPIREDMSG; @@ -337,7 +337,7 @@ class GenericResponseModel { String? startHrApprovalProcessList; StartPhoneApprovalProcess? startPhonesApprovalProcessList; String? startSitApprovalProcess; - String? startTermApprovalProcessList; + StartTermApprovalProcessList? startTermApprovalProcessList; SubmitAddressTransaction? submitAddressTransactionList; SubmitBasicDetailsTransactionList? submitBasicDetTransactionList; String? submitCEITransactionList; @@ -347,7 +347,7 @@ class GenericResponseModel { String? submitHrTransactionList; Map? submitPhonesTransactionList; String? submitSITTransactionList; - String? submitTermTransactionList; + SubmitTermTransactionList? submitTermTransactionList; List? subordinatesOnLeavesList; SumbitAbsenceTransactionList? sumbitAbsenceTransactionList; String? tokenID; @@ -670,22 +670,13 @@ class GenericResponseModel { addAttSuccessList!.add(AddAttSuccessList.fromJson(v)); }); } - addAttachmentList = json['AddAttachment_List'] != null - ? AddAttachmentList.fromJson(json['AddAttachment_List']) - : null; + addAttachmentList = json['AddAttachment_List'] != null ? AddAttachmentList.fromJson(json['AddAttachment_List']) : null; bCDomain = json['BC_Domain']; bCLogo = json['BC_Logo']; - basicMemberInformation = json['BasicMemberInformation'] != null - ? BasicMemberInformationModel.fromJson(json['BasicMemberInformation']) - : null; + basicMemberInformation = json['BasicMemberInformation'] != null ? BasicMemberInformationModel.fromJson(json['BasicMemberInformation']) : null; businessCardPrivilege = json['BusinessCardPrivilege']; - calculateAbsenceDuration = json['CalculateAbsenceDuration'] != null - ? new CalculateAbsenceDuration.fromJson( - json['CalculateAbsenceDuration']) - : null; - cancelHRTransactionLIst = json['CancelHRTransactionLIst'] != null - ? new CancelHRTransactionLIst.fromJson(json['CancelHRTransactionLIst']) - : null; + calculateAbsenceDuration = json['CalculateAbsenceDuration'] != null ? new CalculateAbsenceDuration.fromJson(json['CalculateAbsenceDuration']) : null; + cancelHRTransactionLIst = json['CancelHRTransactionLIst'] != null ? new CancelHRTransactionLIst.fromJson(json['CancelHRTransactionLIst']) : null; chatEmployeeLoginList = json['Chat_EmployeeLoginList']; companyBadge = json['CompanyBadge']; companyImage = json['CompanyImage']; @@ -700,9 +691,7 @@ class GenericResponseModel { }); } - createVacationRuleList = json['CreateVacationRuleList'] != null - ? CreateVacationRuleList.fromJson(json['CreateVacationRuleList']) - : null; + createVacationRuleList = json['CreateVacationRuleList'] != null ? CreateVacationRuleList.fromJson(json['CreateVacationRuleList']) : null; deleteAttachmentList = json['DeleteAttachmentList']; deleteVacationRuleList = json['DeleteVacationRuleList']; disableSessionList = json['DisableSessionList']; @@ -713,17 +702,14 @@ class GenericResponseModel { if (json['GetAbsenceAttendanceTypesList'] != null) { getAbsenceAttendanceTypesList = []; json['GetAbsenceAttendanceTypesList'].forEach((v) { - getAbsenceAttendanceTypesList! - .add(GetAbsenceAttendanceTypesList.fromJson(v)); + getAbsenceAttendanceTypesList!.add(GetAbsenceAttendanceTypesList.fromJson(v)); }); } if (json['GetAbsenceCollectionNotificationBodyList'] != null) { - getAbsenceCollectionNotificationBodyList = - []; + getAbsenceCollectionNotificationBodyList = []; json['GetAbsenceCollectionNotificationBodyList'].forEach((v) { - getAbsenceCollectionNotificationBodyList! - .add(GetAbsenceCollectionNotificationBodyList.fromJson(v)); + getAbsenceCollectionNotificationBodyList!.add(GetAbsenceCollectionNotificationBodyList.fromJson(v)); }); } @@ -741,10 +727,7 @@ class GenericResponseModel { }); } - getAccrualBalancesList = json["GetAccrualBalancesList"] == null - ? null - : List.from(json["GetAccrualBalancesList"] - .map((x) => GetAccrualBalancesList.fromJson(x))); + getAccrualBalancesList = json["GetAccrualBalancesList"] == null ? null : List.from(json["GetAccrualBalancesList"].map((x) => GetAccrualBalancesList.fromJson(x))); if (json['GetActionHistoryList'] != null) { getActionHistoryList = []; @@ -774,22 +757,18 @@ class GenericResponseModel { getAttachementList!.add(GetAttachementList.fromJson(v)); }); } - getAttendanceTrackingList = json["GetAttendanceTrackingList"] == null - ? null - : GetAttendanceTracking.fromMap(json["GetAttendanceTrackingList"]); + getAttendanceTrackingList = json["GetAttendanceTrackingList"] == null ? null : GetAttendanceTracking.fromMap(json["GetAttendanceTrackingList"]); if (json['GetBasicDetColsStructureList'] != null) { getBasicDetColsStructureList = []; json['GetBasicDetColsStructureList'].forEach((v) { - getBasicDetColsStructureList! - .add(GetBasicDetColsStructureList.fromJson(v)); + getBasicDetColsStructureList!.add(GetBasicDetColsStructureList.fromJson(v)); }); } // getBasicDetDffStructureList = json['GetBasicDetDffStructureList']; if (json['GetBasicDetDffStructureList'] != null) { getBasicDetDffStructureList = []; json['GetBasicDetDffStructureList'].forEach((v) { - getBasicDetDffStructureList! - .add(GetBasicDetDffStructureList.fromJson(v)); + getBasicDetDffStructureList!.add(GetBasicDetDffStructureList.fromJson(v)); }); } if (json['GetContactDffStructureList'] != null) { @@ -806,8 +785,7 @@ class GenericResponseModel { }); } - getCEICollectionNotificationBodyList = - json['GetCEICollectionNotificationBodyList']; + getCEICollectionNotificationBodyList = json['GetCEICollectionNotificationBodyList']; getCEIDFFStructureList = json['GetCEIDFFStructureList']; getCEITransactionList = json['GetCEITransactionList']; getCcpTransactionsList = json['GetCcpTransactionsList']; @@ -820,24 +798,18 @@ class GenericResponseModel { if (json['GetContactColsStructureList'] != null) { getContactColsStructureList = []; json['GetContactColsStructureList'].forEach((v) { - getContactColsStructureList! - .add(GetContactColsStructureList.fromJson(v)); + getContactColsStructureList!.add(GetContactColsStructureList.fromJson(v)); }); } getContactColsStructureList = json['GetContactColsStructureList']; getContactDetailsList = json['GetContactDetailsList']; getContactDffStructureList = json['GetContactDffStructureList']; - getContactNotificationBodyList = - json["GetContactNotificationBodyList"] == null - ? null - : GetContactNotificationBodyList.fromJson( - json["GetContactNotificationBodyList"]); + getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]); if (json['GetContactColsStructureList'] != null) { getContactColsStructureList = []; json['GetContactColsStructureList'].forEach((v) { - getContactColsStructureList! - .add(GetContactColsStructureList.fromJson(v)); + getContactColsStructureList!.add(GetContactColsStructureList.fromJson(v)); }); } @@ -855,11 +827,7 @@ class GenericResponseModel { } // getContactDetailsList = json['GetContactDetailsList']; // getContactDffStructureList = json['GetContactDffStructureList']; - getContactNotificationBodyList = - json["GetContactNotificationBodyList"] == null - ? null - : GetContactNotificationBodyList.fromJson( - json["GetContactNotificationBodyList"]); + getContactNotificationBodyList = json["GetContactNotificationBodyList"] == null ? null : GetContactNotificationBodyList.fromJson(json["GetContactNotificationBodyList"]); if (json['GetCountriesList'] != null) { getCountriesList = []; @@ -881,15 +849,10 @@ class GenericResponseModel { getDeductionsList!.add(GetDeductionsList.fromJson(v)); }); } - getDefaultValueList = json['GetDefaultValueList'] != null - ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) - : null; - getEITCollectionNotificationBodyList = - json["GetEITCollectionNotificationBodyList"] == null - ? null - : List.from( - json["GetEITCollectionNotificationBodyList"].map( - (x) => GetEitCollectionNotificationBodyList.fromJson(x))); + getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null; + getEITCollectionNotificationBodyList = json["GetEITCollectionNotificationBodyList"] == null + ? null + : List.from(json["GetEITCollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x))); if (json['GetEITDFFStructureList'] != null) { getEITDFFStructureList = []; json['GetEITDFFStructureList'].forEach((v) { @@ -918,8 +881,7 @@ class GenericResponseModel { if (json['GetEmployeeBasicDetailsList'] != null) { getEmployeeBasicDetailsList = []; json['GetEmployeeBasicDetailsList'].forEach((v) { - getEmployeeBasicDetailsList! - .add(GetEmployeeBasicDetailsList.fromJson(v)); + getEmployeeBasicDetailsList!.add(GetEmployeeBasicDetailsList.fromJson(v)); }); } if (json['GetEmployeeContactsList'] != null) { @@ -937,34 +899,25 @@ class GenericResponseModel { if (json['GetEmployeeSubordinatesList'] != null) { getEmployeeSubordinatesList = []; json['GetEmployeeSubordinatesList'].forEach((v) { - getEmployeeSubordinatesList! - .add(new GetEmployeeSubordinatesList.fromJson(v)); + getEmployeeSubordinatesList!.add(new GetEmployeeSubordinatesList.fromJson(v)); }); } getFliexfieldStructureList = json['GetFliexfieldStructureList']; - getHrCollectionNotificationBodyList = - json['GetHrCollectionNotificationBodyList']; + getHrCollectionNotificationBodyList = json['GetHrCollectionNotificationBodyList']; getHrTransactionList = json['GetHrTransactionList']; - getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList'] != null - ? GetItemCreationNtfBodyList.fromJson( - json['GetItemCreationNtfBodyList']) - : null; + getItemCreationNtfBodyList = json['GetItemCreationNtfBodyList'] != null ? GetItemCreationNtfBodyList.fromJson(json['GetItemCreationNtfBodyList']) : null; if (json['GetItemTypeNotificationsList'] != null) { getItemTypeNotificationsList = []; json['GetItemTypeNotificationsList'].forEach((v) { - getItemTypeNotificationsList! - .add(GetItemTypeNotificationsList.fromJson(v)); + getItemTypeNotificationsList!.add(GetItemTypeNotificationsList.fromJson(v)); }); } getItemTypesList = json['GetItemTypesList']; getLookupValuesList = json['GetLookupValuesList']; - getMenuEntriesList = json["GetMenuEntriesList"] == null - ? null - : List.from(json["GetMenuEntriesList"] - .map((x) => GetMenuEntriesList.fromJson(x))); + getMenuEntriesList = json["GetMenuEntriesList"] == null ? null : List.from(json["GetMenuEntriesList"].map((x) => GetMenuEntriesList.fromJson(x))); if (json['GetMoItemHistoryList'] != null) { getMoItemHistoryList = []; json['GetMoItemHistoryList'].forEach((v) { @@ -989,8 +942,7 @@ class GenericResponseModel { if (json['GetNotificationReassignModeList'] != null) { getNotificationReassignModeList = []; json['GetNotificationReassignModeList'].forEach((v) { - getNotificationReassignModeList! - .add(GetNotificationReassignModeList.fromJson(v)); + getNotificationReassignModeList!.add(GetNotificationReassignModeList.fromJson(v)); }); } @@ -1001,13 +953,8 @@ class GenericResponseModel { }); } - getOpenMissingSwipesList = json["GetOpenMissingSwipesList"] == null - ? null - : GetOpenMissingSwipesList.fromJson(json["GetOpenMissingSwipesList"]); - getOpenNotificationsList = json["GetOpenNotificationsList"] == null - ? null - : List.from(json["GetOpenNotificationsList"] - .map((x) => GetOpenNotificationsList.fromMap(x))); + getOpenMissingSwipesList = json["GetOpenMissingSwipesList"] == null ? null : GetOpenMissingSwipesList.fromJson(json["GetOpenMissingSwipesList"]); + getOpenNotificationsList = json["GetOpenNotificationsList"] == null ? null : List.from(json["GetOpenNotificationsList"].map((x) => GetOpenNotificationsList.fromMap(x))); getOpenNotificationsNumList = json['GetOpenNotificationsNumList']; getOpenPeriodDatesList = json['GetOpenPeriodDatesList']; getOrganizationsSalariesList = json['GetOrganizationsSalariesList']; @@ -1027,26 +974,17 @@ class GenericResponseModel { } // getPendingReqDetailsList = json['GetPendingReqDetailsList']; // getPendingReqFunctionsList = json['GetPendingReqFunctionsList']; - getPerformanceAppraisalList = json['GetPerformanceAppraisalList'] == null - ? null - : List.from( - json["GetPerformanceAppraisalList"] - .map((x) => GetPerformanceAppraisalList.fromJson(x))); + getPerformanceAppraisalList = + json['GetPerformanceAppraisalList'] == null ? null : List.from(json["GetPerformanceAppraisalList"].map((x) => GetPerformanceAppraisalList.fromJson(x))); getPhonesNotificationBodyList = - json["GetPhonesNotificationBodyList"] == null - ? null - : List.from( - json["GetPhonesNotificationBodyList"] - .map((x) => GetPhonesNotificationBodyList.fromJson(x))); + json["GetPhonesNotificationBodyList"] == null ? null : List.from(json["GetPhonesNotificationBodyList"].map((x) => GetPhonesNotificationBodyList.fromJson(x))); if (json['GetPoItemHistoryList'] != null) { getPoItemHistoryList = []; json['GetPoItemHistoryList'].forEach((v) { getPoItemHistoryList!.add(GetPoItemHistoryList.fromJson(v)); }); } - getPoNotificationBodyList = json['GetPoNotificationBodyList'] != null - ? GetPoNotificationBodyList.fromJson(json['GetPoNotificationBodyList']) - : null; + getPoNotificationBodyList = json['GetPoNotificationBodyList'] != null ? GetPoNotificationBodyList.fromJson(json['GetPoNotificationBodyList']) : null; getPrNotificationBodyList = json['GetPrNotificationBodyList']; if (json['GetQuotationAnalysisList'] != null) { getQuotationAnalysisList = []; @@ -1056,15 +994,13 @@ class GenericResponseModel { } getRFCEmployeeListList = json['GetRFCEmployeeListList']; getRespondAttributeValueList = json['GetRespondAttributeValueList']; - getSITCollectionNotificationBodyList = - json['GetSITCollectionNotificationBodyList']; + getSITCollectionNotificationBodyList = json['GetSITCollectionNotificationBodyList']; getSITDFFStructureList = json['GetSITDFFStructureList']; getSITTransactionList = json['GetSITTransactionList']; if (json['GetScheduleShiftsDetailsList'] != null) { getScheduleShiftsDetailsList = []; json['GetScheduleShiftsDetailsList'].forEach((v) { - getScheduleShiftsDetailsList! - .add(GetScheduleShiftsDetailsList.fromJson(v)); + getScheduleShiftsDetailsList!.add(GetScheduleShiftsDetailsList.fromJson(v)); }); } getShiftTypesList = json['GetShiftTypesList']; @@ -1072,15 +1008,13 @@ class GenericResponseModel { if (json['GetStampMsNotificationBodyList'] != null) { getStampMsNotificationBodyList = []; json['GetStampMsNotificationBodyList'].forEach((v) { - getStampMsNotificationBodyList! - .add(GetStampMsNotificationBodyList.fromJson(v)); + getStampMsNotificationBodyList!.add(GetStampMsNotificationBodyList.fromJson(v)); }); } if (json['GetStampNsNotificationBodyList'] != null) { getStampNsNotificationBodyList = []; json['GetStampNsNotificationBodyList'].forEach((v) { - getStampNsNotificationBodyList! - .add(GetStampNsNotificationBodyList.fromJson(v)); + getStampNsNotificationBodyList!.add(GetStampNsNotificationBodyList.fromJson(v)); }); } @@ -1094,11 +1028,9 @@ class GenericResponseModel { } if (json['GetSubordinatesLeavesTotalVacationsList'] != null) { - getSubordinatesLeavesTotalVacationsList = - []; + getSubordinatesLeavesTotalVacationsList = []; json['GetSubordinatesLeavesTotalVacationsList'].forEach((v) { - getSubordinatesLeavesTotalVacationsList! - .add(new GetSubordinatesLeavesTotalVacationsList.fromJson(v)); + getSubordinatesLeavesTotalVacationsList!.add(new GetSubordinatesLeavesTotalVacationsList.fromJson(v)); }); } if (json['GetSummaryOfPaymentList'] != null) { @@ -1108,8 +1040,20 @@ class GenericResponseModel { }); } getSwipesList = json['GetSwipesList']; - getTermColsStructureList = json['GetTermColsStructureList']; - getTermDffStructureList = json['GetTermDffStructureList']; + if (json['GetTermColsStructureList'] != null) { + getTermColsStructureList = []; + json['GetTermColsStructureList'].forEach((v) { + getTermColsStructureList!.add(GetTermColsStructureList.fromJson(v)); + }); + } + + if (json['GetTermDffStructureList'] != null) { + getTermDffStructureList = []; + json['GetTermDffStructureList'].forEach((v) { + getTermDffStructureList!.add(new GetTermDffStructureList.fromJson(v)); + }); + } + getTermNotificationBodyList = json['GetTermNotificationBodyList']; if (json['GetTimeCardSummaryList'] != null) { @@ -1168,9 +1112,7 @@ class GenericResponseModel { }); } if (json['Mohemm_ITG_Pending_Task_ResponseItem'] != null) { - mohemmITGPendingTaskResponseItem = - MohemmITGPendingTaskResponseItem.fromJson( - json['Mohemm_ITG_Pending_Task_ResponseItem']); + mohemmITGPendingTaskResponseItem = MohemmITGPendingTaskResponseItem.fromJson(json['Mohemm_ITG_Pending_Task_ResponseItem']); } if (json['Mohemm_ITG_SectionTopicsList'] != null) { getSectionTopics = []; @@ -1182,16 +1124,14 @@ class GenericResponseModel { if (json['GetPendingReqFunctionsList'] != null) { getPendingTransactionsFunctions = []; json['GetPendingReqFunctionsList'].forEach((v) { - getPendingTransactionsFunctions! - .add(GetPendingTransactionsFunctions.fromJson(v)); + getPendingTransactionsFunctions!.add(GetPendingTransactionsFunctions.fromJson(v)); }); } if (json['GetPendingReqDetailsList'] != null) { getPendingTransactionsDetails = []; json['GetPendingReqDetailsList'].forEach((v) { - getPendingTransactionsDetails! - .add(GetPendingTransactionsDetails.fromJson(v)); + getPendingTransactionsDetails!.add(GetPendingTransactionsDetails.fromJson(v)); }); } @@ -1270,10 +1210,7 @@ class GenericResponseModel { listItemImagesDetails = json['List_ItemImagesDetails']; listItemMaster = json['List_ItemMaster']; listMedicineDetails = json['List_MedicineDetails']; - listMenu = json["List_Menu"] == null - ? [] - : List.from( - json["List_Menu"].map((x) => ListMenu.fromJson(x))); + listMenu = json["List_Menu"] == null ? [] : List.from(json["List_Menu"].map((x) => ListMenu.fromJson(x))); listNewEmployees = json['List_NewEmployees']; listRadScreen = json['List_RadScreen']; logInTokenID = json['LogInTokenID']; @@ -1283,44 +1220,29 @@ class GenericResponseModel { memberInformationList!.add(MemberInformationListModel.fromJson(v)); }); } - memberLoginList = json['MemberLoginList'] != null - ? MemberLoginListModel.fromJson(json['MemberLoginList']) - : null; - mohemmGetBusinessCardEnabledList = - json['Mohemm_GetBusinessCardEnabledList']; + memberLoginList = json['MemberLoginList'] != null ? MemberLoginListModel.fromJson(json['MemberLoginList']) : null; + mohemmGetBusinessCardEnabledList = json['Mohemm_GetBusinessCardEnabledList']; mohemmGetFavoriteReplacementsList = - json["Mohemm_GetFavoriteReplacementsList"] == null - ? null - : List.from( - json["Mohemm_GetFavoriteReplacementsList"] - .map((x) => GetFavoriteReplacements.fromJson(x))); - - mohemmGetMobileDeviceInfobyEmpInfoList = - json['Mohemm_GetMobileDeviceInfobyEmpInfoList']; + json["Mohemm_GetFavoriteReplacementsList"] == null ? null : List.from(json["Mohemm_GetFavoriteReplacementsList"].map((x) => GetFavoriteReplacements.fromJson(x))); + + mohemmGetMobileDeviceInfobyEmpInfoList = json['Mohemm_GetMobileDeviceInfobyEmpInfoList']; if (json['Mohemm_GetMobileLoginInfoList'] != null) { mohemmGetMobileLoginInfoList = []; json['Mohemm_GetMobileLoginInfoList'].forEach((v) { - mohemmGetMobileLoginInfoList! - .add(GetMobileLoginInfoListModel.fromJson(v)); + mohemmGetMobileLoginInfoList!.add(GetMobileLoginInfoListModel.fromJson(v)); }); } mohemmGetPatientIDList = json['Mohemm_GetPatientID_List']; mohemmITGResponseItem = json['Mohemm_ITG_ResponseItem']; - mohemmIsChangeIsActiveBusinessCardEnable = - json['Mohemm_IsChangeIsActiveBusinessCardEnable']; - mohemmIsInsertBusinessCardEnable = - json['Mohemm_IsInsertBusinessCardEnable']; + mohemmIsChangeIsActiveBusinessCardEnable = json['Mohemm_IsChangeIsActiveBusinessCardEnable']; + mohemmIsInsertBusinessCardEnable = json['Mohemm_IsInsertBusinessCardEnable']; mohemmWifiPassword = json['Mohemm_Wifi_Password']; mohemmWifiSSID = json['Mohemm_Wifi_SSID']; - notificationAction = json['NotificationAction'] != null - ? NotificationAction.fromJson(json['NotificationAction']) - : null; + notificationAction = json['NotificationAction'] != null ? NotificationAction.fromJson(json['NotificationAction']) : null; if (json['NotificationGetRespondAttributesList'] != null) { - notificationGetRespondAttributesList = - []; + notificationGetRespondAttributesList = []; json['NotificationGetRespondAttributesList'].forEach((v) { - notificationGetRespondAttributesList! - .add(NotificationGetRespondAttributesList.fromJson(v)); + notificationGetRespondAttributesList!.add(NotificationGetRespondAttributesList.fromJson(v)); }); } @@ -1345,8 +1267,7 @@ class GenericResponseModel { pQUESTION = json['P_QUESTION']; pSESSIONID = json['P_SESSION_ID']; pSchema = json['P_Schema']; - pharmacyStockAddPharmacyStockList = - json['PharmacyStock_AddPharmacyStockList']; + pharmacyStockAddPharmacyStockList = json['PharmacyStock_AddPharmacyStockList']; pharmacyStockGetOnHandList = json['PharmacyStock_GetOnHandList']; if (json['Privilege_List'] != null) { @@ -1358,10 +1279,7 @@ class GenericResponseModel { processTransactions = json['ProcessTransactions']; registerUserNameList = json['RegisterUserNameList']; - replacementList = json["ReplacementList"] == null - ? null - : List.from( - json["ReplacementList"].map((x) => ReplacementList.fromJson(x))); + replacementList = json["ReplacementList"] == null ? null : List.from(json["ReplacementList"].map((x) => ReplacementList.fromJson(x))); if (json['RespondAttributesList'] != null) { respondAttributesList = []; @@ -1380,57 +1298,33 @@ class GenericResponseModel { resubmitHrTransactionList = json['ResubmitHrTransactionList']; sFHGetPoNotificationBodyList = json['SFH_GetPoNotificationBodyList']; sFHGetPrNotificationBodyList = json['SFH_GetPrNotificationBodyList']; - startAbsenceApprovalProccess = json['StartAbsenceApprovalProccess'] != null - ? StartAbsenceApprovalProccess.fromJson( - json['StartAbsenceApprovalProccess']) - : null; - startAddressApprovalProcessList = - json['StartAddressApprovalProcessList'] != null - ? StartAddressApprovalProcess.fromJson( - json['StartAddressApprovalProcessList']) - : null; + startAbsenceApprovalProccess = json['StartAbsenceApprovalProccess'] != null ? StartAbsenceApprovalProccess.fromJson(json['StartAbsenceApprovalProccess']) : null; + startAddressApprovalProcessList = json['StartAddressApprovalProcessList'] != null ? StartAddressApprovalProcess.fromJson(json['StartAddressApprovalProcessList']) : null; startBasicDetApprProcessList = json['StartBasicDetApprProcessList']; startCeiApprovalProcess = json['StartCeiApprovalProcess']; startContactApprovalProcessList = json['StartContactApprovalProcessList']; - startEitApprovalProcess = json['StartEitApprovalProcess'] != null - ? StartEitApprovalProcess.fromJson(json['StartEitApprovalProcess']) - : null; + startEitApprovalProcess = json['StartEitApprovalProcess'] != null ? StartEitApprovalProcess.fromJson(json['StartEitApprovalProcess']) : null; startHrApprovalProcessList = json['StartHrApprovalProcessList']; - startPhonesApprovalProcessList = - json['StartPhonesApprovalProcessList'] != null - ? StartPhoneApprovalProcess.fromJson( - json['startPhonesApprovalProcessList']) - : null; + startPhonesApprovalProcessList = json['StartPhonesApprovalProcessList'] != null ? StartPhoneApprovalProcess.fromJson(json['startPhonesApprovalProcessList']) : null; startSitApprovalProcess = json['StartSitApprovalProcess']; - startTermApprovalProcessList = json['StartTermApprovalProcessList']; - - submitAddressTransactionList = json['SubmitAddressTransactionList'] != null - ? SubmitAddressTransaction.fromJson( - json['SubmitAddressTransactionList']) - : null; - submitBasicDetTransactionList = - json['SubmitBasicDetTransactionList'] != null - ? SubmitBasicDetailsTransactionList.fromJson( - json['SubmitBasicDetTransactionList']) - : null; + + startTermApprovalProcessList = json['StartTermApprovalProcessList'] != null ? StartTermApprovalProcessList.fromJson(json['StartTermApprovalProcessList']) : null; + + submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null; + submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null; submitCEITransactionList = json['SubmitCEITransactionList']; submitCcpTransactionList = json['SubmitCcpTransactionList']; - submitContactTransactionList = json['SubmitContactTransactionList'] != null - ? SubmitContactTransactionList.fromJson( - json['SubmitContactTransactionList']) - : null; - submitEITTransactionList = json['SubmitEITTransactionList'] != null - ? SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) - : null; + submitContactTransactionList = json['SubmitContactTransactionList'] != null ? SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null; + submitEITTransactionList = json['SubmitEITTransactionList'] != null ? SubmitEITTransactionList.fromJson(json['SubmitEITTransactionList']) : null; submitHrTransactionList = json['SubmitHrTransactionList']; submitPhonesTransactionList = json['SubmitPhonesTransactionList']; submitSITTransactionList = json['SubmitSITTransactionList']; - submitTermTransactionList = json['SubmitTermTransactionList']; + submitTermTransactionList = json['SubmitTermTransactionList'] != null ? SubmitTermTransactionList.fromJson(json['SubmitTermTransactionList']) : null; if (json['SubordinatesOnLeavesList'] != null) { subordinatesOnLeavesList = []; @@ -1439,10 +1333,7 @@ class GenericResponseModel { }); } - sumbitAbsenceTransactionList = json['SumbitAbsenceTransactionList'] != null - ? new SumbitAbsenceTransactionList.fromJson( - json['SumbitAbsenceTransactionList']) - : null; + sumbitAbsenceTransactionList = json['SumbitAbsenceTransactionList'] != null ? new SumbitAbsenceTransactionList.fromJson(json['SumbitAbsenceTransactionList']) : null; tokenID = json['TokenID']; updateAttachmentList = json['UpdateAttachmentList']; @@ -1450,13 +1341,10 @@ class GenericResponseModel { if (json['UpdateItemTypeSuccessList'] != null) { updateItemTypeSuccessList = []; json['UpdateItemTypeSuccessList'].forEach((v) { - updateItemTypeSuccessList! - .add(new UpdateItemTypeSuccessList.fromJson(v)); + updateItemTypeSuccessList!.add(new UpdateItemTypeSuccessList.fromJson(v)); }); } - updateUserItemTypesList = json['UpdateUserItemTypesList'] != null - ? new UpdateUserItemTypesList.fromJson(json['UpdateUserItemTypesList']) - : null; + updateUserItemTypesList = json['UpdateUserItemTypesList'] != null ? new UpdateUserItemTypesList.fromJson(json['UpdateUserItemTypesList']) : null; updateVacationRuleList = json['UpdateVacationRuleList']; vHREmployeeLoginList = json['VHR_EmployeeLoginList']; vHRGetEmployeeDetailsList = json['VHR_GetEmployeeDetailsList']; @@ -1464,16 +1352,9 @@ class GenericResponseModel { vHRGetProjectByCodeList = json['VHR_GetProjectByCodeList']; vHRIsVerificationCodeValid = json['VHR_IsVerificationCodeValid']; - validateAbsenceTransactionList = - json['ValidateAbsenceTransactionList'] != null - ? ValidateAbsenceTransactionList.fromJson( - json['ValidateAbsenceTransactionList']) - : null; + validateAbsenceTransactionList = json['ValidateAbsenceTransactionList'] != null ? ValidateAbsenceTransactionList.fromJson(json['ValidateAbsenceTransactionList']) : null; - validateEITTransactionList = json['ValidateEITTransactionList'] != null - ? ValidateEITTransactionList.fromJson( - json['ValidateEITTransactionList']) - : null; + validateEITTransactionList = json['ValidateEITTransactionList'] != null ? ValidateEITTransactionList.fromJson(json['ValidateEITTransactionList']) : null; validatePhonesTransactionList = json['ValidatePhonesTransactionList']; if (json['VrItemTypesList'] != null) { @@ -1488,8 +1369,7 @@ class GenericResponseModel { wFLookUpList!.add(WFLookUpList.fromJson(v)); }); } - eLearningGETEMPLOYEEPROFILEList = - json['eLearning_GET_EMPLOYEE_PROFILEList']; + eLearningGETEMPLOYEEPROFILEList = json['eLearning_GET_EMPLOYEE_PROFILEList']; eLearningLOGINList = json['eLearning_LOGINList']; eLearningValidateLoginList = json['eLearning_ValidateLoginList']; eLearningValidate_LoginList = json['eLearning_Validate_LoginList']; @@ -1528,8 +1408,7 @@ class GenericResponseModel { data['VidaUpdatedResponse'] = this.vidaUpdatedResponse; if (this.addAttSuccessList != null) { - data['AddAttSuccessList'] = - this.addAttSuccessList!.map((v) => v.toJson()).toList(); + data['AddAttSuccessList'] = this.addAttSuccessList!.map((v) => v.toJson()).toList(); } if (this.addAttachmentList != null) { data['AddAttachment_List'] = this.addAttachmentList!.toJson(); @@ -1542,8 +1421,7 @@ class GenericResponseModel { } data['BusinessCardPrivilege'] = this.businessCardPrivilege; if (this.calculateAbsenceDuration != null) { - data['CalculateAbsenceDuration'] = - this.calculateAbsenceDuration!.toJson(); + data['CalculateAbsenceDuration'] = this.calculateAbsenceDuration!.toJson(); } if (this.cancelHRTransactionLIst != null) { data['CancelHRTransactionLIst'] = this.calculateAbsenceDuration!.toJson(); @@ -1569,45 +1447,35 @@ class GenericResponseModel { data['GetAbsenceAttachmentsList'] = this.getAbsenceAttachmentsList; if (this.getAbsenceAttendanceTypesList != null) { - data['GetAbsenceAttendanceTypesList'] = - this.getAbsenceAttendanceTypesList!.map((v) => v.toJson()).toList(); + data['GetAbsenceAttendanceTypesList'] = this.getAbsenceAttendanceTypesList!.map((v) => v.toJson()).toList(); } if (this.getAbsenceCollectionNotificationBodyList != null) { - data['GetAbsenceCollectionNotificationBodyList'] = this - .getAbsenceCollectionNotificationBodyList! - .map((v) => v.toJson()) - .toList(); + data['GetAbsenceCollectionNotificationBodyList'] = this.getAbsenceCollectionNotificationBodyList!.map((v) => v.toJson()).toList(); } if (this.getAbsenceDffStructureList != null) { - data['GetAbsenceDffStructureList'] = - this.getAbsenceDffStructureList!.map((v) => v.toJson()).toList(); + data['GetAbsenceDffStructureList'] = this.getAbsenceDffStructureList!.map((v) => v.toJson()).toList(); } if (this.getAbsenceTransactionList != null) { - data['GetAbsenceTransactionList'] = - this.getAbsenceTransactionList!.map((v) => v.toJson()).toList(); + data['GetAbsenceTransactionList'] = this.getAbsenceTransactionList!.map((v) => v.toJson()).toList(); } data['GetAccrualBalancesList'] = this.getAccrualBalancesList; if (this.getActionHistoryList != null) { - data['GetActionHistoryList'] = - this.getActionHistoryList!.map((v) => v.toJson()).toList(); + data['GetActionHistoryList'] = this.getActionHistoryList!.map((v) => v.toJson()).toList(); } data['GetAddressDffStructureList'] = this.getAddressDffStructureList; - data['GetAddressNotificationBodyList'] = - this.getAddressNotificationBodyList; + data['GetAddressNotificationBodyList'] = this.getAddressNotificationBodyList; if (this.getApprovesList != null) { - data['GetApprovesList'] = - this.getApprovesList!.map((v) => v.toJson()).toList(); + data['GetApprovesList'] = this.getApprovesList!.map((v) => v.toJson()).toList(); } if (this.getAttachementList != null) { - data['GetAttachementList'] = - this.getAttachementList!.map((v) => v.toJson()).toList(); + data['GetAttachementList'] = this.getAttachementList!.map((v) => v.toJson()).toList(); } data['GetAttendanceTrackingList'] = this.getAttendanceTrackingList; @@ -1615,116 +1483,92 @@ class GenericResponseModel { data['GetBasicDetDffStructureList'] = this.getBasicDetDffStructureList; if (this.getBasicDetNtfBodyList != null) { - data['GetBasicDetNtfBodyList'] = - this.getBasicDetNtfBodyList!.map((v) => v.toJson()).toList(); + data['GetBasicDetNtfBodyList'] = this.getBasicDetNtfBodyList!.map((v) => v.toJson()).toList(); } - data['GetCEICollectionNotificationBodyList'] = - this.getCEICollectionNotificationBodyList; + data['GetCEICollectionNotificationBodyList'] = this.getCEICollectionNotificationBodyList; data['GetCEIDFFStructureList'] = this.getCEIDFFStructureList; data['GetCEITransactionList'] = this.getCEITransactionList; data['GetCcpTransactionsList'] = this.getCcpTransactionsList; if (this.getContactDetailsList != null) { - data['GetContactDetailsList'] = - this.getContactDetailsList!.map((v) => v.toJson()).toList(); + data['GetContactDetailsList'] = this.getContactDetailsList!.map((v) => v.toJson()).toList(); } if (this.getContactColsStructureList != null) { - data['GetContactColsStructureList'] = - this.getContactColsStructureList!.map((v) => v.toJson()).toList(); + data['GetContactColsStructureList'] = this.getContactColsStructureList!.map((v) => v.toJson()).toList(); } if (this.getContactDffStructureList != null) { - data['GetContactDffStructureList'] = - this.getContactDffStructureList!.map((v) => v.toJson()).toList(); + data['GetContactDffStructureList'] = this.getContactDffStructureList!.map((v) => v.toJson()).toList(); } data['GetContactColsStructureList'] = this.getContactColsStructureList; data['GetContactDetailsList'] = this.getContactDetailsList; data['GetContactDffStructureList'] = this.getContactDffStructureList; - data['GetContactNotificationBodyList'] = - this.getContactNotificationBodyList; + data['GetContactNotificationBodyList'] = this.getContactNotificationBodyList; data['GetCountriesList'] = this.getCountriesList; if (this.getDayHoursTypeDetailsList != null) { - data['GetDayHoursTypeDetailsList'] = - this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList(); + data['GetDayHoursTypeDetailsList'] = this.getDayHoursTypeDetailsList!.map((v) => v.toJson()).toList(); } if (this.getDeductionsList != null) { - data['GetDeductionsList'] = - this.getDeductionsList!.map((v) => v.toJson()).toList(); + data['GetDeductionsList'] = this.getDeductionsList!.map((v) => v.toJson()).toList(); } if (this.getDefaultValueList != null) { data['GetDefaultValueList'] = this.getDefaultValueList!.toJson(); } - data['GetEITCollectionNotificationBodyList'] = - this.getEITCollectionNotificationBodyList; + data['GetEITCollectionNotificationBodyList'] = this.getEITCollectionNotificationBodyList; if (this.getEITDFFStructureList != null) { - data['GetEITDFFStructureList'] = - this.getEITDFFStructureList!.map((v) => v.toJson()).toList(); + data['GetEITDFFStructureList'] = this.getEITDFFStructureList!.map((v) => v.toJson()).toList(); } if (this.getEITTransactionList != null) { - data['GetEITTransactionList'] = - this.getEITTransactionList!.map((v) => v.toJson()).toList(); + data['GetEITTransactionList'] = this.getEITTransactionList!.map((v) => v.toJson()).toList(); } if (this.getEarningsList != null) { - data['GetEarningsList'] = - this.getEarningsList!.map((v) => v.toJson()).toList(); + data['GetEarningsList'] = this.getEarningsList!.map((v) => v.toJson()).toList(); } if (this.getEmployeeAddressList != null) { - data['GetEmployeeAddressList'] = - this.getEmployeeAddressList!.map((v) => v.toJson()).toList(); + data['GetEmployeeAddressList'] = this.getEmployeeAddressList!.map((v) => v.toJson()).toList(); } if (this.getEmployeeBasicDetailsList != null) { - data['GetEmployeeBasicDetailsList'] = - this.getEmployeeBasicDetailsList!.map((v) => v.toJson()).toList(); + data['GetEmployeeBasicDetailsList'] = this.getEmployeeBasicDetailsList!.map((v) => v.toJson()).toList(); } if (this.getEmployeeContactsList != null) { - data['GetEmployeeContactsList'] = - this.getEmployeeContactsList!.map((v) => v.toJson()).toList(); + data['GetEmployeeContactsList'] = this.getEmployeeContactsList!.map((v) => v.toJson()).toList(); } if (this.getEmployeePhonesList != null) { - data['GetEmployeePhonesList'] = - this.getEmployeePhonesList!.map((v) => v.toJson()).toList(); + data['GetEmployeePhonesList'] = this.getEmployeePhonesList!.map((v) => v.toJson()).toList(); } if (this.getEmployeeSubordinatesList != null) { - data['GetEmployeeSubordinatesList'] = - this.getEmployeeSubordinatesList!.map((v) => v.toJson()).toList(); + data['GetEmployeeSubordinatesList'] = this.getEmployeeSubordinatesList!.map((v) => v.toJson()).toList(); } data['GetFliexfieldStructureList'] = this.getFliexfieldStructureList; - data['GetHrCollectionNotificationBodyList'] = - this.getHrCollectionNotificationBodyList; + data['GetHrCollectionNotificationBodyList'] = this.getHrCollectionNotificationBodyList; data['GetHrTransactionList'] = this.getHrTransactionList; if (this.getItemCreationNtfBodyList != null) { - data['GetItemCreationNtfBodyList'] = - this.getItemCreationNtfBodyList!.toJson(); + data['GetItemCreationNtfBodyList'] = this.getItemCreationNtfBodyList!.toJson(); } if (this.getItemTypeNotificationsList != null) { - data['GetItemTypeNotificationsList'] = - this.getItemTypeNotificationsList!.map((v) => v.toJson()).toList(); + data['GetItemTypeNotificationsList'] = this.getItemTypeNotificationsList!.map((v) => v.toJson()).toList(); } data['GetItemTypesList'] = this.getItemTypesList; data['GetLookupValuesList'] = this.getLookupValuesList; data['GetMenuEntriesList'] = this.getMenuEntriesList; if (this.getMoItemHistoryList != null) { - data['GetMoItemHistoryList'] = - this.getMoItemHistoryList!.map((v) => v.toJson()).toList(); + data['GetMoItemHistoryList'] = this.getMoItemHistoryList!.map((v) => v.toJson()).toList(); } if (this.getMoNotificationBodyList != null) { - data['GetMoNotificationBodyList'] = - this.getMoNotificationBodyList!.map((v) => v.toJson()).toList(); + data['GetMoNotificationBodyList'] = this.getMoNotificationBodyList!.map((v) => v.toJson()).toList(); } if (this.getNotificationButtonsList != null) { - data['GetNotificationButtonsList'] = - this.getNotificationButtonsList!.map((v) => v.toJson()).toList(); + data['GetNotificationButtonsList'] = this.getNotificationButtonsList!.map((v) => v.toJson()).toList(); } if (getNotificationReassignModeList != null) { - data['GetNotificationReassignModeList'] = - getNotificationReassignModeList!.map((v) => v.toJson()).toList(); + data['GetNotificationReassignModeList'] = getNotificationReassignModeList!.map((v) => v.toJson()).toList(); } data['GetObjectValuesList'] = this.getObjectValuesList; @@ -1734,91 +1578,80 @@ class GenericResponseModel { data['GetOpenPeriodDatesList'] = this.getOpenPeriodDatesList; data['GetOrganizationsSalariesList'] = this.getOrganizationsSalariesList; if (this.getPaymentInformationList != null) { - data['GetPaymentInformationList'] = - this.getPaymentInformationList!.map((v) => v.toJson()).toList(); + data['GetPaymentInformationList'] = this.getPaymentInformationList!.map((v) => v.toJson()).toList(); } if (this.getPayslipList != null) { - data['GetPayslipList'] = - this.getPayslipList!.map((v) => v.toJson()).toList(); + data['GetPayslipList'] = this.getPayslipList!.map((v) => v.toJson()).toList(); } // data['GetPendingReqDetailsList'] = this.getPendingReqDetailsList; // data['GetPendingReqFunctionsList'] = this.getPendingReqFunctionsList; data['GetPerformanceAppraisalList'] = this.getPerformanceAppraisalList; data['GetPhonesNotificationBodyList'] = this.getPhonesNotificationBodyList; if (this.getPoItemHistoryList != null) { - data['GetPoItemHistoryList'] = - this.getPoItemHistoryList!.map((v) => v.toJson()).toList(); + data['GetPoItemHistoryList'] = this.getPoItemHistoryList!.map((v) => v.toJson()).toList(); } if (this.getPoNotificationBodyList != null) { - data['GetPoNotificationBodyList'] = - this.getPoNotificationBodyList!.toJson(); + data['GetPoNotificationBodyList'] = this.getPoNotificationBodyList!.toJson(); } data['GetPrNotificationBodyList'] = this.getPrNotificationBodyList; if (this.getQuotationAnalysisList != null) { - data['GetQuotationAnalysisList'] = - this.getQuotationAnalysisList!.map((v) => v.toJson()).toList(); + data['GetQuotationAnalysisList'] = this.getQuotationAnalysisList!.map((v) => v.toJson()).toList(); } data['GetRFCEmployeeListList'] = this.getRFCEmployeeListList; data['GetRespondAttributeValueList'] = this.getRespondAttributeValueList; - data['GetSITCollectionNotificationBodyList'] = - this.getSITCollectionNotificationBodyList; + data['GetSITCollectionNotificationBodyList'] = this.getSITCollectionNotificationBodyList; data['GetSITDFFStructureList'] = this.getSITDFFStructureList; data['GetSITTransactionList'] = this.getSITTransactionList; if (this.getScheduleShiftsDetailsList != null) { - data['GetScheduleShiftsDetailsList'] = - this.getScheduleShiftsDetailsList!.map((v) => v.toJson()).toList(); + data['GetScheduleShiftsDetailsList'] = this.getScheduleShiftsDetailsList!.map((v) => v.toJson()).toList(); } data['GetShiftTypesList'] = this.getShiftTypesList; if (this.getStampMsNotificationBodyList != null) { - data['GetStampMsNotificationBodyList'] = - this.getStampMsNotificationBodyList!.map((v) => v.toJson()).toList(); + data['GetStampMsNotificationBodyList'] = this.getStampMsNotificationBodyList!.map((v) => v.toJson()).toList(); } if (this.getStampNsNotificationBodyList != null) { - data['GetStampNsNotificationBodyList'] = - this.getStampNsNotificationBodyList!.map((v) => v.toJson()).toList(); + data['GetStampNsNotificationBodyList'] = this.getStampNsNotificationBodyList!.map((v) => v.toJson()).toList(); } - data['GetStampNsNotificationBodyList'] = - this.getStampNsNotificationBodyList; + data['GetStampNsNotificationBodyList'] = this.getStampNsNotificationBodyList; data['GetSubordinatesAttdStatusList'] = this.getSubordinatesAttdStatusList; data['GetSubordinatesLeavesList'] = this.getSubordinatesLeavesList; if (this.getSubordinatesLeavesList != null) { - data['GetSubordinatesLeavesList'] = - this.getSubordinatesLeavesList!.map((v) => v.toJson()).toList(); + data['GetSubordinatesLeavesList'] = this.getSubordinatesLeavesList!.map((v) => v.toJson()).toList(); } if (this.getSubordinatesLeavesTotalVacationsList != null) { - data['GetSubordinatesLeavesTotalVacationsList'] = this - .getSubordinatesLeavesTotalVacationsList! - .map((v) => v.toJson()) - .toList(); + data['GetSubordinatesLeavesTotalVacationsList'] = this.getSubordinatesLeavesTotalVacationsList!.map((v) => v.toJson()).toList(); } if (this.getSummaryOfPaymentList != null) { - data['GetSummaryOfPaymentList'] = - this.getSummaryOfPaymentList!.map((v) => v.toJson()).toList(); + data['GetSummaryOfPaymentList'] = this.getSummaryOfPaymentList!.map((v) => v.toJson()).toList(); } data['GetSwipesList'] = this.getSwipesList; - data['GetTermColsStructureList'] = this.getTermColsStructureList; - data['GetTermDffStructureList'] = this.getTermDffStructureList; + + if (this.getTermColsStructureList != null) { + data['GetTermColsStructureList'] = this.getTermColsStructureList!.map((v) => v.toJson()).toList(); + } + + if (this.getTermDffStructureList != null) { + data['GetTermDffStructureList'] = this.getTermDffStructureList!.map((v) => v.toJson()).toList(); + } + data['GetTermNotificationBodyList'] = this.getTermNotificationBodyList; if (this.getTimeCardSummaryList != null) { - data['GetTimeCardSummaryList'] = - this.getTimeCardSummaryList!.map((v) => v.toJson()).toList(); + data['GetTimeCardSummaryList'] = this.getTimeCardSummaryList!.map((v) => v.toJson()).toList(); } data['GetUserItemTypesList'] = this.getUserItemTypesList; if (this.getVacationRulesList != null) { - data['GetVacationRulesList'] = - this.getVacationRulesList!.map((v) => v.toJson()).toList(); + data['GetVacationRulesList'] = this.getVacationRulesList!.map((v) => v.toJson()).toList(); } data['GetVaccinationOnHandList'] = this.getVaccinationOnHandList; data['GetVaccinationsList'] = this.getVaccinationsList; if (getValueSetValuesList != null) { - data['GetValueSetValuesList'] = - getValueSetValuesList!.map((v) => v.toJson()).toList(); + data['GetValueSetValuesList'] = getValueSetValuesList!.map((v) => v.toJson()).toList(); } if (getWorkList != null) { data['GetWorkList'] = getWorkList!.map((v) => v.toJson()).toList(); @@ -1849,26 +1682,19 @@ class GenericResponseModel { data['List_RadScreen'] = this.listRadScreen; data['LogInTokenID'] = this.logInTokenID; if (this.memberInformationList != null) { - data['MemberInformationList'] = - this.memberInformationList!.map((v) => v.toJson()).toList(); + data['MemberInformationList'] = this.memberInformationList!.map((v) => v.toJson()).toList(); } data['MemberLoginList'] = this.memberLoginList; - data['Mohemm_GetBusinessCardEnabledList'] = - this.mohemmGetBusinessCardEnabledList; - data['Mohemm_GetFavoriteReplacementsList'] = - this.mohemmGetFavoriteReplacementsList; - data['Mohemm_GetMobileDeviceInfobyEmpInfoList'] = - this.mohemmGetMobileDeviceInfobyEmpInfoList; + data['Mohemm_GetBusinessCardEnabledList'] = this.mohemmGetBusinessCardEnabledList; + data['Mohemm_GetFavoriteReplacementsList'] = this.mohemmGetFavoriteReplacementsList; + data['Mohemm_GetMobileDeviceInfobyEmpInfoList'] = this.mohemmGetMobileDeviceInfobyEmpInfoList; if (this.mohemmGetMobileLoginInfoList != null) { - data['Mohemm_GetMobileLoginInfoList'] = - this.mohemmGetMobileLoginInfoList!.map((v) => v.toJson()).toList(); + data['Mohemm_GetMobileLoginInfoList'] = this.mohemmGetMobileLoginInfoList!.map((v) => v.toJson()).toList(); } data['Mohemm_GetPatientID_List'] = this.mohemmGetPatientIDList; data['Mohemm_ITG_ResponseItem'] = this.mohemmITGResponseItem; - data['Mohemm_IsChangeIsActiveBusinessCardEnable'] = - this.mohemmIsChangeIsActiveBusinessCardEnable; - data['Mohemm_IsInsertBusinessCardEnable'] = - this.mohemmIsInsertBusinessCardEnable; + data['Mohemm_IsChangeIsActiveBusinessCardEnable'] = this.mohemmIsChangeIsActiveBusinessCardEnable; + data['Mohemm_IsInsertBusinessCardEnable'] = this.mohemmIsInsertBusinessCardEnable; data['Mohemm_Wifi_Password'] = this.mohemmWifiPassword; data['Mohemm_Wifi_SSID'] = this.mohemmWifiSSID; @@ -1877,13 +1703,11 @@ class GenericResponseModel { } if (notificationGetRespondAttributesList != null) { - data['NotificationGetRespondAttributesList'] = - notificationGetRespondAttributesList!.map((v) => v.toJson()).toList(); + data['NotificationGetRespondAttributesList'] = notificationGetRespondAttributesList!.map((v) => v.toJson()).toList(); } if (notificationRespondRolesList != null) { - data['NotificationRespondRolesList'] = - notificationRespondRolesList!.map((v) => v).toList(); + data['NotificationRespondRolesList'] = notificationRespondRolesList!.map((v) => v).toList(); } data['OracleOutPutNumber'] = this.oracleOutPutNumber; @@ -1900,55 +1724,47 @@ class GenericResponseModel { data['P_QUESTION'] = this.pQUESTION; data['P_SESSION_ID'] = this.pSESSIONID; data['P_Schema'] = this.pSchema; - data['PharmacyStock_AddPharmacyStockList'] = - this.pharmacyStockAddPharmacyStockList; + data['PharmacyStock_AddPharmacyStockList'] = this.pharmacyStockAddPharmacyStockList; data['PharmacyStock_GetOnHandList'] = this.pharmacyStockGetOnHandList; if (this.privilegeList != null) { - data['Privilege_List'] = - this.privilegeList!.map((v) => v.toJson()).toList(); + data['Privilege_List'] = this.privilegeList!.map((v) => v.toJson()).toList(); } data['ProcessTransactions'] = this.processTransactions; data['RegisterUserNameList'] = this.registerUserNameList; data['ReplacementList'] = this.replacementList; if (respondAttributesList != null) { - data['RespondAttributesList'] = - respondAttributesList!.map((v) => v.toJson()).toList(); + data['RespondAttributesList'] = respondAttributesList!.map((v) => v.toJson()).toList(); } data['RespondRolesList'] = this.respondRolesList; - data['ResubmitAbsenceTransactionList'] = - this.resubmitAbsenceTransactionList; + data['ResubmitAbsenceTransactionList'] = this.resubmitAbsenceTransactionList; data['ResubmitEITTransactionList'] = this.resubmitEITTransactionList; data['ResubmitHrTransactionList'] = this.resubmitHrTransactionList; data['SFH_GetPoNotificationBodyList'] = this.sFHGetPoNotificationBodyList; data['SFH_GetPrNotificationBodyList'] = this.sFHGetPrNotificationBodyList; if (this.startAbsenceApprovalProccess != null) { - data['StartAbsenceApprovalProccess'] = - this.startAbsenceApprovalProccess!.toJson(); + data['StartAbsenceApprovalProccess'] = this.startAbsenceApprovalProccess!.toJson(); } - data['StartAddressApprovalProcessList'] = - this.startAddressApprovalProcessList; + data['StartAddressApprovalProcessList'] = this.startAddressApprovalProcessList; data['StartBasicDetApprProcessList'] = this.startBasicDetApprProcessList; data['StartCeiApprovalProcess'] = this.startCeiApprovalProcess; - data['StartContactApprovalProcessList'] = - this.startContactApprovalProcessList; + data['StartContactApprovalProcessList'] = this.startContactApprovalProcessList; if (this.startEitApprovalProcess != null) { data['StartEitApprovalProcess'] = this.startEitApprovalProcess!.toJson(); } data['StartHrApprovalProcessList'] = this.startHrApprovalProcessList; - data['StartPhonesApprovalProcessList'] = - this.startPhonesApprovalProcessList; + data['StartPhonesApprovalProcessList'] = this.startPhonesApprovalProcessList; data['StartSitApprovalProcess'] = this.startSitApprovalProcess; - data['StartTermApprovalProcessList'] = this.startTermApprovalProcessList; + if (this.startTermApprovalProcessList != null) { + data['StartTermApprovalProcessList'] = this.startTermApprovalProcessList!.toJson(); + } if (this.submitAddressTransactionList != null) { - data['SubmitAddressTransactionList'] = - this.submitAddressTransactionList!.toJson(); + data['SubmitAddressTransactionList'] = this.submitAddressTransactionList!.toJson(); } if (this.submitBasicDetTransactionList != null) { - data['SubmitBasicDetTransactionList'] = - this.submitBasicDetTransactionList!.toJson(); + data['SubmitBasicDetTransactionList'] = this.submitBasicDetTransactionList!.toJson(); } data['SubmitCEITransactionList'] = this.submitCEITransactionList; @@ -1956,31 +1772,32 @@ class GenericResponseModel { data['SubmitContactTransactionList'] = this.submitContactTransactionList; if (this.submitEITTransactionList != null) { - data['SubmitEITTransactionList'] = - this.submitEITTransactionList!.toJson(); + data['SubmitEITTransactionList'] = this.submitEITTransactionList!.toJson(); } data['SubmitHrTransactionList'] = this.submitHrTransactionList; data['SubmitPhonesTransactionList'] = this.submitPhonesTransactionList; data['SubmitSITTransactionList'] = this.submitSITTransactionList; data['SubmitTermTransactionList'] = this.submitTermTransactionList; + + if (this.submitTermTransactionList != null) { + data['SubmitTermTransactionList'] = this.submitTermTransactionList!.toJson(); + } + data['SubordinatesOnLeavesList'] = this.subordinatesOnLeavesList; if (this.subordinatesOnLeavesList != null) { - data['SubordinatesOnLeavesList'] = - this.subordinatesOnLeavesList!.map((v) => v.toJson()).toList(); + data['SubordinatesOnLeavesList'] = this.subordinatesOnLeavesList!.map((v) => v.toJson()).toList(); } if (this.sumbitAbsenceTransactionList != null) { - data['SumbitAbsenceTransactionList'] = - this.sumbitAbsenceTransactionList!.toJson(); + data['SumbitAbsenceTransactionList'] = this.sumbitAbsenceTransactionList!.toJson(); } data['TokenID'] = this.tokenID; data['UpdateAttachmentList'] = this.updateAttachmentList; data['UpdateEmployeeImageList'] = this.updateEmployeeImageList; if (this.updateItemTypeSuccessList != null) { - data['UpdateItemTypeSuccessList'] = - this.updateItemTypeSuccessList!.map((v) => v.toJson()).toList(); + data['UpdateItemTypeSuccessList'] = this.updateItemTypeSuccessList!.map((v) => v.toJson()).toList(); } if (this.updateUserItemTypesList != null) { data['UpdateUserItemTypesList'] = this.updateUserItemTypesList!.toJson(); @@ -1993,22 +1810,19 @@ class GenericResponseModel { data['VHR_IsVerificationCodeValid'] = this.vHRIsVerificationCodeValid; if (validateAbsenceTransactionList != null) { - data['ValidateAbsenceTransactionList'] = - validateAbsenceTransactionList!.toJson(); + data['ValidateAbsenceTransactionList'] = validateAbsenceTransactionList!.toJson(); } if (validateEITTransactionList != null) { data['ValidateEITTransactionList'] = validateEITTransactionList!.toJson(); } data['ValidatePhonesTransactionList'] = this.validatePhonesTransactionList; if (vrItemTypesList != null) { - data['VrItemTypesList'] = - vrItemTypesList!.map((v) => v.toJson()).toList(); + data['VrItemTypesList'] = vrItemTypesList!.map((v) => v.toJson()).toList(); } if (wFLookUpList != null) { data['WFLookUpList'] = wFLookUpList!.map((v) => v.toJson()).toList(); } - data['eLearning_GET_EMPLOYEE_PROFILEList'] = - this.eLearningGETEMPLOYEEPROFILEList; + data['eLearning_GET_EMPLOYEE_PROFILEList'] = this.eLearningGETEMPLOYEEPROFILEList; data['eLearning_LOGINList'] = this.eLearningLOGINList; data['eLearning_ValidateLoginList'] = this.eLearningValidateLoginList; data['eLearning_Validate_LoginList'] = this.eLearningValidateLoginList; diff --git a/lib/models/submit_term_transaction_list_model.dart b/lib/models/submit_term_transaction_list_model.dart new file mode 100644 index 0000000..84c310a --- /dev/null +++ b/lib/models/submit_term_transaction_list_model.dart @@ -0,0 +1,24 @@ +class SubmitTermTransactionList { + String? pITEMKEY; + String? pRETURNMSG; + String? pRETURNSTATUS; + int? pTRANSACTIONID; + + SubmitTermTransactionList({this.pITEMKEY, this.pRETURNMSG, this.pRETURNSTATUS, this.pTRANSACTIONID}); + + SubmitTermTransactionList.fromJson(Map json) { + pITEMKEY = json['P_ITEM_KEY']; + pRETURNMSG = json['P_RETURN_MSG']; + pRETURNSTATUS = json['P_RETURN_STATUS']; + pTRANSACTIONID = json['P_TRANSACTION_ID']; + } + + Map toJson() { + Map data = new Map(); + data['P_ITEM_KEY'] = this.pITEMKEY; + data['P_RETURN_MSG'] = this.pRETURNMSG; + data['P_RETURN_STATUS'] = this.pRETURNSTATUS; + data['P_TRANSACTION_ID'] = this.pTRANSACTIONID; + return data; + } +} diff --git a/lib/models/termination/get_term_cols_structure_list_model.dart b/lib/models/termination/get_term_cols_structure_list_model.dart new file mode 100644 index 0000000..68fd349 --- /dev/null +++ b/lib/models/termination/get_term_cols_structure_list_model.dart @@ -0,0 +1,85 @@ +class GetTermColsStructureList { + String? aPPLICATIONCOLUMNNAME; + String? dATATYPE; + String? dISPLAYFLAG; + int? mAXIMUMSIZE; + String? oBJECTNAME; + String? oBJECTTYPE; + List? objectValuesList; + String? rEQUIREDFLAG; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? selectedValue; + ObjectValuesList? selectedObjectValue; + + GetTermColsStructureList( + {this.aPPLICATIONCOLUMNNAME, + this.dATATYPE, + this.dISPLAYFLAG, + this.mAXIMUMSIZE, + this.oBJECTNAME, + this.oBJECTTYPE, + this.objectValuesList, + this.rEQUIREDFLAG, + this.sEGMENTPROMPT, + this.selectedValue, + this.selectedObjectValue, + this.sEGMENTSEQNUM}); + + GetTermColsStructureList.fromJson(Map json) { + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + dATATYPE = json['DATATYPE']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + mAXIMUMSIZE = json['MAXIMUM_SIZE']; + oBJECTNAME = json['OBJECT_NAME']; + oBJECTTYPE = json['OBJECT_TYPE']; + objectValuesList = []; + if (json['ObjectValuesList'] != null) { + json['ObjectValuesList'].forEach((v) { + objectValuesList!.add(new ObjectValuesList.fromJson(v)); + }); + } + rEQUIREDFLAG = json['REQUIRED_FLAG']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + } + + Map toJson() { + Map data = new Map(); + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['DATATYPE'] = this.dATATYPE; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE; + data['OBJECT_NAME'] = this.oBJECTNAME; + data['OBJECT_TYPE'] = this.oBJECTTYPE; + if (this.objectValuesList != null) { + data['ObjectValuesList'] = this.objectValuesList!.map((v) => v.toJson()).toList(); + } + data['REQUIRED_FLAG'] = this.rEQUIREDFLAG; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + return data; + } +} + +class ObjectValuesList { + String? cODE; + String? dESCRIPTION; + String? mEANING; + + ObjectValuesList({this.cODE, this.dESCRIPTION, this.mEANING}); + + ObjectValuesList.fromJson(Map json) { + cODE = json['CODE']; + dESCRIPTION = json['DESCRIPTION']; + mEANING = json['MEANING']; + } + + Map toJson() { + Map data = new Map(); + data['CODE'] = this.cODE; + data['DESCRIPTION'] = this.dESCRIPTION; + data['MEANING'] = this.mEANING; + return data; + } +} diff --git a/lib/models/termination/get_term_dff_structure_list_model.dart b/lib/models/termination/get_term_dff_structure_list_model.dart new file mode 100644 index 0000000..3217acf --- /dev/null +++ b/lib/models/termination/get_term_dff_structure_list_model.dart @@ -0,0 +1,280 @@ +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart'; + +class GetTermDffStructureList { + String? aLPHANUMERICALLOWEDFLAG; + String? aPPLICATIONCOLUMNNAME; + String? cHILDSEGMENTSVS; + List? cHILDSEGMENTSVSSplited; + String? dEFAULTTYPE; + String? dEFAULTVALUE; + String? dESCFLEXCONTEXTCODE; + String? dESCFLEXCONTEXTNAME; + String? dESCFLEXNAME; + String? dISPLAYFLAG; + String? eNABLEDFLAG; + ESERVICESDV? eSERVICESDV; + List? eSERVICESVS; + String? fLEXVALUESETNAME; + String? fORMATTYPE; + String? fORMATTYPEDSP; + String? lONGLISTFLAG; + int? mAXIMUMSIZE; + String? mAXIMUMVALUE; + String? mINIMUMVALUE; + String? mOBILEENABLED; + String? nUMBERPRECISION; + String? nUMERICMODEENABLEDFLAG; + String? pARENTSEGMENTSDV; + List? pARENTSEGMENTSDVSplited; + String? pARENTSEGMENTSVS; + List? pARENTSEGMENTSVSSplitedVS; + String? rEADONLY; + String? rEQUIREDFLAG; + String? sEGMENTNAME; + String? sEGMENTPROMPT; + int? sEGMENTSEQNUM; + String? uPPERCASEONLYFLAG; + String? uSEDFLAG; + String? vALIDATIONTYPE; + String? vALIDATIONTYPEDSP; + + GetTermDffStructureList( + {this.aLPHANUMERICALLOWEDFLAG, + this.aPPLICATIONCOLUMNNAME, + this.cHILDSEGMENTSVS, + this.cHILDSEGMENTSVSSplited, + this.dEFAULTTYPE, + this.dEFAULTVALUE, + this.dESCFLEXCONTEXTCODE, + this.dESCFLEXCONTEXTNAME, + this.dESCFLEXNAME, + this.dISPLAYFLAG, + this.eNABLEDFLAG, + this.eSERVICESDV, + this.eSERVICESVS, + this.fLEXVALUESETNAME, + this.fORMATTYPE, + this.fORMATTYPEDSP, + this.lONGLISTFLAG, + this.mAXIMUMSIZE, + this.mAXIMUMVALUE, + this.mINIMUMVALUE, + this.mOBILEENABLED, + this.nUMBERPRECISION, + this.nUMERICMODEENABLEDFLAG, + this.pARENTSEGMENTSDV, + this.pARENTSEGMENTSDVSplited, + this.pARENTSEGMENTSVS, + this.pARENTSEGMENTSVSSplitedVS, + this.rEADONLY, + this.rEQUIREDFLAG, + this.sEGMENTNAME, + this.sEGMENTPROMPT, + this.sEGMENTSEQNUM, + this.uPPERCASEONLYFLAG, + this.uSEDFLAG, + this.vALIDATIONTYPE, + this.vALIDATIONTYPEDSP}); + + GetTermDffStructureList.fromJson(Map json) { + aLPHANUMERICALLOWEDFLAG = json['ALPHANUMERIC_ALLOWED_FLAG']; + aPPLICATIONCOLUMNNAME = json['APPLICATION_COLUMN_NAME']; + cHILDSEGMENTSVS = json['CHILD_SEGMENTS_VS']; + cHILDSEGMENTSVSSplited = json['CHILD_SEGMENTS_VS_Splited'] == null ? [] : json['CHILD_SEGMENTS_VS_Splited'].cast(); + dEFAULTTYPE = json['DEFAULT_TYPE']; + dEFAULTVALUE = json['DEFAULT_VALUE']; + dESCFLEXCONTEXTCODE = json['DESC_FLEX_CONTEXT_CODE']; + dESCFLEXCONTEXTNAME = json['DESC_FLEX_CONTEXT_NAME']; + dESCFLEXNAME = json['DESC_FLEX_NAME']; + dISPLAYFLAG = json['DISPLAY_FLAG']; + eNABLEDFLAG = json['ENABLED_FLAG']; + eSERVICESDV = json['E_SERVICES_DV'] != null ? new ESERVICESDV.fromJson(json['E_SERVICES_DV']) : null; + if (json['E_SERVICES_VS'] != null) { + eSERVICESVS = []; + json['E_SERVICES_VS'].forEach((v) { + eSERVICESVS!.add(ESERVICESVS.fromJson(v)); + }); + } + fLEXVALUESETNAME = json['FLEX_VALUE_SET_NAME']; + fORMATTYPE = json['FORMAT_TYPE']; + fORMATTYPEDSP = json['FORMAT_TYPE_DSP']; + lONGLISTFLAG = json['LONGLIST_FLAG']; + mAXIMUMSIZE = json['MAXIMUM_SIZE']; + mAXIMUMVALUE = json['MAXIMUM_VALUE']; + mINIMUMVALUE = json['MINIMUM_VALUE']; + mOBILEENABLED = json['MOBILE_ENABLED']; + nUMBERPRECISION = json['NUMBER_PRECISION']; + nUMERICMODEENABLEDFLAG = json['NUMERIC_MODE_ENABLED_FLAG']; + pARENTSEGMENTSDV = json['PARENT_SEGMENTS_DV']; + if (json['PARENT_SEGMENTS_DV_Splited'] != null) { + pARENTSEGMENTSDVSplited = []; + json['PARENT_SEGMENTS_DV_Splited'].forEach((v) { + pARENTSEGMENTSDVSplited!.add(PARENTSEGMENTSDVSplited.fromJson(v)); + }); + } + pARENTSEGMENTSVS = json['PARENT_SEGMENTS_VS']; + if (json['PARENT_SEGMENTS_VS_SplitedVS'] != null) { + pARENTSEGMENTSVSSplitedVS = []; + json['PARENT_SEGMENTS_VS_SplitedVS'].forEach((v) { + pARENTSEGMENTSVSSplitedVS!.add(PARENTSEGMENTSVSSplitedVS.fromJson(v)); + }); + } + rEADONLY = json['READ_ONLY']; + rEQUIREDFLAG = json['REQUIRED_FLAG']; + sEGMENTNAME = json['SEGMENT_NAME']; + sEGMENTPROMPT = json['SEGMENT_PROMPT']; + sEGMENTSEQNUM = json['SEGMENT_SEQ_NUM']; + uPPERCASEONLYFLAG = json['UPPERCASE_ONLY_FLAG']; + uSEDFLAG = json['USED_FLAG']; + vALIDATIONTYPE = json['VALIDATION_TYPE']; + vALIDATIONTYPEDSP = json['VALIDATION_TYPE_DSP']; + } + + Map toJson() { + Map data = new Map(); + data['ALPHANUMERIC_ALLOWED_FLAG'] = this.aLPHANUMERICALLOWEDFLAG; + data['APPLICATION_COLUMN_NAME'] = this.aPPLICATIONCOLUMNNAME; + data['CHILD_SEGMENTS_VS'] = this.cHILDSEGMENTSVS; + data['CHILD_SEGMENTS_VS_Splited'] = this.cHILDSEGMENTSVSSplited; + data['DEFAULT_TYPE'] = this.dEFAULTTYPE; + data['DEFAULT_VALUE'] = this.dEFAULTVALUE; + data['DESC_FLEX_CONTEXT_CODE'] = this.dESCFLEXCONTEXTCODE; + data['DESC_FLEX_CONTEXT_NAME'] = this.dESCFLEXCONTEXTNAME; + data['DESC_FLEX_NAME'] = this.dESCFLEXNAME; + data['DISPLAY_FLAG'] = this.dISPLAYFLAG; + data['ENABLED_FLAG'] = this.eNABLEDFLAG; + if (this.eSERVICESDV != null) { + data['E_SERVICES_DV'] = this.eSERVICESDV!.toJson(); + } + if (this.eSERVICESVS != null) { + data['E_SERVICES_VS'] = this.eSERVICESVS!.map((v) => v.toJson()).toList(); + } + data['FLEX_VALUE_SET_NAME'] = this.fLEXVALUESETNAME; + data['FORMAT_TYPE'] = this.fORMATTYPE; + data['FORMAT_TYPE_DSP'] = this.fORMATTYPEDSP; + data['LONGLIST_FLAG'] = this.lONGLISTFLAG; + data['MAXIMUM_SIZE'] = this.mAXIMUMSIZE; + data['MAXIMUM_VALUE'] = this.mAXIMUMVALUE; + data['MINIMUM_VALUE'] = this.mINIMUMVALUE; + data['MOBILE_ENABLED'] = this.mOBILEENABLED; + data['NUMBER_PRECISION'] = this.nUMBERPRECISION; + data['NUMERIC_MODE_ENABLED_FLAG'] = this.nUMERICMODEENABLEDFLAG; + data['PARENT_SEGMENTS_DV'] = this.pARENTSEGMENTSDV; + if (this.pARENTSEGMENTSDVSplited != null) { + data['PARENT_SEGMENTS_DV_Splited'] = this.pARENTSEGMENTSDVSplited!.map((v) => v.toJson()).toList(); + } + data['PARENT_SEGMENTS_VS'] = this.pARENTSEGMENTSVS; + if (this.pARENTSEGMENTSVSSplitedVS != null) { + data['PARENT_SEGMENTS_VS_SplitedVS'] = this.pARENTSEGMENTSVSSplitedVS!.map((v) => v.toJson()).toList(); + } + data['READ_ONLY'] = this.rEADONLY; + data['REQUIRED_FLAG'] = this.rEQUIREDFLAG; + data['SEGMENT_NAME'] = this.sEGMENTNAME; + data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT; + data['SEGMENT_SEQ_NUM'] = this.sEGMENTSEQNUM; + data['UPPERCASE_ONLY_FLAG'] = this.uPPERCASEONLYFLAG; + data['USED_FLAG'] = this.uSEDFLAG; + data['VALIDATION_TYPE'] = this.vALIDATIONTYPE; + data['VALIDATION_TYPE_DSP'] = this.vALIDATIONTYPEDSP; + return data; + } + + bool get isDefaultTypeIsCDPS => (dEFAULTTYPE == "C" || dEFAULTTYPE == "D" || dEFAULTTYPE == "P" || dEFAULTTYPE == "S"); +} + +class ESERVICESDV { + String? pIDCOLUMNNAME; + String? pRETURNMSG; + String? pRETURNSTATUS; + String? pVALUECOLUMNNAME; + + ESERVICESDV({this.pIDCOLUMNNAME, this.pRETURNMSG, this.pRETURNSTATUS, this.pVALUECOLUMNNAME}); + + ESERVICESDV.fromJson(Map json) { + pIDCOLUMNNAME = json['P_ID_COLUMN_NAME']; + pRETURNMSG = json['P_RETURN_MSG']; + pRETURNSTATUS = json['P_RETURN_STATUS']; + pVALUECOLUMNNAME = json['P_VALUE_COLUMN_NAME']; + } + + Map toJson() { + Map data = new Map(); + data['P_ID_COLUMN_NAME'] = this.pIDCOLUMNNAME; + data['P_RETURN_MSG'] = this.pRETURNMSG; + data['P_RETURN_STATUS'] = this.pRETURNSTATUS; + data['P_VALUE_COLUMN_NAME'] = this.pVALUECOLUMNNAME; + return data; + } +} + +// class ESERVICESVS { +// String? dESCRIPTION; +// int? fROMROWNUM; +// String? iDCOLUMNNAME; +// int? nOOFROWS; +// int? rOWNUM; +// int? tOROWNUM; +// String? vALUECOLUMNNAME; +// +// ESERVICESVS({this.dESCRIPTION, this.fROMROWNUM, this.iDCOLUMNNAME, this.nOOFROWS, this.rOWNUM, this.tOROWNUM, this.vALUECOLUMNNAME}); +// +// ESERVICESVS.fromJson(Map json) { +// dESCRIPTION = json['DESCRIPTION']; +// fROMROWNUM = json['FROM_ROW_NUM']; +// iDCOLUMNNAME = json['ID_COLUMN_NAME']; +// nOOFROWS = json['NO_OF_ROWS']; +// rOWNUM = json['ROW_NUM']; +// tOROWNUM = json['TO_ROW_NUM']; +// vALUECOLUMNNAME = json['VALUE_COLUMN_NAME']; +// } +// +// Map toJson() { +// Map data = new Map(); +// data['DESCRIPTION'] = this.dESCRIPTION; +// data['FROM_ROW_NUM'] = this.fROMROWNUM; +// data['ID_COLUMN_NAME'] = this.iDCOLUMNNAME; +// data['NO_OF_ROWS'] = this.nOOFROWS; +// data['ROW_NUM'] = this.rOWNUM; +// data['TO_ROW_NUM'] = this.tOROWNUM; +// data['VALUE_COLUMN_NAME'] = this.vALUECOLUMNNAME; +// return data; +// } +// } + +class PARENTSEGMENTSDVSplited { + String? isRequired; + String? name; + + PARENTSEGMENTSDVSplited({this.isRequired, this.name}); + + PARENTSEGMENTSDVSplited.fromJson(Map json) { + isRequired = json['IsRequired']; + name = json['Name']; + } + + Map toJson() { + Map data = new Map(); + data['IsRequired'] = this.isRequired; + data['Name'] = this.name; + return data; + } +} + +class PARENTSEGMENTSVSSplitedVS { + String? isRequired; + String? name; + + PARENTSEGMENTSVSSplitedVS({this.isRequired, this.name}); + + PARENTSEGMENTSVSSplitedVS.fromJson(Map json) { + isRequired = json['IsRequired']; + name = json['Name']; + } + + Map toJson() { + Map data = new Map(); + data['IsRequired'] = this.isRequired; + data['Name'] = this.name; + return data; + } +} diff --git a/lib/start_term_approval_process_list_model.dart b/lib/start_term_approval_process_list_model.dart new file mode 100644 index 0000000..060a875 --- /dev/null +++ b/lib/start_term_approval_process_list_model.dart @@ -0,0 +1,18 @@ +class StartTermApprovalProcessList { + String? pRETURNMSG; + String? pRETURNSTATUS; + + StartTermApprovalProcessList({this.pRETURNMSG, this.pRETURNSTATUS}); + + StartTermApprovalProcessList.fromJson(Map json) { + pRETURNMSG = json['P_RETURN_MSG']; + pRETURNSTATUS = json['P_RETURN_STATUS']; + } + + Map toJson() { + Map data = new Map(); + data['P_RETURN_MSG'] = this.pRETURNMSG; + data['P_RETURN_STATUS'] = this.pRETURNSTATUS; + return data; + } +} diff --git a/lib/ui/misc/request_submit_screen.dart b/lib/ui/misc/request_submit_screen.dart index 4d3d341..8ca9a0c 100644 --- a/lib/ui/misc/request_submit_screen.dart +++ b/lib/ui/misc/request_submit_screen.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/api/leave_balance_api_client.dart'; import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; import 'package:mohem_flutter_app/api/profile_api_client.dart'; +import 'package:mohem_flutter_app/api/termination_dff_api_client.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; @@ -67,7 +68,7 @@ class _RequestSubmitScreenState extends State { } void submitRequest() async { - // try { + try { Utils.showLoading(context); List> list = []; if (attachmentFiles.isNotEmpty) { @@ -128,16 +129,23 @@ class _RequestSubmitScreenState extends State { params!.pItemId, params!.transactionId, ); + }else if (params!.approvalFlag == 'endEmployment') { + await TerminationDffApiClient().startTermApprovalProcess( + LocaleKeys.submit.tr(), + comments.text, + params!.pItemId, + params!.transactionId, + ); } else {} Utils.hideLoading(context); Utils.showToast(LocaleKeys.yourRequestHasBeenSubmittedForApprovals.tr(), longDuration: true); Navigator.of(context).popUntil((route) => route.settings.name == AppRoutes.dashboard); Navigator.pushNamed(context, AppRoutes.workList); - // } catch (ex) { - // Utils.hideLoading(context); - // Utils.handleException(ex, context, null); - // } + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } } @override diff --git a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart index 17c5f7d..0a6c9d4 100644 --- a/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart +++ b/lib/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/leave_balance_api_client.dart'; import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/config/routes.dart'; @@ -92,7 +93,11 @@ class _DynamicInputScreenState extends State { genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values); SubmitEITTransactionList submitEITTransactionList = await MyAttendanceApiClient().submitEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values); Utils.hideLoading(context); - Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams("title", submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit')); + await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, + arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit')); + Utils.showLoading(context); + await LeaveBalanceApiClient().cancelHrTransaction(submitEITTransactionList.pTRANSACTIONID!); + Utils.hideLoading(context); } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); @@ -104,26 +109,26 @@ class _DynamicInputScreenState extends State { Future calGetValueSetValues(GetEITDFFStructureList structureList) async { try { - Utils.showLoading(context); - String segmentId = structureList.cHILDSEGMENTSVS!; - if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; - - List filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? []; - List> values = filteredList - .map((e) => GetSetValuesRequestModel( - sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) - .toJson()) - .toList(); - List eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); - List abc = genericResponseModel?.getEITDFFStructureList ?? []; - getEitDffStructureList = abc; - int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); - getEitDffStructureList![index].eSERVICESVS!.clear(); - if (eServicesResponseModel.isNotEmpty) getEitDffStructureList![index].eSERVICESVS!.addAll(eServicesResponseModel); - // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; - //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); - Utils.hideLoading(context); - setState(() {}); + Utils.showLoading(context); + String segmentId = structureList.cHILDSEGMENTSVS!; + if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; + + List filteredList = getEitDffStructureList?.where((element) => element.cHILDSEGMENTSVSSplited!.contains(segmentId)).toList() ?? []; + List> values = filteredList + .map((e) => GetSetValuesRequestModel( + sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) + .toJson()) + .toList(); + List eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + List abc = genericResponseModel?.getEITDFFStructureList ?? []; + getEitDffStructureList = abc; + int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); + getEitDffStructureList![index].eSERVICESVS!.clear(); + if (eServicesResponseModel.isNotEmpty) getEitDffStructureList![index].eSERVICESVS!.addAll(eServicesResponseModel); + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + Utils.hideLoading(context); + setState(() {}); } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); diff --git a/lib/ui/my_attendance/services_menu_list_screen.dart b/lib/ui/my_attendance/services_menu_list_screen.dart index fe82058..4e0c584 100644 --- a/lib/ui/my_attendance/services_menu_list_screen.dart +++ b/lib/ui/my_attendance/services_menu_list_screen.dart @@ -56,7 +56,14 @@ class ServicesMenuListScreen extends StatelessWidget { Navigator.pushNamed(context, AppRoutes.leaveBalance); return; } - Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!)); + if (servicesMenuData.list[index].requestType == "EIT") { + Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!)); + } else { + if (servicesMenuData.list[index].requestType == "TERMINATION") { + Navigator.pushNamed(context, AppRoutes.endEmploymentScreen, arguments: DynamicListViewParams(servicesMenuData.list[index].prompt!, servicesMenuData.list[index].functionName!)); + + } + } }), separatorBuilder: (cxt, index) => 12.height, itemCount: servicesMenuData.list.length), diff --git a/lib/ui/termination/end_employement.dart b/lib/ui/termination/end_employement.dart new file mode 100644 index 0000000..6fbfa61 --- /dev/null +++ b/lib/ui/termination/end_employement.dart @@ -0,0 +1,625 @@ +import 'dart:io'; + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/leave_balance_api_client.dart'; +import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; +import 'package:mohem_flutter_app/api/termination_dff_api_client.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/dyanmic_forms/get_set_values_request_model.dart'; +import 'package:mohem_flutter_app/models/dyanmic_forms/validate_eit_transaction_model.dart'; +import 'package:mohem_flutter_app/models/get_eit_dff_structure_list_model.dart' as dff; +import 'package:mohem_flutter_app/models/submit_term_transaction_list_model.dart'; +import 'package:mohem_flutter_app/models/termination/get_term_cols_structure_list_model.dart'; +import 'package:mohem_flutter_app/models/termination/get_term_dff_structure_list_model.dart'; +import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; +import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; + +class EndEmploymentScreen extends StatefulWidget { + EndEmploymentScreen({Key? key}) : super(key: key); + + @override + _EndEmploymentScreenState createState() { + return _EndEmploymentScreenState(); + } +} + +class _EndEmploymentScreenState extends State { + List? termColsList; + List? termDffList; + DynamicListViewParams? dynamicParams; + + @override + void initState() { + super.initState(); + } + + void getTerminationDffStructure() async { + try { + Utils.showLoading(context); + List results = await Future.wait([ + TerminationDffApiClient().getTermColsStructure(), + TerminationDffApiClient().getTermDffStructure(dynamicParams!.dynamicId, null), + ]); + termColsList = results[0]; + termDffList = results[1]; + termColsList = termColsList?.where((element) => element.dISPLAYFLAG == 'Y').toList() ?? []; + termDffList = termDffList?.where((element) => element.dISPLAYFLAG == 'Y').toList() ?? []; + + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + void validateTransaction() { + String errorMessage = ""; + for (var element in termColsList!) { + if (element.rEQUIREDFLAG == "Y") { + if (element.objectValuesList!.isEmpty) { + if ((element.selectedValue ?? "").isEmpty) { + errorMessage = element.sEGMENTPROMPT!; + break; + } + } else { + if (element.selectedObjectValue == null) { + errorMessage = element.sEGMENTPROMPT!; + break; + } + } + } + } + if (errorMessage.isEmpty) { + for (var element in termDffList!) { + if (element.rEQUIREDFLAG == "Y") { + if (element.eSERVICESDV?.pVALUECOLUMNNAME == null) { + errorMessage = element.sEGMENTPROMPT!; + break; + } + } + } + } + if (errorMessage.isNotEmpty) { + Utils.showToast(LocaleKeys.fieldIsEmpty.tr(namedArgs: {'data': errorMessage})); + } else { + submitTransaction(); + } + } + + void submitTransaction() async { + try { + Utils.showLoading(context); + List> values = termDffList!.map((e) { + String tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; + if (e.fORMATTYPE == "X") { + // for date format type, date format is changed + tempVar = e.eSERVICESDV?.pIDCOLUMNNAME ?? ""; + if (tempVar.isNotEmpty) { + if (!tempVar.contains("/")) { + DateTime date = DateFormat('yyyy-MM-dd').parse(tempVar); + tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date); + } + } + } + return ValidateEitTransactionModel(dATEVALUE: null, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: tempVar.toString()).toJson(); + }).toList(); + termColsList!.forEach((element) { + String? value = ""; + ValidateEitTransactionModel model = ValidateEitTransactionModel(nAME: element.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1); + if (element.dATATYPE == "DATE") { + value = element.selectedValue == null ? null : Utils.formatDate(DateTime.parse(element.selectedValue!).toString()); + model.dATEVALUE = value; + } else if (element.dATATYPE == "VARCHAR2") { + if (element.objectValuesList!.isEmpty) { + value = element.selectedValue; + } else { + value = element.selectedObjectValue?.cODE; + } + model.vARCHAR2VALUE = value; + } + + values.add(model.toJson()); + }); + + SubmitTermTransactionList submitTermTransaction = await TerminationDffApiClient().submitTermTransaction(dynamicParams!.dynamicId, values); + Utils.hideLoading(context); + await Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, + arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), submitTermTransaction.pTRANSACTIONID!, submitTermTransaction.pITEMKEY!, "endEmployment")); + Utils.showLoading(context); + await LeaveBalanceApiClient().cancelHrTransaction(submitTermTransaction.pTRANSACTIONID!); + Utils.hideLoading(context); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + void dispose() { + super.dispose(); + } + + String dESCFLEXCONTEXTCODE = ""; + String descFlexConTextTitle = ""; + + Future calGetValueSetValues(GetTermDffStructureList structureList) async { + try { + Utils.showLoading(context); + String segmentId = structureList.cHILDSEGMENTSVS!; + if (dESCFLEXCONTEXTCODE.isEmpty) dESCFLEXCONTEXTCODE = structureList.dESCFLEXCONTEXTCODE!; + + List filteredList = termDffList?.where((element) => element.cHILDSEGMENTSVS == segmentId).toList() ?? []; + List> values = filteredList + .map((e) => GetSetValuesRequestModel( + sEGMENTNAME: e.sEGMENTNAME, vALUECOLUMNNAME: e.eSERVICESDV!.pVALUECOLUMNNAME, dESCRIPTION: "", iDCOLUMNNAME: e.eSERVICESDV!.pIDCOLUMNNAME, fLEXVALUESETNAME: e.fLEXVALUESETNAME) + .toJson()) + .toList(); + + List eServicesResponseModel = await MyAttendanceApiClient().getValueSetValues(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values); + List abc = termDffList ?? []; + termDffList = abc; + int index = termDffList!.indexWhere((element) => element.sEGMENTNAME == structureList.cHILDSEGMENTSVS); + termDffList![index].eSERVICESVS!.clear(); + if (eServicesResponseModel.isNotEmpty) termDffList![index].eSERVICESVS!.addAll(eServicesResponseModel); + // getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? []; + //getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList(); + Utils.hideLoading(context); + setState(() {}); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } + + @override + Widget build(BuildContext context) { + if (dynamicParams == null) { + dynamicParams = ModalRoute.of(context)!.settings.arguments as DynamicListViewParams; + getTerminationDffStructure(); + } + + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBarWidget(context, title: dynamicParams!.title), + body: Column( + children: [ + (termColsList == null && termDffList == null + ? const SizedBox() + : (((termColsList?.length ?? 0) + (termDffList?.length ?? 0)) < 1 + ? Utils.getNoDataWidget(context) + : ListView( + physics: const BouncingScrollPhysics(), + padding: const EdgeInsets.all(21), + children: [ + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, int index) => termColWidget(termColsList![index]), + separatorBuilder: (cxt, index) => 12.height, + itemCount: termColsList!.length, + ), + 12.height, + ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (cxt, int index) => dffColWidget(termDffList![index], index), + separatorBuilder: (cxt, index) => 12.height, + itemCount: termDffList!.length, + ), + ], + ))) + .expanded, + DefaultButton( + LocaleKeys.next.tr(), + (((termColsList?.length ?? 0) + (termDffList?.length ?? 0)) < 1) + ? null + : () { + validateTransaction(); + }, + ).insideContainer, + ], + ), + ); + } + + Widget termColWidget(GetTermColsStructureList termColObject) { + if (termColObject.dATATYPE == "VARCHAR2") { + if (termColObject.objectValuesList!.isEmpty) { + return DynamicTextFieldWidget( + (termColObject.sEGMENTPROMPT ?? "") + (termColObject.rEQUIREDFLAG == "Y" ? "*" : ""), + termColObject.selectedValue ?? "", + onChange: (text) { + termColObject.selectedValue = text; + }, + ); + } + return PopupMenuButton( + child: DynamicTextFieldWidget( + (termColObject.sEGMENTPROMPT ?? "") + (termColObject.rEQUIREDFLAG == "Y" ? "*" : ""), + termColObject.selectedObjectValue?.mEANING ?? LocaleKeys.pleaseSelect.tr(), + isEnable: false, + isPopup: true, + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + for (int i = 0; i < termColObject.objectValuesList!.length; i++) PopupMenuItem(value: i, child: Text(termColObject.objectValuesList![i].mEANING ?? "")), + ], + onSelected: (int popipIndex) async { + termColObject.selectedObjectValue = termColObject.objectValuesList![popipIndex]; + print(termColObject.selectedObjectValue?.toJson()); + setState(() {}); + }); + } + if (termColObject.dATATYPE == "DATE") { + return DynamicTextFieldWidget( + (termColObject.sEGMENTPROMPT ?? "") + (termColObject.rEQUIREDFLAG == "Y" ? "*" : ""), + (termColObject.selectedValue != null) ? Utils.getMonthNamedFormat(DateTime.parse(termColObject.selectedValue!)) : LocaleKeys.pleaseSelectDate.tr(), + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + DateTime? selectedDate; + if (termColObject.selectedValue == null) { + selectedDate = DateTime.now(); + } else { + selectedDate = DateTime.parse(termColObject.selectedValue!); + } + DateTime date = await Utils.selectDate(context, selectedDate); + termColObject.selectedValue = date.toString(); + setState(() {}); + }, + ); + } + return const SizedBox(); + } + + Widget dffColWidget(GetTermDffStructureList model, int index) { + if (model.dISPLAYFLAG != "N") { + if (model.vALIDATIONTYPE == "N") { + if (model.fORMATTYPE == "C") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + isReadOnly: model.rEADONLY == "Y", + onChange: (text) { + model.eSERVICESDV ??= ESERVICESDV(); + model.eSERVICESDV!.pIDCOLUMNNAME = text; + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "N") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + isReadOnly: model.rEADONLY == "Y", + isInputTypeNum: true, + onChange: (text) { + model.eSERVICESDV ??= ESERVICESDV(); + model.eSERVICESDV!.pIDCOLUMNNAME = text; + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "X") { + String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? (""); + + if (termDffList![index].isDefaultTypeIsCDPS) { + if (displayText.contains(" 00:00:00")) { + displayText = displayText.replaceAll(" 00:00:00", ""); + } + if (displayText.contains("/")) { + displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText)); + } + } + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + displayText, + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { + if (termDffList![index].isDefaultTypeIsCDPS) { + selectedDate = DateFormat("yyyy/MM/dd").parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); + } else { + selectedDate = DateTime.parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!); + } + } + DateTime date = await _selectDate(context); + String dateString = date.toString().split(' ').first; + // DateTime date1 = DateTime(date.year, date.month, date.day); + // getEitDffStructureList![index].fieldAnswer = date.toString(); + ESERVICESDV eservicesdv; + if (termDffList![index].isDefaultTypeIsCDPS) { + eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: Utils.formatDate(dateString), + pRETURNMSG: "null", + pRETURNSTATUS: termDffList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + } else { + eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: dateString, + pRETURNMSG: "null", + pRETURNSTATUS: termDffList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + } + termDffList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "Y") { + String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? ""; + // if (termDffList![index].isDefaultTypeIsCDPS) { + // displayText = Utils.reverseFormatDate(displayText); + // // if (displayText.contains(" 00:00:00")) { + // // displayText = displayText.replaceAll(" 00:00:00", ""); + // // } + // // if (!displayText.contains("-")) { + // // displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText)); + // // } + // } + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + displayText, + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { + if (termDffList![index].isDefaultTypeIsCDPS) { + String tempDate = termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!; + if (tempDate.contains("00:00:00")) { + tempDate = tempDate.replaceAll("00:00:00", '').trim(); + } + if (tempDate.contains("/")) { + selectedDate = DateFormat("yyyy/MM/dd").parse(tempDate); + } else { + selectedDate = DateFormat("yyyy-MM-dd").parse(tempDate); + } + } else { + selectedDate = DateTime.parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!); + } + } + DateTime date = await _selectDate(context); + String dateString = date.toString().split(' ').first; + // getEitDffStructureList![index].fieldAnswer = date.toString(); + ESERVICESDV eservicesdv; + if (termDffList![index].isDefaultTypeIsCDPS) { + eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: Utils.formatDate(dateString), + pRETURNMSG: "null", + pRETURNSTATUS: termDffList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + } else { + eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: dateString, + pRETURNMSG: "null", + pRETURNSTATUS: termDffList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + } + + termDffList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + }, + ).paddingOnly(bottom: 12); + } + } else { + return PopupMenuButton( + child: DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pVALUECOLUMNNAME ?? LocaleKeys.pleaseSelect.tr(), + isEnable: false, + isPopup: true, + isInputTypeNum: true, + isReadOnly: model.rEADONLY == "Y", + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + if (model.rEADONLY != "Y") + for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), + ], + onSelected: (int popipIndex) async { + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME, + pRETURNMSG: "null", + pRETURNSTATUS: "null", //getEitDffStructureList![popipIndex].dEFAULTVALUE, + pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME); + termDffList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + }); + } + } else { + return const SizedBox(); + } + if (model.fORMATTYPE == "N") { + if (model.eSERVICESVS?.isNotEmpty ?? false) { + return PopupMenuButton( + child: DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pVALUECOLUMNNAME ?? "", + isEnable: false, + isPopup: true, + isInputTypeNum: true, + isReadOnly: model.rEADONLY == "Y", + ).paddingOnly(bottom: 12), + itemBuilder: (_) => >[ + if (model.rEADONLY != "Y") + for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem(value: i, child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!)), + ], + onSelected: (int popipIndex) async { + ESERVICESDV eservicesdv = + ESERVICESDV(pIDCOLUMNNAME: model.eSERVICESVS![popipIndex].iDCOLUMNNAME, pRETURNMSG: "null", pRETURNSTATUS: "null", pVALUECOLUMNNAME: model.eSERVICESVS![popipIndex].vALUECOLUMNNAME); + termDffList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + }); + } + + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + isReadOnly: model.rEADONLY == "Y", + onChange: (text) { + //model.fieldAnswer = text; + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "X" || model.fORMATTYPE == "Y") { + String displayText = model.eSERVICESDV?.pIDCOLUMNNAME ?? ""; + if (termDffList![index].isDefaultTypeIsCDPS) { + if (displayText.contains(" 00:00:00")) { + displayText = displayText.replaceAll(" 00:00:00", ""); + } + if (!displayText.contains("-")) { + displayText = DateFormat('yyyy-MM-dd').format(DateFormat("yyyy/MM/dd").parse(displayText)); + } + } + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + displayText, + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { + if (termDffList![index].isDefaultTypeIsCDPS) { + selectedDate = DateFormat("yyyy/MM/dd").parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!.replaceAll('/"', '').replaceAll(" 00:00:00", "")); + } else { + selectedDate = DateTime.parse(termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!); + } + } + DateTime date = await _selectDate(context); + String dateString = date.toString().split(' ').first; + // termDffList![index].fieldAnswer = date.toString(); + ESERVICESDV eservicesdv = ESERVICESDV( + pIDCOLUMNNAME: dateString, + pRETURNMSG: "null", + pRETURNSTATUS: termDffList![index].dEFAULTVALUE, + pVALUECOLUMNNAME: termDffList![index].isDefaultTypeIsCDPS ? Utils.reverseFormatStandardDate(Utils.formatDate(dateString)) : DateFormat('yyyy-MM-ddThh:mm:ss.s').format(date)); + termDffList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + }, + ).paddingOnly(bottom: 12); + } else if (model.fORMATTYPE == "I") { + return DynamicTextFieldWidget( + (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), + model.eSERVICESDV?.pIDCOLUMNNAME ?? "", + suffixIconData: Icons.access_time_filled_rounded, + isEnable: false, + onTap: () async { + if ((termDffList![index].eSERVICESDV?.pVALUECOLUMNNAME != null)) { + var timeString = termDffList![index].eSERVICESDV!.pVALUECOLUMNNAME!.split(":"); + selectedDate = DateTime(0, 0, 0, int.parse(timeString[0]), int.parse(timeString[1])); + + //DateTime.parse(getEitDffStructureList![index].eSERVICESDV!.pVALUECOLUMNNAME!); + } + TimeOfDay _time = await _selectTime(context); + DateTime tempTime = DateTime(0, 1, 1, _time.hour, _time.minute); + String time = DateFormat('HH:mm').format(tempTime).trim(); + + // DateTime date1 = DateTime(date.year, date.month, date.day); + // getEitDffStructureList![index].fieldAnswer = date.toString(); + ESERVICESDV eservicesdv = ESERVICESDV(pIDCOLUMNNAME: time, pRETURNMSG: "null", pRETURNSTATUS: termDffList![index].dEFAULTVALUE, pVALUECOLUMNNAME: time); + termDffList![index].eSERVICESDV = eservicesdv; + setState(() {}); + if (model.cHILDSEGMENTSVSSplited?.isNotEmpty ?? false) { + await calGetValueSetValues(model); + } + }, + ).paddingOnly(bottom: 12); + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [], + ).objectContainerView(); + } + + DateTime selectedDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day); + + Future _selectDate(BuildContext context) async { + DateTime time = selectedDate; + if (Platform.isIOS) { + await showCupertinoModalPopup( + context: context, + builder: (cxt) => Container( + height: 250, + color: Colors.white, + child: CupertinoDatePicker( + backgroundColor: Colors.white, + mode: CupertinoDatePickerMode.date, + onDateTimeChanged: (value) { + if (value != null && value != selectedDate) { + time = value; + } + }, + initialDateTime: selectedDate, + ), + ), + ); + } else { + DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + if (picked != null && picked != selectedDate) { + time = picked; + } + } + time = DateTime(time.year, time.month, time.day); + return time; + } + + Future _selectTime(BuildContext context) async { + TimeOfDay time = TimeOfDay(hour: selectedDate.hour, minute: selectedDate.minute); + if (Platform.isIOS) { + await showCupertinoModalPopup( + context: context, + builder: (cxt) => Container( + height: 250, + color: Colors.white, + child: CupertinoDatePicker( + backgroundColor: Colors.white, + mode: CupertinoDatePickerMode.time, + use24hFormat: true, + onDateTimeChanged: (value) { + if (value != null && value != selectedDate) { + time = TimeOfDay(hour: value.hour, minute: value.minute); + } + }, + initialDateTime: selectedDate, + ), + ), + ); + } else { + TimeOfDay? picked = await showTimePicker( + context: context, + initialTime: time, + builder: (cxt, child) { + return MediaQuery(data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true), child: child ?? Container()); + }); + + if (picked != null && picked != time) { + time = picked; + } + // final DateTime? picked = + // await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); + // if (picked != null && picked != selectedDate) { + // time = picked; + // } + } + return time; + } +}