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.

ReceivableController.cs 4.2 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. using Learun.Application.CRM;
  2. using Learun.Util;
  3. using System.Web.Mvc;
  4. namespace Learun.Application.Web.Areas.LR_CRMModule.Controllers
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创 建:超级管理员
  10. /// 日 期:2017-07-11 14:48
  11. /// 描 述:应收账款
  12. /// </summary>
  13. public class ReceivableController : MvcControllerBase
  14. {
  15. private CrmReceivableBLL crmReceivableBLL = new CrmReceivableBLL();
  16. #region 视图功能
  17. /// <summary>
  18. /// 列表页面
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet]
  22. public ActionResult Index()
  23. {
  24. return View();
  25. }
  26. /// <summary>
  27. /// 收款页面
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet]
  31. public ActionResult ReceiptForm()
  32. {
  33. return View();
  34. }
  35. #endregion
  36. #region 获取数据
  37. /// <summary>
  38. /// 获取收款单列表
  39. /// </summary>
  40. /// <param name="pagination">分页参数</param>
  41. /// <param name="queryJson">查询参数</param>
  42. /// <returns>返回分页列表Json</returns>
  43. [HttpGet]
  44. public ActionResult GetPaymentPageListJson(string pagination, string queryJson)
  45. {
  46. Pagination paginationobj = pagination.ToObject<Pagination>();
  47. var data = crmReceivableBLL.GetPaymentPageList(paginationobj, queryJson);
  48. var jsonData = new
  49. {
  50. rows = data,
  51. total = paginationobj.total,
  52. page = paginationobj.page,
  53. records = paginationobj.records,
  54. };
  55. return JsonResult(jsonData);
  56. }
  57. /// <summary>
  58. /// 获取收款记录列表
  59. /// </summary>
  60. /// <param name="orderId">订单Id</param>
  61. /// <returns>返回列表Json</returns>
  62. [HttpGet]
  63. [AjaxOnly]
  64. public ActionResult GetPaymentRecordJson(string orderId)
  65. {
  66. var data = crmReceivableBLL.GetPaymentRecord(orderId);
  67. return JsonResult(data);
  68. }
  69. #endregion
  70. #region 提交数据
  71. /// <summary>
  72. /// 保存表单(新增)
  73. /// </summary>
  74. /// <param name="keyValue">主键值</param>
  75. /// <param name="entity">实体对象</param>
  76. /// <returns></returns>
  77. [HttpPost]
  78. [ValidateAntiForgeryToken]
  79. [AjaxOnly]
  80. public ActionResult SaveForm(CrmReceivableEntity entity)
  81. {
  82. crmReceivableBLL.SaveEntity(entity);
  83. return Success("操作成功。");
  84. }
  85. #endregion
  86. #region 报表
  87. #region 视图功能
  88. /// <summary>
  89. /// 列表页面
  90. /// </summary>
  91. /// <returns></returns>
  92. [HttpGet]
  93. public ActionResult ReportIndex()
  94. {
  95. return View();
  96. }
  97. #endregion
  98. #region 获取数据
  99. /// <summary>
  100. /// 获取收款列表
  101. /// </summary>
  102. /// <param name="queryJson">查询参数</param>
  103. /// <returns>返回列表Json</returns>
  104. [HttpGet]
  105. public ActionResult GetListJson(string queryJson)
  106. {
  107. var data = crmReceivableBLL.GetReportList(queryJson);
  108. return ToJsonResult(data);
  109. }
  110. /// <summary>
  111. /// 获取收款列表
  112. /// </summary>
  113. /// <param name="pagination"></param>
  114. /// <param name="queryJson"></param>
  115. /// <returns></returns>
  116. [HttpGet]
  117. public ActionResult GetPageListJson(string pagination, string queryJson)
  118. {
  119. Pagination paginationobj = pagination.ToObject<Pagination>();
  120. var data = crmReceivableBLL.GetReportPageList(paginationobj, queryJson);
  121. var jsonData = new
  122. {
  123. rows = data,
  124. total = paginationobj.total,
  125. page = paginationobj.page,
  126. records = paginationobj.records,
  127. };
  128. return JsonResult(jsonData);
  129. }
  130. #endregion
  131. #endregion
  132. }
  133. }