党员活动 排序

This commit is contained in:
517612449@qq.com
2022-06-27 16:47:40 +08:00
parent 96f7e76f60
commit b806fefce4
2 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContact;
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventContactService; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.EventContactService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -26,7 +27,7 @@ public class EventContactServiceImpl extends ServiceImpl<EventContactMapper, Eve
public Map<String, List<EventContact>> getEventContactGroup() { public Map<String, List<EventContact>> getEventContactGroup() {
LambdaQueryWrapper<EventContact> query = Wrappers.lambdaQuery(); LambdaQueryWrapper<EventContact> query = Wrappers.lambdaQuery();
query.eq(EventContact::getStatus, "1"); query.eq(EventContact::getStatus, "1");
return this.list(query).stream().collect(Collectors.groupingBy(EventContact::getContactUnit)); return this.list(query).stream().sorted(Comparator.comparing(EventContact::getSort)).collect(Collectors.groupingBy(EventContact::getContactUnit));
} }
@Override @Override

View File

@ -66,7 +66,7 @@ public class EventPartyBranchServiceImpl extends ServiceImpl<EventPartyBranchMap
list.forEach(f -> f.setCount(listMap.get(f.getId()) == null ? 0 : listMap.get(f.getId()).size())); list.forEach(f -> f.setCount(listMap.get(f.getId()) == null ? 0 : listMap.get(f.getId()).size()));
return list.stream().sorted(Comparator.comparing(EventPartyBranch::getCount).reversed()).collect(Collectors.toList()); return list.stream().sorted(Comparator.comparing(EventPartyBranch::getSort)).collect(Collectors.toList());
} }
@Override @Override