| | |
| | | using Microsoft.Extensions.Logging; |
| | | using Newtonsoft.Json; |
| | | using WIDESEAWCS_Core.LogHelper; |
| | | using Serilog; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | if (currentEntity == null) |
| | | { |
| | | _repository.GetOrCreate(newState.IPAddress, newState.RobotCrane ?? new RobotCraneDevice()); |
| | | _logger.LogDebug("TryUpdateStateSafely:创建新状态,IP: {IpAddress}", ipAddress); |
| | | QuartzLogger.Debug($"创建新状态,IP: {ipAddress}", ipAddress); |
| | | QuartzLogHelper.LogDebug(_logger, $"创建新状态,IP: {ipAddress}", ipAddress); |
| | | return true; |
| | | } |
| | | |
| | |
| | | |
| | | if (!success) |
| | | { |
| | | _logger.LogWarning("TryUpdateStateSafely:版本冲突,更新失败,IP: {IpAddress},期望版本: {ExpectedVersion}", ipAddress, expectedVersion); |
| | | QuartzLogger.Warn($"版本冲突,更新失败,IP: {ipAddress}", ipAddress); |
| | | QuartzLogHelper.LogWarn(_logger, $"TryUpdateStateSafely:版本冲突,更新失败,IP: {ipAddress},期望版本: {expectedVersion}", ipAddress); |
| | | } |
| | | |
| | | return success; |
| | |
| | | return _repository.ToSocketState(entity); |
| | | } |
| | | } |
| | | } |
| | | } |