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.
90 lines
2.5 KiB
90 lines
2.5 KiB
using Entity.Api.Req;
|
|
using Entity.Api.Resp;
|
|
using Entity.DbModel.Station;
|
|
using HybirdFrameworkCore.Entity;
|
|
using log4net;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Repository.Station;
|
|
using Service.Station;
|
|
|
|
namespace WebStarter.Controllers;
|
|
|
|
/// <summary>
|
|
/// 报警数据编码
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class EquipAlarmDefineController: ControllerBase
|
|
{
|
|
private static readonly ILog Log = LogManager.GetLogger(typeof(EquipAlarmDefineController));
|
|
private readonly EquipAlarmDefineService equipAlarmDefineRepository;
|
|
|
|
public EquipAlarmDefineController(EquipAlarmDefineService equipAlarmDefineRepository)
|
|
{
|
|
this.equipAlarmDefineRepository = equipAlarmDefineRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询分页数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost("QueryPage")]
|
|
public Result<PageResult<EquipAlarmDefine>> QueryPage([FromBody] EquipAlarmDefineReq req)
|
|
{
|
|
return equipAlarmDefineRepository.QueryEquipAlarmPage(req);
|
|
}
|
|
/// <summary>
|
|
/// 导出未处理报警
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("ExportEquipAlarmRecord")]
|
|
public async Task<IActionResult> ExportEquipAlarmRecord(EquipAlarmDefineReq req)
|
|
{
|
|
return await equipAlarmDefineRepository.ExportEquipAlarmRecord(req);
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 新增
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost("Add")]
|
|
public async Task<Result<string>> Add([FromBody] EquipAlarmDefineReq req)
|
|
{
|
|
return await equipAlarmDefineRepository.Add(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改报警数据编码
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Modify")]
|
|
public async Task<Result<string>> Modify([FromBody] EquipAlarmDefineReq req)
|
|
{
|
|
return await equipAlarmDefineRepository.Modify(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="ids">ids id列表</param>
|
|
/// <returns></returns>
|
|
[HttpPost("DeleteByIds")]
|
|
public async Task<Result<string>> DeleteByIds([FromBody] EquipAlarmDefineReq req)
|
|
{
|
|
return await equipAlarmDefineRepository.DeleteByIds(req);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 文件导入
|
|
/// </summary>
|
|
/// <param name="filePath">文件路径</param>
|
|
[HttpPost("fileImport")]
|
|
public string ImportDataFromExcel(string filePath)
|
|
{
|
|
return equipAlarmDefineRepository.ImportDataFromExcel(filePath);
|
|
}
|
|
} |