修改消防数据查询报错问题
This commit is contained in:
@ -630,6 +630,7 @@ public class DeviceDataProcessServiceImpl extends AbstractBatteryDataProcessor i
|
||||
return;
|
||||
}
|
||||
Map<String, String> pointMatchMap = pointMatchList.stream()
|
||||
.filter(data -> StringUtils.isNotEmpty(data.getDataPoint()))
|
||||
.collect(Collectors.toMap(
|
||||
data -> StringUtils.toCamelCase(data.getMatchField()), // 源字段名转为驼峰
|
||||
EmsPointMatch::getDataPoint, // 获取目标点位名
|
||||
|
||||
@ -12,7 +12,6 @@ import com.xzzn.common.core.redis.RedisCache;
|
||||
import com.xzzn.common.enums.DeviceCategory;
|
||||
import com.xzzn.common.enums.DeviceType;
|
||||
import com.xzzn.common.enums.PointType;
|
||||
import com.xzzn.common.enums.SiteEnum;
|
||||
import com.xzzn.common.enums.WorkStatus;
|
||||
import com.xzzn.common.exception.ServiceException;
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
@ -37,6 +36,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -285,10 +285,20 @@ public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService
|
||||
if (v1 == v2) return 0;
|
||||
if (v1 == null) return 1;
|
||||
if (v2 == null) return -1;
|
||||
|
||||
// 获取实际比较对象
|
||||
PointQueryResponse p1 = findByValue(resultResponse, v1);
|
||||
PointQueryResponse p2 = findByValue(resultResponse, v2);
|
||||
|
||||
// 确保比较对象不为null
|
||||
if (p1 == null && p2 == null) return 0;
|
||||
if (p1 == null) return 1;
|
||||
if (p2 == null) return -1;
|
||||
|
||||
// 非null值使用基础比较器逻辑
|
||||
return isAsc ?
|
||||
comparator.compare(findByValue(resultResponse, v1), findByValue(resultResponse, v2)) :
|
||||
comparator.reversed().compare(findByValue(resultResponse, v1), findByValue(resultResponse, v2));
|
||||
comparator.compare(p1, p2) :
|
||||
comparator.reversed().compare(p1, p2);
|
||||
}
|
||||
);
|
||||
return resultResponse.stream()
|
||||
@ -370,7 +380,7 @@ public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService
|
||||
return list.stream()
|
||||
.filter(p -> {
|
||||
Object val = p.getPointValue();
|
||||
return val == value || (val != null && val.equals(value));
|
||||
return Objects.equals(val, value);
|
||||
})
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
@ -887,7 +887,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
xfDataVo.setEmsCommunicationStatus(xfDevice.get("communicationStatus") == null ? "" : xfDevice.get("communicationStatus").toString());
|
||||
|
||||
// 处理枚举匹配字段
|
||||
devicePointMatchDataProcessor.convertFieldValueToEnumMatch(siteId, DeviceCategory.XF.getCode(), xfData);
|
||||
devicePointMatchDataProcessor.convertFieldValueToEnumMatch(siteId, DeviceCategory.XF.getCode(), xfDataVo);
|
||||
|
||||
emsXfDataList.add(xfDataVo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user