|
|
@@ -214,10 +214,11 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
214
|
214
|
}
|
|
215
|
215
|
|
|
216
|
216
|
// 查询条件处理
|
|
|
217
|
+ Long brigadeId = dto.getBrigadeId();
|
|
217
|
218
|
Long departmentId = dto.getDepartmentId();
|
|
218
|
219
|
Long teamId = dto.getTeamId();
|
|
219
|
220
|
Long userId = dto.getUserId();
|
|
220
|
|
- if (ObjUtil.isNull(departmentId) && ObjUtil.isNull(teamId) && ObjUtil.isNull(userId)) {
|
|
|
221
|
+ if (ObjUtil.isNull(brigadeId) && ObjUtil.isNull(departmentId) && ObjUtil.isNull(teamId) && ObjUtil.isNull(userId)) {
|
|
221
|
222
|
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
|
222
|
223
|
if (CollUtil.isEmpty(roles)) {
|
|
223
|
224
|
return Collections.emptyList();
|
|
|
@@ -227,6 +228,9 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
227
|
228
|
|
|
228
|
229
|
} else if (roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
|
|
229
|
230
|
|
|
|
231
|
+ } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
|
|
|
232
|
+ brigadeId = SecurityUtils.getLoginUser().getDeptId();
|
|
|
233
|
+ dto.setBrigadeId(brigadeId);
|
|
230
|
234
|
} else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
|
|
231
|
235
|
departmentId = SecurityUtils.getLoginUser().getDeptId();
|
|
232
|
236
|
dto.setDepartmentId(departmentId);
|
|
|
@@ -246,6 +250,8 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
246
|
250
|
dto.setTeamId(teamId);
|
|
247
|
251
|
} else if (ObjUtil.isNotNull(departmentId)) {
|
|
248
|
252
|
dto.setDepartmentId(departmentId);
|
|
|
253
|
+ } else if (ObjUtil.isNotNull(brigadeId)) {
|
|
|
254
|
+ dto.setBrigadeId(brigadeId);
|
|
249
|
255
|
} else {
|
|
250
|
256
|
return Collections.emptyList();
|
|
251
|
257
|
}
|
|
|
@@ -260,6 +266,11 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
260
|
266
|
if (roleKeyList.contains(RoleTypeEnum.admin.getCode()) || roleKeyList.contains(RoleTypeEnum.test.getCode()) || roleKeyList.contains(RoleTypeEnum.zhijianke.getCode())) {
|
|
261
|
267
|
userId = null;
|
|
262
|
268
|
dto.setUserId(userId);
|
|
|
269
|
+ } else if (roleKeyList.contains(RoleTypeEnum.jingli.getCode()) || roleKeyList.contains(RoleTypeEnum.xingzheng.getCode())) {
|
|
|
270
|
+ userId = null;
|
|
|
271
|
+ dto.setUserId(userId);
|
|
|
272
|
+ brigadeId = sysUser.getDeptId();
|
|
|
273
|
+ dto.setBrigadeId(brigadeId);
|
|
263
|
274
|
} else if (roleKeyList.contains(RoleTypeEnum.kezhang.getCode())) {
|
|
264
|
275
|
userId = null;
|
|
265
|
276
|
dto.setUserId(userId);
|
|
|
@@ -305,7 +316,8 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
305
|
316
|
List<SysDept> deptList = sysDeptService.selectAllDept(sysUser.getDeptId());
|
|
306
|
317
|
if (CollUtil.isNotEmpty(deptList)) {
|
|
307
|
318
|
SysDept team = deptList.stream().filter(item -> StrUtil.equals(DeptType.TEAMS.getCode(), item.getDeptType())).findFirst().orElse(null);
|
|
308
|
|
- SysDept department = deptList.stream().filter(item -> StrUtil.equals(DeptType.DEPARTMENT.getCode(), item.getDeptType())).findFirst().orElse(null);
|
|
|
319
|
+ SysDept department = deptList.stream().filter(item -> StrUtil.equals(DeptType.MANAGER.getCode(), item.getDeptType())).findFirst().orElse(null);
|
|
|
320
|
+ SysDept brigade = deptList.stream().filter(item -> StrUtil.equals(DeptType.BRIGADE.getCode(), item.getDeptType())).findFirst().orElse(null);
|
|
309
|
321
|
SysDept station = deptList.stream().filter(item -> StrUtil.equals(DeptType.STATION.getCode(), item.getDeptType())).findFirst().orElse(null);
|
|
310
|
322
|
// 本班排名处理
|
|
311
|
323
|
if (ObjUtil.isNotNull(team)) {
|
|
|
@@ -399,6 +411,52 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
399
|
411
|
resultItem.setDepartmentRanking(integer);
|
|
400
|
412
|
}
|
|
401
|
413
|
}
|
|
|
414
|
+ // 本大队排名处理
|
|
|
415
|
+ if (ObjUtil.isNotNull(brigade)) {
|
|
|
416
|
+ List<SysLargeScreenLearningGrowthSqlDto> brigadeList = all.stream().filter(item -> ObjUtil.equals(item.getDdDeptId(), brigade.getDeptId())).collect(Collectors.toList());
|
|
|
417
|
+ if (CollUtil.isNotEmpty(brigadeList)) {
|
|
|
418
|
+ Map<Long, BigDecimal> avgMap = brigadeList.stream()
|
|
|
419
|
+ .filter(item -> item.getExamScore() != null)
|
|
|
420
|
+ .collect(Collectors.groupingBy(
|
|
|
421
|
+ SysLargeScreenLearningGrowthSqlDto::getUserId,
|
|
|
422
|
+ Collectors.collectingAndThen(
|
|
|
423
|
+ Collectors.averagingDouble(record -> record.getExamScore().doubleValue()),
|
|
|
424
|
+ avg -> BigDecimal.valueOf(avg).setScale(2, RoundingMode.HALF_UP)
|
|
|
425
|
+ )
|
|
|
426
|
+ ));
|
|
|
427
|
+ long count = avgMap.keySet().stream().count();
|
|
|
428
|
+ resultItem.setBrigadeTotal((int) count);
|
|
|
429
|
+ // 1. 按值升序排序
|
|
|
430
|
+ List<Map.Entry<Long, BigDecimal>> sortedEntries = avgMap.entrySet()
|
|
|
431
|
+ .stream()
|
|
|
432
|
+ .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
|
|
|
433
|
+ .collect(Collectors.toList());
|
|
|
434
|
+ // 2. 计算排名(考虑并列情况)
|
|
|
435
|
+ Map<Long, Integer> rankMap = new HashMap<>();
|
|
|
436
|
+ int currentRank = 1;
|
|
|
437
|
+ BigDecimal prevValue = null;
|
|
|
438
|
+ int sameValueCount = 1; // 记录相同值的用户数
|
|
|
439
|
+ for (int i = 0; i < sortedEntries.size(); i++) {
|
|
|
440
|
+ Map.Entry<Long, BigDecimal> entry = sortedEntries.get(i);
|
|
|
441
|
+ BigDecimal currentValue = entry.getValue();
|
|
|
442
|
+ if (prevValue != null && !currentValue.equals(prevValue)) {
|
|
|
443
|
+ // 如果当前值与前一个值不同,更新排名
|
|
|
444
|
+ currentRank += sameValueCount;
|
|
|
445
|
+ sameValueCount = 1;
|
|
|
446
|
+ } else if (prevValue != null) {
|
|
|
447
|
+ // 如果当前值与前一个值相同,排名不变,但增加相同值的计数
|
|
|
448
|
+ sameValueCount++;
|
|
|
449
|
+ }
|
|
|
450
|
+ // 存储用户ID和排名
|
|
|
451
|
+ rankMap.put(entry.getKey(), currentRank);
|
|
|
452
|
+ prevValue = currentValue;
|
|
|
453
|
+ }
|
|
|
454
|
+ // 3. 查询指定排名
|
|
|
455
|
+ Long targetId = userId;
|
|
|
456
|
+ Integer integer = rankMap.get(targetId);
|
|
|
457
|
+ resultItem.setBrigadeRanking(integer);
|
|
|
458
|
+ }
|
|
|
459
|
+ }
|
|
402
|
460
|
// 本站排名处理
|
|
403
|
461
|
if (ObjUtil.isNotNull(station)) {
|
|
404
|
462
|
List<SysLargeScreenLearningGrowthSqlDto> stationList = all.stream().filter(item -> ObjUtil.equals(item.getZjDeptId(), station.getDeptId())).collect(Collectors.toList());
|
|
|
@@ -524,7 +582,52 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
524
|
582
|
Integer integer = rankMapTeam.get(targetId);
|
|
525
|
583
|
resultItem.setDepartmentRanking(integer);
|
|
526
|
584
|
}
|
|
527
|
|
-
|
|
|
585
|
+ // 本大队排名处理
|
|
|
586
|
+ SysDept sysDeptKs = sysDeptService.selectDeptById(ksId);
|
|
|
587
|
+ Long ddId = sysDeptKs.getParentId();
|
|
|
588
|
+ List<SysLargeScreenLearningGrowthSqlDto> brigadeList = all.stream().filter(item -> ObjUtil.equals(item.getDdDeptId(), ddId)).collect(Collectors.toList());
|
|
|
589
|
+ if (CollUtil.isNotEmpty(brigadeList)) {
|
|
|
590
|
+ Map<Long, BigDecimal> avgMap = brigadeList.stream()
|
|
|
591
|
+ .filter(item -> item.getExamScore() != null)
|
|
|
592
|
+ .collect(Collectors.groupingBy(
|
|
|
593
|
+ SysLargeScreenLearningGrowthSqlDto::getBzDeptId,
|
|
|
594
|
+ Collectors.collectingAndThen(
|
|
|
595
|
+ Collectors.averagingDouble(record -> record.getExamScore().doubleValue()),
|
|
|
596
|
+ avg -> BigDecimal.valueOf(avg).setScale(2, RoundingMode.HALF_UP)
|
|
|
597
|
+ )
|
|
|
598
|
+ ));
|
|
|
599
|
+ long count = avgMap.keySet().stream().count();
|
|
|
600
|
+ resultItem.setBrigadeTotal((int) count);
|
|
|
601
|
+ // 1. 按值升序排序
|
|
|
602
|
+ List<Map.Entry<Long, BigDecimal>> sortedEntriesTeam = avgMap.entrySet()
|
|
|
603
|
+ .stream()
|
|
|
604
|
+ .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
|
|
|
605
|
+ .collect(Collectors.toList());
|
|
|
606
|
+ // 2. 计算排名(考虑并列情况)
|
|
|
607
|
+ Map<Long, Integer> rankMapTeam = new HashMap<>();
|
|
|
608
|
+ int currentRank = 1;
|
|
|
609
|
+ BigDecimal prevValueTeam = null;
|
|
|
610
|
+ int sameValueCount = 1; // 记录相同值的用户数
|
|
|
611
|
+ for (int i = 0; i < sortedEntriesTeam.size(); i++) {
|
|
|
612
|
+ Map.Entry<Long, BigDecimal> entry = sortedEntriesTeam.get(i);
|
|
|
613
|
+ BigDecimal currentValue = entry.getValue();
|
|
|
614
|
+ if (prevValueTeam != null && !currentValue.equals(prevValueTeam)) {
|
|
|
615
|
+ // 如果当前值与前一个值不同,更新排名
|
|
|
616
|
+ currentRank += sameValueCount;
|
|
|
617
|
+ sameValueCount = 1;
|
|
|
618
|
+ } else if (prevValueTeam != null) {
|
|
|
619
|
+ // 如果当前值与前一个值相同,排名不变,但增加相同值的计数
|
|
|
620
|
+ sameValueCount++;
|
|
|
621
|
+ }
|
|
|
622
|
+ // 存储用户ID和排名
|
|
|
623
|
+ rankMapTeam.put(entry.getKey(), currentRank);
|
|
|
624
|
+ prevValueTeam = currentValue;
|
|
|
625
|
+ }
|
|
|
626
|
+ // 3. 查询指定排名
|
|
|
627
|
+ Long targetId = teamId;
|
|
|
628
|
+ Integer integer = rankMapTeam.get(targetId);
|
|
|
629
|
+ resultItem.setBrigadeRanking(integer);
|
|
|
630
|
+ }
|
|
528
|
631
|
// 本站排名处理
|
|
529
|
632
|
SysDept sysDeptDepartment = sysDeptService.selectDeptById(ksId);
|
|
530
|
633
|
Long stationId = sysDeptDepartment.getParentId();
|
|
|
@@ -602,10 +705,56 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
602
|
705
|
.reduce(BigDecimal::add)
|
|
603
|
706
|
.map(sum -> sum.divide(BigDecimal.valueOf(target.size()), 2, RoundingMode.HALF_UP))
|
|
604
|
707
|
.orElse(BigDecimal.ZERO));
|
|
605
|
|
-
|
|
|
708
|
+ // 本大队排名处理
|
|
|
709
|
+ SysDept sysDeptKs = sysDeptService.selectDeptById(departmentId);
|
|
|
710
|
+ Long ddId = sysDeptKs.getParentId();
|
|
|
711
|
+ List<SysLargeScreenLearningGrowthSqlDto> brigadeList = all.stream().filter(item -> ObjUtil.equals(item.getDdDeptId(), ddId)).collect(Collectors.toList());
|
|
|
712
|
+ if (CollUtil.isNotEmpty(brigadeList)) {
|
|
|
713
|
+ Map<Long, BigDecimal> avgMap = brigadeList.stream()
|
|
|
714
|
+ .filter(item -> item.getExamScore() != null)
|
|
|
715
|
+ .collect(Collectors.groupingBy(
|
|
|
716
|
+ SysLargeScreenLearningGrowthSqlDto::getKsDeptId,
|
|
|
717
|
+ Collectors.collectingAndThen(
|
|
|
718
|
+ Collectors.averagingDouble(record -> record.getExamScore().doubleValue()),
|
|
|
719
|
+ avg -> BigDecimal.valueOf(avg).setScale(2, RoundingMode.HALF_UP)
|
|
|
720
|
+ )
|
|
|
721
|
+ ));
|
|
|
722
|
+ long count = avgMap.keySet().stream().count();
|
|
|
723
|
+ resultItem.setBrigadeTotal((int) count);
|
|
|
724
|
+ // 1. 按值升序排序
|
|
|
725
|
+ List<Map.Entry<Long, BigDecimal>> sortedEntriesTeam = avgMap.entrySet()
|
|
|
726
|
+ .stream()
|
|
|
727
|
+ .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
|
|
|
728
|
+ .collect(Collectors.toList());
|
|
|
729
|
+ // 2. 计算排名(考虑并列情况)
|
|
|
730
|
+ Map<Long, Integer> rankMapTeam = new HashMap<>();
|
|
|
731
|
+ int currentRank = 1;
|
|
|
732
|
+ BigDecimal prevValueTeam = null;
|
|
|
733
|
+ int sameValueCount = 1; // 记录相同值的用户数
|
|
|
734
|
+ for (int i = 0; i < sortedEntriesTeam.size(); i++) {
|
|
|
735
|
+ Map.Entry<Long, BigDecimal> entry = sortedEntriesTeam.get(i);
|
|
|
736
|
+ BigDecimal currentValue = entry.getValue();
|
|
|
737
|
+ if (prevValueTeam != null && !currentValue.equals(prevValueTeam)) {
|
|
|
738
|
+ // 如果当前值与前一个值不同,更新排名
|
|
|
739
|
+ currentRank += sameValueCount;
|
|
|
740
|
+ sameValueCount = 1;
|
|
|
741
|
+ } else if (prevValueTeam != null) {
|
|
|
742
|
+ // 如果当前值与前一个值相同,排名不变,但增加相同值的计数
|
|
|
743
|
+ sameValueCount++;
|
|
|
744
|
+ }
|
|
|
745
|
+ // 存储用户ID和排名
|
|
|
746
|
+ rankMapTeam.put(entry.getKey(), currentRank);
|
|
|
747
|
+ prevValueTeam = currentValue;
|
|
|
748
|
+ }
|
|
|
749
|
+ // 3. 查询指定排名
|
|
|
750
|
+ Long targetId = departmentId;
|
|
|
751
|
+ Integer integer = rankMapTeam.get(targetId);
|
|
|
752
|
+ resultItem.setBrigadeRanking(integer);
|
|
|
753
|
+ }
|
|
|
754
|
+ result.add(resultItem);
|
|
606
|
755
|
// 本站排名处理
|
|
607
|
|
- SysDept sysDeptDepartmentId = sysDeptService.selectDeptById(departmentId);
|
|
608
|
|
- Long stationId = sysDeptDepartmentId.getParentId();
|
|
|
756
|
+ SysDept sysDeptBrigade = sysDeptService.selectDeptById(ddId);
|
|
|
757
|
+ Long stationId = sysDeptBrigade.getParentId();
|
|
609
|
758
|
List<SysLargeScreenLearningGrowthSqlDto> stationList = all.stream().filter(item -> ObjUtil.equals(item.getZjDeptId(), stationId)).collect(Collectors.toList());
|
|
610
|
759
|
if (CollUtil.isNotEmpty(stationList)) {
|
|
611
|
760
|
Map<Long, BigDecimal> avgMap = stationList.stream()
|
|
|
@@ -650,14 +799,91 @@ public class SysLearningGrowthServiceImpl implements ISysLearningGrowthService {
|
|
650
|
799
|
resultItem.setStationRanking(integer);
|
|
651
|
800
|
}
|
|
652
|
801
|
result.add(resultItem);
|
|
|
802
|
+ } else if (ObjUtil.isNotNull(brigadeId)) {
|
|
|
803
|
+ // 大队级
|
|
|
804
|
+ Long finalBrigadeId = brigadeId;
|
|
|
805
|
+ List<SysLargeScreenLearningGrowthSqlDto> target = all.stream()
|
|
|
806
|
+ .filter(item -> ObjUtil.equals(item.getDdDeptId(), finalBrigadeId))
|
|
|
807
|
+ .collect(Collectors.toList());
|
|
|
808
|
+ if (CollUtil.isEmpty(target)) {
|
|
|
809
|
+ return Collections.emptyList();
|
|
|
810
|
+ }
|
|
|
811
|
+ SysLargeScreenLearningGrowthDto resultItem = new SysLargeScreenLearningGrowthDto();
|
|
|
812
|
+ resultItem.setId(brigadeId);
|
|
|
813
|
+ resultItem.setName(target.get(0).getDdDeptName());
|
|
|
814
|
+ resultItem.setHighestScore(target
|
|
|
815
|
+ .stream()
|
|
|
816
|
+ .map(SysLargeScreenLearningGrowthSqlDto::getExamScore)
|
|
|
817
|
+ .filter(ObjUtil::isNotNull)
|
|
|
818
|
+ .reduce(BigDecimal::max)
|
|
|
819
|
+ .orElse(BigDecimal.ZERO));
|
|
|
820
|
+ resultItem.setLowestScore(target
|
|
|
821
|
+ .stream()
|
|
|
822
|
+ .map(SysLargeScreenLearningGrowthSqlDto::getExamScore)
|
|
|
823
|
+ .filter(ObjUtil::isNotNull)
|
|
|
824
|
+ .reduce(BigDecimal::min)
|
|
|
825
|
+ .orElse(BigDecimal.ZERO));
|
|
|
826
|
+ resultItem.setAverageScore(target.stream()
|
|
|
827
|
+ .map(SysLargeScreenLearningGrowthSqlDto::getExamScore)
|
|
|
828
|
+ .filter(ObjUtil::isNotNull)
|
|
|
829
|
+ .reduce(BigDecimal::add)
|
|
|
830
|
+ .map(sum -> sum.divide(BigDecimal.valueOf(target.size()), 2, RoundingMode.HALF_UP))
|
|
|
831
|
+ .orElse(BigDecimal.ZERO));
|
|
|
832
|
+ // 本站排名处理
|
|
|
833
|
+ SysDept sysDeptBrigade = sysDeptService.selectDeptById(brigadeId);
|
|
|
834
|
+ Long stationId = sysDeptBrigade.getParentId();
|
|
|
835
|
+ List<SysLargeScreenLearningGrowthSqlDto> stationList = all.stream().filter(item -> ObjUtil.equals(item.getZjDeptId(), stationId)).collect(Collectors.toList());
|
|
|
836
|
+ if (CollUtil.isNotEmpty(stationList)) {
|
|
|
837
|
+ Map<Long, BigDecimal> avgMap = stationList.stream()
|
|
|
838
|
+ .filter(item -> item.getExamScore() != null)
|
|
|
839
|
+ .collect(Collectors.groupingBy(
|
|
|
840
|
+ SysLargeScreenLearningGrowthSqlDto::getDdDeptId,
|
|
|
841
|
+ Collectors.collectingAndThen(
|
|
|
842
|
+ Collectors.averagingDouble(record -> record.getExamScore().doubleValue()),
|
|
|
843
|
+ avg -> BigDecimal.valueOf(avg).setScale(2, RoundingMode.HALF_UP)
|
|
|
844
|
+ )
|
|
|
845
|
+ ));
|
|
|
846
|
+ long count = avgMap.keySet().stream().count();
|
|
|
847
|
+ resultItem.setStationTotal((int) count);
|
|
|
848
|
+ // 1. 按值升序排序
|
|
|
849
|
+ List<Map.Entry<Long, BigDecimal>> sortedEntriesTeam = avgMap.entrySet()
|
|
|
850
|
+ .stream()
|
|
|
851
|
+ .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
|
|
|
852
|
+ .collect(Collectors.toList());
|
|
|
853
|
+ // 2. 计算排名(考虑并列情况)
|
|
|
854
|
+ Map<Long, Integer> rankMapTeam = new HashMap<>();
|
|
|
855
|
+ int currentRank = 1;
|
|
|
856
|
+ BigDecimal prevValueTeam = null;
|
|
|
857
|
+ int sameValueCount = 1; // 记录相同值的用户数
|
|
|
858
|
+ for (int i = 0; i < sortedEntriesTeam.size(); i++) {
|
|
|
859
|
+ Map.Entry<Long, BigDecimal> entry = sortedEntriesTeam.get(i);
|
|
|
860
|
+ BigDecimal currentValue = entry.getValue();
|
|
|
861
|
+ if (prevValueTeam != null && !currentValue.equals(prevValueTeam)) {
|
|
|
862
|
+ // 如果当前值与前一个值不同,更新排名
|
|
|
863
|
+ currentRank += sameValueCount;
|
|
|
864
|
+ sameValueCount = 1;
|
|
|
865
|
+ } else if (prevValueTeam != null) {
|
|
|
866
|
+ // 如果当前值与前一个值相同,排名不变,但增加相同值的计数
|
|
|
867
|
+ sameValueCount++;
|
|
|
868
|
+ }
|
|
|
869
|
+ // 存储用户ID和排名
|
|
|
870
|
+ rankMapTeam.put(entry.getKey(), currentRank);
|
|
|
871
|
+ prevValueTeam = currentValue;
|
|
|
872
|
+ }
|
|
|
873
|
+ // 3. 查询指定排名
|
|
|
874
|
+ Long targetId = brigadeId;
|
|
|
875
|
+ Integer integer = rankMapTeam.get(targetId);
|
|
|
876
|
+ resultItem.setStationRanking(integer);
|
|
|
877
|
+ }
|
|
|
878
|
+ result.add(resultItem);
|
|
653
|
879
|
} else {
|
|
654
|
880
|
// 站级
|
|
655
|
|
- Map<Long, String> allMap = all.stream().collect(Collectors.toMap(SysLargeScreenLearningGrowthSqlDto::getKsDeptId, SysLargeScreenLearningGrowthSqlDto::getKsDeptName, (oldValue, newValue) -> newValue));
|
|
656
|
|
- Map<Long, List<SysLargeScreenLearningGrowthSqlDto>> groupingByMap = all.stream().collect(Collectors.groupingBy(SysLargeScreenLearningGrowthSqlDto::getKsDeptId));
|
|
657
|
|
- groupingByMap.forEach((ksDeptId, sysLargeScreenLearningGrowthSqlDtolist) -> {
|
|
|
881
|
+ Map<Long, String> allMap = all.stream().collect(Collectors.toMap(SysLargeScreenLearningGrowthSqlDto::getDdDeptId, SysLargeScreenLearningGrowthSqlDto::getDdDeptName, (oldValue, newValue) -> newValue));
|
|
|
882
|
+ Map<Long, List<SysLargeScreenLearningGrowthSqlDto>> groupingByMap = all.stream().collect(Collectors.groupingBy(SysLargeScreenLearningGrowthSqlDto::getDdDeptId));
|
|
|
883
|
+ groupingByMap.forEach((ddDeptId, sysLargeScreenLearningGrowthSqlDtolist) -> {
|
|
658
|
884
|
SysLargeScreenLearningGrowthDto resultItem = new SysLargeScreenLearningGrowthDto();
|
|
659
|
|
- resultItem.setId(ksDeptId);
|
|
660
|
|
- resultItem.setName(allMap.get(ksDeptId));
|
|
|
885
|
+ resultItem.setId(ddDeptId);
|
|
|
886
|
+ resultItem.setName(allMap.get(ddDeptId));
|
|
661
|
887
|
resultItem.setHighestScore(sysLargeScreenLearningGrowthSqlDtolist
|
|
662
|
888
|
.stream()
|
|
663
|
889
|
.map(SysLargeScreenLearningGrowthSqlDto::getExamScore)
|