diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java new file mode 100644 index 0000000000..5e4d3e9cc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员(积分)排行--接口入参 + * @Author sun + */ +@Data +public class PartyPointRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PartyPointRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java new file mode 100644 index 0000000000..c6a11b1ea3 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +@Data +public class PartyPointRankResultDTO { + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 党员积分 + */ + private Double pointTotal; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java index 84d586306f..9add2dd4d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -1,13 +1,13 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -40,6 +40,18 @@ public class ScreenUserController { return new Result>().ok(screenUserService.userPointRank(formDTO)); } + /** + * 热心市民积分排行列表(不包含党员) + * @param formDTO + * @return + * @author wxz + */ + @PostMapping("userpointrank/withoutpartymember") + public Result> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.userPointRankWithoutPartyMem(formDTO)); + } + /** * @param formDTO * @Description 党员(指标得分)排行 @@ -52,5 +64,17 @@ public class ScreenUserController { } + /** + * @param formDTO + * @Description 党员(积分)排行 + * @author wxz + */ + @PostMapping("partypointrank") + public Result> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.partyPointRank(formDTO)); + } + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index fe5adc1a77..9dff1c7f68 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -19,11 +19,9 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.user.KcUserPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; -import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; -import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; -import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; -import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -65,6 +63,13 @@ public interface ScreenPartyUserRankDataDao{ */ List selectAgencyUserPointList(UserPointRankFormDTO formDTO); + /** + * 查询组织下居民(不包含党员)积分排行,按积分值降序 + * @param formDTO + * @return + */ + List selectAgencyResiPointListWithoutPartyMem(UserPointRankFormDTO formDTO); + /** * @param formDTO * @Description 查询组织下党员的积分排行,按积分值降序 @@ -75,4 +80,11 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); List selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode); + + /** + * 党员积分排行 + * @param formDTO + * @return + */ + List listPartymemberPointRank(PartyPointRankFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java index f5e2428f09..85366a3db6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java @@ -1,8 +1,10 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import java.util.List; @@ -21,10 +23,19 @@ public interface ScreenUserService { */ List userPointRank(UserPointRankFormDTO formDTO); + List userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO); + /** * @param formDTO * @Description 党员(指标得分)排行 * @author sun */ List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO); + + /** + * 党员积分排行 + * @param formDTO + * @return + */ + List partyPointRank(PartyPointRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java index 7721876c58..31f3ee8d3e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java @@ -7,8 +7,10 @@ import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,6 +45,22 @@ public class ScreenUserServiceImpl implements ScreenUserService { return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); } + /** + * @param formDTO + * @Description 热心市民积分排行列表(不包含党员) + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectAgencyResiPointListWithoutPartyMem(formDTO); + } + /** * @param formDTO * @Description 党员(指标得分)排行 @@ -59,4 +77,14 @@ public class ScreenUserServiceImpl implements ScreenUserService { return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); } + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List partyPointRank(PartyPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + return screenPartyUserRankDataDao.listPartymemberPointRank(formDTO); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 30fb7bd125..aa584adbae 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -131,4 +131,60 @@ m.POINT_TOTAL DESC, m.user_name + + + + + \ No newline at end of file