huanghongfa
2021-08-12 4e2466dcdb39491ec8a609971e860f44ef5cfb5a
修改选择社区,根据社区数量排序问题
2个文件已修改
8 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/switchs/StreetAllAppletsVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/switchs/StreetAllAppletsVO.java
@@ -19,4 +19,7 @@
    @ApiModelProperty("街道下社区列表")
    private List<CommunitySwitchAllAppletsVO> childList;
    @ApiModelProperty("街道下社区数量")
    private Integer count;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java
@@ -25,7 +25,10 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -220,8 +223,10 @@
            List<CommunitySwitchAllAppletsVO> communityList = this.comActDAO.getCommunityListByStreetId(street.getStreetId());
            if(!communityList.isEmpty()){
                street.setChildList(communityList);
                street.setCount(communityList.size());
            }
        });
        streetList = streetList.stream().sorted(Comparator.comparing(StreetAllAppletsVO::getCount).reversed()).collect(Collectors.toList());
        return R.ok(streetList);
    }