Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

150 Zeilen
5.2 KiB

  1. using Nancy;
  2. using Learun.Util;
  3. using System.Collections.Generic;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using Learun.Application.TwoDevelopment.LogisticsManagement;
  6. using System;
  7. using Learun.Application.WorkFlow;
  8. namespace Learun.Application.WebApi
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-06-03 14:29
  15. /// 描 述:系部数据
  16. /// </summary>
  17. public class PurchaseLogisticApi : BaseApi
  18. {
  19. private Purchase_LogisticIBLL PurchaseLogisticIBLL = new Purchase_LogisticBLL();
  20. private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();
  21. /// <summary>
  22. /// 注册接口
  23. /// <summary>
  24. public PurchaseLogisticApi()
  25. : base("/learun/adms/PurchaseLogistic")
  26. {
  27. Get["/pagelist"] = GetPageList;
  28. Get["/form"] = GetForm;
  29. Post["/delete"] = DeleteForm;
  30. Post["/save"] = SaveForm;
  31. Post["/submit"] = Submit;
  32. //Get["/shList"] = GetshList;
  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 = PurchaseLogisticIBLL.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 GetForm(dynamic _)
  59. {
  60. string keyValue = this.GetReqData();
  61. var Purchase_LogisticData = PurchaseLogisticIBLL.GetPurchase_LogisticEntity(keyValue);
  62. var Purchase_Logistic_DetailsData = PurchaseLogisticIBLL.GetPurchase_Logistic_DetailsList(Purchase_LogisticData.Id);
  63. var jsonData = new
  64. {
  65. Purchase_Logistic = Purchase_LogisticData,
  66. Purchase_Logistic_Details = Purchase_Logistic_DetailsData,
  67. };
  68. return Success(jsonData);
  69. }
  70. ///// <summary>
  71. ///// 获取页面显示列表数据
  72. ///// <summary>
  73. ///// <param name="_"></param>
  74. ///// <returns></returns>
  75. //public Response GetshList(dynamic _)
  76. //{
  77. // FundsApplyEntity parameter = this.GetReqData<FundsApplyEntity>();
  78. // var FundsApplyData = fundsApplyIBLL.GetEntityByProcessId(parameter.ProcessId);
  79. // var FundsApplyDetailData = fundsApplyDetailIBLL.GetListByApplyId(FundsApplyData.Id);
  80. // var jsonData = new
  81. // {
  82. // FundsApply = FundsApplyData,
  83. // FundsApplyDetail = FundsApplyDetailData,
  84. // };
  85. // return Success(jsonData);
  86. //}
  87. #endregion
  88. #region 提交数据
  89. /// <summary>
  90. /// 删除实体数据
  91. /// <param name="_"></param>
  92. /// <summary>
  93. /// <returns></returns>
  94. public Response DeleteForm(dynamic _)
  95. {
  96. string keyValue = this.GetReqData();
  97. PurchaseLogisticIBLL.DeleteEntity(keyValue);
  98. return Success("删除成功!");
  99. }
  100. /// <summary>
  101. /// 保存实体数据(新增、修改)
  102. /// <param name="_"></param>
  103. /// <summary>
  104. /// <returns></returns>
  105. public Response SaveForm(dynamic _)
  106. {
  107. ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
  108. Purchase_LogisticEntity entity = parameter.strEntity.ToObject<Purchase_LogisticEntity>();
  109. List<Purchase_Logistic_DetailsEntity> detailList = parameter.DetailList.ToObject<List<Purchase_Logistic_DetailsEntity>>();
  110. //var code = entity.EnCode;
  111. PurchaseLogisticIBLL.SaveEntity(parameter.keyValue, entity, detailList);
  112. return Success("保存成功!");
  113. }
  114. /// <summary>
  115. /// 提交
  116. /// <param name="_"></param>
  117. /// <summary>
  118. /// <returns></returns>
  119. public Response Submit(dynamic _)
  120. {
  121. string keyValue = this.GetReqData();
  122. var processId = Guid.NewGuid().ToString();
  123. PurchaseLogisticIBLL.ModifyStatus(keyValue, 1, processId);
  124. UserInfo userInfo = LoginUserInfo.Get();
  125. nWFProcessIBLL.CreateFlow("2-1", processId, "", 1, "", userInfo);
  126. return Success("提交成功!");
  127. }
  128. #endregion
  129. #region 私有类
  130. /// <summary>
  131. /// 表单实体类
  132. /// <summary>
  133. private class ReqFormEntity
  134. {
  135. public string keyValue { get; set; }
  136. public string strEntity { get; set; }
  137. public string DetailList { get; set; }
  138. }
  139. #endregion
  140. }
  141. }