|
|
|
|
@ -12,6 +12,7 @@ import { DatePipe } from '@angular/common';
|
|
|
|
|
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
|
|
|
|
|
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
|
|
|
|
|
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
|
|
|
|
import { COCRequest } from '../models/COCRequest';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-home',
|
|
|
|
|
@ -224,7 +225,12 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.resetData();
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
|
|
|
|
|
this.openNotificationsDashboard();
|
|
|
|
|
|
|
|
|
|
var isWorklistChanged = this.common.sharedService.getSharedData(HomeComponent.COUNT_CHANGED);
|
|
|
|
|
if (isWorklistChanged) {
|
|
|
|
|
this.openNotificationsDashboard()
|
|
|
|
|
}
|
|
|
|
|
this.openNotificationsDashboardLocal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -235,28 +241,10 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openNotificationsDashboard() {
|
|
|
|
|
// if (this.countChanged) {
|
|
|
|
|
|
|
|
|
|
// this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
|
|
|
|
|
// if (this.common.validResponse(result)) {
|
|
|
|
|
// this.countChanged = false;
|
|
|
|
|
// this.worklistNotifications = result;
|
|
|
|
|
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
|
|
|
|
//this.resetFiltersUI();
|
|
|
|
|
// this.assignDataToFilters();
|
|
|
|
|
// this.common.sharedService.setSharedData(result, 'worklistNotifications');
|
|
|
|
|
openNotificationsDashboardLocal() {
|
|
|
|
|
this.Details();
|
|
|
|
|
this.callWorkListServices();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// } else {
|
|
|
|
|
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
|
|
|
|
// this.resetFiltersUI();
|
|
|
|
|
// this.assignDataToFilters();
|
|
|
|
|
// this.Details();
|
|
|
|
|
// this.callWorkListServices();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
assignDataToFilters() {
|
|
|
|
|
@ -651,30 +639,10 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Details() {
|
|
|
|
|
// var result = this.common.sharedService.getSharedData(MenuResponse.ITG_COUNTS, false);
|
|
|
|
|
// if (this.countChanged) {
|
|
|
|
|
// this.workListService.getITGDetails('', '', this.isPostNoLoad)
|
|
|
|
|
// .subscribe((result: any) => {
|
|
|
|
|
// this.countChanged = false;
|
|
|
|
|
// this.ITGCount = result.TotalCount;
|
|
|
|
|
// // this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
|
// this.data.datasets[0].data[4] = this.ITGCount;
|
|
|
|
|
// this.filters[4].value = result.TotalCount;
|
|
|
|
|
// this.receivedITGCount = true;
|
|
|
|
|
// })
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
|
|
//this.workListService.getITGDetails('', '', this.isPostNoLoad)
|
|
|
|
|
//.subscribe((result: any) => {
|
|
|
|
|
this.ITGCount = this.common.filterKeys['ITG'];//result.TotalCount;
|
|
|
|
|
// this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
|
this.data.datasets[0].data[4] = this.common.filterKeys['ITG'];//this.ITGCount;
|
|
|
|
|
this.filters[4].value = this.common.filterKeys['ITG'];
|
|
|
|
|
this.receivedITGCount = true;
|
|
|
|
|
//});
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchBtn() {
|
|
|
|
|
@ -731,4 +699,58 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
this.openITG(ITEM, NAME);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openNotificationsDashboard() {
|
|
|
|
|
this.common.startLoading();
|
|
|
|
|
this.resetFiltersUI();
|
|
|
|
|
this.totalRequestCount = 0;
|
|
|
|
|
this.DS.getOpenNotifications('', '', false).subscribe((result: GetOpenNotificationsResponse) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
const key = 'P_OPEN_NTF_NUMBER';
|
|
|
|
|
// this.totalRequestCount = ;
|
|
|
|
|
this.ITGCountAllNotification(result[key]);
|
|
|
|
|
this.common.sharedService.setSharedData(
|
|
|
|
|
result,
|
|
|
|
|
'worklistNotifications'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
this.common.setFilterValues(result['GetOpenNotificationsList']);
|
|
|
|
|
const values = this.common.getFiltersData();
|
|
|
|
|
this.data = values.data;
|
|
|
|
|
this.filters = values.filters;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
ITGCountAllNotification(count) {
|
|
|
|
|
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
|
|
|
|
|
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
|
|
|
|
|
this.common.filterKeys['ITG'] = result.TotalCount;
|
|
|
|
|
this.totalRequestCount = Math.floor(count + result.TotalCount);
|
|
|
|
|
this.common.sharedService.setSharedData(this.totalRequestCount, 'total-count');
|
|
|
|
|
this.getCOCNotificationCount();
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
getCOCNotificationCount() {
|
|
|
|
|
const request = new COCRequest();
|
|
|
|
|
request.ItgPageSize = 1;
|
|
|
|
|
request.ItgPageNo = 1;
|
|
|
|
|
request.Date = moment(new Date()).format("YYYY-MM-DD");
|
|
|
|
|
|
|
|
|
|
this.workListService.getCOCCount(request, '', '', this.isPostNoLoad).subscribe((result: any) => {
|
|
|
|
|
console.log(result);
|
|
|
|
|
const countResult = result.Mohemm_ITG_Pending_Task_ResponseItem;
|
|
|
|
|
const totalCount = countResult.escalation + countResult.waitingToClose + countResult.waitingForAcceptance + countResult.extendTATRequest;
|
|
|
|
|
this.common.filterKeys['COC'] = totalCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.totalRequestCount = Math.floor(this.totalRequestCount + totalCount);
|
|
|
|
|
|
|
|
|
|
this.common.sharedService.setSharedData(this.totalRequestCount, 'total-count');
|
|
|
|
|
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|