Compare commits
2 Commits
397f227bfb
...
9058dcfcb1
| Author | SHA1 | Date | |
|---|---|---|---|
| 9058dcfcb1 | |||
| 3e19cd9db2 |
@ -38,7 +38,6 @@ import static com.fuyuanshen.global.mqtt.constants.DeviceRedisKeyConstants.*;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class BjqAlarmRule implements MqttMessageRule {
|
public class BjqAlarmRule implements MqttMessageRule {
|
||||||
|
|
||||||
|
|
||||||
private final IDeviceAlarmService deviceAlarmService;
|
private final IDeviceAlarmService deviceAlarmService;
|
||||||
private final DeviceService deviceService;
|
private final DeviceService deviceService;
|
||||||
|
|
||||||
@ -89,6 +88,8 @@ public class BjqAlarmRule implements MqttMessageRule {
|
|||||||
deviceAlarmBo.setFinishTime(new Date());
|
deviceAlarmBo.setFinishTime(new Date());
|
||||||
String durationBetween = DurationUtils.getDurationBetween(deviceAlarmVo.getStartTime(), deviceAlarmBo.getFinishTime());
|
String durationBetween = DurationUtils.getDurationBetween(deviceAlarmVo.getStartTime(), deviceAlarmBo.getFinishTime());
|
||||||
deviceAlarmBo.setDurationTime(durationBetween);
|
deviceAlarmBo.setDurationTime(durationBetween);
|
||||||
|
// 0已处理,1未处理
|
||||||
|
deviceAlarmBo.setTreatmentState(0);
|
||||||
deviceAlarmService.updateByBo(deviceAlarmBo);
|
deviceAlarmService.updateByBo(deviceAlarmBo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,12 +68,12 @@ public class DeviceAlarm extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 经度
|
* 经度
|
||||||
*/
|
*/
|
||||||
private Long longitude;
|
private Double longitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 纬度
|
* 纬度
|
||||||
*/
|
*/
|
||||||
private Long latitude;
|
private Double latitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报警位置
|
* 报警位置
|
||||||
@ -99,7 +99,7 @@ public class DeviceAlarm extends TenantEntity {
|
|||||||
* 0已处理,1未处理
|
* 0已处理,1未处理
|
||||||
* treatment_state
|
* treatment_state
|
||||||
*/
|
*/
|
||||||
private Long treatmentState;
|
private Integer treatmentState;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -267,9 +267,13 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
|
|
||||||
// 处理上传的图片
|
// 处理上传的图片
|
||||||
if (deviceForm.getFile() != null) {
|
if (deviceForm.getFile() != null) {
|
||||||
SysOssVo upload = ossService.upload(deviceForm.getFile());
|
|
||||||
// 设置图片路径
|
// 设置图片路径
|
||||||
deviceForm.setDevicePic(upload.getUrl());
|
SysOssVo oss = ossService.upload(deviceForm.getFile());
|
||||||
|
// 强制将HTTP替换为HTTPS
|
||||||
|
if (oss.getUrl() != null && oss.getUrl().startsWith("http://")) {
|
||||||
|
oss.setUrl(oss.getUrl().replaceFirst("^http://", "https://"));
|
||||||
|
}
|
||||||
|
deviceForm.setDevicePic(oss.getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新字段
|
// 更新字段
|
||||||
@ -665,7 +669,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
|||||||
* 获取设备使用数据
|
* 获取设备使用数据
|
||||||
*
|
*
|
||||||
* @param deviceTypeId 设备ID
|
* @param deviceTypeId 设备ID
|
||||||
* @param range 时间范围 1:半年 2:一年
|
* @param range 时间范围 1:半年 2:一年
|
||||||
* @return 每月使用数据列表
|
* @return 每月使用数据列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -351,13 +351,13 @@
|
|||||||
|
|
||||||
<!-- 获取告警信息 -->
|
<!-- 获取告警信息 -->
|
||||||
<select id="getAlarmInformation" resultType="com.fuyuanshen.equipment.domain.vo.AlarmInformationVo">
|
<select id="getAlarmInformation" resultType="com.fuyuanshen.equipment.domain.vo.AlarmInformationVo">
|
||||||
SELECT (SELECT COUNT(1) FROM device_alarm WHERE treatment_state = 0) AS alarmsTotal
|
SELECT (SELECT COUNT(1) FROM device_alarm) AS alarmsTotal
|
||||||
, (SELECT COUNT(1)
|
, (SELECT COUNT(1)
|
||||||
FROM device_alarm
|
FROM device_alarm
|
||||||
WHERE treatment_state = 0) AS processingAlarm
|
WHERE treatment_state = 0) AS processingAlarm
|
||||||
, (SELECT COUNT(1)
|
, (SELECT COUNT(1)
|
||||||
FROM device_alarm
|
FROM device_alarm
|
||||||
WHERE treatment_state = 0 AND
|
WHERE
|
||||||
DATE (create_time) = CURDATE()) AS alarmsTotalToday
|
DATE (create_time) = CURDATE()) AS alarmsTotalToday
|
||||||
, (
|
, (
|
||||||
SELECT COUNT (1)
|
SELECT COUNT (1)
|
||||||
@ -425,7 +425,9 @@
|
|||||||
|
|
||||||
<!-- 根据设备IMEI查询设备 -->
|
<!-- 根据设备IMEI查询设备 -->
|
||||||
<select id="selectDeviceByImei" resultType="com.fuyuanshen.equipment.domain.Device">
|
<select id="selectDeviceByImei" resultType="com.fuyuanshen.equipment.domain.Device">
|
||||||
SELECT * FROM device WHERE device_imei = #{deviceImei}
|
SELECT *
|
||||||
|
FROM device
|
||||||
|
WHERE device_imei = #{deviceImei}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user