Commit c2efea8a authored by duanruiming's avatar duanruiming

[update] 离线告警;锁定恢复优化

parent 2226de7f
......@@ -124,14 +124,16 @@ public class FeignProxyServiceImpl implements FeignProxyService {
@Override
public JsonViewObject lockControl(LockControlVO lockControlVO) {
String resultMessage = "锁定控制-相位锁定控制成功";
Integer control = 4;
if (lockControlVO.getCommand() == 0) {
resultMessage = "锁定控制-相位锁定恢复成功";
control = 1;
}
JsonViewObject jsonViewObject = utcFeignClients.lockControl(lockControlVO);
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
return jsonViewObject.fail("锁定控制-相位锁定/解锁UTC服务调用异常");
}
insertControlHist(lockControlVO.getCrossCode(), 4, Constants.ProcessService.ADMIN_ID);
insertControlHist(lockControlVO.getCrossCode(), control, Constants.ProcessService.ADMIN_ID);
return jsonViewObject.success(resultMessage);
}
......
......@@ -30,7 +30,7 @@ import java.util.*;
*/
@Component
@Slf4j
public class CommonEventWarnTask {
public class CommonEventWarnTask {
@Autowired
private UtcFeignClients utcFeignClients;
......@@ -95,10 +95,12 @@ public class CommonEventWarnTask {
Map<String, Object> result = map;
String signalId = (String) result.get("signalId");
String crossId = (String) result.get("crossId");
Integer currentStatus = (Integer) result.get("status");
Integer currentFaultType = (Integer) result.get("faultType");
String coordinate = "";
String crossName = "";
int faultTypeDB = 0;
int statusDB = 0;
if (StringUtils.isNotEmpty(crossId)) {
CrossInfoPO tBaseCrossInfo = situationDetectionService.selectCrossInfoById(crossId);
if (Objects.nonNull(tBaseCrossInfo)) {
......@@ -108,16 +110,21 @@ public class CommonEventWarnTask {
TDeviceStatusInfo tDeviceStatusInfo = tDeviceStatusMapper.selectOne(queryWrapper.eq("code", crossId));
if (Objects.nonNull(tDeviceStatusInfo)) {
faultTypeDB = tDeviceStatusInfo.getFaultType();
statusDB = tDeviceStatusInfo.getStatus();
crossName = tDeviceStatusInfo.getName();
}
}
if (Objects.nonNull(currentFaultType) && currentFaultType != faultTypeDB) {
if ((Objects.nonNull(currentFaultType) && currentFaultType != faultTypeDB) || currentStatus != statusDB) {
CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
commonEventAlarmOutVo.setEventType(3);
commonEventAlarmOutVo.setEventId(signalId);
commonEventAlarmOutVo.setEventName(crossName);
commonEventAlarmOutVo.setEventDesc(crossName.concat("信号机告警"));
commonEventAlarmOutVo.setStatus(String.valueOf(currentFaultType));
if (currentStatus == 0) {
commonEventAlarmOutVo.setStatus("11");
} else {
commonEventAlarmOutVo.setStatus(String.valueOf(currentFaultType));
}
commonEventAlarmOutVo.setStartTime(formatNow);
commonEventAlarmOutVo.setCoordinate(coordinate);
results.add(commonEventAlarmOutVo);
......
......@@ -24,7 +24,7 @@ public class CommonEventAlarmOutVo {
@ApiModelProperty(value = "事件描述")
String eventDesc;
@ApiModelProperty(value = "事件状态:路口报警:状态 0正常 1失衡 2拥堵 3溢出 4死锁;事件报警:1事故 2拥堵 3管制 4施工; 信号机故障:0正常 1检测器故障 2时钟故障 3电源故障 4驱动模块故障 5信号灯故障 6箱门开启 7方案错误 8绿冲突 9红全熄 10行人红熄")
@ApiModelProperty(value = "事件状态:路口报警:状态 0正常 1失衡 2拥堵 3溢出 4死锁;事件报警:1事故 2拥堵 3管制 4施工; 信号机故障:0正常 1检测器故障 2时钟故障 3电源故障 4驱动模块故障 5信号灯故障 6箱门开启 7方案错误 8绿冲突 9红全熄 10行人红熄 11通讯中断")
String status;
@ApiModelProperty(value = "发生时间")
......
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