经纬度bug修复
This commit is contained in:
@ -40,37 +40,5 @@ public class LightingCommandTypeConstants {
|
|||||||
* 主动上报设备数据 (Active Reporting Device Data)
|
* 主动上报设备数据 (Active Reporting Device Data)
|
||||||
*/
|
*/
|
||||||
public static final String ACTIVE_REPORTING_DEVICE_DATA = "Light_12";
|
public static final String ACTIVE_REPORTING_DEVICE_DATA = "Light_12";
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取命令类型描述
|
|
||||||
*
|
|
||||||
* @param commandType 命令类型
|
|
||||||
* @return 命令类型描述
|
|
||||||
*/
|
|
||||||
public static String getCommandTypeDescription(String commandType) {
|
|
||||||
return switch (commandType) {
|
|
||||||
case LIGHT_MODE -> "灯光模式 (Light Mode)";
|
|
||||||
case PERSONNEL_INFO -> "人员信息 (Personnel Information)";
|
|
||||||
case BOOT_LOGO -> "开机LOGO (Boot Logo)";
|
|
||||||
case LASER_LIGHT -> "激光灯 (Laser Light)";
|
|
||||||
case MAIN_LIGHT_BRIGHTNESS -> "主灯亮度 (Main Light Brightness)";
|
|
||||||
case LOCATION_DATA -> "定位数据 (Location Data)";
|
|
||||||
default -> "未知命令类型 (Unknown Command Type)";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查是否为有效命令类型
|
|
||||||
*
|
|
||||||
* @param commandType 命令类型
|
|
||||||
* @return 是否有效
|
|
||||||
*/
|
|
||||||
public static boolean isValidCommandType(String commandType) {
|
|
||||||
return commandType.equals(LIGHT_MODE) ||
|
|
||||||
commandType.equals(PERSONNEL_INFO) ||
|
|
||||||
commandType.equals(BOOT_LOGO) ||
|
|
||||||
commandType.equals(LASER_LIGHT) ||
|
|
||||||
commandType.equals(MAIN_LIGHT_BRIGHTNESS) ||
|
|
||||||
commandType.equals(LOCATION_DATA);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ public class LocationDataRule implements MqttMessageRule {
|
|||||||
public void asyncSendLocationToRedisWithFuture(String deviceImei, String latitude, String longitude) {
|
public void asyncSendLocationToRedisWithFuture(String deviceImei, String latitude, String longitude) {
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
if(StringUtils.isNotBlank(latitude) || StringUtils.isNotBlank(longitude)){
|
if(StringUtils.isBlank(latitude) || StringUtils.isBlank(longitude)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 构造位置信息对象
|
// 构造位置信息对象
|
||||||
|
Reference in New Issue
Block a user