Browse Source

export setProperties

zhuhaiwen 3 years ago
parent
commit
42f69e8b42

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/assign/service/AssignService.java

@ -414,8 +414,8 @@ public class AssignService extends BaseAssignService {
414 414
            Page<Assign> pages = repository.findAll(spec, pageReques);
415 415
            List<Assign> content = pages.getContent();
416 416
            beanList.addAll(content);
417
            setProperties(beanList);
418 417
        }
418
        setProperties(beanList);
419 419
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "分配考场"), entityList, beanList);
420 420
        workbook.createCellStyle().setLocked(true);
421 421
        ExcelDelegate.exportExcel(workbook, "分配考场-导出.xls", response);

+ 14 - 1
oa-app/src/main/java/com/css/oa/exam/common/controller/CommonController.java

@ -8,6 +8,9 @@ import io.swagger.annotations.ApiOperation;
8 8
import lombok.extern.slf4j.Slf4j;
9 9
import org.springframework.web.bind.annotation.*;
10 10
11
import java.util.ArrayList;
12
import java.util.HashMap;
13
import java.util.List;
11 14
import java.util.Map;
12 15
13 16
@Slf4j
@ -21,7 +24,17 @@ public class CommonController extends BaseController {
21 24
    public Result orderKey() {
22 25
        Result<Map> result;
23 26
        try {
24
            result = setResult("res", MyOrder.arr);
27
            List list = new ArrayList<>();
28
            for (int i = 0; i < MyOrder.keys.length; i++) {
29
                Map map = new HashMap();
30
                map.put("key", MyOrder.keys[i]);
31
                map.put("han", MyOrder.hans[i]);
32
                list.add(map);
33
            }
34
            Map map = new HashMap();
35
            map.put("total", list.size());
36
            map.put("list", list);
37
            result = setResult("res", map);
25 38
        } catch (Exception e) {
26 39
            result = setErr(e.toString());
27 40
            e.printStackTrace();

+ 5 - 4
oa-app/src/main/java/com/css/oa/exam/constants/MyOrder.java

@ -2,12 +2,13 @@ package com.css.oa.exam.constants;
2 2
3 3
public class MyOrder {
4 4
5
    public static String[] arr = {"gender", "verify_state", "pay_state"};
5
    public static String[] keys = {"unit", "department", "verify_state", "gender", "pay_state"};
6
    public static String[] hans = {"单位", "部门", "审核状态", "性别", "缴费状态"};
6 7
    //        性别: 男、女
7 8
//        审核状态 :审核通过、审核中、未审核
8 9
//        缴费状态:已经缴费、未缴费
9
    public static String gender = arr[0];
10
    public static String verify_state = arr[1];
11
    public static String pay_state = arr[2];
10
    public static String gender = keys[0];
11
    public static String verify_state = keys[1];
12
    public static String pay_state = keys[2];
12 13
13 14
}

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/enroll/bean/Condition.java

@ -22,6 +22,6 @@ public class Condition {
22 22
23 23
    public List<String> studentIds = new ArrayList<>();
24 24
25
    public String orderKey = ""; //gender verify_state pay_state
25
    public List<String> orderKeys = new ArrayList<>(); //gender verify_state pay_state
26 26
27 27
}

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

@ -307,59 +307,59 @@ public class EnrollService extends BaseVerifyService implements IEnrollService {
307 307
        }
308 308
    }
309 309
310
    private void groupBy(List<Enroll> list, String orderKey) {
310
    private void groupBy(List<Enroll> list, List<String> orderKeys) {
311 311
//        性别: 男、女
312 312
//        审核状态 :审核通过、审核中、未审核
313 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
        }
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 363
    }
364 364
365 365
    @Autowired
@ -383,7 +383,7 @@ public class EnrollService extends BaseVerifyService implements IEnrollService {
383 383
        Page<Enroll> pages = repository.findAll(spec, pageReques);
384 384
        List<Enroll> enrollList = pages.getContent();
385 385
        setProperties(enrollList);
386
        groupBy(enrollList, req.condition.orderKey);
386
        groupBy(enrollList, req.condition.orderKeys);
387 387
388 388
        Map map = new LinkedHashMap();
389 389
        map.put("total", count);
@ -525,8 +525,8 @@ public class EnrollService extends BaseVerifyService implements IEnrollService {
525 525
            Page<Enroll> pages = repository.findAll(spec, pageReques);
526 526
            List<Enroll> content = pages.getContent();
527 527
            beanList.addAll(content);
528
            setProperties(beanList);
529 528
        }
529
        setProperties(beanList);
530 530
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "报名管理"), entityList, beanList);
531 531
        workbook.createCellStyle().setLocked(true);
532 532
        ExcelDelegate.exportExcel(workbook, "报名管理-导出.xls", response);

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/monitor/service/MonitorService.java

@ -295,8 +295,8 @@ public class MonitorService extends BaseVerifyService implements IMonitorService
295 295
            Page<Monitor> pages = repository.findAll(spec, pageReques);
296 296
            List<Monitor> content = pages.getContent();
297 297
            beanList.addAll(content);
298
            setProperties(beanList);
299 298
        }
299
        setProperties(beanList);
300 300
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "督考员管理"), entityList, beanList);
301 301
        workbook.createCellStyle().setLocked(true);
302 302
        ExcelDelegate.exportExcel(workbook, "督考员管理-导出.xls", response);

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/place/service/PlaceService.java

@ -520,8 +520,8 @@ public class PlaceService extends BaseVerifyService implements IPlaceService {
520 520
            Page<Place> pages = repository.findAll(spec, pageReques);
521 521
            List<Place> content = pages.getContent();
522 522
            beanList.addAll(content);
523
            setVerifyState(beanList);
524 523
        }
524
        setVerifyState(beanList);
525 525
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "考点管理"), entityList, beanList);
526 526
        workbook.createCellStyle().setLocked(true);
527 527
        ExcelDelegate.exportExcel(workbook, "考点管理-导出.xls", response);

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/room/service/RoomService.java

@ -321,8 +321,8 @@ public class RoomService extends BaseVerifyService implements IRoomService {
321 321
            Page<Room> pages = repository.findAll(spec, pageReques);
322 322
            List<Room> content = pages.getContent();
323 323
            beanList.addAll(content);
324
            setVerifyState(beanList);
325 324
        }
325
        setVerifyState(beanList);
326 326
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "考场管理"), entityList, beanList);
327 327
        workbook.createCellStyle().setLocked(true);
328 328
        ExcelDelegate.exportExcel(workbook, "考场管理-导出.xls", response);

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/score/service/ScoreService.java

@ -421,8 +421,8 @@ public class ScoreService extends BaseVerifyService implements IScoreService {
421 421
            Page<Score> pages = repository.findAll(spec, pageReques);
422 422
            List<Score> content = pages.getContent();
423 423
            beanList.addAll(content);
424
            setProperties(beanList);
425 424
        }
425
        setProperties(beanList);
426 426
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(null, "成绩管理"), entityList, beanList);
427 427
        workbook.createCellStyle().setLocked(true);
428 428
        ExcelDelegate.exportExcel(workbook, "成绩管理-导出.xls", response);