af6e5325 张雷

奥体项目增加报警功能

1 个父辈 192b5a18
......@@ -73,9 +73,9 @@ public class OlympicCenterController {
@ApiOperation(value="新获取整体实时数据给V3.0", notes="新获取整体实时数据给V3.0")
@GetMapping(value = "/getRealDataToUE")
public Result<Map<String,Object>> getRealDataToUE(){
public Result<Map<String,Object>> getRealDataToUE(AlarmParams alarmParams){
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = olympicCenterService.getRealDataToUENew();
Map<String,Object> map = olympicCenterService.getRealDataToUENew(alarmParams);
result.setResult(map);
result.setSuccess(true);
return result;
......
......@@ -30,7 +30,7 @@ public interface IOlympicCenterService {
Map<String, Object> getRealTimeDataToUENew();
Map<String, Object> getRealDataToUENew();
Map<String, Object> getRealDataToUENew(AlarmParams alarmParams);
List<Map<String, Object>> getFlowData(String equipId);
......
......@@ -1090,20 +1090,25 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
* 获取30秒内报警数据
* @return
*/
public Map<String, Object> getNowAlarmData(){
public Map<String, Object> getNowAlarmData(AlarmParams alarmParams){
Map<String, Object> map = new HashMap<>();
int minute = 10;
if(alarmParams.getMinute()!=0){
minute = alarmParams.getMinute();
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date now = new Date();
Date before = new Date(now.getTime() - 30 * 1000);
Date before = new Date(now.getTime() - minute * 60 * 1000);
JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm");
List<Map<String, Object>> list = alarmDB.queryForList("select DISTINCT alarm_param_code as alarmCode from alert_record_history " +
" where handle_status = 0 " +
" and alarm_param_code like '"+AT_ID+"_%' " +
" and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " +
" ORDER BY record_time");
if(list.size()>0){
for (Map<String, Object> bean : list) {
if(bean.get("alarm_param_code")!=null){
map.put(bean.get("alarm_param_code").toString(),"abnormal");
if(bean.get("alarmCode")!=null){
map.put(bean.get("alarmCode").toString(),"abnormal");
}
}
return map;
......@@ -1113,13 +1118,15 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
}
@Override
public Map<String, Object> getRealDataToUENew() {
public Map<String, Object> getRealDataToUENew(AlarmParams alarmParams) {
List<WhatStructData> list = whatStructDataMapper.getListForUENew();
List<WhatStructData> fList = new ArrayList<>();
List<WhatStructData> otherList = new ArrayList<>();
// List<Map<String, Object>> alarmList = new ArrayList<>();
// alarmList = getAlarmList(alarmParams);//报警记录
Map<String, Object> map = new HashMap<>();
Map<String, Object> monitorMap = new HashMap<>();
Map<String, Object> alarmMap = getNowAlarmData();
Map<String, Object> alarmMap = getNowAlarmData(alarmParams);
String pgField = "";
for (WhatStructData whatStructData:list) {
pgField = pgField +","+whatStructData.getMonitorId();
......@@ -1875,7 +1882,7 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
@Override
public List<Map<String, Object>> getAlarmList(AlarmParams alarmParams) {
int minute = 1;
int minute = 10;
if(alarmParams.getMinute()!=0){
minute = alarmParams.getMinute();
}
......@@ -1886,8 +1893,10 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService {
// System.out.println("之前的时间为:" + dateFormat.format(before));
List<Map<String, Object>> list = new ArrayList<>();
JdbcTemplate alarmDB = (JdbcTemplate) SpringContextUtils.getBean("mysql-alarm");
list = alarmDB.queryForList("select alarm_content as alarmContent from alert_record_history " +
list = alarmDB.queryForList("select alarm_content as alarmContent,alarm_param_code as alarmParamCode " +
" from alert_record_history " +
" where handle_status = 0 " +
" and alarm_param_code like '"+AT_ID+"_%' " +
" and record_time between '"+dateFormat.format(before)+"' and '"+dateFormat.format(now)+"' " +
" ORDER BY record_time");
return list;
......
......@@ -18,7 +18,8 @@ public class YwLocationServiceImpl implements ILocationService {
private static final String username = "ywsjh";//人员定位账号
private static final String password = "ywsjh@2023";//人员定位密码
private static final String url = "http://xylie.tpddns.cn:8084/YWSJH/";
// private static final String url = "http://xylie.tpddns.cn:8084/YWSJH/";//代理地址
private static final String url = "http://10.0.210.115:8084//YWSJH/";//内网
//**********************人员定位坐标***************************
private static final Double DW_X = 3990.0;//定位系统层X坐标
private static final Double DW_Y = -1683.0;//定位系统层Y坐标
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!