commit
This commit is contained in:
+12
-4
@@ -172,14 +172,22 @@ public class TeacherCongressDelegateServiceImpl extends BaseServiceImpl<Teacher_
|
||||
List<NutMap> delegateList = delegateAllList.stream()
|
||||
.filter(delegate -> delegation.getString("id").equals(delegate.getString("delegationId")))
|
||||
.collect(Collectors.toList());
|
||||
Comparator<NutMap> comparator = Comparator.comparing(map -> {
|
||||
Comparator<NutMap> comparator = Comparator.comparing((NutMap map) -> {
|
||||
String userName = map.getString("userName");
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
return getStrokeCount(String.valueOf(userName.charAt(0)));
|
||||
if (userName == null || userName.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
// 获取第一个字的笔画数作为主排序键
|
||||
return getStrokeCount(String.valueOf(userName.charAt(0)));
|
||||
}).thenComparing(map -> {
|
||||
String userName = map.getString("userName");
|
||||
// 如果名字长度大于 1,获取第二个字的笔画数
|
||||
if (userName != null && userName.length() > 1) {
|
||||
return getStrokeCount(String.valueOf(userName.charAt(1)));
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
Collections.sort(delegateList, comparator);
|
||||
delegateList.sort(comparator);
|
||||
//按5人平均分组
|
||||
List<List<NutMap>> delegateGroupList = ListUtil.split(delegateList, 5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user