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); } }