浏览代码

联锁状态判断逻辑修正

sl 9 月之前
父节点
当前提交
9ad186e327

+ 12 - 6
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/impl/InterlockSummaryServiceImpl.java

@@ -219,7 +219,8 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
         String controlSystemStatusNormal = base.getControlSystemStatusNormal(); // 正常
         String controlSystemStatusAbnormal = editStatus(base.getControlSystemStatusNormal()); // 非正常
         // 旁路状态
-        String bypassYes = base.getBypassYes(); // 是
+        String bypassYes = base.getBypassYes(); // 否 无旁路
+        String bypassNo = editStatus(base.getBypassYes()); // 是  有旁路
         // 仪表状态
         String instrumentStatusNormal = base.getInstrumentStatusNormal(); // 正常
         String instrumentStatusAbnormal = editStatus(base.getInstrumentStatusNormal()); // 正常
@@ -258,8 +259,10 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
             dto.setSummaryid(summaryId);
 
 
-            //联锁状态; 旁路状态是多个的话,任何一个旁路状态为“是”,则联锁状态是“未投用(摘除)”,旁路状态都为“否”,则联锁状态是“投用”。
-            if(dto.getBypass()!=null && bypassYes.equals(dto.getBypass())) interlockStatus = interlockStatusWty;
+//            //联锁状态; 旁路状态是多个的话,任何一个旁路状态为“是”,则联锁状态是“未投用(摘除)”,旁路状态都为“否”,则联锁状态是“投用”。
+//            if(dto.getBypass()!=null && bypassYes.equals(dto.getBypass())) interlockStatus = interlockStatusWty;
+            //联锁状态:旁路状态多个的话,任何一个旁路状态是故障状态,则联锁状态是故障状态,如果旁路状态都是正常状态,则联锁状态是正常状态
+            if(dto.getBypass()!=null && bypassNo.equals(dto.getBypass())) interlockStatus = interlockStatusWty;
 
             //仪表状态
             if(dto.getInstrumentStatusJuge()!=null){
@@ -367,7 +370,8 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
         String controlSystemStatusNormal = base.getControlSystemStatusNormal(); // 正常
         String controlSystemStatusAbnormal = editStatus(base.getControlSystemStatusNormal()); // 非正常
         // 旁路状态
-        String bypassYes = base.getBypassYes(); // 是
+        String bypassYes = base.getBypassYes(); // 否   无旁路
+        String bypassNo = editStatus(base.getBypassYes()); // 是  旁路
         // 仪表状态
         String instrumentStatusNormal = base.getInstrumentStatusNormal(); // 正常
         String instrumentStatusAbnormal = editStatus(base.getInstrumentStatusNormal()); // 正常
@@ -397,8 +401,10 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
             dto.setSummaryid(summaryId);
 
 
-            //联锁状态; 旁路状态是多个的话,任何一个旁路状态为“是”,则联锁状态是“未投用(摘除)”,旁路状态都为“否”,则联锁状态是“投用”。
-            if(dto.getBypass()!=null && bypassYes.equals(dto.getBypass())) interlockStatus = interlockStatusWty;
+//            //联锁状态; 旁路状态是多个的话,任何一个旁路状态为“是”,则联锁状态是“未投用(摘除)”,旁路状态都为“否”,则联锁状态是“投用”。
+//            if(dto.getBypass()!=null && bypassYes.equals(dto.getBypass())) interlockStatus = interlockStatusWty;
+            //联锁状态:旁路状态多个的话,任何一个旁路状态是故障状态,则联锁状态是故障状态,如果旁路状态都是正常状态,则联锁状态是正常状态
+            if(dto.getBypass()!=null && bypassNo.equals(dto.getBypass())) interlockStatus = interlockStatusWty;
 
             //仪表状态
             if(dto.getInstrumentStatusJuge()!=null){