ReportDemoController.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using LeaRun.Application.Code;
  2. using LeaRun.Util.Offices;
  3. using LeaRun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace LeaRun.Application.Web.Areas.ReportManage.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 6.1
  13. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  14. /// 创建人:佘赐雄
  15. /// 日 期:2016.3.28 16:54
  16. /// 描 述:报表Demo
  17. /// </summary>
  18. public class MobileAuditorController : MvcControllerBase
  19. {
  20. #region 视图功能
  21. /// <summary>
  22. /// 采购报表
  23. /// </summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. [HandlerAuthorize(PermissionMode.Enforce)]
  27. public ActionResult Purchase()
  28. {
  29. return View();
  30. }
  31. /// <summary>
  32. /// 销售报表
  33. /// </summary>
  34. /// <returns></returns>
  35. [HttpGet]
  36. [HandlerAuthorize(PermissionMode.Enforce)]
  37. public ActionResult Sales()
  38. {
  39. return View();
  40. }
  41. /// <summary>
  42. /// 仓库报表
  43. /// </summary>
  44. /// <returns></returns>
  45. [HttpGet]
  46. [HandlerAuthorize(PermissionMode.Enforce)]
  47. public ActionResult Store()
  48. {
  49. return View();
  50. }
  51. /// <summary>
  52. /// 对账报表
  53. /// </summary>
  54. /// <returns></returns>
  55. [HttpGet]
  56. [HandlerAuthorize(PermissionMode.Enforce)]
  57. public ActionResult Reconciliation()
  58. {
  59. return View();
  60. }
  61. #endregion
  62. #region 获取数据
  63. /// <summary>
  64. /// 获取采购报表数据
  65. /// </summary>
  66. /// <returns></returns>
  67. [HttpGet]
  68. public ActionResult GetPurchaseJson()
  69. {
  70. var data = ExcelHelper.ExcelImport(Server.MapPath("~/Areas/ReportManage/Views/ReportDemo/data/Purchase.xlsx"));
  71. return Content(data.ToJson());
  72. }
  73. /// <summary>
  74. /// 获取销售报表数据
  75. /// </summary>
  76. /// <returns></returns>
  77. [HttpGet]
  78. public ActionResult GetSalesJson()
  79. {
  80. var data = ExcelHelper.ExcelImport(Server.MapPath("~/Areas/ReportManage/Views/ReportDemo/data/Sales.xlsx"));
  81. return Content(data.ToJson());
  82. }
  83. /// <summary>
  84. /// 获取仓库报表数据
  85. /// </summary>
  86. /// <returns></returns>
  87. [HttpGet]
  88. public ActionResult GetStoreJson()
  89. {
  90. var data = ExcelHelper.ExcelImport(Server.MapPath("~/Areas/ReportManage/Views/ReportDemo/data/Store.xlsx"));
  91. return Content(data.ToJson());
  92. }
  93. /// <summary>
  94. /// 获取对账报表数据
  95. /// </summary>
  96. /// <returns></returns>
  97. [HttpGet]
  98. public ActionResult GetReconciliationJson()
  99. {
  100. var data = ExcelHelper.ExcelImport(Server.MapPath("~/Areas/ReportManage/Views/ReportDemo/data/Reconciliation.xlsx"));
  101. return Content(data.ToJson());
  102. }
  103. #endregion
  104. }
  105. }