实时数据报警功能
正在显示
4 个修改的文件
包含
22 行增加
和
23 行删除
... | @@ -46,20 +46,16 @@ public class AlarmJobTestController { | ... | @@ -46,20 +46,16 @@ public class AlarmJobTestController { |
46 | private EquipmentMaintainReminderJob equipmentMaintainReminderJob; | 46 | private EquipmentMaintainReminderJob equipmentMaintainReminderJob; |
47 | @Autowired | 47 | @Autowired |
48 | private SuddenIncreaseAlarmJob suddenIncreaseAlarmJob; | 48 | private SuddenIncreaseAlarmJob suddenIncreaseAlarmJob; |
49 | 49 | ||
50 | @Autowired | 50 | @Autowired |
51 | private XtDataSameJob dataSameJob; | 51 | private XtDataSameJob dataSameJob; |
52 | 52 | ||
53 | @ApiOperation(value = "测试实时数据报警定时服务", notes = "测试实时数据报警定时服务") | 53 | @ApiOperation(value = "测试实时数据报警定时服务", notes = "测试实时数据报警定时服务") |
54 | @GetMapping(value = "/testRealTimeAlarmJob") | 54 | @GetMapping(value = "/testRealTimeAlarmJob") |
55 | public Result<String> testRealTimeAlarmJob() { | 55 | public Result<String> testRealTimeAlarmJob() { |
56 | 56 | ||
57 | Result<String> result = new Result<>(); | 57 | Result<String> result = new Result<>(); |
58 | try { | 58 | realTimeAlarmJob.execute(null); |
59 | realTimeAlarmJob.execute(null); | ||
60 | } catch (JobExecutionException e) { | ||
61 | e.printStackTrace(); | ||
62 | } | ||
63 | result.setResult("成功"); | 59 | result.setResult("成功"); |
64 | result.setSuccess(true); | 60 | result.setSuccess(true); |
65 | return result; | 61 | return result; |
... | @@ -77,7 +73,7 @@ public class AlarmJobTestController { | ... | @@ -77,7 +73,7 @@ public class AlarmJobTestController { |
77 | result.setSuccess(true); | 73 | result.setSuccess(true); |
78 | return result; | 74 | return result; |
79 | } | 75 | } |
80 | 76 | ||
81 | @ApiOperation(value = "测试设备频繁维修定时服务", notes = "测试设备频繁维修报警定时服务") | 77 | @ApiOperation(value = "测试设备频繁维修定时服务", notes = "测试设备频繁维修报警定时服务") |
82 | @GetMapping(value = "/testEquipmentRepairAlarmJob") | 78 | @GetMapping(value = "/testEquipmentRepairAlarmJob") |
83 | public Result<String> testEquipmentRepairAlarmJob() { | 79 | public Result<String> testEquipmentRepairAlarmJob() { |
... | @@ -91,7 +87,7 @@ public class AlarmJobTestController { | ... | @@ -91,7 +87,7 @@ public class AlarmJobTestController { |
91 | result.setSuccess(true); | 87 | result.setSuccess(true); |
92 | return result; | 88 | return result; |
93 | } | 89 | } |
94 | 90 | ||
95 | @ApiOperation(value = "测试设备到期提醒定时服务", notes = "测试设备到期提醒定时服务") | 91 | @ApiOperation(value = "测试设备到期提醒定时服务", notes = "测试设备到期提醒定时服务") |
96 | @GetMapping(value = "/testEquipmentMaintainReminderJob") | 92 | @GetMapping(value = "/testEquipmentMaintainReminderJob") |
97 | public Result<String> testEquipmentMaintainReminderJob() { | 93 | public Result<String> testEquipmentMaintainReminderJob() { |
... | @@ -105,7 +101,7 @@ public class AlarmJobTestController { | ... | @@ -105,7 +101,7 @@ public class AlarmJobTestController { |
105 | result.setSuccess(true); | 101 | result.setSuccess(true); |
106 | return result; | 102 | return result; |
107 | } | 103 | } |
108 | 104 | ||
109 | @ApiOperation(value = "测试指标突增报警定时服务", notes = "测试指标突增报警定时服务") | 105 | @ApiOperation(value = "测试指标突增报警定时服务", notes = "测试指标突增报警定时服务") |
110 | @GetMapping(value = "/testSuddenIncreaseAlarmJob") | 106 | @GetMapping(value = "/testSuddenIncreaseAlarmJob") |
111 | public Result<String> testSuddenIncreaseAlarmJob() { | 107 | public Result<String> testSuddenIncreaseAlarmJob() { |
... | @@ -119,7 +115,7 @@ public class AlarmJobTestController { | ... | @@ -119,7 +115,7 @@ public class AlarmJobTestController { |
119 | result.setSuccess(true); | 115 | result.setSuccess(true); |
120 | return result; | 116 | return result; |
121 | } | 117 | } |
122 | 118 | ||
123 | @ApiOperation(value = "测试设备故障报警定时服务", notes = "测试设备故障报警定时服务") | 119 | @ApiOperation(value = "测试设备故障报警定时服务", notes = "测试设备故障报警定时服务") |
124 | @GetMapping(value = "/testEquipAlarmJob") | 120 | @GetMapping(value = "/testEquipAlarmJob") |
125 | public Result<String> testEquipAlarmJob() { | 121 | public Result<String> testEquipAlarmJob() { |
... | @@ -134,7 +130,7 @@ public class AlarmJobTestController { | ... | @@ -134,7 +130,7 @@ public class AlarmJobTestController { |
134 | result.setSuccess(true); | 130 | result.setSuccess(true); |
135 | return result; | 131 | return result; |
136 | } | 132 | } |
137 | 133 | ||
138 | @ApiOperation(value = "数据长期不变报警定时服务", notes = "数据长期不变报警定时服务") | 134 | @ApiOperation(value = "数据长期不变报警定时服务", notes = "数据长期不变报警定时服务") |
139 | @GetMapping(value = "/testDataSameJob") | 135 | @GetMapping(value = "/testDataSameJob") |
140 | public Result<String> testDataSameJob() { | 136 | public Result<String> testDataSameJob() { |
... | @@ -150,7 +146,7 @@ public class AlarmJobTestController { | ... | @@ -150,7 +146,7 @@ public class AlarmJobTestController { |
150 | return result; | 146 | return result; |
151 | 147 | ||
152 | } | 148 | } |
153 | 149 | ||
154 | @ApiOperation(value = "测试设备在、离线报警定时服务", notes = "测试设备在、离线报警定时服务") | 150 | @ApiOperation(value = "测试设备在、离线报警定时服务", notes = "测试设备在、离线报警定时服务") |
155 | @GetMapping(value = "/testDeviceStatusJob") | 151 | @GetMapping(value = "/testDeviceStatusJob") |
156 | public Result<String> testDeviceStatusJob() { | 152 | public Result<String> testDeviceStatusJob() { |
... | @@ -167,4 +163,4 @@ public class AlarmJobTestController { | ... | @@ -167,4 +163,4 @@ public class AlarmJobTestController { |
167 | 163 | ||
168 | } | 164 | } |
169 | 165 | ||
170 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
166 | } | ... | ... |
... | @@ -111,8 +111,9 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -111,8 +111,9 @@ public class RealTimeAlarmJob implements Job { |
111 | private static String departNameTemplete = "${departName}"; | 111 | private static String departNameTemplete = "${departName}"; |
112 | private static String contentTemplete = "${alarmParamName}:${actualAvgValue}(${limit})${alarmParamUnit}"; | 112 | private static String contentTemplete = "${alarmParamName}:${actualAvgValue}(${limit})${alarmParamUnit}"; |
113 | private static String suffix = ",请注意!"; | 113 | private static String suffix = ",请注意!"; |
114 | |||
114 | @Override | 115 | @Override |
115 | public void execute(JobExecutionContext context) throws JobExecutionException { | 116 | public void execute(JobExecutionContext context) { |
116 | try { | 117 | try { |
117 | log.info("水质实时数据报警任务开始"); | 118 | log.info("水质实时数据报警任务开始"); |
118 | //获取水质、水量、工艺报警规则信息 | 119 | //获取水质、水量、工艺报警规则信息 |
... | @@ -321,7 +322,8 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -321,7 +322,8 @@ public class RealTimeAlarmJob implements Job { |
321 | private void dealSZLtatus(List<AlarmRuleConfigAndLevelVO> errorList) { | 322 | private void dealSZLtatus(List<AlarmRuleConfigAndLevelVO> errorList) { |
322 | //查询报警记录置为正常状态 | 323 | //查询报警记录置为正常状态 |
323 | QueryWrapper<AlarmRecordHistory> queryWrapper = new QueryWrapper<>(); | 324 | QueryWrapper<AlarmRecordHistory> queryWrapper = new QueryWrapper<>(); |
324 | queryWrapper.in("alarm_rule_type", Lists.newArrayList("6")); | 325 | // queryWrapper.in("alarm_rule_type", Lists.newArrayList("6")); |
326 | queryWrapper.in("alarm_rule_type", Lists.newArrayList("A001A001")); | ||
325 | queryWrapper.eq("alarm_param_type", "数据超过有效上下限报警配置"); | 327 | queryWrapper.eq("alarm_param_type", "数据超过有效上下限报警配置"); |
326 | queryWrapper.in("handle_status", 0); | 328 | queryWrapper.in("handle_status", 0); |
327 | List<AlarmRecordHistory> list = alarmRecordHistoryService.list(queryWrapper); | 329 | List<AlarmRecordHistory> list = alarmRecordHistoryService.list(queryWrapper); |
... | @@ -353,7 +355,8 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -353,7 +355,8 @@ public class RealTimeAlarmJob implements Job { |
353 | private void dealStatus(List<AlarmRuleConfigAndLevelVO> excessList) { | 355 | private void dealStatus(List<AlarmRuleConfigAndLevelVO> excessList) { |
354 | //查询报警记录置为正常状态 | 356 | //查询报警记录置为正常状态 |
355 | QueryWrapper<AlarmRecordHistory> queryWrapper = new QueryWrapper<>(); | 357 | QueryWrapper<AlarmRecordHistory> queryWrapper = new QueryWrapper<>(); |
356 | queryWrapper.in("alarm_rule_type", Lists.newArrayList("1", "2", "3", "5", "8")); | 358 | // queryWrapper.in("alarm_rule_type", Lists.newArrayList("1", "2", "3", "5", "8")); |
359 | queryWrapper.in("alarm_rule_type", Lists.newArrayList("A001A001", "A001A002", "A001A003", "5", "8")); | ||
357 | queryWrapper.in("handle_status", 0); | 360 | queryWrapper.in("handle_status", 0); |
358 | List<AlarmRecordHistory> list = alarmRecordHistoryService.list(queryWrapper); | 361 | List<AlarmRecordHistory> list = alarmRecordHistoryService.list(queryWrapper); |
359 | if (list != null && list.size() > 0) { | 362 | if (list != null && list.size() > 0) { | ... | ... |
... | @@ -5,6 +5,7 @@ import java.util.List; | ... | @@ -5,6 +5,7 @@ import java.util.List; |
5 | import com.skua.modules.emergency.vo.DangerDatabaseResult; | 5 | import com.skua.modules.emergency.vo.DangerDatabaseResult; |
6 | import com.skua.modules.emergency.vo.MapDatabaseResult; | 6 | import com.skua.modules.emergency.vo.MapDatabaseResult; |
7 | import com.skua.modules.emergency.vo.RiskDatabaseResult; | 7 | import com.skua.modules.emergency.vo.RiskDatabaseResult; |
8 | import com.skua.tool.annotation.Anonymous; | ||
8 | import org.apache.ibatis.annotations.Param; | 9 | import org.apache.ibatis.annotations.Param; |
9 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; | 10 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; |
10 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 11 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
... | @@ -14,9 +15,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ... | @@ -14,9 +15,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
14 | */ | 15 | */ |
15 | public interface EmergencyRiskEventMapper extends BaseMapper<EmergencyRiskEvent> { | 16 | public interface EmergencyRiskEventMapper extends BaseMapper<EmergencyRiskEvent> { |
16 | 17 | ||
18 | @Anonymous | ||
17 | List<RiskDatabaseResult> getRiskList(@Param("year") String year); | 19 | List<RiskDatabaseResult> getRiskList(@Param("year") String year); |
18 | 20 | ||
21 | @Anonymous | ||
19 | List<DangerDatabaseResult> getDangerList(@Param("year") String year); | 22 | List<DangerDatabaseResult> getDangerList(@Param("year") String year); |
20 | 23 | ||
24 | @Anonymous | ||
21 | List<MapDatabaseResult> getMapData(@Param("year") String year); | 25 | List<MapDatabaseResult> getMapData(@Param("year") String year); |
22 | } | 26 | } | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/xml/PowerAnalysisNewMapper.xml
... | @@ -685,13 +685,9 @@ | ... | @@ -685,13 +685,9 @@ |
685 | and depart_id=#{factoryId} | 685 | and depart_id=#{factoryId} |
686 | </if> | 686 | </if> |
687 | GROUP BY | 687 | GROUP BY |
688 | depart_id, | 688 | depart_id,LEFT ( ts, 7 ),index_tag |
689 | LEFT ( ts, 7 ), | ||
690 | index_tag | ||
691 | ORDER BY | 689 | ORDER BY |
692 | depart_id, | 690 | depart_id,LEFT ( ts, 7 ),index_tag |
693 | LEFT ( ts, 7 ), | ||
694 | index_tag | ||
695 | </select> | 691 | </select> |
696 | <select id="queryHDLAndSL" resultType="java.util.Map"> | 692 | <select id="queryHDLAndSL" resultType="java.util.Map"> |
697 | SELECT | 693 | SELECT | ... | ... |
-
请 注册 或 登录 后发表评论