RealCurveBLL.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using LeaRun.Application.Entity.WaterWellManage;
  2. using LeaRun.Application.Service.WaterWellManage;
  3. using LeaRun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace LeaRun.Application.Busines.WaterWell
  10. {
  11. /// <summary>
  12. /// 实时图表
  13. /// </summary>
  14. public class RealCurveBLL
  15. {
  16. RealCurveService service = new RealCurveService();
  17. #region 获取实时图表
  18. /// <summary>
  19. /// 获取实时图表
  20. /// </summary>
  21. /// <param name="tableNames"></param>
  22. /// <param name="type"></param>
  23. /// <returns></returns>
  24. public string GetRealCurve(string tableNames, string type)
  25. {
  26. var tables = Json.ToList<string>(tableNames);
  27. List<RealCurveEntity> list = service.GetRealCurve(tables, type);
  28. StringBuilder sb = new StringBuilder("[");
  29. Dictionary<string, List<RealCurveEntity>> d = new Dictionary<string, List<RealCurveEntity>>();
  30. for (int i = 0; i < tables.Count; i++)
  31. {
  32. d.Add(tables[i], new List<RealCurveEntity>());
  33. }
  34. for (int i = 0; i < list.Count; i++)
  35. {
  36. d["WaterWell_" + list[i].WaterWellId].Add(list[i]);
  37. }
  38. return Json.ToJson(d);
  39. }
  40. #endregion
  41. }
  42. }