故障配置(数据库字段不全)

master
xjl 6 months ago
parent 1fe786d954
commit b195a52329

@ -0,0 +1,52 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///添加设备报警等级
///</summary>
public partial class AddEquipAlarmLevelReq
{
/// <summary>
/// 自增id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,52 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///添加设备报警等级
///</summary>
public partial class AddEquipAlarmTypeReq
{
/// <summary>
/// 自增id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,49 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///更改设备报警等级
///</summary>
public partial class ModifyEquipAlarmLevelReq
{
/// <summary>
/// 自增id
/// </summary>
[Required]
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,49 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///更改设备报警等级
///</summary>
public partial class ModifyEquipAlarmTypeReq
{
/// <summary>
/// 自增id
/// </summary>
[Required]
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,53 @@
using System;
using System.Linq;
using System.Text;
using HybirdFrameworkCore.Entity;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///查询设备报警等级
///</summary>
public partial class QueryEquipAlarmLevelReq : QueryPageModel
{
/// <summary>
/// 自增id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string? CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string? UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,53 @@
using System;
using System.Linq;
using System.Text;
using HybirdFrameworkCore.Entity;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///查询设备报警等级
///</summary>
public partial class QueryEquipAlarmTypeReq : QueryPageModel
{
/// <summary>
/// 自增id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string? CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string? UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,41 @@
using HybirdFrameworkCore.Entity;
namespace Entity.Api.Req;
/// <summary>
/// 查询换电步序
/// </summary>
public class QuerySwapOrderStepReq : QueryPageModel
{
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
public int Id { get; set; }
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
public string? SwapOrderSn { get; set; }
/// <summary>
/// Desc:步序;0-未知1-空闲200-rfid扫描300-云平台验证;
/// Default:
/// Nullable:True
/// </summary>
public int? Step { get; set; }
/// <summary>
/// Desc:步序名称
/// Default:
/// Nullable:True
/// </summary>
public string? StepName { get; set; }
}

@ -0,0 +1,52 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///添加设备报警等级
///</summary>
public partial class EquipAlarmLevelResp
{
/// <summary>
/// 自增id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,52 @@
using System;
using System.Linq;
using System.Text;
using SqlSugar;
namespace Entity.DbModel.Station
{
///<summary>
///添加设备报警等级
///</summary>
public partial class EquipAlarmTypeResp
{
/// <summary>
/// 自增id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
public DateTime? UpdatedTime { get; set; }
}
}

@ -11,41 +11,50 @@ namespace Entity.DbModel.Station
[SugarTable("equip_alarm_level")]
public partial class EquipAlarmLevel
{
public EquipAlarmLevel(){
/// <summary>
/// 自增id
/// </summary>
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
public long Id { get; set; }
//TODO 数据库字段未设计完
}
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
[SugarColumn(ColumnName = "created_by")]
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
[SugarColumn(ColumnName = "created_time")]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
[SugarColumn(ColumnName = "updated_by")]
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
[SugarColumn(ColumnName = "updated_time")]
public DateTime? UpdatedTime { get; set; }
}
}

@ -11,41 +11,44 @@ namespace Entity.DbModel.Station
[SugarTable("equip_alarm_type")]
public partial class EquipAlarmType
{
public EquipAlarmType(){
/// <summary>
/// 自增id
/// </summary>
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
public long Id { get; set; }
}
//TODO 数据库字段未设计完
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
[SugarColumn(ColumnName = "created_by")]
public string CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
[SugarColumn(ColumnName = "created_time")]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
[SugarColumn(ColumnName = "updated_by")]
public string UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
[SugarColumn(ColumnName = "updated_time")]
public DateTime? UpdatedTime { get; set; }
}
}

@ -11,73 +11,65 @@ namespace Entity.DbModel.Station
[SugarTable("swap_order_step")]
public partial class SwapOrderStep
{
public SwapOrderStep(){
}
/// <summary>
/// Desc:id
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey=true,IsIdentity=true,ColumnName="id")]
public int Id {get;set;}
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
public int Id { get; set; }
/// <summary>
/// Desc:换电订单编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="swap_order_sn")]
public string SwapOrderSn {get;set;}
[SugarColumn(ColumnName = "swap_order_sn")]
public string? SwapOrderSn { get; set; }
/// <summary>
/// Desc:步序;0-未知1-空闲200-rfid扫描300-云平台验证;
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="step")]
public int? Step {get;set;}
[SugarColumn(ColumnName = "step")]
public int Step { get; set; }
/// <summary>
/// Desc:步序名称
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="step_name")]
public string StepName {get;set;}
[SugarColumn(ColumnName = "step_name")]
public string? StepName { get; set; }
/// <summary>
/// Desc:创建人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_by")]
public string CreatedBy {get;set;}
[SugarColumn(ColumnName = "created_by")]
public string ?CreatedBy { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="created_time")]
public DateTime? CreatedTime {get;set;}
[SugarColumn(ColumnName = "created_time")]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// Desc:更新人
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_by")]
public string UpdatedBy {get;set;}
[SugarColumn(ColumnName = "updated_by")]
public string ?UpdatedBy { get; set; }
/// <summary>
/// Desc:更新时间
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName="updated_time")]
public DateTime? UpdatedTime {get;set;}
[SugarColumn(ColumnName = "updated_time")]
public DateTime? UpdatedTime { get; set; }
}
}

