| | |
| | | namespace WCS.Application; |
| | | using Microsoft.AspNetCore.SignalR; |
| | | |
| | | namespace WCS.Application; |
| | | |
| | | /// <summary> |
| | | /// 报警信息表服务 |
| | |
| | | public class WcsAlarmInfoService : IDynamicApiController, ITransient |
| | | { |
| | | private readonly SqlSugarRepository<WcsAlarmInfo> _wcsAlarmInfoRep; |
| | | public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep) |
| | | private readonly IHubContext<PlcHub, IPlcHub> _plcHubContext; |
| | | |
| | | public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep, IHubContext<PlcHub, IPlcHub> plcHubContext) |
| | | { |
| | | _wcsAlarmInfoRep = wcsAlarmInfoRep; |
| | | _plcHubContext = plcHubContext; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [DisplayName("获取报警信息表列表")] |
| | | public async Task<List<WcsAlarmInfoOutput>> List([FromQuery] PageWcsAlarmInfoInput input) |
| | | { |
| | | return await _wcsAlarmInfoRep.AsQueryable().Select<WcsAlarmInfoOutput>().ToListAsync(); |
| | | return await _wcsAlarmInfoRep.AsQueryable() |
| | | //.WhereIF(!input.Status.IsNullOrEmpty(), s => s.Status == input.Status) |
| | | .Select<WcsAlarmInfoOutput>().ToListAsync(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 复位报警 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [ApiDescriptionSettings(Name = "Reset")] |
| | | [DisplayName("复位报警")] |
| | | public async Task Reset() |
| | | { |
| | | //测试推数据用的 |
| | | await _plcHubContext.Clients.All.PublicAlarm(new WcsAlarmInfoOutput() { Id = new Random().Next(), StationNum = "205", AlarmCode = "MB102", AlarmName = "有物品遮挡", AlarmTime = DateTime.Now }); |
| | | //throw Oops.Bah("开发中"); |
| | | |
| | | } |
| | | |
| | | |
| | | } |