Browse Source

解决获取设备数量超出实际存在的设备数量问题

develop
Mr.Wang 10 months ago
parent
commit
a499149593
  1. 12
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

12
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -508,9 +508,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
});
if (dcDevices.size() > 0) {
if (dcExecuteAction.getNumber() > dcDevices.size()) {
dcDevices = dcDevices.subList(0, dcDevices.size());
}else {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
}
}
}
} else if (searchRule.equals(3)) {
// 事件下游最近 没有这个类型
@ -530,8 +534,12 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
});
if (dcDevices.size() > 0) {
if (dcExecuteAction.getNumber() > dcDevices.size()) {
dcDevices = dcDevices.subList(0, dcDevices.size());
}else {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
}
}
} else {
// 下行 取最小的几个
@ -550,9 +558,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
});
// 需要对查出的设备,按照桩号进行排序从小到大
if (dcDevices.size() > 0) {
if (dcExecuteAction.getNumber() > dcDevices.size()) {
dcDevices = dcDevices.subList(0, dcDevices.size());
}else {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
}
}
}
} else {
// 最近公里数
Integer kilometers = Integer.parseInt(markArray[0].replaceAll("K", ""));

Loading…
Cancel
Save