党员活动 排序

This commit is contained in:
517612449@qq.com
2022-06-27 16:38:34 +08:00
parent 873affcc13
commit 94745d5ba6
2 changed files with 4 additions and 2 deletions

View File

@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventContactMapper; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.dao.EventContactMapper;
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContact; import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContact;
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventPartyBranch;
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 +28,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