Browse Source

优化护栏碰撞事件上报字段处理

develop
zhaoxianglong 8 months ago
parent
commit
b3c8d75ca0
  1. 2
      zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java
  2. 17
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

2
zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java

@ -14,6 +14,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.eclipse.paho.client.mqttv3.*;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -32,6 +33,7 @@ import java.util.Objects;
*/
@Api(tags = "非机预警接口")
@RestController
@Component
@RequestMapping("/nonAutomaticWarning")
public class NonAutomaticWarningController extends BaseController {

17
zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

@ -378,16 +378,20 @@ public class DeviceMessageHandler {
String direction = "";
if (Objects.equals(location, "0")) {
dcWarning.setDirection("1");
direction = "上行右侧";
dcWarning.setLane("0");
direction = "菏泽方向右侧护栏";
} else if (Objects.equals(location, "1")) {
dcWarning.setDirection("1");
direction = "上行左侧";
dcWarning.setLane("1");
direction = "菏泽方向左侧护栏";
} else if (Objects.equals(location, "10")) {
dcWarning.setDirection("0");
direction = "下行右侧";
dcWarning.setLane("0");
direction = "济南方向右侧护栏";
} else if (Objects.equals(location, "11")) {
dcWarning.setDirection("0");
direction = "下行左侧";
dcWarning.setLane("1");
direction = "济南方向左侧护栏";
}
String eventType = "";
@ -423,8 +427,11 @@ public class DeviceMessageHandler {
dcWarning.setStakeMark(dcDevices.get(0).getStakeMark());
dcWarning.setWarningType(9);
dcWarning.setWarningSubclass("4");
dcWarning.setWarningState(1);
dcWarning.setCreateTime(new Date());
dcWarning.setWarningTitle("护栏碰撞上报事件:区域号为" + areaCode + "在" + timeOfFireAlarming + direction + "发生" + eventType + "事件");
dcWarning.setDirection("护栏碰撞上报事件:区域号为" + areaCode + "在20" + timeOfFireAlarming + direction + "发生" + eventType + "事件");
dcWarning.setWarningTitle("护栏碰撞在20" + timeOfFireAlarming + direction + "发生" + eventType + "事件");
dcWarning.setOtherConfig(dataJsonObject.toJSONString());
dcWarningService.insertDcWarning(dcWarning);
}

Loading…
Cancel
Save