From a499149593897df456c1622222fb5b249a34a9bc Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 31 May 2024 14:57:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=8E=B7=E5=8F=96=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=95=B0=E9=87=8F=E8=B6=85=E5=87=BA=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E8=AE=BE=E5=A4=87=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DcEmergencyPlansServiceImpl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 0541ced0..3952697a 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/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 {