|
|
@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.common.enu.AroundPartyConstant; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.UserPointStatisticalDailyDao; |
|
|
|
import com.epmet.dto.UserPointStatisticalDailyDTO; |
|
|
@ -238,46 +238,45 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<ResiAroundPartyPointRankResultDTO> listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO) { |
|
|
|
//查询条件
|
|
|
|
// 0、查询条件
|
|
|
|
formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); |
|
|
|
List<ResiAroundPartyPointRankResultDTO> resultDTOS = new ArrayList<>(); |
|
|
|
|
|
|
|
List<String> gridList = new ArrayList<>(); |
|
|
|
// 1-1、获取网格id
|
|
|
|
// 1-1、获取参数中的网格id
|
|
|
|
if (AroundPartyConstant.GRID.equals(formDTO.getScope())){ |
|
|
|
gridList.add(formDTO.getGridId()); |
|
|
|
} |
|
|
|
|
|
|
|
// 1-2、获取社区(下的所有的网格) id
|
|
|
|
// 1-2、获取社区(下的所有网格) 的网格id
|
|
|
|
if (AroundPartyConstant.COMMUNITY.equals(formDTO.getScope())){ |
|
|
|
// 1、根据网格id,获取社区下的所有网格id
|
|
|
|
Result<List<String>> gridInCommunity = govOrgOpenFeignClient.getGridIdsInCommunity(formDTO.getGridId()); |
|
|
|
if (gridInCommunity.success() && gridInCommunity.getData().isEmpty()){ |
|
|
|
if (gridInCommunity.success() && null != gridInCommunity.getData() && gridInCommunity.getData().isEmpty()){ |
|
|
|
log.warn("根据" + formDTO.getGridId() + "网格id, 查询不到同属于一个社区下的所有网格id"); |
|
|
|
return resultDTOS; |
|
|
|
} |
|
|
|
gridList = gridInCommunity.getData(); |
|
|
|
} |
|
|
|
|
|
|
|
// 2.获取网格下的所有党员
|
|
|
|
// 2.根据网格id,获取网格下的所有党员(认证通过)
|
|
|
|
Result<List<PartymemberInfoDTO>> partymemberInfo = resiPartyMemberOpenFeignClient.getPartymemberInfoByGridId(gridList); |
|
|
|
if (partymemberInfo.success() && partymemberInfo.getData().isEmpty()){ |
|
|
|
if (partymemberInfo.success() && null != partymemberInfo.getData() && partymemberInfo.getData().isEmpty()){ |
|
|
|
log.warn("根据" + formDTO.getGridId() + "网格id, 查询不到党员信息"); |
|
|
|
return resultDTOS; |
|
|
|
} |
|
|
|
|
|
|
|
// 2.1.获取认证通过的党员的 用户id
|
|
|
|
// 2.1.获取认证通过党员的 用户id
|
|
|
|
List<String> userIds = getUserIds(partymemberInfo.getData()); |
|
|
|
formDTO.setUserIds(userIds); |
|
|
|
|
|
|
|
// 3.根据用户id(所有),查询积分信息,进行排名
|
|
|
|
if (AroundPartyConstant.ALL.equals(formDTO.getType())){ |
|
|
|
// scope : community && type :all 表示:按网格(一个网格 或 社区下的所有网格)统计,对党员累计可用积分 排序
|
|
|
|
// type :all 表示:按网格(一个网格 或 社区下的所有网格)统计,对党员累计可用积分 排序
|
|
|
|
resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(formDTO); |
|
|
|
|
|
|
|
} else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ |
|
|
|
// scope : community && type :monthly 表示:按网格(一个网格 或 社区下的所有网格)统计,对本月党员增加的积分 进行排序
|
|
|
|
resultDTOS = baseDao.selectListGridPartyRankPointByMonth(formDTO); |
|
|
|
// type :monthly 表示:按网格(一个网格 或 社区下的所有网格)统计,对本月党员增加的积分 进行排序
|
|
|
|
resultDTOS = baseDao.selectListGridPartyRankByMonth(formDTO); |
|
|
|
} |
|
|
|
|
|
|
|
// 4.给排好序的 身边党员-积分排行, 赋值 【头像、真实姓名】
|
|
|
|