using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using System;
|
using WMS.IBLL.IIndexEcharServer;
|
using WMS.IBLL.ILogServer;
|
using WMS.IBLL.ISysServer;
|
|
namespace Wms_09.Controllers
|
{
|
[Route("api/[controller]/[action]")]
|
[ApiController]
|
[Authorize]
|
public class IndexEcharController : ControllerBase
|
{
|
/// <summary>
|
/// 依赖注入
|
/// </summary>
|
private readonly IDailyInventoryServer daily;
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="_daily"></param>
|
public IndexEcharController(IDailyInventoryServer _daily)
|
{
|
daily = _daily;
|
}
|
|
/// <summary>
|
/// 当前任务量
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
public IActionResult DailyInventory()
|
{
|
//捕获异常
|
try
|
{
|
var list = daily.DailyInventory();
|
return Ok(new
|
{
|
code = 0,
|
msg = "任务列表",
|
data = list
|
});
|
}
|
catch (Exception ex)
|
{
|
//抛出异常
|
throw new Exception("获取当前任务量异常", ex);
|
}
|
}
|
|
/// <summary>
|
/// 当前单据量
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
public IActionResult DailyReceipts()
|
{
|
//捕获异常
|
try
|
{
|
var list = daily.DailyReceipts();
|
return Ok(new
|
{
|
code = 0,
|
msg = "单据列表",
|
data = list
|
});
|
}
|
catch (Exception ex)
|
{
|
//抛出异常
|
throw new Exception("获取当前单据量异常", ex);
|
}
|
}
|
|
/// <summary>
|
/// 获取储位占用量
|
/// </summary>
|
/// <returns></returns>
|
/// <exception cref="Exception"></exception>
|
[HttpPost]
|
public IActionResult LocatInventory()
|
{
|
//捕获异常
|
try
|
{
|
var list = daily.LocatInventory();
|
return Ok(new
|
{
|
code = 0,
|
msg = "储位占用量",
|
data = list
|
});
|
}
|
catch (Exception ex)
|
{
|
//抛出异常
|
throw new Exception("获取当前储位占用量异常", ex);
|
}
|
}
|
|
[HttpPost]
|
public IActionResult LocatInventoryA()
|
{
|
//捕获异常
|
try
|
{
|
var list = daily.LocatInventoryA();
|
return Ok(new
|
{
|
code = 0,
|
msg = "储位占用量",
|
data = list
|
});
|
}
|
catch (Exception ex)
|
{
|
//抛出异常
|
throw new Exception("获取当前储位占用量异常", ex);
|
}
|
}
|
}
|
}
|