mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
290 lines
7.4 KiB
TypeScript
290 lines
7.4 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';
|
|
import { DocumentSetUpMeeting } from '../models/CallMeeting';
|
|
import { Excludetask } from '../models/Excludetask';
|
|
|
|
@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);
|
|
}
|
|
|
|
SetTaskToPending(serialNumber:string): Observable<any>{
|
|
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("serialNumber", serialNumber);
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
return this.http.post<any>(`${geturl}`,'', options);
|
|
}
|
|
|
|
GetPendingTasks(onlyCount: boolean){
|
|
const geturl = environment.apiURL + 'Tasks/ListPending';
|
|
let params = new HttpParams();
|
|
|
|
params = params.set("onlyCount", onlyCount.toString());
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
params: params
|
|
};
|
|
|
|
return this.http.get<any>(`${geturl}`, options);
|
|
}
|
|
|
|
DelegateTask(body:any){
|
|
const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options);
|
|
}
|
|
|
|
GetTaskParticipants(folderId): 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)
|
|
}
|
|
|
|
CompleteTask(body:Excludetask) {
|
|
const geturl = environment.apiURL + 'Tasks/CompleteTask';
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options)
|
|
}
|
|
|
|
CompleteParecerPrTask(body:any){
|
|
const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr';
|
|
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options)
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
postDespatchoPr(body:any) {
|
|
const geturl = environment.apiURL + 'Processes/CreateDispatchPR';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options)
|
|
}
|
|
|
|
postParecer(body:any){
|
|
const geturl = environment.apiURL + 'Processes/CreateParecer';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options)
|
|
}
|
|
|
|
postParecerPr(body:any){
|
|
const geturl = environment.apiURL + 'Processes/CreateParecerPR';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options)
|
|
}
|
|
|
|
postDeferimento(body:any){
|
|
const geturl = environment.apiURL + 'Processes/CreateDeferimento';
|
|
let options = {
|
|
headers: this.headers,
|
|
};
|
|
return this.http.post<any>(`${geturl}`, body, options)
|
|
}
|
|
|
|
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 + 'search/documents';
|
|
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);
|
|
}
|
|
|
|
documentSetUpMeeting(body: DocumentSetUpMeeting) {
|
|
|
|
let url = environment.apiURL + 'Processes/CallMeeting';
|
|
url = url.replace('/V4/','/V5/')
|
|
|
|
let options: any = {
|
|
headers: this.headers,
|
|
}
|
|
return this.http.post<any>(`${url}`,body, options);
|
|
}
|
|
|
|
}
|