yanjinhui
8 小时以前 52ba6b195a4126df405ef453d52ba6eaab6521da
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -1286,6 +1286,7 @@
        {
            throw new NotImplementedException();
        }
        public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode)
        {
            WebResponseContent content = new WebResponseContent();
@@ -1868,5 +1869,36 @@
                return content.Error($"更新站台状态失败:{ex.Message}");
            }
        }
        /// <summary>
        /// PLC报警信息
        /// </summary>
        /// <param name="ErrorMsg"></param>
        /// <returns></returns>
        public WebResponseContent PLCAlarmtoWMS(string ErrorMsg)
        {
            PLCAlarmDTO PLCAlarmDTO = new PLCAlarmDTO();
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(PLCAlarmDTO)) ?? throw new Exception("未找到PLC报警信息接口配置信息!请检查接口配置");
                PLCAlarmDTO.errorMsg = ErrorMsg;
                string response = HttpHelper.Post(apiInfo.ApiAddress, PLCAlarmDTO.Serialize());
                content.OK(data: response);
                WMSReturn wMSReturn = response.DeserializeObject<WMSReturn>();
                if (wMSReturn == null) throw new Exception("WMS返回结果转换失败!");
                if (!wMSReturn.success) throw new Exception(wMSReturn.message);
               return content.OK();
            }
            catch (Exception ex)
            {
                return content.Error(ex.Message);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(PLCAlarmDTO, content, "PLC报警信息上报WMS", "", "");
            }
        }
    }
}