| | |
| | | |
| | | @GetMapping("/getCountInfo") |
| | | public AjaxResult getCountInfo(@Validated AlarmAnalysisDTO alarmAnalysisDTO){ |
| | | if(ObjectUtils.isEmpty(alarmAnalysisDTO.getNodeId())){ |
| | | return AjaxResult.error("节点id不能为空"); |
| | | } |
| | | |
| | | if(ObjectUtils.isEmpty(alarmAnalysisDTO.getModelCode())){ |
| | | return AjaxResult.error("模型编码不能为空"); |
| | | } |
| | |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(JkHistoryAlarm jkHistoryAlarm) |
| | | { |
| | | startPage(); |
| | | List<JkHistoryAlarm> list = historyAlarmService.selectHistoryAlarmPageList(jkHistoryAlarm); |
| | | // Page<JkHistoryAlarm> list = historyAlarmService.selectJkHistoryAlarmPage(jkHistoryAlarm); |
| | | return getDataTable(list); |
| | | return getDataTable(historyAlarmService.selectHistoryAlarmPageList(jkHistoryAlarm)); |
| | | } |
| | | /** |
| | | * 导出历史报警监控列表 |
| | |
| | | public String login(String username, String password, String code, String uuid) |
| | | { |
| | | // 验证码校验 |
| | | validateCaptcha(username, code, uuid); |
| | | // validateCaptcha(username, code, uuid); |
| | | // 登录前置校验 |
| | | loginPreCheck(username, password); |
| | | // 用户验证 |
| | |
| | | */ |
| | | public interface HistoryAlarmMapper { |
| | | |
| | | /** |
| | | * 获取历史报警集合 |
| | | * |
| | | * @param jkHistoryAlarm 报警参数 |
| | | * @return 预报警设置集合 |
| | | */ |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmList(JkHistoryAlarm jkHistoryAlarm); |
| | | /** |
| | | * 获取历史报警集合 |
| | | * |
| | | * @param jkHistoryAlarm 报警参数 |
| | | * @return 预报警设置集合 |
| | | */ |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmList(JkHistoryAlarm jkHistoryAlarm); |
| | | |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmListExcel(JkHistoryAlarm jkHistoryAlarm); |
| | | List<JkHistoryAlarm> selectJkHistoryAlarmListExcel(JkHistoryAlarm jkHistoryAlarm); |
| | | |
| | | /** |
| | | * 实时检测 功能 的多 sheet页 展示 组态图 测点 报警信息 |
| | | * |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | List<JkHistoryAlarm> selectHistoryAlarmNoteList(JkHistoryAlarm jkHistoryAlarm); |
| | | /** |
| | | * 实时检测 功能 的多 sheet页 展示 组态图 测点 报警信息 |
| | | * |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | List<JkHistoryAlarm> selectHistoryAlarmNoteList(JkHistoryAlarm jkHistoryAlarm); |
| | | |
| | | void updateHistoryAlarm(@Param("alarmCode") String alarmCode, @Param("historyAlarm") HistoryAlarm historyAlarm); |
| | | void updateHistoryAlarm(@Param("alarmCode") String alarmCode, @Param("historyAlarm") HistoryAlarm historyAlarm); |
| | | |
| | | Page<JkHistoryAlarm> selectJkHistoryAlarmPage(@Param("jkHistoryAlarm") JkHistoryAlarm jkHistoryAlarm,@Param("page")Page<?> page); |
| | | Page<JkHistoryAlarm> selectJkHistoryAlarmPage(@Param("jkHistoryAlarm") JkHistoryAlarm jkHistoryAlarm, @Param("page") Page<?> page); |
| | | |
| | | Integer selectCountByTime(@Param("beginTime") DateTime beginTime, |
| | | @Param("endTime") DateTime endTime, |
| | | @Param("nodeIdList") List<String> nodeIdList); |
| | | Integer selectCountByTime(@Param("beginTime") DateTime beginTime, |
| | | @Param("endTime") DateTime endTime, |
| | | @Param("indexIdList") List<String> indexIdList); |
| | | |
| | | List<JkHistoryAlarm> getHistoryAlarmList(@Param("indexIdList") List<String> indexIdList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime")Date endTime); |
| | | Page<JkHistoryAlarm> getHistoryAlarmList(@Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("indexIdList") List<String> indexIdList, |
| | | Page<JkHistoryAlarm> pageInfo); |
| | | } |
| | |
| | | |
| | | void updateHistoryAlarm(String alarmCode, HistoryAlarm historyAlarm); |
| | | |
| | | Page<JkHistoryAlarm> selectJkHistoryAlarmPage(JkHistoryAlarm jkHistoryAlarm, Long pageNum, Long pageSize); |
| | | |
| | | /** |
| | | * 历史报警分页查询 |
| | | * @param jkHistoryAlarm |
| | | * @return |
| | | */ |
| | | List<JkHistoryAlarm> selectHistoryAlarmPageList(JkHistoryAlarm jkHistoryAlarm); |
| | | Page<JkHistoryAlarm> selectHistoryAlarmPageList(JkHistoryAlarm jkHistoryAlarm); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.zhitan.alarm.domain.JkHistoryAlarm; |
| | | import com.zhitan.alarm.domain.dto.AlarmAnalysisDTO; |
| | | import com.zhitan.alarm.domain.vo.AlarmAnalysisVO; |
| | |
| | | private final SysEnergyMapper sysEnergyMapper; |
| | | |
| | | /** |
| | | * 根据节点id获取报警分析信息(废弃) |
| | | * 根据节点id获取报警分析信息 |
| | | * |
| | | * @param alarmAnalysisDTO |
| | | * @return |
| | |
| | | |
| | | AlarmAnalysisVO alarmAnalysisVO = new AlarmAnalysisVO(); |
| | | |
| | | ModelNode parentNode = modelNodeMapper.selectModelNodeById(alarmAnalysisDTO.getNodeId()); |
| | | if(ObjectUtils.isEmpty(parentNode)){ |
| | | return alarmAnalysisVO; |
| | | } |
| | | |
| | | // 查询模型下的点位数据 |
| | | ModelNode modelNode = modelNodeMapper.selectModelNodeById(alarmAnalysisDTO.getNodeId()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.getAllModelNodeIndexByAddress(modelNode.getModelCode(), modelNode.getAddress()); |
| | | List<ModelNodeIndexInfo> nodeIndexInfoList = modelNodeMapper.getAllModelNodeIndexByAddress(parentNode.getModelCode(), parentNode.getAddress()); |
| | | alarmAnalysisVO.setIndexCount(nodeIndexInfoList.size()); |
| | | if (CollectionUtils.isEmpty(nodeIndexInfoList)) { |
| | | return alarmAnalysisVO; |
| | | } |
| | | |
| | | // 获取月报警数、年报警数 |
| | | List<String> nodeIdList = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | List<String> indexIdList = nodeIndexInfoList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); |
| | | |
| | | DateTime beginOfMonth = DateUtil.beginOfMonth(new Date()); |
| | | DateTime endOfMonth = DateUtil.endOfMonth(new Date()); |
| | | DateTime beginOfYear = DateUtil.beginOfYear(new Date()); |
| | | DateTime endOfYear = DateUtil.endOfYear(new Date()); |
| | | Integer monthCount = historyAlarmMapper.selectCountByTime(beginOfMonth,endOfMonth, nodeIdList); |
| | | Integer yearCount = historyAlarmMapper.selectCountByTime(beginOfYear,endOfYear, nodeIdList); |
| | | Integer monthCount = historyAlarmMapper.selectCountByTime(beginOfMonth,endOfMonth, indexIdList); |
| | | Integer yearCount = historyAlarmMapper.selectCountByTime(beginOfYear,endOfYear, indexIdList); |
| | | |
| | | alarmAnalysisVO.setMonthCount(monthCount); |
| | | alarmAnalysisVO.setYearCount(yearCount); |
| | |
| | | import com.zhitan.basicdata.mapper.MeterImplementMapper; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.DateUtils; |
| | | import com.zhitan.common.utils.PageUtils; |
| | | import com.zhitan.common.utils.StringUtils; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | |
| | | historyAlarmMapper.updateHistoryAlarm(alarmCode, historyAlarm); |
| | | } |
| | | |
| | | // 废弃 |
| | | @Override |
| | | public Page<JkHistoryAlarm> selectJkHistoryAlarmPage(JkHistoryAlarm jkHistoryAlarm, Long pageNum, Long pageSize) { |
| | | final Page<JkHistoryAlarm> jkHistoryAlarmPage = historyAlarmMapper.selectJkHistoryAlarmPage(jkHistoryAlarm, new Page<>(pageNum, pageSize)); |
| | | jkHistoryAlarmPage.getRecords().forEach(alarm -> { |
| | | final String indexType = alarm.getIndexType(); |
| | | final String indexId = alarm.getIndexId(); |
| | | if ("COLLECT".equals(indexType) && StringUtils.isEmpty(alarm.getEnergyId())) { |
| | | //根据nodeId和indexId 去查询计量器具 |
| | | EnergyIndex energyIndex = energyIndexMapper.selectEnergyIndexById(indexId); |
| | | final MeterImplement meterImplement = meterImplementMapper.selectMeterImplementById(energyIndex.getMeterId()); |
| | | alarm.setEnergyId(meterImplement.getEnergyType()); |
| | | } |
| | | }); |
| | | return jkHistoryAlarmPage; |
| | | } |
| | | |
| | | /** |
| | | * 获取历史报警分页数据 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<JkHistoryAlarm> selectHistoryAlarmPageList(JkHistoryAlarm historyAlarm) { |
| | | public Page<JkHistoryAlarm> selectHistoryAlarmPageList(JkHistoryAlarm historyAlarm) { |
| | | Page<JkHistoryAlarm> pageInfo = PageUtils.getPageInfo(JkHistoryAlarm.class); |
| | | |
| | | List<String> indexIdList = new ArrayList<>(); |
| | | if ("ALL".equals(historyAlarm.getEierarchyFlag())) { |
| | |
| | | } |
| | | |
| | | if (ObjectUtils.isEmpty(indexIdList)) { |
| | | return new ArrayList<>(); |
| | | return pageInfo; |
| | | } |
| | | |
| | | //时间处理 如果不传时间默认查询当天的数据 |
| | |
| | | if (ObjectUtils.isEmpty(endTime)) { |
| | | endTime = DateUtil.endOfDay(DateUtils.getNowDate()); |
| | | } |
| | | Date beginTime = DateUtils.parseDate(historyAlarm.getEndTime()); |
| | | Date beginTime = DateUtils.parseDate(historyAlarm.getBeginTime()); |
| | | if (ObjectUtils.isEmpty(beginTime)) { |
| | | beginTime = DateUtil.beginOfDay(DateUtils.getNowDate()); |
| | | } |
| | | |
| | | List<JkHistoryAlarm> historyAlarmList = historyAlarmMapper.getHistoryAlarmList(indexIdList, beginTime, endTime); |
| | | return historyAlarmList; |
| | | return historyAlarmMapper.getHistoryAlarmList(beginTime, endTime,indexIdList, pageInfo); |
| | | } |
| | | |
| | | } |
| | |
| | | <if test="endTime != null "> |
| | | and begin_time <= #{endTime} |
| | | </if> |
| | | <if test="nodeIdList != null and nodeIdList.size() > 0"> |
| | | and node_id in |
| | | <foreach collection="nodeIdList" item="item" open="(" separator="," close=")"> |
| | | <if test="indexIdList != null and indexIdList.size() > 0"> |
| | | and index_id in |
| | | <foreach collection="indexIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | |
| | | </select> |
| | | <select id="getHistoryAlarmList" resultType="com.zhitan.alarm.domain.JkHistoryAlarm"> |
| | | SELECT |
| | | mn.node_id nodeId, |
| | | mn."name" modelName, |
| | | mi.meter_name meterName, |
| | | mi.energy_type energyId, |
| | | his.index_id indexId, |
| | | ei."name" indexName, |
| | | ei.index_type indexType, |
| | | ei.code code, |
| | | ei.unit_id unitId, |
| | | ai.alarm_level alarmLevel, |
| | | ai.limit_type limitType, |
| | | his.limiting_value limitingValue, |
| | | his.alarm_value alarmValue, |
| | | his.begin_time beginTime, |
| | | his.end_time endTime, |
| | | his.duration |
| | | his.begin_time alarmBeginTime, |
| | | his.end_time alarmEndTime, |
| | | his.duration duration |
| | | FROM |
| | | history_alarm his |
| | | LEFT JOIN alarm_item ai ON his.item_id = ai."id" |
| | |
| | | show-overflow-tooltip |
| | | :formatter="(row, column) => formatterLabel(energyTypeList, row.energyId)" |
| | | /> |
| | | <el-table-column label="预设值" prop="energyType" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="预设值" prop="limitingValue" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="报警值" prop="alarmValue" align="center" show-overflow-tooltip /> |
| | | <el-table-column label="报警时间" prop="alarmBeginTime" align="center" show-overflow-tooltip /> |
| | | </el-table> |
| | |
| | | timeType: null, |
| | | dataTime: null, |
| | | nodeId: null, |
| | | modelCode: '' |
| | | }) |
| | | |
| | | import { getByNodeId, getCountInfo } from "@/api/alarmManage/alarmManage" |
| | | import { el } from "element-plus/es/locales.mjs" |
| | | import { useRoute } from "vue-router" |
| | | const route = useRoute() |
| | | let form = ref({}) |
| | | let currentNode = ref() |
| | | |
| | |
| | | handleTimeType(period.value[0].value) |
| | | |
| | | getByNodeIdFun() |
| | | getCountInfoFun() |
| | | } |
| | | |
| | | function getByNodeIdFun() { |
| | |
| | | // getByNodeIdFun() |
| | | function handleQuery() { |
| | | getByNodeIdFun() |
| | | getCountInfoFun() |
| | | } |
| | | function resetQuery() { |
| | | handleTimeType("YEAR") |
| | | getByNodeIdFun() |
| | | getCountInfoFun() |
| | | } |
| | | let dataArray = ref({ |
| | | indexCount: 0, |
| | |
| | | monthCount: 0, |
| | | }) |
| | | function getCountInfoFun() { |
| | | getCountInfo(queryParams.value).then((res) => { |
| | | getCountInfo({ |
| | | ...queryParams.value, |
| | | modelCode: route.query.modelCode, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | dataArray.value = res.data |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getCountInfoFun() |
| | | function pieChart(Id, data, name) { |
| | | console.log(data) |
| | | let total = 0 |
| | |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true, |
| | | length: 5, |
| | | }, |
| | | // axisTick: { |
| | | // show: false, |
| | | // alignWithLabel: true, |
| | | // length: 5, |
| | | // }, |
| | | // 坐标轴刻度线样式 |
| | | axisTick: { |
| | | show: false, |
| | |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | // 坐标轴刻度 |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true, |
| | | length: 5, |
| | | }, |
| | | // axisTick: { |
| | | // show: false, |
| | | // alignWithLabel: true, |
| | | // length: 5, |
| | | // }, |
| | | // 坐标轴刻度线样式 |
| | | axisTick: { |
| | | show: false, |
| | |
| | | proxy: { |
| | | // https://cn.vitejs.dev/config/#server-proxy |
| | | "/dev-api": { |
| | | target: "https://demo-ems.zhitancloud.com", |
| | | target: "http://localhost:8080", |
| | | changeOrigin: true, |
| | | rewrite: (p) => p.replace(/^\/dev-api/, "/prod-api"), |
| | | rewrite: (p) => p.replace(/^\/dev-api/, "/"), |
| | | }, |
| | | "/prod-api": { |
| | | target: "https://demo-ems.zhitancloud.com", |
| | | target: "http://localhost:8080", |
| | | changeOrigin: true, |
| | | secure: true, |
| | | }, |