Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

151 righe
4.8 KiB

  1. using DataVApi.Order;
  2. using DataVApi.Order.RequestModel;
  3. using DataVAPI.Model;
  4. using Microsoft.AspNetCore.Mvc;
  5. namespace DataVAPI.Controllers
  6. {
  7. /// <summary>
  8. /// 订单接口:统计订单或者营业额
  9. /// </summary>
  10. public class OrderController : BaseController
  11. {
  12. string st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  13. OrderProvider orderProvider = new OrderProvider();
  14. /// <summary>
  15. /// 全部数据
  16. /// </summary>
  17. [HttpPost]
  18. public JsonMsg<object> GetAllOrderDataState(FullScreenInput auth)
  19. {
  20. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  21. try
  22. {
  23. object retdata = orderProvider.GetAllOrderDataState(auth);
  24. return JsonMsg<object>.OK(retdata, st);
  25. }
  26. catch (System.Exception ex)
  27. {
  28. return JsonMsg<object>.Error(null, st, ex.Message);
  29. }
  30. }
  31. /// <summary>
  32. /// 店铺id 或者 设备id查询全部数据
  33. /// </summary>
  34. /// <param name="auth"></param>
  35. /// <returns></returns>
  36. [HttpGet]
  37. public JsonMsg<object> GetAllOrderDataState(int? OrgId,int? DeviceId)
  38. {
  39. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  40. try
  41. {
  42. FullScreenInput fullScreen = new FullScreenInput();
  43. if (OrgId.HasValue) fullScreen.OrgId = OrgId;
  44. if (DeviceId.HasValue) fullScreen.DeviceId = DeviceId;
  45. object retdata = orderProvider.GetAllOrderDataState(fullScreen);
  46. return JsonMsg<object>.OK(retdata, st);
  47. }
  48. catch (System.Exception ex)
  49. {
  50. return JsonMsg<object>.Error(null, st, ex.Message);
  51. }
  52. }
  53. /// <summary>
  54. /// 折线图
  55. /// </summary>
  56. [HttpPost]
  57. public JsonMsg<object> OrderLine(FullScreenInput auth)
  58. {
  59. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  60. try
  61. {
  62. object retdata = orderProvider.OrderLine(auth);
  63. return JsonMsg<object>.OK(retdata, st);
  64. }
  65. catch (System.Exception ex)
  66. {
  67. return JsonMsg<object>.Error(null, st, ex.Message);
  68. }
  69. }
  70. /// <summary>
  71. /// 折线图
  72. /// </summary>
  73. [HttpGet]
  74. public JsonMsg<object> OrderLine(int Count)
  75. {
  76. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  77. try
  78. {
  79. FullScreenBasic fullScreen=new FullScreenBasic();
  80. fullScreen.Count = Count;
  81. object retdata = orderProvider.OrderLine(fullScreen);
  82. return JsonMsg<object>.OK(retdata, st);
  83. }
  84. catch (System.Exception ex)
  85. {
  86. return JsonMsg<object>.Error(null, st, ex.Message);
  87. }
  88. }
  89. /// <summary>
  90. /// 区域销售
  91. /// </summary>
  92. [HttpPost]
  93. public JsonMsg<object> GetLocSale()
  94. {
  95. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  96. try
  97. {
  98. object retdata = orderProvider.GetLocSale();
  99. return JsonMsg<object>.OK(retdata, st);
  100. }
  101. catch (System.Exception ex)
  102. {
  103. return JsonMsg<object>.Error(null, st, ex.Message);
  104. }
  105. }
  106. /// <summary>
  107. /// 下单数量
  108. /// </summary>
  109. [HttpPost]
  110. public JsonMsg<object> OrderNumber(FullScreenBasic input)
  111. {
  112. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  113. try
  114. {
  115. object retdata = orderProvider.OrderNumber(input);
  116. return JsonMsg<object>.OK(retdata, st);
  117. }
  118. catch (System.Exception ex)
  119. {
  120. return JsonMsg<object>.Error(null, st, ex.Message);
  121. }
  122. }
  123. /// <summary>
  124. /// 下单数量
  125. /// </summary>
  126. [HttpGet]
  127. public JsonMsg<object> OrderNumber(int? OrgId, int? DeviceId)
  128. {
  129. st = System.Reflection.MethodBase.GetCurrentMethod().Name;
  130. try
  131. {
  132. FullScreenBasic fullScreen = new FullScreenBasic();
  133. if (OrgId.HasValue) fullScreen.OrgId = OrgId;
  134. if (DeviceId.HasValue) fullScreen.DeviceId = DeviceId;
  135. object retdata = orderProvider.OrderNumber(fullScreen);
  136. return JsonMsg<object>.OK(retdata, st);
  137. }
  138. catch (System.Exception ex)
  139. {
  140. return JsonMsg<object>.Error(null, st, ex.Message);
  141. }
  142. }
  143. }
  144. }