From fa950fb4dd45d336ed80e303516ae2dfaaae03a1 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 11 Jul 2023 13:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalaryItemServiceImpl.java | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index c2c89f31b..99b2730ab 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -140,27 +140,13 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService .sorted(new Comparator() { @Override public int compare(SalaryItemPO o1, SalaryItemPO o2) { - if(o1 == null) - return 1; - if(o2 == null) - return -1; - if(o1 == null && o2 == null) - return 0; if(o1.getSortedIndex() == null && o2.getSortedIndex() == null){ - Integer systemType1=o1.getSystemType(); - Integer systemType2=o2.getSystemType(); - if(systemType1 == null) - systemType1=0; - if(systemType2 == null) - systemType2=0; + Integer systemType1=o1.getSystemType() == null ? 0 : o1.getSystemType(); + Integer systemType2=o2.getSystemType() == null ? 0 : o2.getSystemType(); return systemType1.compareTo(systemType2); }else{ - Integer sortedIndex1=o1.getSortedIndex(); - Integer sortedIndex2=o2.getSortedIndex(); - if(sortedIndex1 == null) - sortedIndex1=0; - if(sortedIndex2 == null) - sortedIndex2=0; + Integer sortedIndex1=o1.getSortedIndex() == null ? 0 : o1.getSortedIndex(); + Integer sortedIndex2=o2.getSortedIndex() == null ? 0 : o2.getSortedIndex(); return sortedIndex2.compareTo(sortedIndex1); } }