| | |
| | | using System.Security.Claims; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | { |
| | | public class ContainerService : ServiceBase<Dt_Container, IRepository<Dt_Container>>, IContainerService |
| | | { |
| | | public ContainerService(IRepository<Dt_Container> BaseDal) : base(BaseDal) |
| | | private readonly IMessageInfoService _messageInfoService; |
| | | public ContainerService(IRepository<Dt_Container> BaseDal, IMessageInfoService messageInfoService) : base(BaseDal) |
| | | { |
| | | _messageInfoService = messageInfoService; |
| | | } |
| | | |
| | | public IRepository<Dt_Container> Repository => BaseDal; |
| | |
| | | var result = HttpHelper.Get(url); |
| | | var response = JsonConvert.DeserializeObject<CollResponse<CoolDto>>(result); |
| | | |
| | | if (response?.code != "000" || response.data == null) |
| | | if (response.code != "000" || response.data == null) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "鎺ュ彛杩斿洖鏁版嵁鎶ラ敊" }; |
| | | } |
| | |
| | | cool.CurrentTemperature = item.temperature; |
| | | cool.Humidity = item.humidity; |
| | | cool.Alarm = item.alarm; |
| | | cool.AlarmInformation = item.message ?? "杩愯姝e父"; |
| | | cool.AlarmInformation = item.message; |
| | | cool.ModifyDate = currentTime; |
| | | updateList.Add(cool); |
| | | if (cool.Alarm!="姝e父") |
| | | { |
| | | _messageInfoService.AddMessageInfo(MessageGroupByEnum.EquipmentAlarm, $"鍐锋煖{item.alarm}", item.message, MessageStatusEnum.Undisposed); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | CurrentTemperature = item.temperature, |
| | | Humidity = item.humidity, |
| | | Alarm = item.alarm, |
| | | AlarmInformation = item.message ?? "杩愯姝e父", |
| | | AlarmInformation = item.message, |
| | | CreateDate = currentTime, |
| | | Creater = "System", |
| | | ModifyDate = currentTime, |
| | | Modifier = "System" |
| | | }; |
| | | addList.Add(dto); |
| | | if (cool.Alarm != "姝e父") |
| | | { |
| | | _messageInfoService.AddMessageInfo(MessageGroupByEnum.EquipmentAlarm, $"鍐锋煖{item.alarm}", item.message, MessageStatusEnum.Undisposed); |
| | | } |
| | | } |
| | | } |
| | | |