奥体项目增加报警功能
正在显示
4 个修改的文件
包含
22 行增加
和
12 行删除
... | @@ -73,9 +73,9 @@ public class OlympicCenterController { | ... | @@ -73,9 +73,9 @@ public class OlympicCenterController { |
73 | 73 | ||
74 | @ApiOperation(value="新获取整体实时数据给V3.0", notes="新获取整体实时数据给V3.0") | 74 | @ApiOperation(value="新获取整体实时数据给V3.0", notes="新获取整体实时数据给V3.0") |
75 | @GetMapping(value = "/getRealDataToUE") | 75 | @GetMapping(value = "/getRealDataToUE") |
76 | public Result<Map<String,Object>> getRealDataToUE(){ | 76 | public Result<Map<String,Object>> getRealDataToUE(AlarmParams alarmParams){ |
77 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | 77 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); |
78 | Map<String,Object> map = olympicCenterService.getRealDataToUENew(); | 78 | Map<String,Object> map = olympicCenterService.getRealDataToUENew(alarmParams); |
79 | result.setResult(map); | 79 | result.setResult(map); |
80 | result.setSuccess(true); | 80 | result.setSuccess(true); |
81 | return result; | 81 | return result; | ... | ... |
... | @@ -30,7 +30,7 @@ public interface IOlympicCenterService { | ... | @@ -30,7 +30,7 @@ public interface IOlympicCenterService { |
30 | 30 | ||
31 | Map<String, Object> getRealTimeDataToUENew(); | 31 | Map<String, Object> getRealTimeDataToUENew(); |
32 | 32 | ||
33 | Map<String, Object> getRealDataToUENew(); | 33 | Map<String, Object> getRealDataToUENew(AlarmParams alarmParams); |
34 | 34 | ||
35 | List<Map<String, Object>> getFlowData(String equipId); | 35 | List<Map<String, Object>> getFlowData(String equipId); |
36 | 36 | ... | ... |
... | @@ -1090,20 +1090,25 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -1090,20 +1090,25 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
1090 | * 获取30秒内报警数据 | 1090 | * 获取30秒内报警数据 |
1091 | * @return | 1091 | * @return |
1092 | */ | 1092 | */ |
1093 | public Map<String, Object> getNowAlarmData(){ | 1093 | public Map<String, Object> getNowAlarmData(AlarmParams alarmParams){ |
1094 | Map<String, Object> map = new HashMap<>(); | 1094 | Map<String, Object> map = new HashMap<>(); |
1095 | int minute = 10; | ||
1096 | if(alarmParams.getMinute()!=0){ | ||
1097 | minute = alarmParams.getMinute(); | ||
1098 | } | ||
1095 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 1099 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
1096 | Date now = new Date(); | 1100 | Date now = new Date(); |
1097 | Date before = new Date(now.getTime() - 30 * 1000); | 1101 | Date before = new Date(now.getTime() - minute * 60 * 1000); |
1098 | JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm"); | 1102 | JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm"); |
1099 | List<Map<String, Object>> list = alarmDB.queryForList("select DISTINCT alarm_param_code as alarmCode from alert_record_history " + | 1103 | List<Map<String, Object>> list = alarmDB.queryForList("select DISTINCT alarm_param_code as alarmCode from alert_record_history " + |
1100 | " where handle_status = 0 " + | 1104 | " where handle_status = 0 " + |
1105 | " and alarm_param_code like '"+AT_ID+"_%' " + | ||
1101 | " and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " + | 1106 | " and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " + |
1102 | " ORDER BY record_time"); | 1107 | " ORDER BY record_time"); |
1103 | if(list.size()>0){ | 1108 | if(list.size()>0){ |
1104 | for (Map<String, Object> bean : list) { | 1109 | for (Map<String, Object> bean : list) { |
1105 | if(bean.get("alarm_param_code")!=null){ | 1110 | if(bean.get("alarmCode")!=null){ |
1106 | map.put(bean.get("alarm_param_code").toString(),"abnormal"); | 1111 | map.put(bean.get("alarmCode").toString(),"abnormal"); |
1107 | } | 1112 | } |
1108 | } | 1113 | } |
1109 | return map; | 1114 | return map; |
... | @@ -1113,13 +1118,15 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -1113,13 +1118,15 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
1113 | } | 1118 | } |
1114 | 1119 | ||
1115 | @Override | 1120 | @Override |
1116 | public Map<String, Object> getRealDataToUENew() { | 1121 | public Map<String, Object> getRealDataToUENew(AlarmParams alarmParams) { |
1117 | List<WhatStructData> list = whatStructDataMapper.getListForUENew(); | 1122 | List<WhatStructData> list = whatStructDataMapper.getListForUENew(); |
1118 | List<WhatStructData> fList = new ArrayList<>(); | 1123 | List<WhatStructData> fList = new ArrayList<>(); |
1119 | List<WhatStructData> otherList = new ArrayList<>(); | 1124 | List<WhatStructData> otherList = new ArrayList<>(); |
1125 | // List<Map<String, Object>> alarmList = new ArrayList<>(); | ||
1126 | // alarmList = getAlarmList(alarmParams);//报警记录 | ||
1120 | Map<String, Object> map = new HashMap<>(); | 1127 | Map<String, Object> map = new HashMap<>(); |
1121 | Map<String, Object> monitorMap = new HashMap<>(); | 1128 | Map<String, Object> monitorMap = new HashMap<>(); |
1122 | Map<String, Object> alarmMap = getNowAlarmData(); | 1129 | Map<String, Object> alarmMap = getNowAlarmData(alarmParams); |
1123 | String pgField = ""; | 1130 | String pgField = ""; |
1124 | for (WhatStructData whatStructData:list) { | 1131 | for (WhatStructData whatStructData:list) { |
1125 | pgField = pgField +","+whatStructData.getMonitorId(); | 1132 | pgField = pgField +","+whatStructData.getMonitorId(); |
... | @@ -1875,7 +1882,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -1875,7 +1882,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
1875 | 1882 | ||
1876 | @Override | 1883 | @Override |
1877 | public List<Map<String, Object>> getAlarmList(AlarmParams alarmParams) { | 1884 | public List<Map<String, Object>> getAlarmList(AlarmParams alarmParams) { |
1878 | int minute = 1; | 1885 | int minute = 10; |
1879 | if(alarmParams.getMinute()!=0){ | 1886 | if(alarmParams.getMinute()!=0){ |
1880 | minute = alarmParams.getMinute(); | 1887 | minute = alarmParams.getMinute(); |
1881 | } | 1888 | } |
... | @@ -1886,8 +1893,10 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -1886,8 +1893,10 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
1886 | // System.out.println("之前的时间为:" + dateFormat.format(before)); | 1893 | // System.out.println("之前的时间为:" + dateFormat.format(before)); |
1887 | List<Map<String, Object>> list = new ArrayList<>(); | 1894 | List<Map<String, Object>> list = new ArrayList<>(); |
1888 | JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm"); | 1895 | JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm"); |
1889 | list = alarmDB.queryForList("select alarm_content as alarmContent from alert_record_history " + | 1896 | list = alarmDB.queryForList("select alarm_content as alarmContent,alarm_param_code as alarmParamCode " + |
1897 | " from alert_record_history " + | ||
1890 | " where handle_status = 0 " + | 1898 | " where handle_status = 0 " + |
1899 | " and alarm_param_code like '"+AT_ID+"_%' " + | ||
1891 | " and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " + | 1900 | " and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " + |
1892 | " ORDER BY record_time"); | 1901 | " ORDER BY record_time"); |
1893 | return list; | 1902 | return list; | ... | ... |
... | @@ -18,7 +18,8 @@ public class YwLocationServiceImpl implements ILocationService { | ... | @@ -18,7 +18,8 @@ public class YwLocationServiceImpl implements ILocationService { |
18 | 18 | ||
19 | private static final String username = "ywsjh";//人员定位账号 | 19 | private static final String username = "ywsjh";//人员定位账号 |
20 | private static final String password = "ywsjh@2023";//人员定位密码 | 20 | private static final String password = "ywsjh@2023";//人员定位密码 |
21 | private static final String url = "http://xylie.tpddns.cn:8084/YWSJH/"; | 21 | // private static final String url = "http://xylie.tpddns.cn:8084/YWSJH/";//代理地址 |
22 | private static final String url = "http://10.0.210.115:8084//YWSJH/";//内网 | ||
22 | //**********************人员定位坐标*************************** | 23 | //**********************人员定位坐标*************************** |
23 | private static final Double DW_X = 3990.0;//定位系统层X坐标 | 24 | private static final Double DW_X = 3990.0;//定位系统层X坐标 |
24 | private static final Double DW_Y = -1683.0;//定位系统层Y坐标 | 25 | private static final Double DW_Y = -1683.0;//定位系统层Y坐标 | ... | ... |
-
请 注册 或 登录 后发表评论