mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
219 lines
5.6 KiB
TypeScript
219 lines
5.6 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
import { DailyWorkTask } from '../models/dailyworktask.model';
|
|
import { AuthService } from '../services/auth.service';
|
|
import { User } from '../models/user.model';
|
|
import { environment } from 'src/environments/environment';
|
|
import { Observable } from 'rxjs';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class ProcessesService {
|
|
|
|
authheader = {};
|
|
loggeduser: User;
|
|
headers: HttpHeaders;
|
|
|
|
constructor(private http: HttpClient, user: AuthService) {
|
|
this.loggeduser = user.ValidatedUser;
|
|
this.headers = new HttpHeaders();
|
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
|
}
|
|
|
|
GetTasksList(processname:string, onlycount:boolean): Observable<any>
|
|
{
|
|
const geturl = environment.apiURL + 'tasks/List';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("ProcessName", processname);
|
|
params = params.set("OnlyCount", onlycount.toString());
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
GetTask(serialnumber:string): Observable<any>{
|
|
const geturl = environment.apiURL + 'Tasks/FindTask';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("serialNumber", serialnumber);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
GetTaskParticipants(folderId:string): Observable<any>{
|
|
const geturl = environment.apiURL + 'Processes/GetUsersInDispash';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("folderId", folderId);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
FindTaskDocId(serialnumber:string): Observable<any>
|
|
{
|
|
const geturl = environment.apiURL + 'Tasks/FindExpedienteDocId';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("serialNumber", serialnumber);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
GetMDOficialTasks(): Observable<any>
|
|
{
|
|
const geturl = environment.apiURL + 'tasks/GetMDOficialTasks';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
GetMDPersonalTasks(): Observable<any>
|
|
{
|
|
const geturl = environment.apiURL + 'tasks/GetMDPersonalTasks';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
GetToApprovedEvents(categoryname:string, count:string): Observable<any>
|
|
{
|
|
const geturl = environment.apiURL + 'Tasks/ListByCategory';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("categoryname", categoryname);
|
|
params = params.set("onlyCount", count);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params,
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
PostTaskAction(body:any){
|
|
const geturl = environment.apiURL + 'Tasks/Complete';
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
|
console.log(res);
|
|
});
|
|
}
|
|
|
|
UpdateTaskStatus(FolderId:string): Observable<any>{
|
|
const geturl = environment.apiURL + 'Tasks/UpdateTaskStatus';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("FolderId", FolderId);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.post<any>(`${geturl}`,'', options);
|
|
}
|
|
|
|
GetDocumentUrl(DocId:string, FsId:string): Observable<any>{
|
|
const geturl = environment.apiURL + 'ecm/document/viewrequestshort';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("DocId", DocId);
|
|
params = params.set("applicationid", FsId);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
postDespatcho(body:any){
|
|
const geturl = environment.apiURL + 'Processes/CreateDispatch';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
|
console.log(res);
|
|
});
|
|
}
|
|
|
|
postParecer(body:any){
|
|
const geturl = environment.apiURL + 'Processes/CreateParecer';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
|
console.log(res);
|
|
});
|
|
}
|
|
|
|
postDeferimento(body:any){
|
|
const geturl = environment.apiURL + 'Processes/CreateDeferimento';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options).toPromise().then(res =>{
|
|
console.log(res);
|
|
});
|
|
}
|
|
|
|
|
|
GetActionsList(){
|
|
const geturl = environment.apiURL + 'presidentialActions';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
console.log(options);
|
|
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
GetSubjectType(){
|
|
const geturl = environment.apiURL + 'ecm/SubjectType';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
GetDocumentDetails(DocId:string, FsId:string){
|
|
const geturl = environment.apiURL + 'ecm/document/viewrequestshort';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("docId", DocId);
|
|
params = params.set("applicationid", FsId);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|