1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.pdp.businessobject.options;
17
18 import java.util.Comparator;
19
20 import org.kuali.ole.pdp.businessobject.DailyReport;
21 import org.kuali.ole.pdp.service.PaymentGroupService;
22 import org.kuali.ole.sys.context.SpringContext;
23
24 public class DailyReportComparator implements Comparator<DailyReport> {
25
26 public int compare(DailyReport o1, DailyReport o2) {
27 PaymentGroupService paymentGroupService = SpringContext.getBean(PaymentGroupService.class);
28 String key1 = paymentGroupService.getSortGroupId(o1.getPaymentGroup()) + o1.getCustomer();
29 String key2 = paymentGroupService.getSortGroupId(o2.getPaymentGroup()) + o2.getCustomer();
30
31 return key1.compareTo(key2);
32 }
33
34 }