报警点位数量推送增加一层map
增加通用光电报警数量推送
| | |
| | | public int deleteArdAlarmCameraByIds(String[] ids); |
| | | |
| | | public List<ArdAlarmCamera> selectListAllByCommand(@Param("refreshTime")String refreshTime); |
| | | |
| | | int selectCountByAlarmTime(@Param("refreshTime")String refreshTime); |
| | | } |
| | |
| | | @ApiOperation(value = "查看报警点数量",notes = "查询刷新时间内报警的点位数量") |
| | | @ApiOperationSupport(order = 2) |
| | | public AjaxResult countAlarmLog() { |
| | | Map<String, Integer> stringIntegerMap = globalAlarmService.selectAlarmLogsCount(); |
| | | Map<String, Object> stringIntegerMap = globalAlarmService.selectAlarmLogsCount(); |
| | | return AjaxResult.success(stringIntegerMap); |
| | | } |
| | | @GetMapping("/List") |
| | |
| | | public List<GlobalAlarmData> selectAlarmLogs(GlobalAlarmCondition condition); |
| | | Object updateAlarmViewTime(GlobalAlarmCondition condition); |
| | | public void receiveAlarm(String topic,String message); |
| | | public Map<String,Integer> selectAlarmLogsCount(); |
| | | public Map<String,Object> selectAlarmLogsCount(); |
| | | Object selectAlarmList(Integer command, String beginTime, String endTime,Integer pageNum,Integer pageSize); |
| | | } |
| | |
| | | * @修改人和其它信息 |
| | | */ |
| | | @Override |
| | | public Map<String, Integer> selectAlarmLogsCount() { |
| | | public Map<String, Object> selectAlarmLogsCount() { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | Map<String, Integer> countMap = new HashMap<>(); |
| | | String refreshTime = configService.selectConfigByKey("refreshTime"); |
| | | int count1001 = ardAlarmStealelecMapper.selectCountByStartTime(refreshTime); |
| | | countMap.put("1001", count1001); |
| | | int count1014 = ardAlarmTubeMapper.selectCountByStartTime(refreshTime); |
| | | int count1002 = ardAlarmCameraMapper.selectCountByAlarmTime(refreshTime); |
| | | countMap.put("1002", count1002); |
| | | int count1014 = ardAlarmTubeMapper.selectCountByAlarmTime(refreshTime); |
| | | countMap.put("1014", count1014); |
| | | return countMap; |
| | | map.put("20000",countMap); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return null; |
| | | } |
| | | public static void main(String[] args) { |
| | | // 给定坐标 A |
| | | double Ax = 0; |
| | | double Ay = 0; |
| | | |
| | | // 给定角度(以度为单位) |
| | | double angle = 45; |
| | | |
| | | // 给定距离 |
| | | double distance = 1.414; |
| | | |
| | | // 将角度转换为弧度 |
| | | double radians = Math.toRadians(angle); |
| | | |
| | | // 计算 B 坐标 |
| | | double Bx = Ax + distance * Math.cos(radians); |
| | | double By = Ay + distance * Math.sin(radians); |
| | | |
| | | // 输出结果 |
| | | System.out.println("坐标 B: (" + Bx + ", " + By + ")"); |
| | | } |
| | | } |
| | |
| | | public int deleteArdAlarmTubeByIds(String[] ids); |
| | | |
| | | public List<ArdAlarmTube> selectListAllByCommand(@Param("refreshTime")String refreshTime); |
| | | int selectCountByStartTime(@Param("refreshTime")String refreshTime); |
| | | int selectCountByAlarmTime(@Param("refreshTime")String refreshTime); |
| | | public int updateViewTimeByTubeId(@Param("tubeId")String tubeId,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime); |
| | | } |
| | |
| | | WHERE |
| | | T.rn = 1 |
| | | </select> |
| | | <select id="selectCountByAlarmTime" resultType="Integer"> |
| | | SELECT COUNT(DISTINCT aac.camera_name) |
| | | FROM ard_alarm_camera aac |
| | | WHERE aac.alarm_time >= CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE |
| | | </select> |
| | | </mapper> |
| | |
| | | ) T |
| | | WHERE T.rn = 1 |
| | | </select> |
| | | <select id="selectCountByStartTime" resultType="Integer"> |
| | | <select id="selectCountByAlarmTime" resultType="Integer"> |
| | | SELECT COUNT(DISTINCT aat.tube_id) |
| | | FROM ard_alarm_tube aat |
| | | WHERE aat.alarm_time >= CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE |
| | |
| | | */ |
| | | public void globalAlarmCountPush() { |
| | | IGlobalAlarmService globalAlarmService = SpringUtils.getBean(IGlobalAlarmService.class); |
| | | Map<String, Integer> stringIntegerMap = globalAlarmService.selectAlarmLogsCount(); |
| | | Map<String, Object> stringIntegerMap = globalAlarmService.selectAlarmLogsCount(); |
| | | if (ONLINE_USER_SESSIONS.size() > 0) { |
| | | WebSocketUtils.sendMessageAll(stringIntegerMap); |
| | | } |