diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java index 0ef7deae28..63a3e68c1c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java @@ -81,5 +81,5 @@ public interface UserPointStatisticalDailyDao extends BaseDao selectListGridPartyRankPointByMonth(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 4e95ca62da..9d1d387649 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -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 listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO) { - //查询条件 + // 0、查询条件 formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); List resultDTOS = new ArrayList<>(); List 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> 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> 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 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.给排好序的 身边党员-积分排行, 赋值 【头像、真实姓名】 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index 296c1fff1f..4267a9c74f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -149,7 +149,7 @@ - SELECT @curRank := @curRank + 1 AS ranking, P.userId,