Commit c7d743fe authored by duanruiming's avatar duanruiming

[update] 优化故障告警列表

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