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