Commit c2efea8a authored by duanruiming's avatar duanruiming

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

parent 2226de7f
...@@ -124,14 +124,16 @@ public class FeignProxyServiceImpl implements FeignProxyService { ...@@ -124,14 +124,16 @@ public class FeignProxyServiceImpl implements FeignProxyService {
@Override @Override
public JsonViewObject lockControl(LockControlVO lockControlVO) { public JsonViewObject lockControl(LockControlVO lockControlVO) {
String resultMessage = "锁定控制-相位锁定控制成功"; String resultMessage = "锁定控制-相位锁定控制成功";
Integer control = 4;
if (lockControlVO.getCommand() == 0) { if (lockControlVO.getCommand() == 0) {
resultMessage = "锁定控制-相位锁定恢复成功"; resultMessage = "锁定控制-相位锁定恢复成功";
control = 1;
} }
JsonViewObject jsonViewObject = utcFeignClients.lockControl(lockControlVO); JsonViewObject jsonViewObject = utcFeignClients.lockControl(lockControlVO);
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) { if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
return jsonViewObject.fail("锁定控制-相位锁定/解锁UTC服务调用异常"); return jsonViewObject.fail("锁定控制-相位锁定/解锁UTC服务调用异常");
} }
insertControlHist(lockControlVO.getCrossCode(), 4, Constants.ProcessService.ADMIN_ID); insertControlHist(lockControlVO.getCrossCode(), control, Constants.ProcessService.ADMIN_ID);
return jsonViewObject.success(resultMessage); return jsonViewObject.success(resultMessage);
} }
......
...@@ -95,10 +95,12 @@ public class CommonEventWarnTask { ...@@ -95,10 +95,12 @@ public class CommonEventWarnTask {
Map<String, Object> result = map; Map<String, Object> result = map;
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 currentStatus = (Integer) result.get("status");
Integer currentFaultType = (Integer) result.get("faultType"); Integer currentFaultType = (Integer) result.get("faultType");
String coordinate = ""; String coordinate = "";
String crossName = ""; String crossName = "";
int faultTypeDB = 0; int faultTypeDB = 0;
int statusDB = 0;
if (StringUtils.isNotEmpty(crossId)) { if (StringUtils.isNotEmpty(crossId)) {
CrossInfoPO tBaseCrossInfo = situationDetectionService.selectCrossInfoById(crossId); CrossInfoPO tBaseCrossInfo = situationDetectionService.selectCrossInfoById(crossId);
if (Objects.nonNull(tBaseCrossInfo)) { if (Objects.nonNull(tBaseCrossInfo)) {
...@@ -108,16 +110,21 @@ public class CommonEventWarnTask { ...@@ -108,16 +110,21 @@ public class CommonEventWarnTask {
TDeviceStatusInfo tDeviceStatusInfo = tDeviceStatusMapper.selectOne(queryWrapper.eq("code", crossId)); TDeviceStatusInfo tDeviceStatusInfo = tDeviceStatusMapper.selectOne(queryWrapper.eq("code", crossId));
if (Objects.nonNull(tDeviceStatusInfo)) { if (Objects.nonNull(tDeviceStatusInfo)) {
faultTypeDB = tDeviceStatusInfo.getFaultType(); faultTypeDB = tDeviceStatusInfo.getFaultType();
statusDB = tDeviceStatusInfo.getStatus();
crossName = tDeviceStatusInfo.getName(); crossName = tDeviceStatusInfo.getName();
} }
} }
if (Objects.nonNull(currentFaultType) && currentFaultType != faultTypeDB) { if ((Objects.nonNull(currentFaultType) && currentFaultType != faultTypeDB) || currentStatus != statusDB) {
CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo(); CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
commonEventAlarmOutVo.setEventType(3); commonEventAlarmOutVo.setEventType(3);
commonEventAlarmOutVo.setEventId(signalId); commonEventAlarmOutVo.setEventId(signalId);
commonEventAlarmOutVo.setEventName(crossName); commonEventAlarmOutVo.setEventName(crossName);
commonEventAlarmOutVo.setEventDesc(crossName.concat("信号机告警")); commonEventAlarmOutVo.setEventDesc(crossName.concat("信号机告警"));
if (currentStatus == 0) {
commonEventAlarmOutVo.setStatus("11");
} else {
commonEventAlarmOutVo.setStatus(String.valueOf(currentFaultType)); commonEventAlarmOutVo.setStatus(String.valueOf(currentFaultType));
}
commonEventAlarmOutVo.setStartTime(formatNow); commonEventAlarmOutVo.setStartTime(formatNow);
commonEventAlarmOutVo.setCoordinate(coordinate); commonEventAlarmOutVo.setCoordinate(coordinate);
results.add(commonEventAlarmOutVo); results.add(commonEventAlarmOutVo);
......
...@@ -24,7 +24,7 @@ public class CommonEventAlarmOutVo { ...@@ -24,7 +24,7 @@ public class CommonEventAlarmOutVo {
@ApiModelProperty(value = "事件描述") @ApiModelProperty(value = "事件描述")
String eventDesc; 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; String status;
@ApiModelProperty(value = "发生时间") @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