浏览代码

修正升压站报警异常

shilin 11 月之前
父节点
当前提交
26497e69ac

+ 14 - 6
alarm-scanner/src/main/java/com/gyee/alarm/model/vo/AlarmTag.java

@@ -124,16 +124,24 @@ public class AlarmTag {
         if(StringUtils.notEmp(uniformCode) && uniformCode.startsWith("BI")){
 
             int decimal = oval.intValue(); // 十进制报警数
-            String binary = intToBinary32(decimal, 32); // 转换为二进制报警字符串
 
-            String reverse = new StringBuffer(binary).reverse().toString();//翻转字符串,便于报警分析
-            int value = (int) reverse.charAt(triggerType)-48;
-            if (value == 1) {
-                val=1.0;
-            }else {
+            if(decimal==0)
+            {
                 val=0.0;
+            }else  if(decimal>0)
+            {
+                String binary = intToBinary32(decimal, 32); // 转换为二进制报警字符串
+
+                String reverse = new StringBuffer(binary).reverse().toString();//翻转字符串,便于报警分析
+                int value = (int) reverse.charAt(triggerType)-48;
+                if (value == 1) {
+                    val=1.0;
+                }else {
+                    val=0.0;
+                }
             }
 
+
         }else  if(triggerType==-1)
         {
             val=1.0;

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

@@ -63,9 +63,14 @@ public interface ProEconAlarmInfoMapper extends BaseMapper<ProEconAlarmInfo> {
             "and close_time is not null ",
             "</if>",
             "<if test='isclose== false'>",
-            "and close_time is null ",
+            "and close_time is  null ",
+            "</if>",
+            "<if test='isclose== true'>",
+            "and confirmed_time is not null ",
+            "</if>",
+            "<if test='isclose== false'>",
+            "and confirmed_time is  null",
             "</if>",
-
             "</where>",
             " order by last_update_time desc,rank desc  ",
             "</script>"})

+ 0 - 47
alarm-web/src/main/java/com/gyee/alarm/service/AlarmWtService.java

@@ -126,54 +126,7 @@ public class AlarmWtService {
                                 }
 
                             }
-//                            else {
 //
-//                                //临时创建表
-//                                AlarmVo vo=new AlarmVo();
-//                                StringBuilder tbName = new StringBuilder();
-//                                tbName.append(wt.getId()).append("_").append(alarm.getId());
-//                                vo.setTbName(String.valueOf(tbName));
-//                                vo.setAlarmid(alarm.getId());
-//                                vo.setTagid("GF-TZ-SYZ.038200G9911SYB99GI017DB0111PA99RAW01");
-//                                vo.setAlarmtype(alarm.getAlarmType());
-//                                vo.setCharacteristic(alarm.getCharacteristic());
-//                                vo.setComponents(alarm.getComponents());
-//                                vo.setDescription(alarm.getDescription());
-//                                vo.setDeviceid(wt.getId());
-//                                vo.setDevicename(wt.getName());
-//                                vo.setDevicetype(alarm.getDeviceType());
-//                                vo.setEnabled(alarm.getEnable());
-//                                vo.setLineid(wt.getLineId());
-//                                if(CacheContext.lnmap.containsKey(wt.getLineId()))
-//                                {
-//                                    ProBasicLine ln=CacheContext.lnmap.get(wt.getLineId());
-//                                    vo.setLinename(ln.getName());
-//                                }
-//                                vo.setModelId(wt.getModelId());
-//                                vo.setProjectid(wt.getProjectId());
-//                                if(CacheContext.pjmap.containsKey(wt.getProjectId()))
-//                                {
-//                                    ProBasicProject pj=CacheContext.pjmap.get(wt.getProjectId());
-//                                    vo.setProjectname(pj.getName());
-//                                }
-//                                vo.setRank(alarm.getRank());
-//                                vo.setResettable(alarm.getResetTable());
-//                                vo.setStationid(wt.getWindpowerstationId());
-//                                if(CacheContext.wpmap.containsKey(wt.getWindpowerstationId()))
-//                                {
-//                                    ProBasicPowerstation wp=CacheContext.wpmap.get(wt.getWindpowerstationId());
-//                                    vo.setStationname(wp.getName());
-//                                }
-//                                vo.setSubcomponents(alarm.getSubcomponents());
-//                                vo.setSuffix(alarm.getSuffix());
-//                                vo.setTriggertype(alarm.getTriggerType());
-//                                vo.setUniformcode(alarm.getUniformCode());
-//                                vo.setSuperTableName(AlarmSuperTalbeType.WT.getCode());
-//                                vo.setVal(0);
-//                                vo.setOval(0);
-//                                alarmVoList.add(vo);
-//
-//                            }
                         }
                     }
                 }