import {Injectable} from '@angular/core'; import {HttpClient, HttpEvent, HttpRequest} from '@angular/common/http'; import {ApiService} from '../../app.api.service'; import {empFileuploads, HrEmployee} from '../../_models/HREmployee/hrEmployee'; import {SearchEmployee} from '../../_models/Employee/searchEmployee'; import {Observable, Subject} from 'rxjs'; import {Occupation} from '../../_models/HRBasic/occupation'; import {BasicService} from '../Basic/basic.service'; import {EducationLevel} from '../../_models/HRBasic/education-level'; import {TrainingType} from '../../_models/Basic/trainingType'; import {EducationType} from '../../_models/HRBasic/education-type'; import {NominationPurpose} from '../../_models/HRBasic/nomination-purpose'; import {Employee} from '../../_models/Employee/employee'; import {EmployeeBankAccount} from '../../_models/Employee/employeeBankAccount'; import {EmployeeCostCenter} from '../../_models/Employee/employeeCostCenter'; import {Relation} from '../../_models/HRBasic/relation'; import {Designation} from '../../_models/HRBasic/designation'; import {Country} from '../../_models/HRBasic/country'; import {NatureOfTraining} from '../../_models/Training/nature-of-training'; import {Institution} from '../../_models/HRBasic/institution'; import {ResultType} from '../../_models/HRBasic/result-type'; import {Discipline} from '../../_models/HRBasic/discipline'; import {EmployeeBasicInfo} from '../../_models/report/employee-basic-info'; import {EmployeeDetailInfo} from '../../_models/report/employeeDetailInfo'; import { EnumBankAccountType, enumEmpFileUploadType } from '../../_models/enums'; import { EmployeeConfirmation } from '../../_models/Payroll/EmployeeConfirmation'; import {EmpExperience} from '../../_models/HREmployee/empExperience'; import { AuthorizedPerson } from 'src/app/adhoc-feature/authorized-persons/authorizedPerson'; import { EmployeeCordinator } from '../../_models/Attendance/employeeCordinator'; @Injectable({ providedIn: 'root' }) export class EmployeeServices { baseUrl = ApiService.BASE_URL + 'Employee/'; hrEmployee: HrEmployee; occupations: Occupation[]; educationLevels: EducationLevel[]; educationTypes: EducationType[]; trainingTypes: TrainingType[]; countries: Country[]; natureOfTrainings: NatureOfTraining[]; institutions: Institution[]; relations: Relation[]; designations: Designation[]; nominationPurposes: NominationPurpose[]; resultTypes: ResultType[]; disciplines: Discipline[]; Employee_Get_Completed: Subject; constructor(public apiService: ApiService, basicService: BasicService, private http: HttpClient) { this.Employee_Get_Completed = new Subject(); } getLoginEmployee() { return this.apiService.httpGet('/Employee/getLoginEmployee'); } getSearchEmployee(params: any) { return this.apiService.httpPost('/Employee/getSearchEmployee', params); } getSearchEmployeeForCordinator(params: any) { return this.apiService.httpPost('/Employee/getSearchEmployeeForCordinator', params); } getSearchEmployeebyid(empid: number) { return this.apiService.httpGet('/Employee/getSearchEmployeebyid/' + empid); } getSearchEmpbyLoginid() { return this.apiService.httpGet('/Employee/getSearchEmpbyLoginid'); } getMyTeamByLoginID() { return this.apiService.httpGet('/Employee/getMyTeamByLoginID'); } getMyTeamByLoginIDForAttnReguApprove() { return this.apiService.httpGet('/Employee/getMyTeamByLoginIDForAttnReguApprove'); } getSelectedSearchEmployees(empids: any) { return this.apiService.httpPost('/Employee/getSelectedSearchEmployees/', empids); } getSearchEmployeesByIDs(empids: number[]) { return this.apiService.httpPost('/Employee/getSearchEmployeesByIDs/', empids); } getEmpCodeName(code?: string, name?: string) { let nname = this.apiService.getApiDefaultData(name); let ncode = this.apiService.getApiDefaultData(code); return this.apiService.httpGet('/Employee/getEmpCodeName' + '/' + ncode + '/' + nname); } getEmployees() { return this.apiService.httpGet(this.apiService.base_url + 'getemployees'); } getLineManager(empId: number) { return this.apiService.httpGet('/Employee/getLineManager' + '/' + empId); } getByLineManager(empId: number) { return this.apiService.httpGet('/Employee/getByLineManager' + '/' + empId); } getHREmployeeID(empid: number) { return this.apiService.httpGet('/Employee/getHREmployeeID' + '/' + empid); // return this.http.post(this.baseUrl + 'getHREmployeeID', empid); } getEmployeeAttachments(empId: number) { return this.apiService.httpGet('/Employee/getEmployeeAttachments' + '/' + empId); } getEmployeeAttachmentByType(empId: number, refId: number, type: enumEmpFileUploadType) { return this.apiService.httpGet('/Employee/getEmployeeAttachmentByType' + '/' + empId + '/' + refId + '/' + type); } getHREmployee() { return this.apiService.httpGet('/Employee/getHREmployee'); } getEmployeeByID(empID: number) { return this.apiService.httpGet('/Employee/getEmployeeByID' + '/' + empID); } getEmployeesByEmpIDs(data: any) { return this.apiService.httpPost('/Employee/getEmployeesByEmpIDs', data); } getEmployeeDetailByEmpIDs(data: any) { return this.apiService.httpPost('/Employee/getEmployeeDetailByEmpIDs', data); } getCurrentEmployee() { return this.apiService.httpGet('/Employee/getCurrentEmployee'); } getEmployeeForDashboard() { return this.apiService.httpGet('/Employee/getEmployeeForDashboard'); } getUserForLandingPage() { return this.apiService.httpGet('/Employee/getUserForLandingPage'); } GetHolidayInfoForDashboard() { return this.apiService.httpGet('/Employee/GetHolidayInfoForDashboard'); } saveEmployee(param: any) { return this.apiService.httpPost('/Employee/saveEmployee', param); } saveEmployeeList(param: any) { return this.apiService.httpPost('/Employee/saveEmployeeList', param); } saveHrEmployee(param: any) { return this.apiService.httpPost('/Employee/saveHrEmployee', param); } saveHrPersonalInfo(param: any) { return this.apiService.httpPost('/Employee/saveHrPersonalInfo', param); } saveEmployeeContact(param: any) { return this.apiService.httpPost('/Employee/saveEmployeeContact', param); } saveEmployeeAcademic(param: any) { return this.apiService.httpPost('/Employee/saveEmployeeAcademic', param); } saveEmployeeSpouce(param: any) { return this.apiService.httpPost('/Employee/saveEmployeeSpouce', param); } saveExperience(param: any) { return this.apiService.httpPost('/Employee/saveExperience', param); } saveEmpNominee(param: any) { return this.apiService.httpPost('/Employee/saveEmpNominee', param); } DeleteEmpNominee(param: any) { return this.apiService.httpPost('/Employee/DeleteEmpNominee', param); } saveEployeeTraining(param: any) { return this.apiService.httpPost('/Employee/saveEployeeTraining', param); } saveEmployeechildren(param: any) { return this.apiService.httpPost('/Employee/saveEmployeechildren', param); } // Employee Bank Account getBankAccountByEmpID(empid: number) { return this.apiService.httpGet('/Employee/getBankAccountByEmpID/' + empid); } getBankAccountByEmpIDAndType(empid: number, acctountType: EnumBankAccountType) { return this.apiService.httpGet('/Employee/getBankAccountByEmpIDAndType/' + empid + '/' + acctountType); } getAllBankAccount() { return this.apiService.httpGet('/Employee/getAllBankAccount'); } getBankAccountById(id: number) { return this.apiService.httpGet('/Employee/getBankAccountById' + '/' + id); } getBankAccount(id: number, effectDate: Date, payrollTypeID: number) { return this.apiService.httpGet('/Employee/getBankAccount' + '/' + id + '/' + effectDate + '/' + payrollTypeID); } getBankAccountByDate(param: any) { return this.apiService.httpPost('/Employee/getBankAccountByDate', param); } saveBankAccount(params: any) { return this.apiService.httpPost('/Employee/saveBankAccount', params); } deleteBankAccount(empBankAccount: EmployeeBankAccount) { return this.apiService.httpPost('/Employee/deleteBankAccount', empBankAccount); } // Employee Cost Center getCostCenterById(id: number) { return this.apiService.httpGet('/Employee/getCostCenterById' + '/' + id); } getAllEmployeeCostCenter() { return this.apiService.httpGet('/Employee/getAllEmployeeCostCenter'); } getCostCenterByEmpId(id: number) { return this.apiService.httpGet('/Employee/getCostCenterByEmpId' + '/' + id); } getCostCenterByCCId(id: number) { return this.apiService.httpGet('/Employee/getCostCenterByCCId' + '/' + id); } getCostCenterByEmpIdCCId(ccid: number, empId: number) { return this.apiService.httpGet('/Employee/getCostCenterByEmpIdCCId' + '/' + ccid + '/' + empId); } saveCostCenter(params: any) { return this.apiService.httpPost('/Employee/saveCostCenter', params); } saveCostCenterList(params: EmployeeCostCenter[]) { return this.apiService.httpPost('/Employee/saveCostCenterList', params); } deleteCostCenterById(id: number) { return this.apiService.httpPost('/Employee/saveCostCenterList', id); } getCostCenterByMonthStartEnd(start: Date, end: Date, payrollTypeId: number) { return this.apiService.httpGet('/Employee/getCostCenterByMonthStartEnd' + '/' + start + '/' + end + '/' + payrollTypeId); } getCostCenter(costCenter: EmployeeCostCenter[], id: number) { return this.apiService.httpGet('/Employee/getCostCenter' + '/' + costCenter + '/' + id); } GetEmployeeNotYetUser(payrollTypeid: number) { return this.apiService.httpGet('/Employee/GetEmployeeNotYetUser' + '/' + payrollTypeid); } // Hr DashBoard getMaritalStats() { return this.apiService.httpGet('/Employee/getMaritalStats'); } getEmployeeMaleAgeStat() { return this.apiService.httpGet('/Employee/getEmployeeMaleAgeStat'); } getEmployeeFemaleAgeStat() { return this.apiService.httpGet('/Employee/getEmployeeFemaleAgeStat'); } getChildStatMale() { return this.apiService.httpGet('/Employee/getChildStatMale'); } getChildStatFemale() { return this.apiService.httpGet('/Employee/getChildStatFemale'); } getChildrenCount() { return this.apiService.httpGet('/Employee/getChildrenCount'); } getAcademicStat() { return this.apiService.httpGet('/Employee/getAcademicStat'); } getProfileCompletePercentage() { return this.apiService.httpGet('/Employee/getProfileCompletePercentage'); } getEmpBasicInfo(empIds: string) { return this.apiService.httpGet('/Employee/getEmpBasicInfo' + '/' + empIds); } getEmpDetailInfo(emps: SearchEmployee[]) { return this.apiService.httpPost('/Employee/getEmpDetailInfo', emps); } getCurrentHeadCount(departmentId: number, designationId: number, gradeId: number) { return this.apiService.httpGet('/Employee/getCurrentHeadCount' + '/' + departmentId + '/' + designationId + '/' + gradeId); } getAllEmployees(): Observable { return this.apiService.httpGet('/Employee/getAllEmps'); } deleteChildData(data: any) { return this.apiService.httpPost('/Employee/deleteChildData', data); } uploadEmpFile(selectedFile: File, empid: number, referenceid: number, filetype: number): Observable> { const formData: FormData = new FormData(); formData.append('empfile', selectedFile); formData.append('empid', String(empid)); formData.append('referenceid', String(referenceid)); formData.append('filetype', String(filetype)); const req = new HttpRequest('POST', `${this.apiService.base_url + '/'}Employee/uploadEmpFile`, formData, { reportProgress: true, responseType: 'json' }); return this.http.request(req); } uploadEmpFileInProfileUpdate(selectedFile: File, empid: number, referenceid: number, filetype: number, fileName: string): Observable> { const formData: FormData = new FormData(); formData.append('empfile', selectedFile); formData.append('empid', String(empid)); formData.append('referenceid', String(referenceid)); formData.append('filetype', String(filetype)); formData.append('fileName', String(fileName)); const req = new HttpRequest('POST', `${this.apiService.base_url + '/'}Employee/uploadEmpFileInProfileUpdate`, formData, { reportProgress: true, responseType: 'json' }); return this.http.request(req); } GetuploadEmpFile(empid: number, referenceid: number, filetype: number): Observable> { return this.apiService.httpGet('/Employee/GetuploadEmpFile' + '/' + empid + '/' + referenceid + '/' + filetype); } GetCompanyImage(): Observable>{ return this.apiService.httpGet('/Employee/GetCompanyImage'); } getUploadEmpFileInProfileUpdate(empid: number, referenceid: number, filetype: number): Observable> { return this.apiService.httpGet('/Employee/getUploadEmpFileInProfileUpdate' + '/' + empid + '/' + referenceid + '/' + filetype); } GetPayrollTypeNameByLoginID(){ return this.apiService.httpGet('/Employee/GetPayrollTypeNameByLoginID'); } getDashBoardGraphData() { return this.apiService.httpGet('/Employee/getDashBoardGraphData'); } getSelfServiceBasicData() { return this.apiService.httpGet('/Employee/getSelfServiceBasicData'); } getNomineesForEss(employeeId: number) { return this.apiService.httpGet('/Employee/getNomineesForEss/' + employeeId); } getTrainingForEss(employeeId: number) { return this.apiService.httpGet('/Employee/getTrainingForEss/' + employeeId); } getSelfServiceContactData() { return this.apiService.httpGet('/Employee/getSelfServiceContactData'); } getSelfServiceAcademic() { return this.apiService.httpGet('/Employee/getSelfServiceAcademic'); } getEmpExperiences(empId: number) { return this.apiService.httpGet('/Employee/getEmpExperiences/' + empId); } getSelfServiceFamilyInfo() { return this.apiService.httpGet('/Employee/getSelfServiceFamilyInfo'); } getLandingPageData(isEmployee: number, isLeave: number, isAttendance: number) { return this.apiService.httpGet('/Employee/getLandingPageData/' + isEmployee + '/' + isLeave + '/' + isAttendance); } getOtEligibleEmployees() { return this.apiService.httpGet('/Employee/getOtEligibleEmployees/'); } getEmployeeConfirmationData(param: any) { return this.apiService.httpPost('/Employee/getEmployeeConfirmationData/', param); } getupcomingConfirmation(param: any) { let datestr = this.apiService.getApiDateString(param); return this.apiService.httpGet('/Employee/getupcomingConfirmation/' + param); } deleteEmployeeConfirmationData(params: EmployeeConfirmation) { return this.apiService.httpPost('/Employee/deleteEmployeeConfirmationData', params); } saveEmployeeConfirmationData(params: any) { return this.apiService.httpPost('/Employee/saveEmployeeConfirmationData', params); } GetMyTeam(){ return this.apiService.httpGet('/Employee/getMyTeam'); } GetCordinatorTeam(){ return this.apiService.httpGet('/Employee/GetCordinatorTeam'); } GetLiveEmployee(){ return this.apiService.httpGet('/Employee/getLiveEmployee'); } GetEmpOrganogramInfo() { return this.apiService.httpGet('/Employee/getEmpOrganogramInfo'); } getEmpInfoForGateman(id: number) { return this.apiService.httpGet('/Employee/getEmpInfoForGateman/' + id); } getMaternityLeaveEmployee(params : any): Observable { return this.apiService.httpPost('/Employee/GetMaternityLeaveEmployee', params); } GetEmployeeByCoordinator(corID: number) { return this.apiService.httpGet('/Employee/GetEmployeeByCoordinator' + '/' + corID); } GetCoordinatorList() { return this.apiService.httpGet('/Employee/GetCoordinatorList'); } DeleteEmpCoordinator(empCordinator: any) { return this.apiService.httpPost('/Employee/deletecordinator', empCordinator); } deletecordinator GetEmployeeByCoordinatorID() { return this.apiService.httpGet('/Employee/GetEmployeeByCoordinatorID'); } GetLgoinCordinatorEmps() { return this.apiService.httpGet('/Employee/GetLgoinCordinatorEmps'); } GetSchedulerData() { return this.apiService.httpGet('/Employee/GetSchedulerData'); } GetSchedulerBasedOnType(params : any) { return this.apiService.httpPost('/Employee/GetSchedulerBasedOnType', params); } getAuthorizedPerson(): any { return this.apiService.httpGet('/Employee/getAuthorizedPerson'); } getProfilePermission(): any { return this.apiService.httpGet('/Employee/getProfilePermission'); } getDashboardAttnPermission(): any { return this.apiService.httpGet('/Employee/dashboardAttnRemoved'); } gethnmdropdownactive(): any { return this.apiService.httpGet('/Employee/hnmdropdownactive'); } generateEmployeeNo(): any { return this.apiService.httpGet('/Employee/generateEmployeeNo'); } updateBanglaInformation(params : any) { return this.apiService.httpPost('/Employee/updateBanglaInformation', params); } updateBanglaContactInformation(params : any) { return this.apiService.httpPost('/Employee/updateBanglaContactInformation', params); } getPFExceptionData() { return this.apiService.httpGet('/Employee/getPFExceptionData'); } updatePFExceptionData(params: any) { return this.apiService.httpPost('/Employee/updatePFExceptionData', params); } deletePFExceptionById(id: number) { return this.apiService.httpGet('/Employee/deletePFExceptionById'+'/'+id); } saveHnmEmployee(param: any) { return this.apiService.httpPost('/Employee/saveHnmEmployee', param); } getEmployeeByIDHNM(empID: number) { return this.apiService.httpGet('/Employee/getEmployeeByIDforHNM' + '/' + empID); } getSearchEmployeesByEmpIds(empIds: string) { return this.apiService.httpGet('/Employee/getSearchEmployeesByEmpIds/' + empIds); } getAllEmployeeNameAndNo() { return this.apiService.httpGet('/Employee/getAllEmployeeNameAndNo'); } }