25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

136 satır
4.3 KiB

  1. using Nancy;
  2. using Learun.Util;
  3. using System.Collections.Generic;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using System.Linq;
  6. using System;
  7. namespace Learun.Application.WebApi
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2020-04-16 15:52
  14. /// 描 述:班级自诊打卡
  15. /// </summary>
  16. public class ThermographyApi : BaseApi
  17. {
  18. private ThermographyIBLL thermographyIBLL = new ThermographyBLL();
  19. /// <summary>
  20. /// 注册接口
  21. /// <summary>
  22. public ThermographyApi()
  23. : base("/Learun/adms/EducationalAdministration/Thermography")
  24. {
  25. Get["/pagelist"] = GetPageList;
  26. Get["/list"] = GetList;
  27. Get["/listOfStudent"] = GetListOfStudent;
  28. Get["/form"] = GetForm;
  29. Post["/delete"] = DeleteForm;
  30. Post["/save"] = SaveForm;
  31. }
  32. #region 获取数据
  33. /// <summary>
  34. /// 获取页面显示列表分页数据
  35. /// <summary>
  36. /// <param name="_"></param>
  37. /// <returns></returns>
  38. public Response GetPageList(dynamic _)
  39. {
  40. ReqPageParam parameter = this.GetReqData<ReqPageParam>();
  41. var data = thermographyIBLL.GetPageList(parameter.pagination, parameter.queryJson);
  42. var jsonData = new
  43. {
  44. rows = data,
  45. total = parameter.pagination.total,
  46. page = parameter.pagination.page,
  47. records = parameter.pagination.records
  48. };
  49. return Success(jsonData);
  50. }
  51. /// <summary>
  52. /// 获取页面显示列表数据
  53. /// <summary>
  54. /// <param name="_"></param>
  55. /// <returns></returns>
  56. public Response GetList(dynamic _)
  57. {
  58. string queryJson = this.GetReqData();
  59. var data = thermographyIBLL.GetList(queryJson);
  60. return Success(data);
  61. }
  62. /// <summary>
  63. /// 获取表单数据
  64. /// <summary>
  65. /// <param name="_"></param>
  66. /// <returns></returns>
  67. public Response GetForm(dynamic _)
  68. {
  69. string keyValue = this.GetReqData();
  70. var ThermographyData = thermographyIBLL.GetThermographyEntity(keyValue);
  71. var jsonData = new
  72. {
  73. Thermography = ThermographyData,
  74. };
  75. return Success(jsonData);
  76. }
  77. /// <summary>
  78. /// 获取页面显示列表数据
  79. /// <summary>
  80. /// <param name="_"></param>
  81. /// <returns></returns>
  82. public Response GetListOfStudent(dynamic _)
  83. {
  84. ReqPageParam parameter = this.GetReqData<ReqPageParam>();
  85. var data = thermographyIBLL.GetPageListOfStudentInApp(parameter.queryJson).OrderBy(x => x.PersonBeingMeasured);
  86. return Success(data);
  87. }
  88. #endregion
  89. #region 提交数据
  90. /// <summary>
  91. /// 删除实体数据
  92. /// <param name="_"></param>
  93. /// <summary>
  94. /// <returns></returns>
  95. public Response DeleteForm(dynamic _)
  96. {
  97. string keyValue = this.GetReqData();
  98. thermographyIBLL.DeleteEntity(keyValue);
  99. return Success("删除成功!");
  100. }
  101. /// <summary>
  102. /// 保存实体数据(新增、修改)
  103. /// <param name="_"></param>
  104. /// <summary>
  105. /// <returns></returns>
  106. public Response SaveForm(dynamic _)
  107. {
  108. ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
  109. ThermographyEntity entity = parameter.strEntity.ToObject<ThermographyEntity>();
  110. entity.MeasureDate = DateTime.Now;
  111. entity.CreateTime = DateTime.Now;
  112. thermographyIBLL.SaveEntity(this.userInfo, parameter.keyValue, entity);
  113. return Success("保存成功!");
  114. }
  115. #endregion
  116. #region 私有类
  117. /// <summary>
  118. /// 表单实体类
  119. /// <summary>
  120. private class ReqFormEntity
  121. {
  122. public string keyValue { get; set; }
  123. public string strEntity { get; set; }
  124. }
  125. #endregion
  126. }
  127. }