@ -0,0 +1,14 @@
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.Station;
[Scope("SingleInstance")]
public class EquipAlarmLevelRepository : BaseRepository<EquipAlarmLevel>
{
public EquipAlarmLevelRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
}
}

@ -0,0 +1,14 @@
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.Station;
[Scope("SingleInstance")]
public class EquipAlarmTypeRepository : BaseRepository<EquipAlarmType>
{
public EquipAlarmTypeRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
}
}

@ -0,0 +1,52 @@
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository.Station;
using SqlSugar;
using System.Linq.Expressions;
namespace Service.Station;
[Scope("SingleInstance")]
public class EquipAlarmLevelService : BaseServices<EquipAlarmLevel>
{
EquipAlarmLevelRepository _equipAlarmLevelRepository;
public EquipAlarmLevelService(EquipAlarmLevelRepository dal)
{
_equipAlarmLevelRepository = dal;
BaseDal = dal;
}
/// <summary>
/// 根据条件查询故障等级信息分页
/// </summary>
/// <param name="equipAlarmLevel"></param>
/// <returns></returns>
public PageResult<EquipAlarmLevelResp> QueryEqmFaultInfo(QueryEquipAlarmLevelReq equipAlarmLevel)
{
//创建一个空的表达式树
Expression<Func<EquipAlarmLevel, bool>> where = null;
//// 定义参数表达式
ParameterExpression parameter = Expression.Parameter(typeof(EquipAlarmLevel), "u");
//TODO 缺少数据库字段先屏蔽
//if (!string.IsNullOrEmpty(quipAlarmLevel.Level))
//{
// Expression<Func<EquipAlarmLevel, bool>> condition1Expr = u => u.Level == quipAlarmLevel.Level;
// where = condition1Expr;
//}
//// 构建查询条件
//if (!string.IsNullOrEmpty(quipAlarmLevel.LevelName))
//{
// Expression<Func<EquipAlarmLevel, bool>> condition2Expr = u => u.LevelName == quipAlarmLevel.LevelName;
// where = where == null ? condition2Expr : Expression.Lambda<Func<EquipAlarmLevel, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
//}
//查询
return PageResult<EquipAlarmLevelResp>.ConvertPage(_equipAlarmLevelRepository.QueryIPageByCause(equipAlarmLevel, where));
}
}

