Commit c7d743fe authored by duanruiming's avatar duanruiming

[update] 优化故障告警列表

parent efbb69ab
......@@ -571,20 +571,22 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
@Override
public List<SignalFaultInfoVO> listSignalFaultInfos() throws Exception {
LambdaQueryWrapper<TDeviceStatusLog> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.ne(TDeviceStatusLog::getFaultType, 0);
List<TDeviceStatusLog> tDeviceStatusLogs = tDeviceStatusLogMapper.selectList(queryWrapper);
List<TDeviceStatusInfo> tDeviceStatusInfos = allDeviceStatusMapper.selectByEntity(new TDeviceStatusInfo());
List<CrossInfoOutVo> crossInfoOutVoList = getCrossInfoOutVoList(new CrossInfoPageVO());
List<SignalFaultInfoVO> signalFaultInfoVOS = new ArrayList<>(tDeviceStatusLogs.size());
tDeviceStatusLogs.forEach(tDeviceStatusLog -> {
List<SignalFaultInfoVO> signalFaultInfoVOS = new ArrayList<>(tDeviceStatusInfos.size());
tDeviceStatusInfos.forEach(tDeviceStatus -> {
SignalFaultInfoVO signalFaultInfoVO = new SignalFaultInfoVO();
BeanUtils.copyProperties(tDeviceStatusLog, signalFaultInfoVO);
signalFaultInfoVO.setStartTime(tDeviceStatusLog.getGmtCreate().toString().substring(11, 19));
signalFaultInfoVO.setDealStatus("1"); // 默认未处理
BeanUtils.copyProperties(tDeviceStatus, signalFaultInfoVO);
signalFaultInfoVO.setStartTime(tDeviceStatus.getGmtCreate().toString().substring(11, 19));
if (!CollectionUtils.isEmpty(crossInfoOutVoList)) {
for (CrossInfoOutVo crossInfoOutVo : crossInfoOutVoList) {
if (StringUtils.equals(crossInfoOutVo.getId(), tDeviceStatusLog.getCode())) {
if (StringUtils.equals(crossInfoOutVo.getId(), tDeviceStatus.getCode())) {
signalFaultInfoVO.setIp(crossInfoOutVo.getIp());
if (tDeviceStatus.getFaultType() == 0) {
signalFaultInfoVO.setDealStatus("2");
}
}
}
}
......
......@@ -84,27 +84,27 @@ public class CommonEventWarnTask {
private JsonViewObject getSignalWarnData() {
List<CommonEventAlarmOutVo> results = new ArrayList<>();
if (true) {
CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
commonEventAlarmOutVo.setEventType(3);
commonEventAlarmOutVo.setEventId("14Q3709IOR0");
commonEventAlarmOutVo.setEventName("相融路与蠡太路交叉口");
commonEventAlarmOutVo.setStatus("3");
commonEventAlarmOutVo.setCoordinate("120.630807,31.422317");
CommonEventAlarmOutVo commonEventAlarmOutVo1 = new CommonEventAlarmOutVo();
commonEventAlarmOutVo1.setEventType(3);
commonEventAlarmOutVo1.setEventId("8");
commonEventAlarmOutVo1.setEventName("青龙港路与云集街交叉口");
commonEventAlarmOutVo1.setStatus("3");
commonEventAlarmOutVo1.setCoordinate("120.640305,31.418544");
results.add(commonEventAlarmOutVo);
LocalDateTime now = LocalDateTime.now();
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
jsonViewObject.setTimestamp(now.toInstant(ZoneOffset.of("+8")).toEpochMilli());
jsonViewObject.setContent(results);
return jsonViewObject;
}
// if (true) {
// CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
// commonEventAlarmOutVo.setEventType(3);
// commonEventAlarmOutVo.setEventId("14Q3709IOR0");
// commonEventAlarmOutVo.setEventName("相融路与蠡太路交叉口");
// commonEventAlarmOutVo.setStatus("3");
// commonEventAlarmOutVo.setCoordinate("120.630807,31.422317");
//
// CommonEventAlarmOutVo commonEventAlarmOutVo1 = new CommonEventAlarmOutVo();
// commonEventAlarmOutVo1.setEventType(3);
// commonEventAlarmOutVo1.setEventId("8");
// commonEventAlarmOutVo1.setEventName("青龙港路与云集街交叉口");
// commonEventAlarmOutVo1.setStatus("3");
// commonEventAlarmOutVo1.setCoordinate("120.640305,31.418544");
// results.add(commonEventAlarmOutVo);
// LocalDateTime now = LocalDateTime.now();
// JsonViewObject jsonViewObject = JsonViewObject.newInstance();
// jsonViewObject.setTimestamp(now.toInstant(ZoneOffset.of("+8")).toEpochMilli());
// jsonViewObject.setContent(results);
// return jsonViewObject;
// }
JsonViewObject jsonViewObject = utcFeignClients.runningStatusAlarm();
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
......@@ -118,11 +118,6 @@ public class CommonEventWarnTask {
String signalId = (String) result.get("signalId");
String crossId = (String) result.get("crossId");
Integer currentFaultType = (Integer) result.get("faultType");
// todo 配合测试提供数据, 后续删除
if (Objects.equals(crossId, "13FNK0C6790")) {
currentFaultType = 1;
}
String coordinate = "";
int faultTypeDB = 0;
if (StringUtils.isNotEmpty(crossId)) {
......
package net.wanji.web.vo.situationDetection;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.web.entity.TDeviceStatusInfo;
......@@ -11,4 +12,6 @@ import net.wanji.web.entity.TDeviceStatusInfo;
public class SignalFaultInfoVO extends TDeviceStatusInfo {
private String startTime;
private String ip;
@ApiModelProperty(value = "处理状态:1未处理 2已处理")
private String dealStatus;
}
\ No newline at end of file
......@@ -16,20 +16,21 @@
order by type
</select>
<resultMap type="net.wanji.web.po.AllDeviceStatusPO" id="TDeviceStatusInfoMap">
<resultMap type="net.wanji.web.entity.TDeviceStatusInfo" id="TDeviceStatusInfoMap">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="status" column="status"/>
<result property="faultType" column="fault_type"/>
<result property="gmtCreate" column="gmt_create"/>
</resultMap>
<select id="selectByEntity" parameterType="net.wanji.web.entity.TDeviceStatusInfo" resultMap="TDeviceStatusInfoMap">
select id, code, name, type, fault_type, gmt_create from where t_device_status
select id, code, name, type, status, fault_type, gmt_create from t_device_status
<where>
<if test="code != null and code != ''">
code = #{code}
<if test="entity.code != null and entity.code != ''">
code = #{entity.code}
</if>
</where>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment