fix(device):优化监测点线路号过滤与重复检查逻辑
This commit is contained in:
@@ -1272,6 +1272,8 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
.map(ContrastDevExcel::getPqMonitorExcelList)
|
.map(ContrastDevExcel::getPqMonitorExcelList)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.flatMap(List::stream)
|
.flatMap(List::stream)
|
||||||
|
// 过滤掉没有线路号的数据
|
||||||
|
.filter(item -> ObjectUtil.isNotNull(item.getNum()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
// 取第一条为设备基本信息
|
// 取第一条为设备基本信息
|
||||||
ContrastDevExcel devExcel = devExcelList.get(0);
|
ContrastDevExcel devExcel = devExcelList.get(0);
|
||||||
@@ -1297,7 +1299,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
// 判断是否有重复的num
|
// 判断是否有重复的num
|
||||||
Set<Integer> uniqueNumSet = new HashSet<>(numList);
|
Set<Integer> uniqueNumSet = new HashSet<>(numList);
|
||||||
if (uniqueNumSet.size() != numList.size()) {
|
if (uniqueNumSet.size() != numList.size()) {
|
||||||
throw new BusinessException(DetectionResponseEnum.MONITOR_NUM_REPEAT);
|
throw new BusinessException(DetectionResponseEnum.MONITOR_NUM_REPEAT, "【" + name + "】该被检设备下存在相同线路号的监测点!");
|
||||||
}
|
}
|
||||||
Integer max = CollectionUtil.max(numList);
|
Integer max = CollectionUtil.max(numList);
|
||||||
Integer min = CollectionUtil.min(numList);
|
Integer min = CollectionUtil.min(numList);
|
||||||
|
|||||||
Reference in New Issue
Block a user