|
|
|
|
@ -4,6 +4,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
|
|
|
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
|
|
|
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
|
|
|
|
import { MyTeamService } from '../service/my-team.service';
|
|
|
|
|
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-employee-hierarchy',
|
|
|
|
|
@ -11,14 +12,47 @@ import { MyTeamService } from '../service/my-team.service';
|
|
|
|
|
styleUrls: ['./employee-hierarchy.component.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class EmployeeHierarchyComponent implements OnInit {
|
|
|
|
|
public personalInfo: any;
|
|
|
|
|
public hierarchyData: any;
|
|
|
|
|
public subordinateHierarchyList: any;
|
|
|
|
|
public supervisorHierarchyList: any;
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public authService: AuthenticationService,
|
|
|
|
|
public common: CommonService,
|
|
|
|
|
public myTeamService: MyTeamService
|
|
|
|
|
public myTeamService: MyTeamService,
|
|
|
|
|
public cs: CommonService
|
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {}
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.getProfile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getProfile() {
|
|
|
|
|
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
this.personalInfo = user;
|
|
|
|
|
this.getEmployeeHierachy();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getEmployeeHierachy() {
|
|
|
|
|
const body = {
|
|
|
|
|
P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER,
|
|
|
|
|
P_MENU_TYPE: "E",
|
|
|
|
|
P_SELECTED_RESP_ID: -999
|
|
|
|
|
};
|
|
|
|
|
this.myTeamService.getEmployeeHierachy(body).subscribe((result: any) => {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.hierarchyData = result.SupervisorHierarchyLists;
|
|
|
|
|
this.subordinateHierarchyList = this.hierarchyData.SubordinateHierarchyList;
|
|
|
|
|
let rawSupervisorHierarchyList = this.hierarchyData.SupervisorHierarchyList;
|
|
|
|
|
this.supervisorHierarchyList = rawSupervisorHierarchyList.reverse();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|