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.
 
 
 
 
 
 

96 lines
2.7 KiB

  1. using Learun.Application.TwoDevelopment.AssetManagementSystem;
  2. using Nancy;
  3. namespace Learun.Application.WebApi
  4. {
  5. /// <summary>
  6. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  7. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  8. /// 创 建:超级管理员
  9. /// 日 期:2019-10-17 17:01
  10. /// 描 述:盘点单列表
  11. /// </summary>
  12. public class InventoryApi : BaseApi
  13. {
  14. private readonly Ass_InventoryIBLL inventoryIBLL = new Ass_InventoryBLL();
  15. /// <summary>
  16. /// 注册接口
  17. /// <summary>
  18. public InventoryApi()
  19. : base("/Learun/AssetManagementSystem/Inventory")
  20. {
  21. Get["/pagelist"] = GetPageList;
  22. Get["/form"] = GetForm;
  23. Post["/delete"] = DeleteForm;
  24. }
  25. #region  提交数据
  26. /// <summary>
  27. /// 删除实体数据
  28. /// <param name="_"></param>
  29. /// <summary>
  30. /// <returns></returns>
  31. public Response DeleteForm(dynamic _)
  32. {
  33. var keyValue = GetReqData();
  34. inventoryIBLL.DeleteEntity(keyValue);
  35. return Success("删除成功!");
  36. }
  37. #endregion
  38. #region  私有类
  39. /// <summary>
  40. /// 表单实体类
  41. /// <summary>
  42. private class ReqFormEntity
  43. {
  44. public string keyValue { get; set; }
  45. public string strEntity { get; set; }
  46. }
  47. #endregion
  48. #region  获取数据
  49. /// <summary>
  50. /// 获取页面显示列表分页数据
  51. /// <summary>
  52. /// <param name="_"></param>
  53. /// <returns></returns>
  54. public Response GetPageList(dynamic _)
  55. {
  56. var parameter = GetReqData<ReqPageParam>();
  57. var data = inventoryIBLL.GetPageList(parameter.pagination, parameter.queryJson);
  58. var jsonData = new
  59. {
  60. rows = data,
  61. parameter.pagination.total,
  62. parameter.pagination.page,
  63. parameter.pagination.records
  64. };
  65. return Success(jsonData);
  66. }
  67. /// <summary>
  68. /// 获取表单数据
  69. /// <summary>
  70. /// <param name="_"></param>
  71. /// <returns></returns>
  72. public Response GetForm(dynamic _)
  73. {
  74. var keyValue = GetReqData();
  75. var Ass_InventoryData = inventoryIBLL.GetAss_InventoryEntity(keyValue);
  76. var jsonData = new
  77. {
  78. Ass_Inventory = Ass_InventoryData
  79. };
  80. return Success(jsonData);
  81. }
  82. #endregion
  83. }
  84. }