diff --git a/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts b/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts index 808b5603..deeffdad 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts @@ -8,6 +8,12 @@ import { OpenMissingSwipesResponse } from './open-missing-swipes.response'; import { PerformanceAppraisalResponse } from './performance-appraisal.response'; import {AttendanceTrackingResponse} from './attendance-tracking.response' +import {OpenPeriodDatesResponse} from '../../services/dashbored/models/openPeriodDatesResponse' +import {GetSubordinatesLeavesRequest} from './models/GetSubordinatesLeavesRequest'; +import {GetSubordinatesLeavesResponse} from './models/GetSubordinatesLeavesResponse'; +import {GetSubordinatesAttdStatusRequest} from './models/GetSubordinatesAttdStatusRequest'; +import {GetSubordinatesAttdStatusResponse} from './models/GetSubordinatesAttdStatusResponse'; +import {GetOpenNotificationsResponse} from './models/GetOpenNotificationsResponse' @Injectable({ providedIn: 'root' @@ -18,6 +24,10 @@ export class DashboredService { public static performanceappraisalUrl="Services/ERP.svc/REST/GET_Performance_Appraisal" public static attendancetrackingUrl="Services/ERP.svc/REST/GET_Attendance_Tracking" + public static getOpenPeriodDates = 'Services/ERP.svc/REST/GET_OPEN_PERIOD_DATES'; + public static getOpenNotifications = 'Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS'; + public static getSubordinatesLeaves = 'Services/ERP.svc/REST/GET_SUBORDINATES_LEAVES'; + public static getSubordinatesAttStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS'; constructor( public con: ConnectorService, @@ -66,6 +76,24 @@ public getAttendanceTracking(onError ?:any ,oerrorLable ?:any):Observable { + const request = new Request(); + this.authService.authenticateRequest(request); + return this.con.post(DashboredService.getOpenPeriodDates, request, onError, errorLabel); + } + public getOpenNotifications( onError?: any, errorLabel?: string): Observable { + const request = new Request(); + this.authService.authenticateRequest(request); + return this.con.post(DashboredService.getOpenNotifications, request, onError, errorLabel); + } + public getSubordinatesLeaves( req:GetSubordinatesLeavesRequest,onError?: any, errorLabel?: string): Observable { + this.authService.authenticateRequest(req); + return this.con.post(DashboredService.getSubordinatesLeaves, req, onError, errorLabel); + } + public getSubordinatesAttStatus( req:GetSubordinatesAttdStatusRequest, onError?: any, errorLabel?: string): Observable { + this.authService.authenticateRequest(req); + return this.con.post(DashboredService.getSubordinatesAttStatus, req, onError, errorLabel); + } } diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetOpenNotificationsList.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetOpenNotificationsList.ts new file mode 100644 index 00000000..baef1032 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetOpenNotificationsList.ts @@ -0,0 +1,11 @@ +export class GetOpenNotificationsList + +{ +public ITEM_TYPE: number; + +public ITEM_TYPE_DISPLAY_NAME:number; + +public OPEN_NTF_NUMBER:number; + + +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse.ts new file mode 100644 index 00000000..7165f0b4 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse.ts @@ -0,0 +1,7 @@ +import { GetOpenNotificationsList } from './GetOpenNotificationsList'; +import { Response } from '../../../services/models/response' + + +export class GetOpenNotificationsResponse extends Response { + public GetOpenNotificationsList: GetOpenNotificationsList []; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusList.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusList.ts new file mode 100644 index 00000000..7a2cf0b0 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusList.ts @@ -0,0 +1,16 @@ +export class GetSubordinatesAttdStatusList + +{ +public NUMBER_OF_EMPLOYEES: number; + +public LATE_IN:number; + +public EARLY_OUT:number; + +public ON_TIME:number; + +public ABSENCE:number; + + + +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts new file mode 100644 index 00000000..740656b8 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts @@ -0,0 +1,7 @@ +import { Request } from '../../../services/models/request' + +export class GetSubordinatesAttdStatusRequest extends Request{ + //public static SHARED_DATA = ''; + public P_SCHEDULE_DATE_FROM :any; + public P_SCHEDULE_DATE_TO :any; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse.ts new file mode 100644 index 00000000..f66cae7b --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse.ts @@ -0,0 +1,7 @@ +import { GetSubordinatesAttdStatusList } from './GetSubordinatesAttdStatusList'; +import { Response } from '../../../services/models/response' + + +export class GetSubordinatesAttdStatusResponse extends Response { + public GetSubordinatesAttdStatusList: GetSubordinatesAttdStatusList []; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesList.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesList.ts new file mode 100644 index 00000000..08818ef8 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesList.ts @@ -0,0 +1,35 @@ +export class GetSubordinatesLeavesList + +{ + public LVL: number; + +public EMPLOYEE_NUMBER:String; + +public EMPLOYEE_NAME:String; + +public ORGANIZATION_ID:number; + +public ORGANIZATION_NAME:String + +public SUPERVISOR_NUMBER:String; + +public SUPERVISOR_NAME:String; + +public SUPERVISOR_ORGANIZATION_ID:number; + +public SUPERVISOR_ORGANIZATION_NAME:String; + +public EVENT_DATE:any;//DATE; + +public LEAVE_TYPE:String; + +public DATE_START:any;//DATE; + +public DATE_END:any;//DATE; + +public ABSENCE_ATTENDANCE_TYPE_NAME:String; + +public CALENDAR_ENTRY_DESC:String; + +public STATUS:String; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts new file mode 100644 index 00000000..30a4befd --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts @@ -0,0 +1,8 @@ +import { Request } from '../../../services/models/request' + +export class GetSubordinatesLeavesRequest extends Request{ + //public static SHARED_DATA = ''; + public P_DATE_FROM :any; + public P_DATE_TO :any; + +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse.ts new file mode 100644 index 00000000..469cad3e --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse.ts @@ -0,0 +1,7 @@ +import { GetSubordinatesLeavesList } from './GetSubordinatesLeavesList'; +import { Response } from '../../../services/models/response' + + +export class GetSubordinatesLeavesResponse extends Response { + public GetSubordinatesLeavesList: GetSubordinatesLeavesList []; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/openPeriodDatesList.ts b/Mohem/src/app/hmg-common/services/dashbored/models/openPeriodDatesList.ts new file mode 100644 index 00000000..dbcab478 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/openPeriodDatesList.ts @@ -0,0 +1,7 @@ +export class OpenPeriodDatesList { + public P_CLOSING_PERIOD_DATE: any; + public P_PERIOD_END_DATE: any; + public P_PERIOD_START_DATE: any; + public P_RETURN_MSG: string; + public P_RETURN_STATUS: string; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/openPeriodDatesResponse.ts b/Mohem/src/app/hmg-common/services/dashbored/models/openPeriodDatesResponse.ts new file mode 100644 index 00000000..3b559bc7 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/dashbored/models/openPeriodDatesResponse.ts @@ -0,0 +1,7 @@ +import { OpenPeriodDatesList } from './openPeriodDatesList'; +import { Response } from '../../../services/models/response' + + +export class OpenPeriodDatesResponse extends Response { + public openPeriodDatesList: OpenPeriodDatesList []; +} \ No newline at end of file diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index b3c48889..b88e4a6f 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -30,6 +30,12 @@ import { OrganizationSalariesResponse } from '../hmg-common/services/dashbored/o import { OpenMissingSwipesResponse} from '../hmg-common/services/dashbored/open-missing-swipes.response'; import {PerformanceAppraisalResponse} from '../hmg-common/services/dashbored/performance-appraisal.response'; import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/attendance-tracking.response'; +import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse'; +import {GetSubordinatesAttdStatusRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; +import {GetSubordinatesLeavesRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest' +import {GetOpenNotificationsResponse}from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse' +import {GetSubordinatesAttdStatusResponse}from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse' +import {GetSubordinatesLeavesResponse}from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse' @Component({ @@ -412,8 +418,62 @@ showAttendanceTracking(){ this.DS.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => { });; +} + openPeriodDateDashbored(){ + this.DS.getOpenPeriodDates( ()=> {console.log("Error ");} ).subscribe((result:OpenPeriodDatesResponse)=>{ + if (this.common.validResponse(result)) { + console.log("response"); + } + + }); + } + + openNotificationsDashbored(){ + this.DS.getOpenNotifications( ()=> {console.log("Error ");} ).subscribe((result:GetOpenNotificationsResponse)=>{ + if (this.common.validResponse(result)) { + console.log("response"); + console.log(result); + } + + }); + + } + + getSubordinatesLeaves(){ + let request:GetSubordinatesLeavesRequest=new GetSubordinatesLeavesRequest(); + request.P_DATE_FROM="/Date(1578603600000+0300)/"; //test + request.P_DATE_TO="/Date(1576011600000+0300)/"; //test + + this.DS.getSubordinatesLeaves( request,()=> {console.log("Error ");} ).subscribe((result:GetSubordinatesLeavesResponse)=>{ + if (this.common.validResponse(result)) { + console.log("response"); + console.log(result); + } + + }); + + } + + getSubordinatesAttStatus(){ + let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest(); + request.P_SCHEDULE_DATE_FROM="/Date(1578603600000+0300)/"; //test + request.P_SCHEDULE_DATE_TO="/Date(1576011600000+0300)/";//test + + this.DS.getSubordinatesAttStatus( request,()=> {console.log("Error ");} ).subscribe((result:GetSubordinatesAttdStatusResponse)=>{ + if (this.common.validResponse(result)) { + console.log("response"); + console.log(result); + } + + }); + + } + + + + } -} +