sultan-dev #9

Merged
Haroon6138 merged 5 commits from sultan-dev into master 11 months ago

@ -348,12 +348,12 @@ class WorkListApiClient {
}, url, postParams);
}
Future<ITGRequest?> getITGFormDetails(String requestType, int taskId, int itemId, String employeeNumber) async {
Future<ITGRequest?> getITGFormDetails(String requestType, taskId, itemId, String employeeNumber) async {
String url = "${ApiConsts.cocRest}ITGGetFormDetials";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
};
postParams.addAll(AppState().postParamsJson);
@ -363,12 +363,12 @@ class WorkListApiClient {
}, url, postParams);
}
Future<ITGRequest?> rejectITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
Future<ITGRequest?> rejectITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async {
String url = "${ApiConsts.cocRest}ITGRejectRequest";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
@ -379,12 +379,12 @@ class WorkListApiClient {
}, url, postParams);
}
Future<ITGRequest?> approveITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
Future<ITGRequest?> approveITGRequest(String requestType, taskId, itemId, String employeeNumber, String comments) async {
String url = "${ApiConsts.cocRest}ITGApproveRequest";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
@ -395,12 +395,12 @@ class WorkListApiClient {
}, url, postParams);
}
Future<ITGRequest?> delegateITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
Future<ITGRequest?> delegateITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGDelegateRequest";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"NewUserEMPId": newUserEMPId,
"Comments": comments,
@ -414,12 +414,12 @@ class WorkListApiClient {
// ANSWER = 'Services/COCWS.svc/REST/ITGAnswer';
Future<ITGRequest?> answerITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
Future<ITGRequest?> answerITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGAnswer";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": comments,
};
@ -435,7 +435,7 @@ class WorkListApiClient {
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"Comments": "",
"AdditionalFields": null,
@ -448,12 +448,12 @@ class WorkListApiClient {
}, url, postParams);
}
Future<ITGRequest?> informationITGRequest(String requestType, int taskId, int itemId, String employeeNumber, String newUserEMPId, String comments) async {
Future<ITGRequest?> informationITGRequest(String requestType, taskId, itemId, String employeeNumber, String newUserEMPId, String comments) async {
String url = "${ApiConsts.cocRest}ITGRequestInformation";
Map<String, dynamic> postParams = {
"RequestType": requestType,
"TaskID": taskId,
"ItemID": itemId,
"ItemIDStr": itemId,
"EmployeeNumber": employeeNumber,
"NewUserEMPId": newUserEMPId,
"Comments": comments,

@ -1,6 +1,6 @@
class RequestDetails {
int? iD;
int? itemID;
dynamic iD;
dynamic itemID;
String? listID;
String? listName;
String? modifiedDate;

@ -207,7 +207,7 @@ class ServicesWidget extends StatelessWidget {
} else if (menuEntry.menuName == "MBL_PERINFO_SS") {
Navigator.of(context).pushNamed(AppRoutes.profile);
return;
} else if (menuEntry.menuName!.substring(4, menuEntry.menuName!.length) == "MBL_EMPLOYEE_DOCUMENTS") {
} else if (menuEntry.menuName!.isNotEmpty && menuEntry.menuName!.substring(4, menuEntry.menuName!.length) == "MBL_EMPLOYEE_DOCUMENTS") {
Navigator.pushNamed(context, AppRoutes.myDocuments);
return;
}

@ -348,7 +348,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
DateTime date = DateFormat('dd-MM-yyyy').parse(idColName!);
idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date);
}
if (getEitDffStructureList![j].isDefaultTypeIsCDPS) {
// if (displayText.contains(" 00:00:00")) {
// displayText = displayText.replaceAll(" 00:00:00", "");

@ -64,7 +64,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getItgData() async {
try {
Utils.showLoading(context);
itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
itgRequest = await WorkListApiClient().getITGFormDetails(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "");
allowedActionList = itgRequest?.allowedActions ?? [];
if (allowedActionList.isNotEmpty) {
isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE");
@ -467,18 +467,18 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
actionMode: actionMode,
onTap: (note) {
if (actionMode == "APPROVED") {
performApproveAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
performApproveAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
} else if (actionMode == "Answer") {
performAnswerAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
performAnswerAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
} else {
performRejectAction(requestDetails!.requestType!, requestDetails!.iD!, requestDetails!.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
performRejectAction(requestDetails!.requestType!, requestDetails!.iD, requestDetails!.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", note);
}
},
),
);
}
void performAnswerAction(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
void performAnswerAction(String requestType, taskId, itemId, String employeeNumber, String comments) async {
try {
Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().answerITGRequest(requestType, taskId, itemId, employeeNumber, "", comments);
@ -502,7 +502,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}
}
void performRejectAction(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
void performRejectAction(String requestType, taskId, itemId, String employeeNumber, String comments) async {
try {
Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().rejectITGRequest(requestType, taskId, itemId, employeeNumber, comments);
@ -526,7 +526,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}
}
void performApproveAction(String requestType, int taskId, int itemId, String employeeNumber, String comments) async {
void performApproveAction(String requestType, taskId, itemId, String employeeNumber, String comments) async {
try {
Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().approveITGRequest(requestType, taskId, itemId, employeeNumber, comments);

@ -211,13 +211,13 @@ class SelectedItemSheet extends StatelessWidget {
try {
var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!];
if (apiMode == "Delegate") {
await WorkListApiClient().delegateITGRequest(requestDetails.requestType!, requestDetails.iD!, requestDetails.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
await WorkListApiClient().delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} else if (apiMode == "RequestInformation") {
await WorkListApiClient().informationITGRequest(requestDetails.requestType!, requestDetails.iD!, requestDetails.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
await WorkListApiClient().informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} else if (apiMode == "Answer") {
await WorkListApiClient().answerITGRequest(requestDetails.requestType!, requestDetails.iD!, requestDetails.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
await WorkListApiClient().answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "",
isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
}
Utils.hideLoading(context);

@ -122,13 +122,13 @@ class SelectedItgItemSheet extends StatelessWidget {
var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!];
if (apiMode == "Delegate") {
await WorkListApiClient()
.delegateITGRequest(requestDetails.requestType!, requestDetails.iD!, requestDetails.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment);
.delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment);
} else if (apiMode == "RequestInformation") {
await WorkListApiClient()
.informationITGRequest(requestDetails.requestType!, requestDetails.iD!, requestDetails.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment);
.informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment);
} else if (apiMode == "Answer") {
await WorkListApiClient()
.answerITGRequest(requestDetails.requestType!, requestDetails.iD!, requestDetails.itemID!, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment);
.answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", wfHistory.employeeID!, comment);
}
Utils.hideLoading(context);
Navigator.pop(context, "delegate_reload");

Loading…
Cancel
Save