Parcourir la Source

groupBy重写

zhuhaiwen 3 ans auparavant
Parent
commit
46be085d39

+ 65 - 0
oa-app/src/main/java/com/css/oa/exam/enroll/service/EnrollGroup.java

@ -0,0 +1,65 @@
1
package com.css.oa.exam.enroll.service;
2
3
import com.css.oa.exam.enroll.repository.Enroll;
4
5
import java.util.List;
6
7
public class EnrollGroup {
8
9
    public void groupBy(List<Enroll> enrolls, List<String> orderKeys) {
10
        System.out.println("代理类做的事...");
11
12
//        性别: 男、女
13
//        审核状态 :审核通过、审核中、未审核
14
//        缴费状态:已经缴费、未缴费
15
//        if (orderKey.equalsIgnoreCase(MyOrder.gender)) {
16
//            LinkedList<Enroll> man = new LinkedList();
17
//            LinkedList<Enroll> women = new LinkedList();
18
//            for (Enroll enroll : list) {
19
//                if(enroll.getGender() == 1){
20
//                    man.add(enroll);
21
//                }else {
22
//                    women.add(enroll);
23
//                }
24
//            }
25
//            list.clear();
26
//            list.addAll(man);
27
//            list.addAll(women);
28
//        } else if (orderKey.equalsIgnoreCase(MyOrder.verify_state)) {
29
//            LinkedList<Enroll> ed = new LinkedList();
30
//            LinkedList<Enroll> ing = new LinkedList();
31
//            LinkedList<Enroll> no = new LinkedList();
32
//            LinkedList<Enroll> reject = new LinkedList();
33
//            for (Enroll enroll : list) {
34
//                if(enroll.getVerify_state().equalsIgnoreCase(VerifyState.LEVEL1_GREE)){
35
//                    ed.add(enroll);
36
//                }else if(enroll.getVerify_state().equalsIgnoreCase(VerifyState.WAIT_COMMITE)){
37
//                    no.add(enroll);
38
//                }else if(enroll.getVerify_state().equalsIgnoreCase(VerifyState.REJECT)){
39
//                    reject.add(enroll);
40
//                }else {
41
//                    //待xx单位审核
42
//                    ing.add(enroll);
43
//                }
44
//            }
45
//            list.clear();
46
//            list.addAll(ed);
47
//            list.addAll(ing);
48
//            list.addAll(no);
49
//            list.addAll(reject);
50
//        } else if (orderKey.equalsIgnoreCase(MyOrder.pay_state)) {
51
//            LinkedList<Enroll> yes = new LinkedList();
52
//            LinkedList<Enroll> no = new LinkedList();
53
//            for (Enroll enroll : list) {
54
//                if(enroll.getPay_state() == 1){
55
//                    yes.add(enroll);
56
//                }else {
57
//                    no.add(enroll);
58
//                }
59
//            }
60
//            list.clear();
61
//            list.addAll(yes);
62
//            list.addAll(no);
63
//        }
64
    }
65
}

+ 1 - 56
oa-app/src/main/java/com/css/oa/exam/enroll/service/EnrollService.java

@ -307,61 +307,6 @@ public class EnrollService extends BaseVerifyService implements IEnrollService {
307 307
        }
308 308
    }
309 309
310
    private void groupBy(List<Enroll> list, List<String> orderKeys) {
311
//        性别: 男、女
312
//        审核状态 :审核通过、审核中、未审核
313
//        缴费状态:已经缴费、未缴费
314
//        if (orderKey.equalsIgnoreCase(MyOrder.gender)) {
315
//            LinkedList<Enroll> man = new LinkedList();
316
//            LinkedList<Enroll> women = new LinkedList();
317
//            for (Enroll enroll : list) {
318
//                if(enroll.getGender() == 1){
319
//                    man.add(enroll);
320
//                }else {
321
//                    women.add(enroll);
322
//                }
323
//            }
324
//            list.clear();
325
//            list.addAll(man);
326
//            list.addAll(women);
327
//        } else if (orderKey.equalsIgnoreCase(MyOrder.verify_state)) {
328
//            LinkedList<Enroll> ed = new LinkedList();
329
//            LinkedList<Enroll> ing = new LinkedList();
330
//            LinkedList<Enroll> no = new LinkedList();
331
//            LinkedList<Enroll> reject = new LinkedList();
332
//            for (Enroll enroll : list) {
333
//                if(enroll.getVerify_state().equalsIgnoreCase(VerifyState.LEVEL1_GREE)){
334
//                    ed.add(enroll);
335
//                }else if(enroll.getVerify_state().equalsIgnoreCase(VerifyState.WAIT_COMMITE)){
336
//                    no.add(enroll);
337
//                }else if(enroll.getVerify_state().equalsIgnoreCase(VerifyState.REJECT)){
338
//                    reject.add(enroll);
339
//                }else {
340
//                    //待xx单位审核
341
//                    ing.add(enroll);
342
//                }
343
//            }
344
//            list.clear();
345
//            list.addAll(ed);
346
//            list.addAll(ing);
347
//            list.addAll(no);
348
//            list.addAll(reject);
349
//        } else if (orderKey.equalsIgnoreCase(MyOrder.pay_state)) {
350
//            LinkedList<Enroll> yes = new LinkedList();
351
//            LinkedList<Enroll> no = new LinkedList();
352
//            for (Enroll enroll : list) {
353
//                if(enroll.getPay_state() == 1){
354
//                    yes.add(enroll);
355
//                }else {
356
//                    no.add(enroll);
357
//                }
358
//            }
359
//            list.clear();
360
//            list.addAll(yes);
361
//            list.addAll(no);
362
//        }
363
    }
364
365 310
    @Autowired
366 311
    IPlaceRepository placeRepository;
367 312
@ -383,7 +328,7 @@ public class EnrollService extends BaseVerifyService implements IEnrollService {
383 328
        Page<Enroll> pages = repository.findAll(spec, pageReques);
384 329
        List<Enroll> enrollList = pages.getContent();
385 330
        setProperties(enrollList);
386
        groupBy(enrollList, req.condition.orderKeys);
331
        new EnrollGroup().groupBy(enrollList, req.condition.orderKeys);
387 332
388 333
        Map map = new LinkedHashMap();
389 334
        map.put("total", count);