GplotSystemCheckManager.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:GplotSystemCheckManager
  3. * 作者:xulisong
  4. * 创建时间: 2019/2/28 11:43:24
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using Autodesk.Revit.DB;
  13. namespace SAGA.GplotRelationComputerManage.SystemChecks
  14. {
  15. public class GplotSystemCheckManager
  16. {
  17. public static void CheckSystem(List<Document> documents,List<string> gplotTypeSystems)
  18. {
  19. if (gplotTypeSystems == null || !gplotTypeSystems.Any())
  20. return;
  21. if (documents == null || !documents.Any())
  22. return;
  23. GplotSystemCheckContext context = new GplotSystemCheckContext();
  24. context.Relations.AddRange(gplotTypeSystems);
  25. foreach (var document in documents)
  26. {
  27. var floorItem = new FloorCheckItem(document);
  28. floorItem.Parse(context);
  29. }
  30. //向数据库提交信息
  31. }
  32. public static SystemCheckReportItem GetCacheCheckSystemResult(Document document, string gplotType)
  33. {
  34. /*
  35. * 判断数据库中是否存在;存在直接查询数据库返回;不存在的话进行检测,再返回
  36. */
  37. return GetCheckSystemResult(document, gplotType);
  38. }
  39. public static SystemCheckReportItem GetCheckSystemResult(Document document, string gplotType)
  40. {
  41. CheckSystem(new List<Document>() { document }, new List<string>() { gplotType });
  42. return new SystemCheckReportItem();
  43. }
  44. }
  45. }