Browse Source

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

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

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

@ -508,7 +508,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
});
if (dcDevices.size() > 0) {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
if (dcExecuteAction.getNumber() > dcDevices.size()) {
dcDevices = dcDevices.subList(0, dcDevices.size());
}else {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
}
}
}
@ -530,7 +534,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
});
if (dcDevices.size() > 0) {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
if (dcExecuteAction.getNumber() > dcDevices.size()) {
dcDevices = dcDevices.subList(0, dcDevices.size());
}else {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
}
}
} else {
@ -550,7 +558,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
});
// 需要对查出的设备,按照桩号进行排序从小到大
if (dcDevices.size() > 0) {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
if (dcExecuteAction.getNumber() > dcDevices.size()) {
dcDevices = dcDevices.subList(0, dcDevices.size());
}else {
dcDevices = dcDevices.subList(0, dcExecuteAction.getNumber());
}
}
}
} else {

Loading…
Cancel
Save