diff --git a/android/app/agconnect-services.json b/android/app/agconnect-services.json
new file mode 100644
index 0000000..20a7546
--- /dev/null
+++ b/android/app/agconnect-services.json
@@ -0,0 +1,57 @@
+{
+ "agcgw_all":{
+ "CN":"connect-drcn.dbankcloud.cn",
+ "CN_back":"connect-drcn.hispace.hicloud.com",
+ "DE":"connect-dre.dbankcloud.cn",
+ "DE_back":"connect-dre.hispace.hicloud.com",
+ "RU":"connect-drru.hispace.dbankcloud.ru",
+ "RU_back":"connect-drru.hispace.dbankcloud.cn",
+ "SG":"connect-dra.dbankcloud.cn",
+ "SG_back":"connect-dra.hispace.hicloud.com"
+ },
+ "websocketgw_all":{
+ "CN":"connect-ws-drcn.hispace.dbankcloud.cn",
+ "CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
+ "DE":"connect-ws-dre.hispace.dbankcloud.cn",
+ "DE_back":"connect-ws-dre.hispace.dbankcloud.com",
+ "RU":"connect-ws-drru.hispace.dbankcloud.ru",
+ "RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
+ "SG":"connect-ws-dra.hispace.dbankcloud.cn",
+ "SG_back":"connect-ws-dra.hispace.dbankcloud.com"
+ },
+ "client":{
+ "cp_id":"2640966000002322881",
+ "product_id":"737518067793559971",
+ "client_id":"715996003571874624",
+ "client_secret":"B5B89A56A53847C6BB9D216A8747E75952760DF9A8232239D8744CD847A8FFDA",
+ "project_id":"737518067793559971",
+ "app_id":"104737117",
+ "api_key":"DAEDACKDrYgyco9mjPV9ZUjCSh1kCr/GBV0nseHH0z2mnxlZ41RksOKmyTi+PUTwmGEPK+VxCup4F9oUf4VbDnCsjB7aNBShYcjR+g==",
+ "package_name":"hmg.cloudSolutions.mohem"
+ },
+ "oauth_client":{
+ "client_id":"104737117",
+ "client_type":1
+ },
+ "app_info":{
+ "app_id":"104737117",
+ "package_name":"hmg.cloudSolutions.mohem"
+ },
+ "configuration_version":"3.0",
+ "appInfos":[
+ {
+ "package_name":"hmg.cloudSolutions.mohem",
+ "client":{
+ "app_id":"104737117"
+ },
+ "app_info":{
+ "package_name":"hmg.cloudSolutions.mohem",
+ "app_id":"104737117"
+ },
+ "oauth_client":{
+ "client_type":1,
+ "client_id":"104737117"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 198bc87..5279c1f 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -31,6 +31,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion 33
@@ -51,7 +52,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "hmg.cloudSolutions.mohem"
- minSdkVersion 21
+ minSdkVersion 28
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
@@ -66,8 +67,14 @@ android {
}
}
buildTypes {
+ debug {
+ signingConfig signingConfigs.debug
+ }
release {
signingConfig signingConfigs.release
+ minifyEnabled true
+ shrinkResources true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index f187ebd..3f5e424 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -7,12 +7,21 @@
-
+
+
+
+
+
+
+
+
+
postParams = {
- "UID": uuid.v4(), //Mobile Id
+ "UID": await PlatformDeviceId.getDeviceId, //uuid.v4(), //Mobile Id
+ // "UID": uuid.v4(), //Mobile Id
"Latitude": lat,
"Longitude": long,
"QRValue": QRValue,
@@ -199,17 +201,18 @@ class DashboardApiClient {
}, url, postParams);
}
-// Future setAdvertisementViewed(String masterID, int advertisementId) async {
-// String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateAdvertisementAsViewed";
-//
-// Map postParams = {
-// "ItgNotificationMasterId": masterID,
-// "ItgAdvertisement": {"advertisementId": advertisementId, "acknowledgment": true} //Mobile Id
-// };
-// postParams.addAll(AppState().postParamsJson);
-// return await ApiClient().postJsonForObject((json) {
-// // ItgMainRes responseData = ItgMainRes.fromJson(json);
-// return json;
-// }, url, postParams);
-// }
+ Future setAdvertisementViewed(String masterID, int advertisementId) async {
+ String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateAdvertisementAsViewed";
+
+ Map postParams = {
+ "ItgNotificationMasterId": masterID,
+ "EmployeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
+ "ItgAdvertisement": {"advertisementId": advertisementId, "acknowledgment": true} //Mobile Id
+ };
+ postParams.addAll(AppState().postParamsJson);
+ return await ApiClient().postJsonForObject((json) {
+ // ItgMainRes responseData = ItgMainRes.fromJson(json);
+ return json;
+ }, url, postParams);
+ }
}
diff --git a/lib/api/login_api_client.dart b/lib/api/login_api_client.dart
index 7da7754..1b6b19e 100644
--- a/lib/api/login_api_client.dart
+++ b/lib/api/login_api_client.dart
@@ -145,4 +145,15 @@ class LoginApiClient {
return responseData;
}, url, postParams);
}
+
+ Future changePasswordFromActiveDirectorySession(String password, String email) async {
+ String url = "${ApiConsts.authenticationRest}SetPassword";
+ Map postParams = {"EmailAddress": email, "Password": password, "generalid": "Cs2020@2016\$2958"};
+ postParams.addAll(AppState().postParamsJson);
+ postParams["LogInTokenID"] = "@acT!V3D!r3Ct0rY"; // hard code token for active directory
+ return await ApiClient().postJsonForObject((json) {
+ GenericResponseModel responseData = GenericResponseModel.fromJson(json);
+ return responseData;
+ }, url, postParams);
+ }
}
diff --git a/lib/api/marathon/marathon_api_client.dart b/lib/api/marathon/marathon_api_client.dart
index ee3810f..3d75d87 100644
--- a/lib/api/marathon/marathon_api_client.dart
+++ b/lib/api/marathon/marathon_api_client.dart
@@ -34,6 +34,20 @@ class MarathonApiClient {
);
}
+ Future getMarathonersCount({required String marathonId}) async {
+ Response response = await ApiClient().getJsonForResponse(
+ ApiConsts.marathonGetMarathonersCount + '?marathonId=$marathonId',
+ token: AppState().getMarathonToken == null || AppState().getMarathonToken == "" ? await getMarathonToken() : AppState().getMarathonToken,
+ );
+
+ var json = jsonDecode(response.body);
+ logger.i("json in getMarathonersCount: $json");
+
+ MarathonGenericModel marathonGenericModel = MarathonGenericModel.fromJson(json);
+
+ return marathonGenericModel.data as int;
+ }
+
Future getProjectId() async {
return await ApiClient().postJsonForObject(
(json) {
@@ -73,8 +87,8 @@ class MarathonApiClient {
Future joinMarathonAsParticipant() async {
Map jsonObject = {
"employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER ?? "",
- "employeeNameAr": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? "",
- "employeeNameEn": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "",
+ "employeeNameAr": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "",
+ "employeeNameEn": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? "",
"marathonId": AppState().getMarathonProjectId!,
};
diff --git a/lib/api/worklist/worklist_api_client.dart b/lib/api/worklist/worklist_api_client.dart
index 82b865c..628701f 100644
--- a/lib/api/worklist/worklist_api_client.dart
+++ b/lib/api/worklist/worklist_api_client.dart
@@ -14,6 +14,8 @@ import 'package:mohem_flutter_app/models/get_mo_notification_body_list_model.dar
import 'package:mohem_flutter_app/models/get_notification_buttons_list_model.dart';
import 'package:mohem_flutter_app/models/get_po_Item_history_list_model.dart';
import 'package:mohem_flutter_app/models/get_po_notification_body_list_model.dart';
+import 'package:mohem_flutter_app/models/get_pr_action_history_list_model.dart';
+import 'package:mohem_flutter_app/models/get_pr_information_list.dart';
import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_quotation_analysis_list_model.dart';
import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart';
@@ -46,7 +48,7 @@ class WorkListApiClient {
Map postParams = {
"P_NOTIFICATION_TYPE": pNotificationType,
"P_PAGE_NUM": pPageNum,
- "P_PAGE_LIMIT": 25,
+ "P_PAGE_LIMIT": 20,
"P_ITEM_TYPE": pItemType,
"P_SEARCH_FROM_USER": pSearchUser,
"P_SEARCH_ITEM_TYPE_DSP_NAME": pSearchItemType,
@@ -90,6 +92,16 @@ class WorkListApiClient {
}, url, postParams);
}
+ Future> getPRAttachments(String pOLineID) async {
+ String url = "${ApiConsts.erpRest}GET_PR_ATTACHMENTS";
+ Map postParams = {"P_PO_LINE_ID": pOLineID};
+ postParams.addAll(AppState().postParamsJson);
+ return await ApiClient().postJsonForObject((json) {
+ GenericResponseModel responseData = GenericResponseModel.fromJson(json);
+ return responseData.getPRAttachmentList ?? [];
+ }, url, postParams);
+ }
+
Future> getRFCEmployeeeList(int pNotificationID) async {
String url = "${ApiConsts.erpRest}GET_RFC_EMPLOYEE_LIST";
Map postParams = {"P_NOTIFICATION_ID": pNotificationID, "P_PAGE_NUM": 1, "P_PAGE_LIMIT": 10};
@@ -114,6 +126,20 @@ class WorkListApiClient {
}, url, postParams);
}
+ Future> getActionHistoryForPR(String pOLineID) async {
+ String url = "${ApiConsts.erpRest}GET_PR_ACTION_HISTORY";
+ Map postParams = {
+ "P_PO_LINE_ID": pOLineID,
+ "P_PAGE_LIMIT": 100,
+ "P_PAGE_NUM": 1,
+ };
+ postParams.addAll(AppState().postParamsJson);
+ return await ApiClient().postJsonForObject((json) {
+ GenericResponseModel responseData = GenericResponseModel.fromJson(json);
+ return responseData.getPRActionHistoryList?.reversed.toList() ?? [];
+ }, url, postParams);
+ }
+
Future> getNotificationButtons(int pNotificationID) async {
String url = "${ApiConsts.erpRest}GET_NOTIFICATION_BUTTONS";
Map postParams = {"P_NOTIFICATION_ID": pNotificationID};
@@ -413,7 +439,7 @@ class WorkListApiClient {
"EmployeeNumber": employeeNumber,
"Comments": "",
"AdditionalFields": null,
- "NewUserEMPId":newUserEMPId
+ "NewUserEMPId": newUserEMPId
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
@@ -589,7 +615,8 @@ class WorkListApiClient {
}, url, postParams);
}
- Future submitComment({String? comment, String? email, String? userId, int? notificationId, required String apiMode, int? approverIndex = null}) async {
+ Future submitComment(
+ {String? comment, String? email, String? userId, int? notificationId, required String apiMode, int? approverIndex = null, List