AW6241 Support source in item count

This commit is contained in:
Peter Bastiani 2024-09-16 14:11:39 +02:00
parent 53c60427f1
commit af4e6f45d1

View File

@ -81,7 +81,7 @@ export class ItemService {
getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string,
indexed?: boolean, validToday?: boolean,tags?:string,crs?:string, startDate?: Date, endDate?: Date, indexed?: boolean, validToday?: boolean,tags?:string,crs?:string, startDate?: Date, endDate?: Date,
skip?: number, take?: number): Observable<IItem[]> { skip?: number, take?: number, sourceTask?: string): Observable<IItem[]> {
let params = new HttpParams(); let params = new HttpParams();
if(itemType) params = params.append("it", itemType); if(itemType) params = params.append("it", itemType);
if(dataFilter) params = params.append("df", JSON.stringify(dataFilter)); if(dataFilter) params = params.append("df", JSON.stringify(dataFilter));
@ -93,15 +93,16 @@ export class ItemService {
if (crs) params = params.append("crs", crs); if (crs) params = params.append("crs", crs);
if (startDate) params = params.append("sDate", startDate.toISOString()); if (startDate) params = params.append("sDate", startDate.toISOString());
if (endDate) params = params.append("eDate", endDate.toISOString()); if (endDate) params = params.append("eDate", endDate.toISOString());
if (sourceTask) params = params.append("sourceTask", sourceTask);
if(skip) params = params.append("skip", skip); if(skip) params = params.append("skip", skip);
if(take) params = params.append("take", take); if(take) params = params.append("take", take);
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params }); return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params });
} }
getItemListCount(itemType: string, startDate?: Date, endDate?: Date, crs?:string): Observable<number> { getItemListCount(itemType: string, startDate?: Date, endDate?: Date, sourceTask?: string): Observable<number> {
let params = new HttpParams(); let params = new HttpParams();
params = params.append("it", itemType); params = params.append("it", itemType);
if (crs) params = params.append("crs", crs); if (sourceTask) params = params.append("sourceTask", sourceTask);
if (startDate) params = params.append("sDate", startDate.toISOString()); if (startDate) params = params.append("sDate", startDate.toISOString());
if (endDate) params = params.append("eDate", endDate.toISOString()); if (endDate) params = params.append("eDate", endDate.toISOString());
return this.httpClient.get<number>(`${this.ApiEndpoint()}/api/v1/items/count`, { params: params }); return this.httpClient.get<number>(`${this.ApiEndpoint()}/api/v1/items/count`, { params: params });