@ -0,0 +1,52 @@
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository.Station;
using SqlSugar;
using System.Linq.Expressions;
namespace Service.Station;
[Scope("SingleInstance")]
public class EquipAlarmTypeService : BaseServices<EquipAlarmType>
{
EquipAlarmTypeRepository _equipAlarmTypeRepository;
public EquipAlarmTypeService(EquipAlarmTypeRepository dal)
{
_equipAlarmTypeRepository = dal;
BaseDal = dal;
}
/// <summary>
/// 根据条件查询故障信息分页
/// </summary>
/// <param name="equipAlarmType"></param>
/// <returns></returns>
public PageResult<EquipAlarmTypeResp> QueryEqmFaultInfo(QueryEquipAlarmTypeReq equipAlarmType)
{
//创建一个空的表达式树
Expression<Func<EquipAlarmType, bool>> where = null;
//// 定义参数表达式
ParameterExpression parameter = Expression.Parameter(typeof(EquipAlarmType), "u");
//TODO 缺少数据库字段先屏蔽
//if (!string.IsNullOrEmpty(quipAlarmLevel.Level))
//{
// Expression<Func<EquipAlarmLevel, bool>> condition1Expr = u => u.Level == quipAlarmLevel.Level;
// where = condition1Expr;
//}
//// 构建查询条件
//if (!string.IsNullOrEmpty(quipAlarmLevel.LevelName))
//{
// Expression<Func<EquipAlarmLevel, bool>> condition2Expr = u => u.LevelName == quipAlarmLevel.LevelName;
// where = where == null ? condition2Expr : Expression.Lambda<Func<EquipAlarmLevel, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
//}
//查询
return PageResult<EquipAlarmTypeResp>.ConvertPage(_equipAlarmTypeRepository.QueryIPageByCause(equipAlarmType, where));
}
}

@ -0,0 +1,63 @@
using Entity.Api.Req;
using Entity.Api.Resp;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository.Station;
using SqlSugar;
using System.Linq.Expressions;
namespace Service.Station;
[Scope("SingleInstance")]
public class SwapOrderStepService : BaseServices<SwapOrderStep>
{
SwapOrderStepRepository _swapOrderStepRepository;
public SwapOrderStepService(SwapOrderStepRepository dal)
{
_swapOrderStepRepository = dal;
BaseDal = dal;
}
/// <summary>
/// 根据条件查询换电步序信息分页
/// </summary>
/// <param name="swapOrderStep"></param>
/// <returns></returns>
public PageResult<SwapOrderStepResp> QueryEqmFaultInfo(QuerySwapOrderStepReq swapOrderStep)
{
//创建一个空的表达式树
Expression<Func<SwapOrderStep, bool>> where = null;
//// 定义参数表达式
ParameterExpression parameter = Expression.Parameter(typeof(SwapOrderStep), "u");
if (swapOrderStep.Id!=0)
{
Expression<Func<SwapOrderStep, bool>> condition1Expr = u => u.Id == swapOrderStep.Id;
where = condition1Expr;
}
if (swapOrderStep.Step != 0)
{
Expression<Func<SwapOrderStep, bool>> condition2Expr = u => u.Step == swapOrderStep.Step;
where = where == null ? condition2Expr : Expression.Lambda<Func<SwapOrderStep, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
}
if (!string.IsNullOrEmpty(swapOrderStep.SwapOrderSn))
{
Expression<Func<SwapOrderStep, bool>> condition2Expr = u => u.SwapOrderSn == swapOrderStep.SwapOrderSn;
where = where == null ? condition2Expr : Expression.Lambda<Func<SwapOrderStep, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
}
// 构建查询条件
if (!string.IsNullOrEmpty(swapOrderStep.StepName))
{
Expression<Func<SwapOrderStep, bool>> condition2Expr = u => u.StepName == swapOrderStep.StepName;
where = where == null ? condition2Expr : Expression.Lambda<Func<SwapOrderStep, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
}
//查询
return PageResult<SwapOrderStepResp>.ConvertPage(_swapOrderStepRepository.QueryIPageByCause(swapOrderStep, where));
}
}

