Browse Source

Merge branch 'dev_third_data' into dev_temp

master
wxz 4 years ago
parent
commit
e6030cbeb5
  1. 9
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java
  2. 9
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java
  3. 336
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  4. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java
  5. 35
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java
  6. 35
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java
  7. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java
  8. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java
  9. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java
  10. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java
  11. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java
  12. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java
  13. 56
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

9
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

9
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

336
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<Integer> closedTotal = new AtomicReference<>(0);
AtomicReference<Integer> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
if(subAgencyList.size()<NumConstant.ONE){
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubAgencyUserResultDTO>() {
@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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
if(gridList.size()<NumConstant.ONE){
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubGridUserResultDTO>() {
@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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
if(subAgencyList.size()<NumConstant.ONE){
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubAgencyGroupResultDTO>() {
@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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
if(gridList.size()<NumConstant.ONE){
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubGridGroupResultDTO>() {
@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<SubAgencyTopicResultDTO> 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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
if(subAgencyList.size()<NumConstant.ONE){
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
@ -324,27 +408,31 @@ public class DataStatsServiceImpl implements DataStatsService {
List<SubAgencyFormDTO.Topic> topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId());
//查询直属下级组织转议题话题-日统计数据表
List<SubAgencyFormDTO.Topic> 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<String> 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<SubAgencyTopicResultDTO>() {
@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<SubGridTopicResultDTO> 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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
if(gridList.size()<NumConstant.ONE){
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
@ -407,27 +504,31 @@ public class DataStatsServiceImpl implements DataStatsService {
List<SubGridFormDTO.Topic> topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId());
//查询网格层级转议题话题-日统计数据表
List<SubGridFormDTO.Topic> 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<String> 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<SubGridTopicResultDTO>() {
@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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
if(subAgencyList.size()<NumConstant.ONE){
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubAgencyIssueResultDTO>() {
@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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
if(gridList.size()<NumConstant.ONE){
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubGridIssueResultDTO>() {
@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<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId());
if(subAgencyList.size()<NumConstant.ONE){
if (subAgencyList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubAgencyProjectResultDTO>() {
@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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
if(gridList.size()<NumConstant.ONE){
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> 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<SubGridProjectResultDTO>() {
@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;
}

6
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;
}

35
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 {}
}

35
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;
}

19
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<String> getStandardSubHeaders(String allIndexCode) {
List<String> 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;

28
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<List<UserPointRankListResultDTO>>().ok(screenUserService.userPointRank(formDTO));
}
/**
* 热心市民积分排行列表(不包含党员)
* @param formDTO
* @return
* @author wxz
*/
@PostMapping("userpointrank/withoutpartymember")
public Result<List<UserPointRankListResultDTO>> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class);
return new Result<List<UserPointRankListResultDTO>>().ok(screenUserService.userPointRankWithoutPartyMem(formDTO));
}
/**
* @param formDTO
* @Description 党员指标得分排行
@ -52,5 +64,17 @@ public class ScreenUserController {
}
/**
* @param formDTO
* @Description 党员积分排行
* @author wxz
*/
@PostMapping("partypointrank")
public Result<List<PartyPointRankResultDTO>> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class);
return new Result<List<PartyPointRankResultDTO>>().ok(screenUserService.partyPointRank(formDTO));
}
}

20
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<UserPointRankListResultDTO> selectAgencyUserPointList(UserPointRankFormDTO formDTO);
/**
* 查询组织下居民(不包含党员)积分排行按积分值降序
* @param formDTO
* @return
*/
List<UserPointRankListResultDTO> selectAgencyResiPointListWithoutPartyMem(UserPointRankFormDTO formDTO);
/**
* @param formDTO
* @Description 查询组织下党员的积分排行按积分值降序
@ -75,4 +80,11 @@ public interface ScreenPartyUserRankDataDao{
List<PartyUserPointResultDTO> selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode);
List<UserPointResultDTO> selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode);
/**
* 党员积分排行
* @param formDTO
* @return
*/
List<PartyPointRankResultDTO> listPartymemberPointRank(PartyPointRankFormDTO formDTO);
}

9
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<IndexScoreDetailResult> 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);
@ -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:

11
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<UserPointRankListResultDTO> userPointRank(UserPointRankFormDTO formDTO);
List<UserPointRankListResultDTO> userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO);
/**
* @param formDTO
* @Description 党员指标得分排行
* @author sun
*/
List<PartIndexScroeRankResultDTO> partIndexScroeRank(PartIndexScroeRankFormDTO formDTO);
/**
* 党员积分排行
* @param formDTO
* @return
*/
List<PartyPointRankResultDTO> partyPointRank(PartyPointRankFormDTO formDTO);
}

28
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<UserPointRankListResultDTO> 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<PartyPointRankResultDTO> 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);
}
}

56
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -132,4 +132,60 @@
m.POINT_TOTAL DESC,
m.user_name
</select>
<select id="selectAgencyResiPointListWithoutPartyMem"
resultType="com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO">
SELECT
org_id AS "agencyId",
org_name AS "agencyName",
grid_id AS "gridId",
grid_name AS "gridName",
user_id AS "userId",
user_name AS "userName",
point_total AS "pointTotal"
FROM
screen_party_user_rank_data
WHERE
del_flag = '0'
AND PARTY_FLAG = 0
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND all_parent_ids LIKE CONCAT('%',#{orgId},'%')
</if>
<if test="orgType == 'grid'">
AND grid_id = #{orgId}
</if>
</if>
ORDER BY
point_total DESC
LIMIT #{topNum}
</select>
<!--党员积分排行-->
<select id="listPartymemberPointRank" resultType="com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO">
SELECT
org_id AS "agencyId",
org_name AS "agencyName",
grid_id AS "gridId",
grid_name AS "gridName",
user_id AS "userId",
user_name AS "userName",
point_total AS "pointTotal"
FROM
screen_party_user_rank_data
WHERE
del_flag = '0'
AND party_flag = '1'<!-- 是否是党员标志:1是。0不是党员 -->
<if test="orgType != null and orgType !=''">
<if test="orgType == 'agency'">
AND all_parent_ids LIKE CONCAT('%',#{orgId},'%')
</if>
<if test="orgType == 'grid'">
AND grid_id = #{orgId}
</if>
</if>
ORDER BY
point_total DESC
LIMIT #{topNum}
</select>
</mapper>
Loading…
Cancel
Save