Aggiornato sync service

This commit is contained in:
Giancarlo Panichi 2022-08-05 12:32:59 +02:00
parent 44c3fc8fa5
commit b93948790f
4 changed files with 11 additions and 8 deletions

View File

@ -785,28 +785,28 @@ public class SyncService {
if (writeTabs == null || writeTabs.isEmpty()) {
writeTabs = "epas_cartellini_rendicontazioni";
} else {
writeTabs = writeTabs + "epas_cartellini_rendicontazioni";
writeTabs = writeTabs + ",epas_cartellini_rendicontazioni";
}
}
if (bpers_orario) {
if (writeTabs == null || writeTabs.isEmpty()) {
writeTabs = "epas_pers_orario";
} else {
writeTabs = writeTabs + "epas_pers_orario";
writeTabs = writeTabs + ",epas_pers_orario";
}
}
if (blavoro_fuori_sede) {
if (writeTabs == null || writeTabs.isEmpty()) {
writeTabs = "epas_lavoro_fuori_sede";
} else {
writeTabs = writeTabs + "epas_lavoro_fuori_sede";
writeTabs = writeTabs + ",epas_lavoro_fuori_sede";
}
}
if (baspettative) {
if (writeTabs == null || writeTabs.isEmpty()) {
writeTabs = "epas_aspettative";
} else {
writeTabs = writeTabs + "epas_aspettative";
writeTabs = writeTabs + ",epas_aspettative";
}
}
return writeTabs;

View File

@ -12,6 +12,6 @@ export class RendicontazioneService {
let queryParams = new HttpParams();
queryParams = queryParams.append('year', year + '');
queryParams = queryParams.append('month', month + '');
return this.http.get(SERVER_API_URL + 'api/sync/test', { params: queryParams });
return this.http.get(SERVER_API_URL + 'api/sync/writes', { params: queryParams });
}
}

View File

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpParams } from '@angular/common/http';
import { SERVER_API_URL } from 'app/app.constants';
import { SyncType } from './sync.model';
@ -10,6 +10,9 @@ export class SyncService {
constructor(private http: HttpClient) {}
sync(syncType: SyncType, year: number, month: number): Observable<{}> {
return this.http.get(SERVER_API_URL + 'api/sync/' + syncType + '?year=' + year + '&month=' + month);
let queryParams = new HttpParams();
queryParams = queryParams.append('year', year + '');
queryParams = queryParams.append('month', month + '');
return this.http.get(SERVER_API_URL + 'api/sync/' + syncType, { params: queryParams });
}
}

View File

@ -29,7 +29,7 @@ public class SyncResourceIT {
private final Logger log = LoggerFactory.getLogger(getClass());
private static final String YEAR="2022";
private static final String MONTH="6";
private static final String MONTH="7";
@Autowired