@ -0,0 +1,118 @@
using AutoMapper;
using Entity.Api.Req;
using Entity.Api.Resp;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.Station;
namespace WebStarter.Controllers;
/// <summary>
/// 换电设备报警等级
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class EquipAlarmLevelController : ControllerBase
{
private readonly EquipAlarmLevelService equipAlarmLevelService;
public EquipAlarmLevelController(EquipAlarmLevelService equipAlarmLevelService)
{
this.equipAlarmLevelService = equipAlarmLevelService;
}
/// <summary>
/// 查询故障等级信息
/// </summary>
/// <param name="eqmFaultLevelReq"> 查询参数</param>
/// <returns></returns>
[HttpPost]
[Route("QueryEquipAlarmLevel")]
public Result<PageResult<EquipAlarmLevelResp>> QueryEquipAlarmLevel([FromBody] QueryEquipAlarmLevelReq eqmFaultLevelReq)
{
return Result<PageResult<EquipAlarmLevelResp>>.Success(equipAlarmLevelService.QueryEqmFaultInfo(eqmFaultLevelReq));
}
/// <summary>
/// 添加故障等级信息
/// </summary>
/// <param name="eqmFaultLevelReq"> 添加参数</param>
/// <returns></returns>
[HttpPost]
[Route("AddEquipAlarmLevel")]
public Result<bool> AddEquipAlarmLevel([FromBody] AddEquipAlarmLevelReq eqmFaultLevelReq)
{
//映射数据
var config = new MapperConfiguration(cfg => cfg.CreateMap<EquipAlarmLevel, AddEquipAlarmLevelReq>().ReverseMap());
IMapper mapper = config.CreateMapper();
EquipAlarmLevel baseEqmFaultLevel = mapper.Map<EquipAlarmLevel>(eqmFaultLevelReq);
//TODO Id换成等级字段
var eqmFaultLevel = equipAlarmLevelService.QueryByClause(u => u.Id == eqmFaultLevelReq.Id);
if (eqmFaultLevel!=null)
{
return Result<bool>.Fail("插入失败!已有改等级信息");
}
else
{
// 更改
if (equipAlarmLevelService.Insert(baseEqmFaultLevel) != 0)
{
return Result<bool>.Success("插入成功");
}
else
{
return Result<bool>.Fail("插入失败");
}
}
}
/// <summary>
/// 更改故障等级信息
/// </summary>
/// <param name="eqmFaultLevelReq">更改信息 </param>
/// <returns></returns>
[HttpPost]
[Route("ModifyEquipAlarmLevel")]
public Result<bool> ModifyEquipAlarmLevel([FromBody] ModifyEquipAlarmLevelReq eqmFaultLevelReq)
{
var config = new MapperConfiguration(cfg => cfg.CreateMap<EquipAlarmLevel, ModifyEquipAlarmLevelReq>().ReverseMap());
IMapper mapper = config.CreateMapper();
EquipAlarmLevel baseEqmFaultLevel = mapper.Map<EquipAlarmLevel>(eqmFaultLevelReq);
if (equipAlarmLevelService.Update(baseEqmFaultLevel))
{
return Result<bool>.Success("更改成功");
}
else
{
return Result<bool>.Fail("更改失败");
}
}
/// <summary>
/// 删除故障等级信息
/// </summary>
/// <param name="ids">自增id数组</param>
/// <returns></returns>
[HttpPost]
[Route("RemoveEquipAlarmLevel")]
public Result<bool> RemoveEquipAlarmLevel([FromBody] int[] ids)
{
if (equipAlarmLevelService.DeleteByIds(ids))
{
return Result<bool>.Success("删除成功");
}
else
{
return Result<bool>.Fail("删除失败");
}
}
}

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

@ -2,7 +2,8 @@
"ConnectionStrings": {
"DbType": "MySql",
//SqlServer,MySql
"SqlConnection": "server=127.0.0.1;Port=3307;Database=winformdevframework;Uid=root;Pwd=w123ee;Charset=utf8;"
"SqlConnection": "server=127.0.0.1;Port=3306;Database=huanneng_dev;Uid=root;Pwd=123456;Charset=utf8;"
//"SqlConnection": "server=192.168.2.2;Port=3306;Database=huanneng_dev;Uid=root;Pwd=Rszn123;Charset=utf8;",
},
"Update": {
"AutoUpdate": "false",

Loading…
Cancel
Save