ITG change pushed.

pull/9/head
Sultan khan 2 years ago
parent 6d92a78843
commit d7f45fa0b9

@ -348,7 +348,7 @@ class WorkListApiClient {
}, url, postParams); }, 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"; String url = "${ApiConsts.cocRest}ITGGetFormDetials";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"RequestType": requestType, "RequestType": requestType,
@ -363,7 +363,7 @@ class WorkListApiClient {
}, url, postParams); }, 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"; String url = "${ApiConsts.cocRest}ITGRejectRequest";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"RequestType": requestType, "RequestType": requestType,
@ -379,7 +379,7 @@ class WorkListApiClient {
}, url, postParams); }, 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"; String url = "${ApiConsts.cocRest}ITGApproveRequest";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"RequestType": requestType, "RequestType": requestType,
@ -395,7 +395,7 @@ class WorkListApiClient {
}, url, postParams); }, 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"; String url = "${ApiConsts.cocRest}ITGDelegateRequest";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"RequestType": requestType, "RequestType": requestType,
@ -414,7 +414,7 @@ class WorkListApiClient {
// ANSWER = 'Services/COCWS.svc/REST/ITGAnswer'; // 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"; String url = "${ApiConsts.cocRest}ITGAnswer";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"RequestType": requestType, "RequestType": requestType,
@ -448,7 +448,7 @@ class WorkListApiClient {
}, url, postParams); }, 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"; String url = "${ApiConsts.cocRest}ITGRequestInformation";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"RequestType": requestType, "RequestType": requestType,

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

@ -64,7 +64,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
void getItgData() async { void getItgData() async {
try { try {
Utils.showLoading(context); 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 ?? []; allowedActionList = itgRequest?.allowedActions ?? [];
if (allowedActionList.isNotEmpty) { if (allowedActionList.isNotEmpty) {
isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE"); isCloseAvailable = allowedActionList.any((element) => element.action == "CLOSE");
@ -467,18 +467,18 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
actionMode: actionMode, actionMode: actionMode,
onTap: (note) { onTap: (note) {
if (actionMode == "APPROVED") { 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") { } 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 { } 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 { try {
Utils.showLoading(context); Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().answerITGRequest(requestType, taskId, itemId, employeeNumber, "", comments); 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 { try {
Utils.showLoading(context); Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().rejectITGRequest(requestType, taskId, itemId, employeeNumber, comments); 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 { try {
Utils.showLoading(context); Utils.showLoading(context);
ITGRequest? itgRequest = await WorkListApiClient().approveITGRequest(requestType, taskId, itemId, employeeNumber, comments); ITGRequest? itgRequest = await WorkListApiClient().approveITGRequest(requestType, taskId, itemId, employeeNumber, comments);

@ -211,13 +211,13 @@ class SelectedItemSheet extends StatelessWidget {
try { try {
var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!];
if (apiMode == "Delegate") { 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); isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} else if (apiMode == "RequestInformation") { } 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); isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} else if (apiMode == "Answer") { } 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); isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment);
} }
Utils.hideLoading(context); Utils.hideLoading(context);

@ -122,13 +122,13 @@ class SelectedItgItemSheet extends StatelessWidget {
var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!];
if (apiMode == "Delegate") { if (apiMode == "Delegate") {
await WorkListApiClient() 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") { } else if (apiMode == "RequestInformation") {
await WorkListApiClient() 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") { } else if (apiMode == "Answer") {
await WorkListApiClient() 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); Utils.hideLoading(context);
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");

Loading…
Cancel
Save