diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java new file mode 100644 index 0000000000..ebfea4f918 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:13 下午 + * @DESC + */ +@Data +public class AllPartyFormDTO implements Serializable { + + private static final long serialVersionUID = -600409785611581009L; + + + /** + * 页码 + **/ + private Integer pageNo = NumConstant.ONE; + + /** + * 每页数据条数 + **/ + private Integer pageSize = NumConstant.TEN; + + /** + * 本月 monthly 总排行 all; + * */ + private String type; + + /** + * 认证成功的党员 的用户ID + * */ + private List userIds; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java new file mode 100644 index 0000000000..25413e04a5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:12 下午 + * @DESC + */ +@Data +public class AllPartyResultDTO implements Serializable { + + private static final long serialVersionUID = -5889648842876122793L; + + /** + * 排序 + **/ + private Integer ranking; + + /** + * 积分 + **/ + private Integer point; + + /** + * 头像 + **/ + private String userHeadPhoto; + + /** + * 名称 + **/ + private String realName; + + /** + * 用户id + **/ + private String userId; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index b52a602ede..9f5ee8acf8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -159,6 +159,18 @@ public class ResiPointController { return new Result>().ok(resultDTOS); } + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + @PostMapping("allparty") + public Result> allParty(@RequestBody AllPartyFormDTO formDTO,@LoginUser TokenDto tokenDto){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(userPointStatisticalDailyService.allParty(formDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result> * @param tokenDto diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java index 6630a87891..1a82b5ca14 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -20,8 +20,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.AllPartyResultDTO; import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; @@ -125,4 +127,12 @@ public interface UserPointStatisticalDailyService extends BaseService listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO); + + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + List allParty(AllPartyFormDTO 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 10ed45500f..23d0381cee 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 @@ -23,11 +23,13 @@ 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.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.UserPointStatisticalDailyDao; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.*; @@ -45,6 +47,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -292,6 +295,36 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl allParty(AllPartyFormDTO formDTO) { + Result> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId()); + if (!partyMemberInfosResult.success()){ + throw new RenException("查询客户下的党员失败......"); + } + if (CollectionUtils.isEmpty(partyMemberInfosResult.getData())){ + return new ArrayList<>(); + } + List partyMemberInfos = partyMemberInfosResult.getData(); + List userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList()); + ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class); + selDto.setUserIds(userIds); + List resultDTOS = new ArrayList<>(); + if (AroundPartyConstant.ALL.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(selDto); + }else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyRankByMonth(selDto); + } + resultDTOS = getPartyBaseInfo(resultDTOS); + List result = ConvertUtils.sourceToTarget(resultDTOS, AllPartyResultDTO.class); + return result; + } + /** * 获取认证通过的党员的 用户id *