ReportService.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using wispro.sp.share;
  6. namespace wispro.sp.web.Services
  7. {
  8. public class ReportService
  9. {
  10. private readonly IHttpService _httpClient;
  11. public ReportService(IHttpService httpClient)
  12. {
  13. _httpClient = httpClient;
  14. }
  15. public async Task<ChartDatas> GetAppealReportData(int type,DateTime? start,DateTime? end,int? userId)
  16. {
  17. //AppealReport(int type, DateTime ? start, DateTime ? end, int ? userId)
  18. string strUrl = $"Report/AppealReport?type={type}";
  19. if (start.HasValue)
  20. {
  21. strUrl = $"{strUrl}&start={start?.ToString("yyyy-MM-dd")}";
  22. }
  23. if (end.HasValue)
  24. {
  25. strUrl = $"{strUrl}&end={end?.ToString("yyyy-MM-dd")}";
  26. }
  27. if (userId.HasValue)
  28. {
  29. strUrl = $"{strUrl}&userId={userId.Value}";
  30. }
  31. var data = await _httpClient.Get<share.ChartDatas>(strUrl);
  32. return data;
  33. }
  34. }
  35. }