|
- using DataVApi.Order;
- using DataVApi.Order.RequestModel;
- using DataVAPI.Model;
- using Microsoft.AspNetCore.Mvc;
-
- namespace DataVAPI.Controllers
- {
- /// <summary>
- /// 订单接口:统计订单或者营业额
- /// </summary>
- public class OrderController : BaseController
- {
- string st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- OrderProvider orderProvider = new OrderProvider();
- /// <summary>
- /// 全部数据
- /// </summary>
- [HttpPost]
- public JsonMsg<object> GetAllOrderDataState(FullScreenInput auth)
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- object retdata = orderProvider.GetAllOrderDataState(auth);
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
- /// <summary>
- /// 店铺id 或者 设备id查询全部数据
- /// </summary>
- /// <param name="auth"></param>
- /// <returns></returns>
- [HttpGet]
- public JsonMsg<object> GetAllOrderDataState(int? OrgId,int? DeviceId)
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- FullScreenInput fullScreen = new FullScreenInput();
- if (OrgId.HasValue) fullScreen.OrgId = OrgId;
- if (DeviceId.HasValue) fullScreen.DeviceId = DeviceId;
- object retdata = orderProvider.GetAllOrderDataState(fullScreen);
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
-
- /// <summary>
- /// 折线图
- /// </summary>
- [HttpPost]
- public JsonMsg<object> OrderLine(FullScreenInput auth)
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- object retdata = orderProvider.OrderLine(auth);
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
-
- /// <summary>
- /// 折线图
- /// </summary>
- [HttpGet]
- public JsonMsg<object> OrderLine(int Count)
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- FullScreenBasic fullScreen=new FullScreenBasic();
- fullScreen.Count = Count;
- object retdata = orderProvider.OrderLine(fullScreen);
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
-
- /// <summary>
- /// 区域销售
- /// </summary>
- [HttpPost]
- public JsonMsg<object> GetLocSale()
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- object retdata = orderProvider.GetLocSale();
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
-
- /// <summary>
- /// 下单数量
- /// </summary>
- [HttpPost]
- public JsonMsg<object> OrderNumber(FullScreenBasic input)
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- object retdata = orderProvider.OrderNumber(input);
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
-
- /// <summary>
- /// 下单数量
- /// </summary>
- [HttpGet]
- public JsonMsg<object> OrderNumber(int? OrgId, int? DeviceId)
- {
- st = System.Reflection.MethodBase.GetCurrentMethod().Name;
- try
- {
- FullScreenBasic fullScreen = new FullScreenBasic();
- if (OrgId.HasValue) fullScreen.OrgId = OrgId;
- if (DeviceId.HasValue) fullScreen.DeviceId = DeviceId;
- object retdata = orderProvider.OrderNumber(fullScreen);
- return JsonMsg<object>.OK(retdata, st);
- }
- catch (System.Exception ex)
- {
- return JsonMsg<object>.Error(null, st, ex.Message);
- }
- }
- }
- }
|