123 lines
4.1 KiB
C#
123 lines
4.1 KiB
C#
using langguanApi.Model;
|
||
using langguanApi.Service;
|
||
using Microsoft.AspNetCore.Http;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
namespace langguanApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 清洁运输
|
||
/// </summary>
|
||
[Route("api/[controller]")]
|
||
[ApiController]
|
||
public class TransportController : ControllerBase
|
||
{
|
||
private TransportService _transportService;
|
||
private WasherService _washerService;
|
||
private TruckScalesService _truckScalesService;
|
||
public TransportController(TransportService transportService, WasherService washerService, TruckScalesService truckScalesService)
|
||
{
|
||
_transportService = transportService;
|
||
_washerService = washerService;
|
||
_truckScalesService = truckScalesService;
|
||
}
|
||
/// <summary>
|
||
/// 获取清洁运输列表
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
public async Task<IActionResult> list([FromQuery] reqpage input)
|
||
{
|
||
var result = await _transportService.GetPage(input);
|
||
return Ok(result);
|
||
}
|
||
/// <summary>
|
||
/// 获取清洁运输数量
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet("count")]
|
||
public async Task<IActionResult> Count()
|
||
{
|
||
var result = await _transportService.GetCount();
|
||
return Ok(result);
|
||
}
|
||
/// <summary>
|
||
/// 新增门禁
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
[HttpPost("add")]
|
||
public async Task<IActionResult> Add(AddTransport input)
|
||
{
|
||
await _transportService.addTransport(input);
|
||
return Ok(new ApiResult() { code = 0 });
|
||
}
|
||
|
||
#region 洗车机
|
||
/// <summary>
|
||
/// 推送洗车机列表(洗车机列表和洗车机记录组合在一起)
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
[HttpPost("addwasherlist")]
|
||
public async Task<IActionResult> AddWasherList(List<AddWasher> input)
|
||
{
|
||
await _washerService.addWasher(input);
|
||
return Ok(new ApiResult() { code = 0 });
|
||
}
|
||
/// <summary>
|
||
/// 获取洗车机列表
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("washerList")]
|
||
public async Task<IActionResult> WasherList()
|
||
{
|
||
var result = await _washerService.getWasherList();
|
||
return Ok(result);
|
||
}
|
||
/// <summary>
|
||
/// 获取洗车机历史记录(起始时间和结束时间非空,根据起始时间和结束时间筛选数据,如果为空,默认获取30条数据)
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("washerhistorylist")]
|
||
public async Task<IActionResult> WasherHistoryList([FromQuery] transportReqPage input)
|
||
{
|
||
var result = await _washerService.WasherHistoryList(input);
|
||
return Ok(result);
|
||
}
|
||
#endregion
|
||
|
||
#region 地磅
|
||
/// <summary>
|
||
/// 推送地磅列表
|
||
/// </summary>
|
||
/// <param name="input"></param>
|
||
/// <returns></returns>
|
||
[HttpPost("addruckscaleslist")]
|
||
public async Task<IActionResult> AddRuckScalesList(List<AddTruckScalesDto> input)
|
||
{
|
||
await _truckScalesService.AddTruckScalesList(input);
|
||
return Ok(new ApiResult() { code = 0 });
|
||
}
|
||
#endregion
|
||
|
||
#region 清洁运输
|
||
/// <summary>
|
||
/// 获取清洁运输(门禁和地磅组合,地磅获取总重量,后期会用地磅重量-车辆车辆)
|
||
/// </summary>
|
||
/// <param name="reqPage"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("gettransport")]
|
||
public async Task<IActionResult> GetTransport([FromQuery] transportReqPage reqPage)
|
||
{
|
||
var result = await _transportService.GetTransport(reqPage);
|
||
return Ok(result);
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
}
|