You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.9 KiB

using Entity.Api.Req;
using Entity.Api.Resp;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
4 months ago
using Microsoft.Extensions.Localization;
using Service.Station;
namespace WebStarter.Controllers;
/// <summary>
/// 换电状态订单信息
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class SwapOrderStepController : ControllerBase
{
private readonly SwapOrderStepService swapOrderStepService;
4 months ago
private readonly IStringLocalizer<SwapOrderStepController> _localizer;
4 months ago
public SwapOrderStepController(IStringLocalizer<SwapOrderStepController> localizer,SwapOrderStepService swapOrderStepService)
{
4 months ago
_localizer = localizer;
this.swapOrderStepService = swapOrderStepService;
}
/// <summary>
/// 查询换电状态订单信息
/// </summary>
/// <param name="swapOrderStepReq"> 查询参数</param>
/// <returns></returns>
[HttpPost]
[Route("QuerySwapOrderStep")]
public Result<PageResult<SwapOrderStepResp>> QuerySwapOrderStep([FromBody] QuerySwapOrderStepReq swapOrderStepReq)
{
4 months ago
PageResult<SwapOrderStepResp> pageResult = swapOrderStepService.QueryEqmFaultInfo(swapOrderStepReq);
4 months ago
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))
{
6 months ago
return Result<bool>.Success(true,"删除成功");
}
else
{
return Result<bool>.Fail("删除失败");
}
}
6 months ago
}