forked from dyf/fys-Multi-tenant
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88650c3d9f |
@ -133,7 +133,7 @@ public class AppDeviceXinghanController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Log("新增设备")
|
// @Log("新增设备")
|
||||||
@Log(title = "新增设备")
|
@Operation(summary = "新增设备")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public R<Void> addDevice(@RequestBody DeviceForm deviceForm) {
|
public R<Void> addDevice(@RequestBody DeviceForm deviceForm) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -67,7 +67,6 @@ public class BjqActiveReportingDeviceDataRule implements MqttMessageRule {
|
|||||||
*/
|
*/
|
||||||
public void asyncSendDeviceDataToRedisWithFuture(String deviceImei, String mainLightMode, String laserLightMode,
|
public void asyncSendDeviceDataToRedisWithFuture(String deviceImei, String mainLightMode, String laserLightMode,
|
||||||
String batteryPercentage, String chargeState, String batteryRemainingTime) {
|
String batteryPercentage, String chargeState, String batteryRemainingTime) {
|
||||||
CompletableFuture.runAsync(() -> {
|
|
||||||
try {
|
try {
|
||||||
// 构造设备状态信息对象
|
// 构造设备状态信息对象
|
||||||
Map<String, Object> deviceInfo = new LinkedHashMap<>();
|
Map<String, Object> deviceInfo = new LinkedHashMap<>();
|
||||||
@ -91,7 +90,6 @@ public class BjqActiveReportingDeviceDataRule implements MqttMessageRule {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("异步发送设备信息到Redis时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
log.error("异步发送设备信息到Redis时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -121,7 +121,6 @@ public class BjqLocationDataRule implements MqttMessageRule {
|
|||||||
* @param longitude 经度
|
* @param longitude 经度
|
||||||
*/
|
*/
|
||||||
public void asyncSendLocationToRedisWithFuture(String deviceImei, String latitude, String longitude) {
|
public void asyncSendLocationToRedisWithFuture(String deviceImei, String latitude, String longitude) {
|
||||||
CompletableFuture.runAsync(() -> {
|
|
||||||
try {
|
try {
|
||||||
if (StringUtils.isBlank(latitude) || StringUtils.isBlank(longitude)) {
|
if (StringUtils.isBlank(latitude) || StringUtils.isBlank(longitude)) {
|
||||||
return;
|
return;
|
||||||
@ -177,7 +176,6 @@ public class BjqLocationDataRule implements MqttMessageRule {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("异步发送位置信息到Redis时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
log.error("异步发送位置信息到Redis时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,7 +187,6 @@ public class BjqLocationDataRule implements MqttMessageRule {
|
|||||||
* @param longitude 经度
|
* @param longitude 经度
|
||||||
*/
|
*/
|
||||||
public void asyncSaveLocationToMySQLWithFuture(String deviceImei, String latitude, String longitude) {
|
public void asyncSaveLocationToMySQLWithFuture(String deviceImei, String latitude, String longitude) {
|
||||||
CompletableFuture.runAsync(() -> {
|
|
||||||
try {
|
try {
|
||||||
if (StringUtils.isBlank(latitude) || StringUtils.isBlank(longitude)) {
|
if (StringUtils.isBlank(latitude) || StringUtils.isBlank(longitude)) {
|
||||||
return;
|
return;
|
||||||
@ -202,7 +199,6 @@ public class BjqLocationDataRule implements MqttMessageRule {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("异步保存位置信息到MySQL时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
log.error("异步保存位置信息到MySQL时出错: device={}, error={}", deviceImei, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user