瀏覽代碼

代码提交

oyq28 2 年之前
父節點
當前提交
4e8ead1aa4
共有 2 個文件被更改,包括 9 次插入8 次删除
  1. 2 2
      IMCS_CCS/Service/Impl/HttpRequestService.cs
  2. 7 6
      IMCS_CCS/Service/Impl/TaskJobService.cs

+ 2 - 2
IMCS_CCS/Service/Impl/HttpRequestService.cs

@@ -674,8 +674,8 @@ namespace IMCS.CCS.Services
                         if (actionAddress.CheckType ? operateResult.ToString().Equals(actionAddress.Value) : operateResult.ToString() != actionAddress.Value)
                         {
                             s7.Close();
-                            Log.Instance.WriteLogAdd(ActionTypeEnum.SendFlexibleWire + "取物品异常===>>" + "条件不满足" + JsonConvert.SerializeObject(req),
-                            EnumHelper.GetDescription(ActionTypeEnum.SendFlexibleWire));
+                            Log.Instance.WriteLogAdd(ActionTypeEnum.SendQualityCenter + "取物品异常===>>" + "条件不满足" + JsonConvert.SerializeObject(req),
+                            EnumHelper.GetDescription(ActionTypeEnum.SendQualityCenter));
                             responseData.result = "false";
                             return responseData;
                         }

+ 7 - 6
IMCS_CCS/Service/Impl/TaskJobService.cs

@@ -1400,7 +1400,7 @@ namespace IMCS.CCS.Service.Impl
                         if (Result.IsSuccess)
                         { 
                             ResponseHeidhData responseData = JsonConvert.DeserializeObject<ResponseHeidhData>(Result.Message);
-                            if (!string.IsNullOrEmpty(responseData.errorsInfo) && !responseData.errorsInfo.Contains("无报警"))
+                            if (!string.IsNullOrEmpty(responseData.errorsInfo) && !Result.Message.Contains("无报警"))
                             {
                                 ProductionStatus productionStatus = new ProductionStatus();
                                 productionStatus.id = alarmEquipment.Id.ToString();
@@ -1424,7 +1424,7 @@ namespace IMCS.CCS.Service.Impl
                             if (AlmMsg != null && AlmMsg.Count > 0)
                             {
                                 var msgs = from o in AlmMsg select o.msg;
-                                if(msgs != null && !msgs.ToString().Contains("无报警"))
+                                if(msgs != null && !Result.Message.Contains("无报警"))
                                 {
                                     ProductionStatus productionStatus = new ProductionStatus();
                                     productionStatus.id = alarmEquipment.Id.ToString();
@@ -1437,7 +1437,7 @@ namespace IMCS.CCS.Service.Impl
                         }
 
                     }
-                    else if(alarmEquipment != null)
+                    else if(alarmEquipment != null && onlineDevice.ProtocolType == "S7_1500")
                     {
                         //缓存取PLCagvalue 值
                         List<CcsTagValue> tagValues = new List<CcsTagValue>();
@@ -1461,7 +1461,7 @@ namespace IMCS.CCS.Service.Impl
                         }
                         //获取机械手报警信息
                         CcsTagValue plcWarnValue = tagValues.Where(x => x.Ip == alarmEquipment.IP && x.Address == "DB200.34").FirstOrDefault();
-                        if (plcWarnValue != null)
+                        if (plcWarnValue != null && plcWarnValue.TagValue != "0")
                         {
                             ToolDto ccsDictionary = new ToolDto();
                             ccsDictionary.Type = "PlcWarnInfo";
@@ -1470,12 +1470,13 @@ namespace IMCS.CCS.Service.Impl
                             if (dictList.Count > 0 && dictList[0] != null)
                             {
 
-                                ToolDto dictObj = dictList.Where(x => x.Code.Equals(plcWarnValue.TagValue) && x.state).FirstOrDefault();
+                                ToolDto dictObj = dictList.Where(x => x.Code.ToString() == plcWarnValue.TagValue  && x.state).FirstOrDefault();
                                 if (null != dictObj && !string.IsNullOrEmpty(dictObj.DictValue.Trim()))
                                 {
                                     ProductionStatus productionStatus = new ProductionStatus();
                                     productionStatus.id = alarmEquipment.Id.ToString();
-                                    productionStatus.alertMsg = dictObj.DictValue.Trim();
+                                    productionStatus.alertMsg = dictObj.Description.Trim();
+                                    productionStatus.onlineStatus = "1";
                                     productionStatus.alarmState = true; //报警 
                                     productionStatusList.Add(productionStatus);
                                 }