1
huangxiaoqiang
2025-07-02 9b139ce92aa09f466c01111dd66af9347a34d865
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs
@@ -60,7 +60,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                var location = _locationRepository.QueryData(x => x.LocationStatus==(int)LocationEnum.Free).ToList();
                var location = _locationRepository.QueryData(x => x.LocationStatus == (int)LocationEnum.Free).ToList();
                if (location.Count == 0)
                {
                    return content.Error("库内无可用库位");
@@ -495,7 +495,7 @@
            try
            {
                LogFactory.GetLog("AGV异常信息").InfoFormat(true, $"请求参数:{JsonConvert.SerializeObject(aGVDTO)}", "");
                var task = BaseDal.QueryFirst(x => x.TaskNum ==Convert.ToInt32( aGVDTO.TaskNum));
                var task = BaseDal.QueryFirst(x => x.TaskNum == Convert.ToInt32(aGVDTO.TaskNum));
                if (task != null)
                {
@@ -558,17 +558,18 @@
                return "";
            }
        }
        public WebResponseContent DeviceWarning(AGVDTO DTO)
        private static readonly SemaphoreSlim _semaphoreUpdate = new SemaphoreSlim(1, 1);
        public async Task<WebResponseContent> DeviceWarning(AGVDTO DTO)
        {
            await _semaphoreUpdate.WaitAsync();
            WebResponseContent content = new WebResponseContent();
            try
            {
                LogFactory.GetLog("AG上传报警信息").InfoFormat(true, $"请求参数:{JsonConvert.SerializeObject(DTO)}", "");
                if (DTO.Message!= null)
                if (DTO.Message != null)
                {
                    Dt_ErrorDescription description=_descriptionRepository.QueryFirst(x => x.Type == DTO.Message);
                    if(description != null)
                    Dt_ErrorDescription description = _descriptionRepository.QueryFirst(x => x.Type == DTO.Message);
                    if (description != null)
                    {
                        _Socket.ErrorReport(description.ErrorCode, "A", "00");
                        _Socket.AddErrorMessage(description.ErrorCode, "AGV", "");
@@ -577,19 +578,23 @@
                    else
                    {
                        return content.Error("未识别报警源");
                    }
                    }
                }
                else
                {
                    return content.Error("未接收到异常信息");
                }
                }
            }
            catch (Exception ex)
            {
                LogFactory.GetLog("AG上传报警信息").InfoFormat(true, $"请求参数:{JsonConvert.SerializeObject(ex.Message)}", "");
                return content.Error(ex.Message);
            }
            finally
            {
                _semaphoreUpdate.Release();
            }
        }
        #endregion å¤–部接口方法
    }