Compare commits
No commits in common. "bc0b52f893075426443869d7863cb1f9e4022c33" and "4961b8ada7511ae0916afdb2f35d927bc0a57cc4" have entirely different histories.
bc0b52f893
...
4961b8ada7
@ -144,7 +144,6 @@ user-settings:
|
|||||||
- http://192.168.1.245:3001
|
- http://192.168.1.245:3001
|
||||||
- http://192.168.1.112:3002
|
- http://192.168.1.112:3002
|
||||||
- http://192.168.1.211:3001
|
- http://192.168.1.211:3001
|
||||||
- http://192.168.1.211:3000
|
|
||||||
- http://192.168.1.20:3000
|
- http://192.168.1.20:3000
|
||||||
- http://192.168.1.112:18080
|
- http://192.168.1.112:18080
|
||||||
- http://192.168.1.38:3000
|
- http://192.168.1.38:3000
|
||||||
|
@ -220,19 +220,4 @@ public class DeviceAlarmRecord implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String noticeTypeName;
|
private String noticeTypeName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 0:未核查;1:已审核;2.已修正
|
|
||||||
*/
|
|
||||||
private String checkFlag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 核查反馈意见
|
|
||||||
*/
|
|
||||||
private String checkComment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否属实
|
|
||||||
*/
|
|
||||||
private String checkResult;
|
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord;
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 变电站-辅控设备-告警记录 Mapper 接口
|
* 变电站-辅控设备-告警记录 Mapper 接口
|
||||||
@ -18,5 +16,4 @@ public interface DeviceAlarmRecordMapper extends BaseMapper<DeviceAlarmRecord> {
|
|||||||
|
|
||||||
Page<DeviceAlarmRecord> getDeviceAlarmRecordPage(Page<DeviceAlarmRecord> page, String systemcode, String deviceName, String signalName, String startDate, String endDate, String alarmLevel, String status);
|
Page<DeviceAlarmRecord> getDeviceAlarmRecordPage(Page<DeviceAlarmRecord> page, String systemcode, String deviceName, String signalName, String startDate, String endDate, String alarmLevel, String status);
|
||||||
|
|
||||||
Map<String, Object> getAlarmLogById(String id);
|
|
||||||
}
|
}
|
||||||
|
@ -199,8 +199,9 @@ public class DeviceAlarmRecordServiceImpl extends ServiceImpl<DeviceAlarmRecordM
|
|||||||
Map<String, Object> singalData, String value) {
|
Map<String, Object> singalData, String value) {
|
||||||
DeviceAlarmRecord deviceAlarmRecord = new DeviceAlarmRecord();
|
DeviceAlarmRecord deviceAlarmRecord = new DeviceAlarmRecord();
|
||||||
MeterDevice device = meterDeviceMapper.selectById(singalData.get("meterDeviceId").toString());
|
MeterDevice device = meterDeviceMapper.selectById(singalData.get("meterDeviceId").toString());
|
||||||
deviceAlarmRecord.setCheckFlag("0");
|
|
||||||
// 创建 SimpleDateFormat 对象,指定日期格式
|
// 创建 SimpleDateFormat 对象,指定日期格式
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
if ("yx".equals(type)) {
|
if ("yx".equals(type)) {
|
||||||
deviceAlarmRecord.setRecordId(IdUtil.fastSimpleUUID());
|
deviceAlarmRecord.setRecordId(IdUtil.fastSimpleUUID());
|
||||||
deviceAlarmRecord.setStationId(singalData.get("stationId").toString());
|
deviceAlarmRecord.setStationId(singalData.get("stationId").toString());
|
||||||
|
@ -60,14 +60,11 @@ public class AlarmLogController {
|
|||||||
return ResponseResult.error("未传变电站信息");
|
return ResponseResult.error("未传变电站信息");
|
||||||
}
|
}
|
||||||
//TODO 整合辅控告警
|
//TODO 整合辅控告警
|
||||||
// LambdaQueryWrapper<AlarmLog> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AlarmLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
// queryWrapper.eq(AlarmLog::getStationId, stationId).eq(AlarmLog::getDatastatus, "1").eq
|
queryWrapper.eq(AlarmLog::getStationId, stationId).eq(AlarmLog::getDatastatus, "1").eq(AlarmLog::getCheckFlag
|
||||||
// (AlarmLog::getCheckFlag
|
, 0).select(AlarmLog::getId,
|
||||||
// , 0).select(AlarmLog::getId,
|
AlarmLog::getContent, AlarmLog::getAlarmLevel, AlarmLog::getAlarmDate, AlarmLog::getStationName).orderByDesc(AlarmLog::getAlarmDate);
|
||||||
// AlarmLog::getContent, AlarmLog::getAlarmLevel, AlarmLog::getAlarmDate,
|
List<Map<String, Object>> maps = alarmLogService.listMaps(queryWrapper);
|
||||||
// AlarmLog::getStationName).orderByDesc(AlarmLog::getAlarmDate);
|
|
||||||
// List<Map<String, Object>> maps = alarmLogService.listMaps(queryWrapper);
|
|
||||||
List<Map<String, Object>> maps = alarmLogService.getAlarmLogList(stationId);
|
|
||||||
return ResponseResult.successData(maps);
|
return ResponseResult.successData(maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,8 +284,9 @@ public class AlarmLogController {
|
|||||||
|
|
||||||
@GetMapping("/getAlarmLogById")
|
@GetMapping("/getAlarmLogById")
|
||||||
@ApiOperation("根据告警信息ID查询详情")
|
@ApiOperation("根据告警信息ID查询详情")
|
||||||
public ResponseResult getAlarmLogById(String id,String systemType) {
|
public ResponseResult getAlarmLogById(String id) {
|
||||||
Map<String, Object> alarmLog = alarmLogService.getAlarmLogById(id,systemType);
|
Map<String, Object> alarmLog = alarmLogService.getAlarmLogById(id);
|
||||||
|
|
||||||
return ResponseResult.successData(alarmLog);
|
return ResponseResult.successData(alarmLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,4 @@ public interface AlarmLogMapper extends BaseMapper<AlarmLog> {
|
|||||||
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||||
***********************************/
|
***********************************/
|
||||||
List<Map<String, Object>> getAlarmLogList(String stationId);
|
List<Map<String, Object>> getAlarmLogList(String stationId);
|
||||||
|
|
||||||
Map<String, Object> getAlarmLogById(String id);
|
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ public interface IAlarmLogService extends IService<AlarmLog> {
|
|||||||
* 参数说明 id 告警id
|
* 参数说明 id 告警id
|
||||||
* 返回值说明: java.util.Map<java.lang.String,java.lang.Object>
|
* 返回值说明: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
***********************************/
|
***********************************/
|
||||||
Map<String, Object> getAlarmLogById(String id,String systemType);
|
Map<String, Object> getAlarmLogById(String id);
|
||||||
|
|
||||||
boolean updateDeviceResult(JSONObject jsonObject) throws Exception;
|
boolean updateDeviceResult(JSONObject jsonObject) throws Exception;
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ import com.yfd.platform.config.AlarmTemplateConfig;
|
|||||||
import com.yfd.platform.config.HttpServerConfig;
|
import com.yfd.platform.config.HttpServerConfig;
|
||||||
import com.yfd.platform.config.ParentConfig;
|
import com.yfd.platform.config.ParentConfig;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.modules.auxcontrol.mapper.DeviceAlarmRecordMapper;
|
|
||||||
import com.yfd.platform.modules.basedata.domain.LinkageSignal;
|
import com.yfd.platform.modules.basedata.domain.LinkageSignal;
|
||||||
import com.yfd.platform.modules.basedata.domain.Substation;
|
import com.yfd.platform.modules.basedata.domain.Substation;
|
||||||
import com.yfd.platform.modules.basedata.domain.SubstationDevice;
|
import com.yfd.platform.modules.basedata.domain.SubstationDevice;
|
||||||
@ -120,8 +119,7 @@ public class AlarmLogServiceImpl extends ServiceImpl<AlarmLogMapper, AlarmLog> i
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISysDictionaryItemsService sysDictionaryItemsService;
|
private ISysDictionaryItemsService sysDictionaryItemsService;
|
||||||
@Resource
|
|
||||||
private DeviceAlarmRecordMapper deviceAlarmRecordMapper;
|
|
||||||
@Resource
|
@Resource
|
||||||
private MqttGateway mqttGateway;
|
private MqttGateway mqttGateway;
|
||||||
|
|
||||||
@ -1179,16 +1177,19 @@ public class AlarmLogServiceImpl extends ServiceImpl<AlarmLogMapper, AlarmLog> i
|
|||||||
* 返回值说明: java.util.Map<java.lang.String,java.lang.Object>
|
* 返回值说明: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
***********************************/
|
***********************************/
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getAlarmLogById(String id, String systemType) {
|
public Map<String, Object> getAlarmLogById(String id) {
|
||||||
|
Map<String, Object> map = this.getMap(new LambdaQueryWrapper<AlarmLog>().eq(AlarmLog::getId, id));
|
||||||
if ("01".equals(systemType)) {
|
if (map == null) {
|
||||||
Map<String, Object> map = deviceAlarmRecordMapper.getAlarmLogById(id);
|
return ResponseResult.successData(null);
|
||||||
}
|
}
|
||||||
if ("02".equals(systemType)) {
|
String taskResultId = map.get("taskResultId").toString();
|
||||||
Map<String, Object> map = alarmLogMapper.getAlarmLogById(id);
|
TaskResult taskResult = taskResultMapper.selectById(taskResultId);
|
||||||
return ResponseResult.successData(map);
|
if (taskResult != null) {
|
||||||
|
map.put("deviceId", taskResult.getPatroldeviceCode());
|
||||||
|
map.put("channelId", taskResult.getPatroldeviceChannelcode());
|
||||||
|
map.put("patroldevicePos", taskResult.getPatroldevicePos());
|
||||||
}
|
}
|
||||||
return ResponseResult.successData(null);
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSlienceType(String type) {
|
private String getSlienceType(String type) {
|
||||||
|
@ -5,7 +5,6 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public class TestFileDir {
|
public class TestFileDir {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
System.out.println("user.home = " + System.getProperty("user.home"));
|
|
||||||
// //获取告警触发条件
|
// //获取告警触发条件
|
||||||
String str = "20<=value<50";
|
String str = "20<=value<50";
|
||||||
// 定义正则表达式
|
// 定义正则表达式
|
||||||
|
@ -53,22 +53,4 @@
|
|||||||
and dar.alarm_time <= #{endDate}
|
and dar.alarm_time <= #{endDate}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAlarmLogById" resultType="java.util.Map">
|
|
||||||
SELECT
|
|
||||||
dar.*,
|
|
||||||
'01' systemType,
|
|
||||||
ism.main_device_name,
|
|
||||||
ism.main_device_id,
|
|
||||||
isc.component_id,
|
|
||||||
isc.component_name
|
|
||||||
FROM
|
|
||||||
fk_device_alarm_record dar
|
|
||||||
INNER JOIN fk_device_signal ds ON dar.signal_id = ds.signal_id
|
|
||||||
INNER JOIN iis_substation_maindevice ism ON ism.main_device_id = ds.main_device_id
|
|
||||||
INNER JOIN iis_substation_component isc ON isc.component_id = ds.main_component_id
|
|
||||||
WHERE
|
|
||||||
dar.record_id = #{id}
|
|
||||||
LIMIT 1
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -75,46 +75,24 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getAlarmLogList" resultType="java.util.Map">
|
<select id="getAlarmLogList" resultType="java.util.Map">
|
||||||
|
(
|
||||||
SELECT
|
SELECT
|
||||||
*
|
record_id AS id,
|
||||||
FROM
|
station_id,
|
||||||
(
|
alarm_message AS content,
|
||||||
(
|
alarm_time AS alarm_date
|
||||||
SELECT
|
FROM `fk_device_alarm_record`
|
||||||
record_id AS id,
|
)
|
||||||
station_id,
|
UNION ALL
|
||||||
'01' system_type,
|
(
|
||||||
alarm_message AS content,
|
|
||||||
CASE
|
|
||||||
WHEN alarm_level = 1 THEN
|
|
||||||
2
|
|
||||||
WHEN alarm_level = 2 THEN
|
|
||||||
3
|
|
||||||
WHEN alarm_level = 3 THEN
|
|
||||||
4 ELSE alarm_level
|
|
||||||
END AS alarm_level,
|
|
||||||
alarm_time AS alarm_date
|
|
||||||
FROM
|
|
||||||
`fk_device_alarm_record`
|
|
||||||
) UNION ALL
|
|
||||||
( SELECT id, station_id,'02' system_type, content, alarm_level alarm_level, alarm_date FROM iis_alarm_log )
|
|
||||||
) AS combined_data
|
|
||||||
WHERE
|
|
||||||
station_id = #{stationId}
|
|
||||||
ORDER BY
|
|
||||||
alarm_date DESC;
|
|
||||||
</select>
|
|
||||||
<select id="getAlarmLogById" resultType="java.util.Map">
|
|
||||||
SELECT
|
SELECT
|
||||||
'02' systemType,
|
id,
|
||||||
al.*,
|
station_id,
|
||||||
tr.patroldevice_code deviceId,
|
content,
|
||||||
tr.patroldevice_channelcode channelId,
|
alarm_date
|
||||||
tr.patroldevice_pos patroldevicePos
|
FROM iis_alarm_log
|
||||||
FROM
|
)
|
||||||
iis_alarm_log al
|
|
||||||
INNER JOIN iis_task_result tr ON al.task_result_id = tr.result_id
|
ORDER BY alarm_date DESC;
|
||||||
WHERE
|
|
||||||
al.id = #{id}
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user