You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

169 lines
5.7 KiB

  1. using Nancy;
  2. using Learun.Util;
  3. using System.Collections.Generic;
  4. using Learun.Application.TwoDevelopment.PersonnelManagement;
  5. using System;
  6. using Learun.Application.WorkFlow;
  7. namespace Learun.Application.WebApi
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  11. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2021-02-21 10:07
  14. /// 描 述:会议管理
  15. /// </summary>
  16. public class MeetingManagementApi : BaseApi
  17. {
  18. private MeetingManagementIBLL meetingManagementIBLL = new MeetingManagementBLL();
  19. private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();
  20. /// <summary>
  21. /// 注册接口
  22. /// <summary>
  23. public MeetingManagementApi()
  24. : base("/learun/adms/PersonnelManagement/MeetingManagement")
  25. {
  26. Get["/pagelist"] = GetPageList;
  27. Get["/list"] = GetList;
  28. Get["/form"] = GetForm;
  29. Get["/shList"] = GetshList;
  30. Post["/delete"] = DeleteForm;
  31. Post["/save"] = SaveForm;
  32. Post["/submit"] = Submit;
  33. }
  34. #region 获取数据
  35. /// <summary>
  36. /// 获取页面显示列表分页数据
  37. /// <summary>
  38. /// <param name="_"></param>
  39. /// <returns></returns>
  40. public Response GetPageList(dynamic _)
  41. {
  42. ReqPageParam parameter = this.GetReqData<ReqPageParam>();
  43. var data = meetingManagementIBLL.GetPageList(parameter.pagination, parameter.queryJson);
  44. var jsonData = new
  45. {
  46. rows = data,
  47. total = parameter.pagination.total,
  48. page = parameter.pagination.page,
  49. records = parameter.pagination.records
  50. };
  51. return Success(jsonData);
  52. }
  53. /// <summary>
  54. /// 获取页面显示列表数据
  55. /// <summary>
  56. /// <param name="_"></param>
  57. /// <returns></returns>
  58. public Response GetList(dynamic _)
  59. {
  60. string queryJson = this.GetReqData();
  61. var data = meetingManagementIBLL.GetList(queryJson);
  62. return Success(data);
  63. }
  64. /// <summary>
  65. /// 获取表单数据
  66. /// <summary>
  67. /// <param name="_"></param>
  68. /// <returns></returns>
  69. public Response GetForm(dynamic _)
  70. {
  71. string keyValue = this.GetReqData();
  72. var MeetingManagementData = meetingManagementIBLL.GetMeetingManagementEntity(keyValue);
  73. var jsonData = new
  74. {
  75. MeetingManagement = MeetingManagementData,
  76. };
  77. return Success(jsonData);
  78. }
  79. /// <summary>
  80. /// 获取页面显示列表数据
  81. /// <summary>
  82. /// <param name="_"></param>
  83. /// <returns></returns>
  84. public Response GetshList(dynamic _)
  85. {
  86. MeetingManagementEntity parameter = this.GetReqData<MeetingManagementEntity>();
  87. var MeetingManagement = meetingManagementIBLL.GetMeetingManagementEntityByProcessId(parameter.ProcessId);
  88. return Success(MeetingManagement);
  89. }
  90. #endregion
  91. #region 提交数据
  92. /// <summary>
  93. /// 删除实体数据
  94. /// <param name="_"></param>
  95. /// <summary>
  96. /// <returns></returns>
  97. public Response DeleteForm(dynamic _)
  98. {
  99. string keyValue = this.GetReqData();
  100. meetingManagementIBLL.DeleteEntity(keyValue);
  101. return Success("删除成功!");
  102. }
  103. /// <summary>
  104. /// 保存实体数据(新增、修改)
  105. /// <param name="_"></param>
  106. /// <summary>
  107. /// <returns></returns>
  108. public Response SaveForm(dynamic _)
  109. {
  110. ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
  111. MeetingManagementEntity entity = parameter.strEntity.ToObject<MeetingManagementEntity>();
  112. entity.CreateUser = userInfo.userId;
  113. entity.CreateTime = DateTime.Now;
  114. entity.CheckStatus = "0";
  115. string id = meetingManagementIBLL.SaveEntity(this.userInfo, parameter.keyValue, entity); ;
  116. var json = new
  117. {
  118. Id = id
  119. };
  120. return Success(json);
  121. }
  122. ///// <summary>
  123. ///// 提交
  124. ///// <param name="_"></param>
  125. ///// <summary>
  126. ///// <returns></returns>
  127. //public Response Submit(dynamic _)
  128. //{
  129. // string keyValue = this.GetReqData();
  130. // var processId = Guid.NewGuid().ToString();
  131. // meetingManagementIBLL.DoSubmit(keyValue, "1", processId);
  132. // UserInfo userInfo = LoginUserInfo.Get();
  133. // nWFProcessIBLL.CreateFlow("MeetingManagementApply", processId, "", 1, "", userInfo);
  134. // return Success("提交成功!");
  135. //}
  136. public Response Submit(dynamic _)
  137. {
  138. MeetingManagementEntity parameter = this.GetReqData<MeetingManagementEntity>();
  139. //string keyValue = this.GetReqData();
  140. //var processId = Guid.NewGuid().ToString();
  141. meetingManagementIBLL.DoSubmit(parameter.Id, "1", parameter.ProcessId);
  142. //UserInfo userInfo = LoginUserInfo.Get();
  143. //nWFProcessIBLL.CreateFlow("0.1", processId, "", 1, "", userInfo);
  144. return Success("提交成功!");
  145. }
  146. #endregion
  147. #region 私有类
  148. /// <summary>
  149. /// 表单实体类
  150. /// <summary>
  151. private class ReqFormEntity
  152. {
  153. public string keyValue { get; set; }
  154. public string strEntity { get; set; }
  155. }
  156. #endregion
  157. }
  158. }