浏览代码

新增设备离线逻辑处理

oyq28 2 年之前
父节点
当前提交
37493156d7
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      IMCS_CCS/Service/Impl/TaskJobService.cs

+ 10 - 0
IMCS_CCS/Service/Impl/TaskJobService.cs

@@ -98,6 +98,7 @@ namespace IMCS.CCS.Service.Impl
             syncStatusMap.Add("报警", 3);
             syncStatusMap.Add("报警", 3);
             //在线状态默认传参后台空闲状态
             //在线状态默认传参后台空闲状态
             syncStatusMap.Add("在线", 1);
             syncStatusMap.Add("在线", 1);
+            syncStatusMap.Add("掉线", -1);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -1275,6 +1276,15 @@ namespace IMCS.CCS.Service.Impl
 
 
                         continue;
                         continue;
                     }
                     }
+                    else if (device != null && device.State && !device.UseState)
+                    {
+                        if (equipment.Status != "离线")
+                        {
+                            equipment.Status = "离线";
+                            changeEquipmentMonitors.Add(equipment);
+                        }
+                        continue;
+                    }
                     else if (device != null && equipment.Name == "机械手")
                     else if (device != null && equipment.Name == "机械手")
                     {
                     {
                         //缓存取PLCagvalue 值
                         //缓存取PLCagvalue 值