diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 3c78cef40..95b6bf39e 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -71,7 +71,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService private SysSalaryItemBiz sysSalaryItemBiz = new SysSalaryItemBiz(); -// +// @Autowired // private LoggerTemplate salaryItemLoggerTemplate; @Override @@ -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; + if(o1.getSortedIndex() == null && o2.getSortedIndex() == null){ + 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; + }else{ + Integer sortedIndex1=o1.getSortedIndex() == null ? 0 : o1.getSortedIndex(); + Integer sortedIndex2=o2.getSortedIndex() == null ? 0 : o2.getSortedIndex(); return sortedIndex2.compareTo(sortedIndex1); } }