|
|
|
using Entity.Api.Req;
|
|
|
|
using Entity.Api.Resp;
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
using Service.Station;
|
|
|
|
|
|
|
|
namespace WebStarter.Controllers;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 换电状态订单信息
|
|
|
|
/// </summary>
|
|
|
|
[ApiController]
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
public class SwapOrderStepController : ControllerBase
|
|
|
|
{
|
|
|
|
|
|
|
|
private readonly SwapOrderStepService swapOrderStepService;
|
|
|
|
private readonly IStringLocalizer<SwapOrderStepController> _localizer;
|
|
|
|
|
|
|
|
public SwapOrderStepController(IStringLocalizer<SwapOrderStepController> localizer,SwapOrderStepService swapOrderStepService)
|
|
|
|
{
|
|
|
|
_localizer = localizer;
|
|
|
|
this.swapOrderStepService = swapOrderStepService;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 查询换电状态订单信息
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="swapOrderStepReq"> 查询参数</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("QuerySwapOrderStep")]
|
|
|
|
public Result<PageResult<SwapOrderStepResp>> QuerySwapOrderStep([FromBody] QuerySwapOrderStepReq swapOrderStepReq)
|
|
|
|
{
|
|
|
|
PageResult<SwapOrderStepResp> pageResult = swapOrderStepService.QueryEqmFaultInfo(swapOrderStepReq);
|
|
|
|
|
|
|
|
if (pageResult.Rows.Count > 0)
|
|
|
|
{
|
|
|
|
foreach (var order in pageResult.Rows)
|
|
|
|
{
|
|
|
|
order.StepName = _localizer[order.StepName];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Result<PageResult<SwapOrderStepResp>>.Success(pageResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 删除换电状态订单信息
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ids">自增id数组</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("RemoveSwapOrderStep")]
|
|
|
|
public Result<bool> RemoveSwapOrderStep([FromBody] int[] ids)
|
|
|
|
{
|
|
|
|
if (swapOrderStepService.DeleteByIds(ids))
|
|
|
|
{
|
|
|
|
return Result<bool>.Success(true,"删除成功");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return Result<bool>.Fail("删除失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|