|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- 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);
- }
- }
- }
- }
|