From 2176fdba6fbb2b0e2d6a097c5468cb0269a3b436 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 14 May 2021 17:47:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/form/IndexExplainFormDTO.java | 6 ++++++ .../datareport/constant/IndexConstant.java | 19 +++++++++++-------- .../index/impl/IndexExplainServiceImpl.java | 4 ++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java index 7d17b128d1..b97139c8ff 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java @@ -48,5 +48,11 @@ public class IndexExplainFormDTO implements Serializable { * 组织id */ private String orgId; + /** + * 月份Id + */ + private String monthId; + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java index df3239962b..4e2c5e01e1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -22,8 +22,11 @@ public class IndexConstant { private static final String FWZS_CN = "服务指数"; private static final String ZLZS_CN = "治理指数"; private static final String ZB_CN = "指标"; - private static final String BEN_JI = "本级"; - private static final String XIA_JI = "下级"; + private static final String BEN_JI_CN = "本级"; + private static final String XIA_JI_CN = "下级"; + + public static final String ZI_SHEN = "ZISHEN"; + public static final String XIA_JI = "xiaji"; /** @@ -41,11 +44,11 @@ public class IndexConstant { } if (allIndexCode.contains(FactConstant.DJNL)) { - result.add(BEN_JI + DJZS_CN + ZB_CN); + result.add(BEN_JI_CN + DJZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.FWNL)) { - result.add(BEN_JI + FWZS_CN + ZB_CN); + result.add(BEN_JI_CN + FWZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.ZLNL)) { - result.add(BEN_JI + ZLZS_CN + ZB_CN); + result.add(BEN_JI_CN + ZLZS_CN + ZB_CN); } result.addAll(ScoreLastHeader); return result; @@ -62,11 +65,11 @@ public class IndexConstant { public static List getStandardSubHeaders(String allIndexCode) { List result = new ArrayList<>(8); if (allIndexCode.contains(FactConstant.DJNL)) { - result.add(XIA_JI + DJZS_CN + ZB_CN); + result.add(XIA_JI_CN + DJZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.FWNL)) { - result.add(XIA_JI + FWZS_CN + ZB_CN); + result.add(XIA_JI_CN + FWZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.ZLNL)) { - result.add(XIA_JI + ZLZS_CN + ZB_CN); + result.add(XIA_JI_CN + ZLZS_CN + ZB_CN); } result.addAll(QuantityLastHeader); return result; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index ac2e998e2e..0734fadda1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -103,11 +103,11 @@ public class IndexExplainServiceImpl implements IndexExplainService { String type = explainDTO.getType(); String allIndexCodePath = null; List tableList = null; - if ("zishen".equals(type)) { + if (IndexConstant.ZI_SHEN.equals(type)) { allIndexCodePath = "wanggexiangguan:dangjiannengli"; tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); result.setTableDataList(tableList); - } else if ("xiaji".equals(type)) { + } else if (IndexConstant.XIA_JI.equals(type)) { allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); result.setTableDataList(tableList); From fa5303ec97c0887e35dedb2221c243f1760ac265 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 14 May 2021 17:50:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/index/impl/IndexExplainServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 0734fadda1..0f79d225e2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -126,6 +126,9 @@ public class IndexExplainServiceImpl implements IndexExplainService { //不下钻 scoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); } + if (scoreList == null || tableList == null) { + return; + } for (IndexScoreResult score : scoreList) { for (IndexScoreDetailResult tb : tableList) { if (tb.getIndexCode().equals(score.getIndexCode())) { @@ -136,6 +139,8 @@ public class IndexExplainServiceImpl implements IndexExplainService { } } } + + break; default: From 054e20801d28fd8ae86dbfdfce21b12a260f5922 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 17 May 2021 11:04:33 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=83=A8=E5=88=86=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/form/SubAgencyFormDTO.java | 9 + .../dto/datastats/form/SubGridFormDTO.java | 9 + .../datastats/impl/DataStatsServiceImpl.java | 336 ++++++++++++++---- 3 files changed, 277 insertions(+), 77 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java index a02a39456c..d5d3d8a66a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -23,6 +23,15 @@ public class SubAgencyFormDTO implements Serializable { * 日维度Id */ private String dateId; + /** + * 排序类型字段 + * 用户【用户:user 党员:party 居民:resi】 + * 党群【党群:group 楼院小组:ordinary 支部小组:branch】 + * 话题【话题:topic 热议中:discussing 已处理:closed 已转议题:shiftIssue】 + * 议题【议题:issue 表决中:voting 已转项目:shiftProject 已处理:closed】 + * 项目【项目:project 处理中:pending 已结案:closed】 + */ + private String type; public interface Agency extends CustomerClientShowGroup{} @Data diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java index d7da58385e..d429b47b7c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -23,6 +23,15 @@ public class SubGridFormDTO implements Serializable { * 日维度Id */ private String dateId; + /** + * 排序类型字段 + * 用户【用户:user 党员:party 居民:resi】 + * 党群【党群:group 楼院小组:ordinary 支部小组:branch】 + * 话题【话题:topic 热议中:discussing 已处理:closed 已转议题:shiftIssue】 + * 议题【议题:issue 表决中:voting 已转项目:shiftProject 已处理:closed】 + * 项目【项目:project 处理中:pending 已结案:closed】 + */ + private String type; public interface Agency extends CustomerClientShowGroup{} @Data diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index f289a4abc9..900144795e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -84,18 +84,22 @@ public class DataStatsServiceImpl implements DataStatsService { AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); AtomicReference closedTotal = new AtomicReference<>(0); AtomicReference hiddenTotal = new AtomicReference<>(0); - if (topic.size()>NumConstant.ZERO) { + if (topic.size() > NumConstant.ZERO) { resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); topic.forEach(t -> { - if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + if (t.getTopicStatus().equals("hidden")) { + hiddenTotal.set(t.getTopicCount()); + } }); } if (null != topicSHiftIssue) { resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); } - resultDTO.setDiscussingTotal(resultDTO.getTopicTotal()-closedTotal.get()-hiddenTotal.get()-resultDTO.getShiftIssueTotal()); + resultDTO.setDiscussingTotal(resultDTO.getTopicTotal() - closedTotal.get() - hiddenTotal.get() - resultDTO.getShiftIssueTotal()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -142,10 +146,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("user"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -153,17 +161,34 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyUserResultDTO o1, SubAgencyUserResultDTO o2) { + if ("party".equals(formDTO.getType())) { + //升序 + //return o1.getPartyMemberTotal().compareTo(o2.getPartyMemberTotal()); + //降序 + return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); + } else if ("resi".equals(formDTO.getType())) { + return o2.getResiTotal().compareTo(o1.getResiTotal()); + } else { + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + } + }); + return resultList; } @@ -184,10 +209,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("user"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -195,17 +224,32 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询网格层级注册用户日统计数据,默认按用户总数降序 resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridUserResultDTO o1, SubGridUserResultDTO o2) { + if ("party".equals(formDTO.getType())) { + //降序 + return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); + } else if ("resi".equals(formDTO.getType())) { + return o2.getResiTotal().compareTo(o1.getResiTotal()); + } else { + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + } + }); + return resultList; } @@ -226,10 +270,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("group"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -237,17 +285,31 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织小组日统计数据,默认按群组总数降序 resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyGroupResultDTO o1, SubAgencyGroupResultDTO o2) { + if ("ordinary".equals(formDTO.getType())) { + return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); + } else if ("branch".equals(formDTO.getType())) { + return o2.getBranchTotal().compareTo(o1.getBranchTotal()); + } else { + return o2.getGroupTotal().compareTo(o1.getGroupTotal()); + } + } + }); + return resultList; } @@ -268,10 +330,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("group"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -280,24 +346,38 @@ public class DataStatsServiceImpl implements DataStatsService { resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); //3.封装数据并返回 - resultList.forEach(re->{ + resultList.forEach(re -> { re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridGroupResultDTO o1, SubGridGroupResultDTO o2) { + if ("ordinary".equals(formDTO.getType())) { + return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); + } else if ("branch".equals(formDTO.getType())) { + return o2.getBranchTotal().compareTo(o1.getBranchTotal()); + } else { + return o2.getGroupTotal().compareTo(o1.getGroupTotal()); + } + } + }); + return resultList; } /** + * @return * @Param formDTO * @Description 查询当前组织的直属下级组织话题数据 * @author sun - * @return */ @Override public List subAgencyTopic(SubAgencyFormDTO formDTO) { @@ -311,10 +391,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("topic"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -324,27 +408,31 @@ public class DataStatsServiceImpl implements DataStatsService { List topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); //查询直属下级组织转议题话题-日统计数据表 List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); - agencyIds.forEach(agencyId->{ + agencyIds.forEach(agencyId -> { SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger hiddenTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); AtomicReference agencyName = new AtomicReference<>(""); - topic.forEach(t->{ - if(t.getAgencyId().equals(agencyId)){ + topic.forEach(t -> { + if (t.getAgencyId().equals(agencyId)) { topicTotal.addAndGet(t.getTopicCount()); - if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + if (t.getTopicStatus().equals("hidden")) { + hiddenTotal.set(t.getTopicCount()); + } } }); - topicShiftIssue.forEach(t->{ - if(t.getAgencyId().equals(agencyId)){ + topicShiftIssue.forEach(t -> { + if (t.getAgencyId().equals(agencyId)) { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); - subAgencyList.forEach(sub->{ - if(agencyId.equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (agencyId.equals(sub.getId())) { agencyName.set(sub.getAgencyName()); } }); @@ -352,7 +440,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setAgencyId(agencyId); resultDTO.setAgencyName(agencyName.get()); resultDTO.setTopicTotal(topicTotal.get()); - resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -362,14 +450,19 @@ public class DataStatsServiceImpl implements DataStatsService { resultList.add(resultDTO); }); - //3.默认按话题总数降序 + //3.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { - //升序 - //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); - //降序 - return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + if ("discussing".equals(formDTO.getType())) { + return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); + } else if ("shiftIssue".equals(formDTO.getType())) { + return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); + } else { + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } } }); @@ -377,10 +470,10 @@ public class DataStatsServiceImpl implements DataStatsService { } /** + * @return * @Param formDTO * @Description 查询当前组织下直属网格列表话题数据 * @author sun - * @return */ @Override public List subGridTopic(SubGridFormDTO formDTO) { @@ -394,10 +487,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("topic"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -407,27 +504,31 @@ public class DataStatsServiceImpl implements DataStatsService { List topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); //查询网格层级转议题话题-日统计数据表 List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); - gridIds.forEach(gridId->{ + gridIds.forEach(gridId -> { SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger hiddenTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); AtomicReference gridName = new AtomicReference<>(""); - topic.forEach(t->{ - if(t.getGridId().equals(gridId)){ + topic.forEach(t -> { + if (t.getGridId().equals(gridId)) { topicTotal.addAndGet(t.getTopicCount()); - if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + if (t.getTopicStatus().equals("hidden")) { + hiddenTotal.set(t.getTopicCount()); + } } }); - topicShiftIssue.forEach(t->{ - if(t.getGridId().equals(gridId)){ + topicShiftIssue.forEach(t -> { + if (t.getGridId().equals(gridId)) { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); - gridList.forEach(sub->{ - if(gridId.equals(sub.getId())){ + gridList.forEach(sub -> { + if (gridId.equals(sub.getId())) { gridName.set(sub.getGridName()); } }); @@ -435,7 +536,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setGridId(gridId); resultDTO.setGridName(gridName.get()); resultDTO.setTopicTotal(topicTotal.get()); - resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -445,14 +546,19 @@ public class DataStatsServiceImpl implements DataStatsService { resultList.add(resultDTO); }); - //3.默认按话题总数降序 + //3.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { - //升序 - //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); - //降序 - return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + if ("discussing".equals(formDTO.getType())) { + return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); + } else if ("shiftIssue".equals(formDTO.getType())) { + return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); + } else { + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } } }); @@ -476,10 +582,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("issue"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -487,18 +597,34 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织议题日统计数据,默认按议题总数降序 resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyIssueResultDTO o1, SubAgencyIssueResultDTO o2) { + if ("voting".equals(formDTO.getType())) { + return o2.getVotingTotal().compareTo(o1.getVotingTotal()); + } else if ("shiftProject".equals(formDTO.getType())) { + return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); + } else { + return o2.getIssueTotal().compareTo(o1.getIssueTotal()); + } + } + }); + return resultList; } @@ -519,10 +645,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("issue"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -530,18 +660,34 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询网格层级议题日统计数据,默认按议题总数降序 resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridIssueResultDTO o1, SubGridIssueResultDTO o2) { + if ("voting".equals(formDTO.getType())) { + return o2.getVotingTotal().compareTo(o1.getVotingTotal()); + } else if ("shiftProject".equals(formDTO.getType())) { + return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); + } else { + return o2.getIssueTotal().compareTo(o1.getIssueTotal()); + } + } + }); + return resultList; } @@ -562,10 +708,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("project"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -573,17 +723,31 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织项目日统计数据,默认按项目总数降序 resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyProjectResultDTO o1, SubAgencyProjectResultDTO o2) { + if ("pending".equals(formDTO.getType())) { + return o2.getPendingTotal().compareTo(o1.getPendingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); + } else { + return o2.getProjectTotal().compareTo(o1.getProjectTotal()); + } + } + }); + return resultList; } @@ -604,10 +768,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("project"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -615,17 +783,31 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询网格层级项目日统计数据,默认按项目总数降序 resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridProjectResultDTO o1, SubGridProjectResultDTO o2) { + if ("pending".equals(formDTO.getType())) { + return o2.getPendingTotal().compareTo(o1.getPendingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); + } else { + return o2.getProjectTotal().compareTo(o1.getProjectTotal()); + } + } + }); + return resultList; } From 77e2146f220b4601b10333e1056cd9a99182e2db Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 17 May 2021 14:08:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=85=88?= =?UTF-8?q?=E8=BF=9B=E6=8E=92=E8=A1=8C->=E5=B1=85=E6=B0=91=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E6=8E=92=E8=A1=8C=E5=88=97=E8=A1=A8(=E4=B8=8D?= =?UTF-8?q?=E5=90=AB=E5=85=9A=E5=91=98)=20=E6=96=B0=E5=A2=9E=EF=BC=9A?= =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=8E=92=E8=A1=8C->=E5=85=9A=E5=91=98?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=8E=92=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartyPointRankFormDTO.java | 35 ++++++++++++ .../dto/result/PartyPointRankResultDTO.java | 35 ++++++++++++ .../screen/ScreenUserController.java | 28 +++++++++- .../screen/ScreenPartyUserRankDataDao.java | 20 +++++-- .../screen/ScreenUserService.java | 11 ++++ .../screen/impl/ScreenUserServiceImpl.java | 28 ++++++++++ .../screen/ScreenPartyUserRankDataDao.xml | 56 +++++++++++++++++++ 7 files changed, 207 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java 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