a lot of changes

This commit is contained in:
Eudes Inácio
2023-09-06 21:23:21 +01:00
parent 9de3019446
commit fb1bd07ad0
25 changed files with 1187 additions and 482 deletions
+80 -56
View File
@@ -20,8 +20,8 @@ export class ProcessesService {
loggeduser: LoginUserRespose;
headers: HttpHeaders;
headers2: HttpHeaders;
constructor(
private http: HttpClient,
@@ -31,12 +31,12 @@ export class ProcessesService {
this.loggeduser = SessionStore.user;
this.setHeader()
this.changeProfileService.registerCallback(()=>{
this.changeProfileService.registerCallback(() => {
this.loggeduser = SessionStore.user;
this.setHeader()
})
}
@@ -50,11 +50,11 @@ export class ProcessesService {
this.headers2 = new HttpHeaders();
this.headers2 = this.headers2.set('Authorization',"Bearer "+ CPSession.AuthorizationJwt);
this.headers2 = this.headers2.set('Authorization', "Bearer " + CPSession.AuthorizationJwt);
}
uploadFile(formData:any){
uploadFile(formData: any) {
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'lakefs/UploadFiles';
@@ -66,8 +66,7 @@ export class ProcessesService {
return this.http.post(`${geturl}`, formData, options);
}
GetTasksList(processname: typeof GetTasksListType, onlycount:boolean): Observable<fullTaskList[]>
{
GetTasksList(processname: typeof GetTasksListType, onlycount: boolean): Observable<fullTaskList[]> {
const geturl = environment.apiURL + 'tasks/List';
let params = new HttpParams();
@@ -119,7 +118,7 @@ export class ProcessesService {
return this.http.get<ExpedienteFullTask[]>(`${geturl}`, options);
}
GetTask(serialnumber:string): Observable<any> {
GetTask(serialnumber: string): Observable<any> {
const geturl = environment.apiURL + 'Tasks/FindTask';
let params = new HttpParams();
@@ -133,7 +132,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetDraftByID(id:string): Observable<any> {
GetDraftByID(id: string): Observable<any> {
const geturl = environment.apiPCURL + `Documents/${id}`;
let params = new HttpParams();
@@ -147,7 +146,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
SaveDraftByID(id:string, object): Observable<any> {
SaveDraftByID(id: string, object): Observable<any> {
const geturl = environment.apiPCURL + `Documents/${id}`;
let params = new HttpParams();
@@ -160,7 +159,7 @@ export class ProcessesService {
return this.http.put<any>(`${geturl}`, object, options);
}
SetTaskToPending(serialNumber:string): Observable<any>{
SetTaskToPending(serialNumber: string): Observable<any> {
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
let params = new HttpParams();
@@ -170,10 +169,10 @@ export class ProcessesService {
headers: this.headers,
params: params
};
return this.http.post<any>(`${geturl}`,'', options);
return this.http.post<any>(`${geturl}`, '', options);
}
GetPendingTasks(onlyCount: boolean){
GetPendingTasks(onlyCount: boolean) {
const geturl = environment.apiURL + 'Tasks/ListPending';
let params = new HttpParams();
@@ -187,7 +186,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
DelegateTask(body:any){
DelegateTask(body: any) {
const geturl = environment.apiURL + 'Tasks/DelegateTask';
let options = {
@@ -196,7 +195,7 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options);
}
GetTaskParticipants(folderId): Observable<any>{
GetTaskParticipants(folderId): Observable<any> {
const geturl = environment.apiURL + 'Processes/GetUsersInDispash';
let params = new HttpParams();
@@ -209,8 +208,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
FindTaskDocId(serialnumber:string): Observable<any>
{
FindTaskDocId(serialnumber: string): Observable<any> {
const geturl = environment.apiURL + 'Tasks/FindExpedienteDocId';
let params = new HttpParams();
@@ -223,8 +221,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetMDOficialTasks(): Observable<any>
{
GetMDOficialTasks(): Observable<any> {
const geturl = environment.apiURL + 'tasks/GetMDOficialTasks';
let options = {
headers: this.headers,
@@ -232,8 +229,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetMDPersonalTasks(): Observable<any>
{
GetMDPersonalTasks(): Observable<any> {
const geturl = environment.apiURL + 'tasks/GetMDPersonalTasks';
let options = {
headers: this.headers,
@@ -241,8 +237,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetToApprovedEvents(categoryname:string, count:string): Observable<any>
{
GetToApprovedEvents(categoryname: string, count: string): Observable<any> {
const geturl = environment.apiURL + 'Tasks/ListByCategory';
let params = new HttpParams();
@@ -256,7 +251,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
PostTaskAction(body:any){
PostTaskAction(body: any) {
const geturl = environment.apiURL + 'Tasks/Complete';
let options = {
@@ -274,7 +269,7 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
CompleteTask(body:Excludetask) {
CompleteTask(body: Excludetask) {
// double check
const geturl = environment.apiURL + 'Tasks/CompleteTask';
@@ -285,7 +280,7 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
CompleteParecerPrTask(body:any) {
CompleteParecerPrTask(body: any) {
const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr';
let options = {
@@ -294,7 +289,7 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
UpdateTaskStatus(FolderId:any): Observable<any>{
UpdateTaskStatus(FolderId: any): Observable<any> {
const geturl = environment.apiURL + 'Tasks/UpdateTaskStatus';
let params = new HttpParams();
@@ -304,10 +299,10 @@ export class ProcessesService {
headers: this.headers,
params: params
};
return this.http.post<any>(`${geturl}`,'', options);
return this.http.post<any>(`${geturl}`, '', options);
}
GetDocumentUrl(DocId:string, FsId:string): Observable<any>{
GetDocumentUrl(DocId: string, FsId: string): Observable<any> {
const geturl = environment.apiURL + 'ecm/document/viewrequestshort';
let params = new HttpParams();
@@ -321,7 +316,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
postDespatcho(body:any) {
postDespatcho(body: any) {
const geturl = environment.apiURL + 'Processes/CreateDispatch';
let options = {
headers: this.headers,
@@ -329,7 +324,7 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
postDespatchoPr(body:any) {
postDespatchoPr(body: any) {
const geturl = environment.apiURL + 'Processes/CreateDispatchPR';
let options = {
headers: this.headers,
@@ -337,24 +332,24 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
postParecer(body:any) {
postParecer(body: any) {
try {
if(!body.AttachmentList) {
if (!body.AttachmentList) {
body.AttachmentList = {}
}
if(!body?.dataFields) {
if (!body?.dataFields) {
body.dataFields = {}
}
if(!body.dataFields?.DraftIds) {
if (!body.dataFields?.DraftIds) {
body.dataFields.DraftIds = ""
}
if(!body.AttachmentList?.DraftIds) {
if (!body.AttachmentList?.DraftIds) {
body.AttachmentList.DraftIds = ""
}
} catch (error) {}
} catch (error) { }
const geturl = environment.apiURL + 'Processes/CreateParecer';
let options = {
headers: this.headers,
@@ -362,22 +357,22 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
postParecerPr(body:any) {
try {
if(!body.AttachmentList) {
postParecerPr(body: any) {
try {
if (!body.AttachmentList) {
body.AttachmentList = {}
}
if(!body?.dataFields) {
if (!body?.dataFields) {
body.dataFields = {}
}
if(!body.dataFields?.DraftIds) {
if (!body.dataFields?.DraftIds) {
body.dataFields.DraftIds = ""
}
if(!body.AttachmentList?.DraftIds) {
if (!body.AttachmentList?.DraftIds) {
body.AttachmentList.DraftIds = ""
}
} catch(error) {}
} catch (error) { }
const geturl = environment.apiURL + 'Processes/CreateParecerPR';
let options = {
@@ -386,7 +381,7 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
postDeferimento(body:any){
postDeferimento(body: any) {
const geturl = environment.apiURL + 'Processes/CreateDeferimento';
let options = {
headers: this.headers,
@@ -394,12 +389,12 @@ export class ProcessesService {
return this.http.post<any>(`${geturl}`, body, options)
}
GetActionsList(){
GetActionsList() {
const geturl = environment.apiURL + 'presidentialActions';
let options = {
headers: this.headers,
};
return this.http.get<any>(`${geturl}`, options);
}
@@ -412,7 +407,7 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetDocumentDetails(DocId:string, FsId:string){
GetDocumentDetails(DocId: string, FsId: string) {
const geturl = environment.apiURL + 'search/documents';
let params = new HttpParams();
@@ -430,15 +425,15 @@ export class ProcessesService {
documentSetUpMeeting(body: DocumentSetUpMeeting) {
let url = environment.apiURL + 'Processes/CallMeeting';
url = url.replace('/V4/','/V5/')
url = url.replace('/V4/', '/V5/')
let options: any = {
headers: this.headers,
}
return this.http.post<any>(`${url}`,body, options);
return this.http.post<any>(`${url}`, body, options);
}
DocumentDetail(DocId:string, FsId:string){
DocumentDetail(DocId: string, FsId: string) {
const geturl = environment.apiURL + 'ecm/GetDocument';
let params = new HttpParams();
@@ -472,7 +467,7 @@ export class ProcessesService {
GetViewer(DocId:string, FsId:string){
GetViewer(DocId: string, FsId: string) {
const geturl = environment.apiURL + 'ecm/document/viewfile';
let params = new HttpParams();
@@ -493,7 +488,36 @@ export class ProcessesService {
let options = {
headers: this.headers,
};
return this.http.post<any>(`${geturl}`,file, options);
return this.http.post<any>(`${geturl}`, file, options);
}
createEventToAprove(calendarType, agenda, body) {
const geturl = environment.apiURL + 'Processes/CreateEvent/' + agenda;
let params = new HttpParams();
params = params.set('calendarName', calendarType);
let options = {
headers: this.headers,
params: params
};
return this.http.post<any>(`${geturl}`, body, options);
}
generateInstaceFormatDate(): string {
const data = new Date();
const ano = data.getFullYear().toString().padStart(4, '0');
const mes = (data.getMonth() + 1).toString().padStart(2, '0');
const dia = data.getDate().toString().padStart(2, '0');
const horas = data.getHours().toString().padStart(2, '0');
const minutos = data.getMinutes().toString().padStart(2, '0');
const segundos = data.getSeconds().toString().padStart(2, '0');
const milissegundos = data.getMilliseconds().toString().padStart(3, '0');
const dataFormatada = `${ano}-${mes}-${dia}_${horas}:${minutos}:${segundos}.${milissegundos}`;
return dataFormatada;
}
}