diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml index cab6f35..45b108f 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml @@ -10,6 +10,7 @@ TYPHOON_SPEED AS typhoonSpeed, SHIP_DIS AS shipDistance, ROBOT_BATTERY AS robotBattery, + METER_BATTERY AS meterBattery, ROBOT_DIS AS robotDistance, SATELLITE_SIGNAL AS satelliteSignal diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml index cab6f35..45b108f 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml @@ -10,6 +10,7 @@ TYPHOON_SPEED AS typhoonSpeed, SHIP_DIS AS shipDistance, ROBOT_BATTERY AS robotBattery, + METER_BATTERY AS meterBattery, ROBOT_DIS AS robotDistance, SATELLITE_SIGNAL AS satelliteSignal diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java index 7183bb7..bc020d7 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java @@ -24,9 +24,14 @@ private Double shipDistance; /** - * 机器人电量 + * 机器人动力电量 */ - private Double robotBattery; + private Double robotPowerBattery; + + /** + * 机器人仪表电量 + */ + private Double robotMeterBattery; /** * 机器人与方舱之间的距离 @@ -42,7 +47,8 @@ this.typhoonDistance = threshold.getTyphoonDistance(); this.typhoonSpeed = threshold.getTyphoonSpeed(); this.shipDistance = threshold.getShipDistance(); - this.robotBattery = threshold.getRobotBattery(); + this.robotPowerBattery = threshold.getRobotBattery(); + this.robotMeterBattery = threshold.getMeterBattery(); this.robotDistance = threshold.getRobotDistance(); this.satelliteSignal = threshold.getSatelliteSignal(); } diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml index cab6f35..45b108f 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml @@ -10,6 +10,7 @@ TYPHOON_SPEED AS typhoonSpeed, SHIP_DIS AS shipDistance, ROBOT_BATTERY AS robotBattery, + METER_BATTERY AS meterBattery, ROBOT_DIS AS robotDistance, SATELLITE_SIGNAL AS satelliteSignal diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java index 7183bb7..bc020d7 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java @@ -24,9 +24,14 @@ private Double shipDistance; /** - * 机器人电量 + * 机器人动力电量 */ - private Double robotBattery; + private Double robotPowerBattery; + + /** + * 机器人仪表电量 + */ + private Double robotMeterBattery; /** * 机器人与方舱之间的距离 @@ -42,7 +47,8 @@ this.typhoonDistance = threshold.getTyphoonDistance(); this.typhoonSpeed = threshold.getTyphoonSpeed(); this.shipDistance = threshold.getShipDistance(); - this.robotBattery = threshold.getRobotBattery(); + this.robotPowerBattery = threshold.getRobotBattery(); + this.robotMeterBattery = threshold.getMeterBattery(); this.robotDistance = threshold.getRobotDistance(); this.satelliteSignal = threshold.getSatelliteSignal(); } diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java index edbea33..6fdb8cc 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java @@ -33,10 +33,7 @@ private final ISatelliteService satelliteService; private final WebSocketServerEndpoint webSocket; - public AlarmServiceImpl(AbstractDictService dictService, IAlarmThresholdService thresholdService, - ITyphoonService typhoonService, IShipService shipService, - IRobotService robotService, IShelterPositionService shelterPositionService, - ISatelliteService satelliteService, WebSocketServerEndpoint webSocket) { + public AlarmServiceImpl(AbstractDictService dictService, IAlarmThresholdService thresholdService, ITyphoonService typhoonService, IShipService shipService, IRobotService robotService, IShelterPositionService shelterPositionService, ISatelliteService satelliteService, WebSocketServerEndpoint webSocket) { this.dictService = dictService; this.thresholdService = thresholdService; this.typhoonService = typhoonService; @@ -60,14 +57,14 @@ int robotId = (int) robotMap.get("robotId"); float instrumentE = (float) robotMap.get("instrumentE"); float powerE = (float) robotMap.get("powerE"); - if (instrumentE < thresholdDTO.getRobotBattery()) { - //存库 - save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "仪表电量低", instrumentE)); - } - if (powerE < thresholdDTO.getRobotBattery()) { + if (powerE < thresholdDTO.getRobotPowerBattery()) { //存库 save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "动力电量低", powerE)); } + if (instrumentE < thresholdDTO.getRobotMeterBattery()) { + //存库 + save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "仪表电量低", instrumentE)); + } } /** diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml index cab6f35..45b108f 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml @@ -10,6 +10,7 @@ TYPHOON_SPEED AS typhoonSpeed, SHIP_DIS AS shipDistance, ROBOT_BATTERY AS robotBattery, + METER_BATTERY AS meterBattery, ROBOT_DIS AS robotDistance, SATELLITE_SIGNAL AS satelliteSignal diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java index 7183bb7..bc020d7 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java @@ -24,9 +24,14 @@ private Double shipDistance; /** - * 机器人电量 + * 机器人动力电量 */ - private Double robotBattery; + private Double robotPowerBattery; + + /** + * 机器人仪表电量 + */ + private Double robotMeterBattery; /** * 机器人与方舱之间的距离 @@ -42,7 +47,8 @@ this.typhoonDistance = threshold.getTyphoonDistance(); this.typhoonSpeed = threshold.getTyphoonSpeed(); this.shipDistance = threshold.getShipDistance(); - this.robotBattery = threshold.getRobotBattery(); + this.robotPowerBattery = threshold.getRobotBattery(); + this.robotMeterBattery = threshold.getMeterBattery(); this.robotDistance = threshold.getRobotDistance(); this.satelliteSignal = threshold.getSatelliteSignal(); } diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java index edbea33..6fdb8cc 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java @@ -33,10 +33,7 @@ private final ISatelliteService satelliteService; private final WebSocketServerEndpoint webSocket; - public AlarmServiceImpl(AbstractDictService dictService, IAlarmThresholdService thresholdService, - ITyphoonService typhoonService, IShipService shipService, - IRobotService robotService, IShelterPositionService shelterPositionService, - ISatelliteService satelliteService, WebSocketServerEndpoint webSocket) { + public AlarmServiceImpl(AbstractDictService dictService, IAlarmThresholdService thresholdService, ITyphoonService typhoonService, IShipService shipService, IRobotService robotService, IShelterPositionService shelterPositionService, ISatelliteService satelliteService, WebSocketServerEndpoint webSocket) { this.dictService = dictService; this.thresholdService = thresholdService; this.typhoonService = typhoonService; @@ -60,14 +57,14 @@ int robotId = (int) robotMap.get("robotId"); float instrumentE = (float) robotMap.get("instrumentE"); float powerE = (float) robotMap.get("powerE"); - if (instrumentE < thresholdDTO.getRobotBattery()) { - //存库 - save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "仪表电量低", instrumentE)); - } - if (powerE < thresholdDTO.getRobotBattery()) { + if (powerE < thresholdDTO.getRobotPowerBattery()) { //存库 save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "动力电量低", powerE)); } + if (instrumentE < thresholdDTO.getRobotMeterBattery()) { + //存库 + save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "仪表电量低", instrumentE)); + } } /** diff --git a/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java b/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java index d43d55d..a8d5d88 100644 --- a/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java +++ b/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java @@ -48,12 +48,18 @@ private Double shipDistance; /** - * 机器人电量 + * 机器人动力电量 */ @TableField("ROBOT_BATTERY") private Double robotBattery; /** + * 机器人仪表电量 + */ + @TableField("METER_BATTERY") + private Double meterBattery; + + /** * 机器人与方舱之间的距离 */ @TableField("ROBOT_DIS") diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml index cab6f35..45b108f 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dao/mapping/AlarmThresholdMapper.xml @@ -10,6 +10,7 @@ TYPHOON_SPEED AS typhoonSpeed, SHIP_DIS AS shipDistance, ROBOT_BATTERY AS robotBattery, + METER_BATTERY AS meterBattery, ROBOT_DIS AS robotDistance, SATELLITE_SIGNAL AS satelliteSignal diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java index 7183bb7..bc020d7 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/dto/AlarmThresholdDTO.java @@ -24,9 +24,14 @@ private Double shipDistance; /** - * 机器人电量 + * 机器人动力电量 */ - private Double robotBattery; + private Double robotPowerBattery; + + /** + * 机器人仪表电量 + */ + private Double robotMeterBattery; /** * 机器人与方舱之间的距离 @@ -42,7 +47,8 @@ this.typhoonDistance = threshold.getTyphoonDistance(); this.typhoonSpeed = threshold.getTyphoonSpeed(); this.shipDistance = threshold.getShipDistance(); - this.robotBattery = threshold.getRobotBattery(); + this.robotPowerBattery = threshold.getRobotBattery(); + this.robotMeterBattery = threshold.getMeterBattery(); this.robotDistance = threshold.getRobotDistance(); this.satelliteSignal = threshold.getSatelliteSignal(); } diff --git a/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java b/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java index edbea33..6fdb8cc 100644 --- a/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java +++ b/casic-alarm/src/main/java/com/casic/missiles/modular/system/service/impl/AlarmServiceImpl.java @@ -33,10 +33,7 @@ private final ISatelliteService satelliteService; private final WebSocketServerEndpoint webSocket; - public AlarmServiceImpl(AbstractDictService dictService, IAlarmThresholdService thresholdService, - ITyphoonService typhoonService, IShipService shipService, - IRobotService robotService, IShelterPositionService shelterPositionService, - ISatelliteService satelliteService, WebSocketServerEndpoint webSocket) { + public AlarmServiceImpl(AbstractDictService dictService, IAlarmThresholdService thresholdService, ITyphoonService typhoonService, IShipService shipService, IRobotService robotService, IShelterPositionService shelterPositionService, ISatelliteService satelliteService, WebSocketServerEndpoint webSocket) { this.dictService = dictService; this.thresholdService = thresholdService; this.typhoonService = typhoonService; @@ -60,14 +57,14 @@ int robotId = (int) robotMap.get("robotId"); float instrumentE = (float) robotMap.get("instrumentE"); float powerE = (float) robotMap.get("powerE"); - if (instrumentE < thresholdDTO.getRobotBattery()) { - //存库 - save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "仪表电量低", instrumentE)); - } - if (powerE < thresholdDTO.getRobotBattery()) { + if (powerE < thresholdDTO.getRobotPowerBattery()) { //存库 save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "动力电量低", powerE)); } + if (instrumentE < thresholdDTO.getRobotMeterBattery()) { + //存库 + save(creatAlarm(String.valueOf(robotId), "1", "机器人" + robotId + "仪表电量低", instrumentE)); + } } /** diff --git a/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java b/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java index d43d55d..a8d5d88 100644 --- a/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java +++ b/casic-server-support/src/main/java/com/casic/missiles/modular/system/model/AlarmThreshold.java @@ -48,12 +48,18 @@ private Double shipDistance; /** - * 机器人电量 + * 机器人动力电量 */ @TableField("ROBOT_BATTERY") private Double robotBattery; /** + * 机器人仪表电量 + */ + @TableField("METER_BATTERY") + private Double meterBattery; + + /** * 机器人与方舱之间的距离 */ @TableField("ROBOT_DIS") diff --git a/casic-shelter/src/main/java/com/casic/missiles/modular/system/service/impl/RobotServiceImpl.java b/casic-shelter/src/main/java/com/casic/missiles/modular/system/service/impl/RobotServiceImpl.java index d4e441a..36446c5 100644 --- a/casic-shelter/src/main/java/com/casic/missiles/modular/system/service/impl/RobotServiceImpl.java +++ b/casic-shelter/src/main/java/com/casic/missiles/modular/system/service/impl/RobotServiceImpl.java @@ -28,7 +28,7 @@ /** * 经纬度相差0.0006,实际距离相差50米 */ - private static final double delta = 0.0006; + private static final double DELTA = 0.0006; private final AbstractDictService dictService; private final ITaskService taskService; @@ -124,7 +124,7 @@ for (int i = 0; i < robotInfos.size() - 1; i++) { RobotInfo aRobot = robotInfos.get(i); RobotInfo bRobot = robotInfos.get(i + 1); - if (Math.abs((bRobot.getLng() - aRobot.getLng())) >= delta || Math.abs((bRobot.getLat() - aRobot.getLat())) >= delta) { + if (Math.abs((bRobot.getLng() - aRobot.getLng())) >= DELTA || Math.abs((bRobot.getLat() - aRobot.getLat())) >= DELTA) { String modelType = bRobot.getModelType(); dtoList.add(new RobotInfoDTO(bRobot, getRobotType(modelType))); }