Quellcode durchsuchen

定边报警系统修改

shilin vor 1 Monat
Ursprung
Commit
11cbbcd8a0

+ 4 - 0
alarm-service/src/main/java/com/gyee/alarm/AlarmMain.java

@@ -20,6 +20,10 @@ public class AlarmMain {
 
 //        AlarmBtService alarmBtService= SpringUtils.getBean("alarmBtService");
 //        AlarmWtService alarmWtService= SpringUtils.getBean("alarmWtService");
+//        AlarmCtService alarmCtService= SpringUtils.getBean("alarmCtService");
+//
+//        alarmCtService.createSuperTable();
+//        alarmCtService.initalCtAlarm();
 //
 //
 //

+ 34 - 18
alarm-service/src/main/java/com/gyee/alarm/service/AlarmCtService.java

@@ -63,6 +63,8 @@ public class AlarmCtService {
 
         if (!alarmVoList.isEmpty()) {
             for (AlarmVo vo : alarmVoList) {
+
+
                 alarmTsService.createTable(vo.getTbName(), vo.getAlarmid(), vo.getAlarmtype(),
                         vo.getCharacteristic(), vo.getComponents(),
                         vo.getDescription(),
@@ -74,23 +76,37 @@ public class AlarmCtService {
                         vo.getResettable(), vo.getStationid(),
                         vo.getStationname(), vo.getSubcomponents(),
                         vo.getSuffix(), vo.getTagid(),
-                        vo.getTriggertype(), vo.getUniformcode(),
-                        vo.getSuperTableName(),vo.getName(),
-                        vo.getNemCode(),vo.getFaultCause(),vo.getResolvent(),vo.getFaultType(),vo.getAname());
-                alarmTsService.updateTable(vo.getTbName(), vo.getAlarmid(), vo.getAlarmtype(),
-                        vo.getCharacteristic(), vo.getComponents(),
-                        vo.getDescription(),
-                        vo.getDeviceid(), vo.getDevicename(),
-                        vo.getDevicetype(), vo.getEnabled(),
-                        vo.getLineid(), vo.getLinename(),
-                        vo.getModelId(), vo.getProjectid(),
-                        vo.getProjectname(), vo.getRank(),
-                        vo.getResettable(), vo.getStationid(),
-                        vo.getStationname(), vo.getSubcomponents(),
-                        vo.getSuffix(), vo.getTagid(),
                         vo.getTriggertype(), vo.getUniformcode(), vo.getSuperTableName(),
                         vo.getName(),
-                        vo.getNemCode(),vo.getFaultCause(),vo.getResolvent(),vo.getFaultType(),vo.getAname());
+                        vo.getNemCode(), vo.getFaultCause(), vo.getResolvent(), vo.getFaultType(), vo.getAname());
+//                alarmTsService.createTable(vo.getTbName(), vo.getAlarmid(), vo.getAlarmtype(),
+//                        vo.getCharacteristic(), vo.getComponents(),
+//                        vo.getDescription(),
+//                        vo.getDeviceid(), vo.getDevicename(),
+//                        vo.getDevicetype(), vo.getEnabled(),
+//                        vo.getLineid(), vo.getLinename(),
+//                        vo.getModelId(), vo.getProjectid(),
+//                        vo.getProjectname(), vo.getRank(),
+//                        vo.getResettable(), vo.getStationid(),
+//                        vo.getStationname(), vo.getSubcomponents(),
+//                        vo.getSuffix(), vo.getTagid(),
+//                        vo.getTriggertype(), vo.getUniformcode(),
+//                        vo.getSuperTableName(),vo.getName(),
+//                        vo.getNemCode(),vo.getFaultCause(),vo.getResolvent(),vo.getFaultType(),vo.getAname());
+//                alarmTsService.updateTable(vo.getTbName(), vo.getAlarmid(), vo.getAlarmtype(),
+//                        vo.getCharacteristic(), vo.getComponents(),
+//                        vo.getDescription(),
+//                        vo.getDeviceid(), vo.getDevicename(),
+//                        vo.getDevicetype(), vo.getEnabled(),
+//                        vo.getLineid(), vo.getLinename(),
+//                        vo.getModelId(), vo.getProjectid(),
+//                        vo.getProjectname(), vo.getRank(),
+//                        vo.getResettable(), vo.getStationid(),
+//                        vo.getStationname(), vo.getSubcomponents(),
+//                        vo.getSuffix(), vo.getTagid(),
+//                        vo.getTriggertype(), vo.getUniformcode(), vo.getSuperTableName(),
+//                        vo.getName(),
+//                        vo.getNemCode(),vo.getFaultCause(),vo.getResolvent(),vo.getFaultType(),vo.getAname());
 //                AlarmTag po = new AlarmTag();
 //                po.setId(vo.getTbName());
 //                po.setVal(0.0);
@@ -194,7 +210,7 @@ public class AlarmCtService {
                         vo.setSuperTableName(AlarmSuperTalbeType.CT.getCode());
                         vo.setVal(0);
 
-                        vo.setCharacteristic("自定义");
+                        vo.setCharacteristic(alarm.getName());
                         vo.setFaultCause(alarm.getDescription());
                         vo.setResolvent(alarm.getExpression());
                         alarmVoList.add(vo);
@@ -273,7 +289,7 @@ public class AlarmCtService {
                         vo.setSuperTableName(AlarmSuperTalbeType.CT.getCode());
                         vo.setVal(0);
 
-                        vo.setCharacteristic("自定义");
+                        vo.setCharacteristic(alarm.getName());
                         vo.setFaultCause(alarm.getDescription());
                         vo.setResolvent(alarm.getExpression());
                         alarmVoList.add(vo);
@@ -406,7 +422,7 @@ public class AlarmCtService {
                     vo.setVal(0);
                     vo.setOval(0);
 
-                    vo.setCharacteristic("自定义");
+                    vo.setCharacteristic(alarm.getName());
                     vo.setFaultCause(alarm.getDescription());
                     vo.setResolvent(alarm.getExpression());
                     alarmVoList.add(vo);

+ 5 - 0
alarm-web/src/main/java/com/gyee/alarm/controller/AlarmConfigurationController.java

@@ -151,6 +151,11 @@ public class AlarmConfigurationController {
                     {
                         vo.setComponentsName(CacheContext.alarmTypeMap.get(ac.getComponents()).getName());
                     }
+
+                    if(CacheContext.wtmap.containsKey(ac.getDeviceId()))
+                    {
+                        vo.setDeviceName(CacheContext.wtmap.get(ac.getDeviceId()).getName());
+                    }
                     vos.add(vo);
                 }
             }

+ 4 - 0
alarm-web/src/main/java/com/gyee/alarm/controller/ProEconShutdownEvent2Controller.java

@@ -68,6 +68,10 @@ public class ProEconShutdownEvent2Controller {
             {
                 vo.setCode(CacheContext.wtmap.get(vo.getWindturbineId()).getNemCode());
             }
+            if(StringUtils.notEmp(vo.getWindturbineId()) && CacheContext.wtmap.containsKey(vo.getWindturbineId()))
+            {
+                vo.setWindturbineName(CacheContext.wtmap.get(vo.getWindturbineId()).getName());
+            }
         }
         if (StringUtils.notEmp(vos)) {
 

+ 2 - 2
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/AlarmTsMapper.java

@@ -150,7 +150,7 @@ public interface AlarmTsMapper extends BaseMapper<AlarmTs> {
             "and alarmType = #{alarmType}",
             "</if>",
             "<if test='components != null'>",
-            "and components = #{components}",
+            "and components in (${components}) ",
             "</if>",
             "<if test='stationid != null'>",
             "and stationid = #{stationid}",
@@ -189,7 +189,7 @@ public interface AlarmTsMapper extends BaseMapper<AlarmTs> {
             "and deviceType = #{deviceType}",
             "</if>",
             "<if test='components != null'>",
-            "and components = #{components}",
+            "and components in (${components}) ",
             "</if>",
             "<if test='stationid != null'>",
             "and stationid = #{stationid}",

+ 1 - 1
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/ProEconAlarmRuleMapper.java

@@ -60,7 +60,7 @@ public interface ProEconAlarmRuleMapper extends BaseMapper<ProEconAlarmRule> {
             "and a.station_id  = #{wpId} ",
             "</if>",
             "<if test='name !=null  '>",
-            "and a.name like #{name} ",
+            "and a.description like #{name} ",
             "</if>",
             "<if test='modelId !=null  '>",
             "and a.model_id = #{modelId} ",

+ 2 - 0
alarm-web/src/main/java/com/gyee/alarm/model/auto/ProEconAlarmConfiguration.java

@@ -155,4 +155,6 @@ public class ProEconAlarmConfiguration extends Model {
     private String resolvent;
 
 
+
+
 }

+ 3 - 0
alarm-web/src/main/java/com/gyee/alarm/model/auto/ProEconShutdownEvent2.java

@@ -126,4 +126,7 @@ public class ProEconShutdownEvent2 extends Model {
 
     @TableField(exist = false)
     private String code;
+
+    @TableField(exist = false)
+    private String windturbineName;
 }

+ 3 - 0
alarm-web/src/main/java/com/gyee/alarm/model/vo/ProEconAlarmConfigurationVo.java

@@ -130,4 +130,7 @@ public class ProEconAlarmConfigurationVo  {
 
     @TableField(exist = false)
     private String componentsName;
+
+    @TableField(exist = false)
+    private String deviceName;
 }

+ 39 - 0
alarm-web/src/main/java/com/gyee/alarm/service/AlarmHistoryService.java

@@ -321,6 +321,19 @@ public class AlarmHistoryService   {
         if(StringUtils.empty(components)  )
         {
             components=null;
+        }else
+        {
+             StringBuilder componentsList=new StringBuilder();
+            String [] componentsStr=components.split(",");
+            for(String c:componentsStr)
+            {
+                componentsList.append("'").append(c).append("',");
+
+            }
+            if(componentsList.length()>0)
+            {
+                components=String.valueOf(componentsList.substring(0,componentsList.length()-1));
+            }
         }
         if(StringUtils.empty(alarmId)  )
         {
@@ -719,6 +732,12 @@ public class AlarmHistoryService   {
             d.setAlertText(fs.getDescription());
             d.setCount(fs.getTotal());
             d.setAlarmid(fs.getAlarmid());
+
+            if(CacheContext.ctAlarmMap.containsKey(fs.getAlarmid()))
+            {
+                ProEconAlarmRule ar=CacheContext.ctAlarmMap.get(fs.getAlarmid());
+                d.setAlertText(ar.getName());
+            }
             if(StringUtils.notEmp(timeType))
             {
                 if(AlarmTime.H.getCode().equals(timeType))
@@ -841,6 +860,12 @@ public class AlarmHistoryService   {
             d.setAlertText(fs.getDescription());
             d.setCount(fs.getTotal());
             d.setAlarmid(fs.getAlarmid());
+
+            if(CacheContext.ctAlarmMap.containsKey(fs.getAlarmid()))
+            {
+                ProEconAlarmRule ar=CacheContext.ctAlarmMap.get(fs.getAlarmid());
+                d.setAlertText(ar.getName());
+            }
             if(StringUtils.notEmp(timeType))
             {
                 if(AlarmTime.H.getCode().equals(timeType))
@@ -961,6 +986,13 @@ public class AlarmHistoryService   {
             d.setAlertText(fs.getDescription());
             d.setCount(fs.getTotal());
             d.setAlarmid(fs.getAlarmid());
+
+
+            if(CacheContext.ctAlarmMap.containsKey(fs.getAlarmid()))
+            {
+                ProEconAlarmRule ar=CacheContext.ctAlarmMap.get(fs.getAlarmid());
+                d.setAlertText(ar.getName());
+            }
             if(StringUtils.notEmp(timeType))
             {
                 if(AlarmTime.H.getCode().equals(timeType))
@@ -1082,6 +1114,13 @@ public class AlarmHistoryService   {
             d.setAlertText(fs.getDescription());
             d.setCount(fs.getTotal());
             d.setAlarmid(fs.getAlarmid());
+
+
+            if(CacheContext.ctAlarmMap.containsKey(fs.getAlarmid()))
+            {
+                ProEconAlarmRule ar=CacheContext.ctAlarmMap.get(fs.getAlarmid());
+                d.setAlertText(ar.getName());
+            }
             if(StringUtils.notEmp(timeType))
             {
                 if(AlarmTime.H.getCode().equals(timeType))