Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_screen_data_2.0

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
dev
wangchao 5 years ago
parent
commit
af1f8dcae6
  1. 30
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java
  2. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java
  3. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java
  4. 49
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java
  5. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  6. 96
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  7. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  8. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  9. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  10. 31
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml
  11. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml
  12. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java
  13. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java
  14. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java
  15. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java
  16. 68
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java
  17. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java
  18. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java
  19. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  21. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  22. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java
  23. 90
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  24. 58
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java
  25. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  26. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  27. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  28. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  29. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java
  30. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java
  31. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java
  32. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java
  33. 229
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
  34. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java
  35. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java
  36. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java
  37. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java
  38. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  39. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  40. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  41. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  42. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  43. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  44. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  45. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  46. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  47. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  48. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  49. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  50. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  51. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  52. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  53. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  54. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  55. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java
  56. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java
  57. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java
  58. 182
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  59. 260
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  60. 211
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java
  61. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  62. 147
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  63. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java
  64. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  65. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java
  66. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java
  67. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java
  68. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java
  69. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java
  70. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java
  71. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java
  72. 157
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java
  73. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java
  74. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java
  75. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java
  76. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java
  77. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java
  78. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java
  79. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java
  80. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java
  81. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java
  82. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java
  83. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java
  84. 41
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  85. 34
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml
  86. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  87. 68
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  88. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  89. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  90. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  91. 57
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml
  92. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml
  93. 47
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml
  94. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml
  95. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml
  96. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml
  97. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml
  98. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml
  99. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml
  100. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml

30
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 评价指标字典表数据--接口返参
* @Author sun
*/
@Data
public class IndexDictResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 指标名
*/
private String indexName;
/**
* 指标code
*/
private String indexCode;
/**
* 指标值类型 百分比percent
*/
private String valueType;
}

7
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiProfileResultDTO.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 3公众参与概况返参DTO
@ -24,7 +25,7 @@ public class PublicPartiProfileResultDTO implements Serializable {
* */
private String monthTrend = "";
private Integer averageIssue = NumConstant.ZERO;
private BigDecimal averageIssue = new BigDecimal(NumConstant.ZERO);
/**
* 较上月百分比
@ -38,8 +39,8 @@ public class PublicPartiProfileResultDTO implements Serializable {
/**
* 平均参与度
* */
private Integer averageJoin = NumConstant.ZERO;
*/
private BigDecimal averageJoin = new BigDecimal(NumConstant.ZERO);
private String joinCompareLatestMonth = "";

16
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java

@ -45,4 +45,20 @@ public interface FactConstant {
* 网格相关
*/
String WANG_GE_XIANG_GUAN = "wanggexiangguan";
/**
* 评价指标类型-
*/
String NONE = "none";
/**
* 评价指标类型-整数
*/
String INTEGER = "integer";
/**
* 评价指标类型-小数
*/
String DECIMAL = "decimal";
/**
* 评价指标类型-百分比
*/
String PERCENT = "percent";
}

49
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/IndexDictDao.java

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 评价指标字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface IndexDictDao {
/**
* @param
* @Description 查询指标字典表是百分比类型的数据
* @author sun
*/
List<IndexDictResultDTO> selectList();
/**
* @param
* @Description 根据indexCode查询指标字典表具体数据
* @author sun
*/
IndexDictResultDTO selectIndexDict(@Param("indexCode") String indexCode);
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -270,6 +270,9 @@ public class IndexServiceImpl implements IndexService {
//screen_index_data_monthly 根据组织id和月份获取月度指标得分
//1.根据组织或网格Id以及月份Id查询各项月度指数得分
IndexScoreResultDTO resultDTO = screenIndexDataMonthlyDao.selectMonthData(formDTO);
if (null == resultDTO) {
return resultDTO;
}
//2.将数据改成正确格式 四舍五入保留一位小数 权重转成百分比
NumberFormat nf = NumberFormat.getPercentInstance();

96
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -15,12 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
/**
* 数据改版api
@ -47,6 +45,8 @@ public class FactIndexServiceImpl implements FactIndexService {
private FactIndexGridScoreDao factIndexGridScoreDao;
@Autowired
private FactIndexGridSubScoreDao factIndexGridSubScoreDao;
@Autowired
private IndexDictDao indexDictDao;
/**
* @param formDTO
@ -125,19 +125,27 @@ public class FactIndexServiceImpl implements FactIndexService {
AblityIndexResultDTO nl = new AblityIndexResultDTO();
nl.setIndexCode(FactConstant.NLZB);
nl.setScoreList(nlList);
if(null != nlList){resultList.add(nl);}
if (null != nlList) {
resultList.add(nl);
}
AblityIndexResultDTO dj = new AblityIndexResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
if(null != djList){resultList.add(dj);}
if (null != djList) {
resultList.add(dj);
}
AblityIndexResultDTO zl = new AblityIndexResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
if (null != zlList) {
resultList.add(zl);
}
AblityIndexResultDTO fw = new AblityIndexResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
if (null != fwList) {
resultList.add(fw);
}
return resultList;
}
@ -203,9 +211,15 @@ public class FactIndexServiceImpl implements FactIndexService {
throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//5.封装数据并返回
if(null != dj){resultList.add(dj);}
if(null != zl){resultList.add(zl);}
if(null != fw){resultList.add(fw);}
if (null != dj) {
resultList.add(dj);
}
if (null != zl) {
resultList.add(zl);
}
if (null != fw) {
resultList.add(fw);
}
return resultList;
}
@ -278,15 +292,21 @@ public class FactIndexServiceImpl implements FactIndexService {
MonthScoreListResultDTO dj = new MonthScoreListResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
if(null != djList){resultList.add(dj);}
if (null != djList) {
resultList.add(dj);
}
MonthScoreListResultDTO zl = new MonthScoreListResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
if (null != zlList) {
resultList.add(zl);
}
MonthScoreListResultDTO fw = new MonthScoreListResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
if (null != fwList) {
resultList.add(fw);
}
return resultList;
}
@ -333,7 +353,28 @@ public class FactIndexServiceImpl implements FactIndexService {
throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
//4.查询指标字典表数据
List<IndexDictResultDTO> list = indexDictDao.selectList();
//5.遍历数据,判断数据类型并处理
/*NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMaximumFractionDigits(1);*/
resultList.forEach(result -> {
list.forEach(l -> {
if (result.getKey().equals(l.getIndexCode())) {
//小数类型,四舍五入保留小数点后一位
if (FactConstant.DECIMAL.equals(l.getValueType())) {
BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setValue(num.toString());
}
//百分数类型,四舍五入保留小数点后一位并转成百分比
if (FactConstant.PERCENT.equals(l.getValueType())) {
BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setValue(num+"%");
}
}
});
});
return resultList;
}
@ -373,7 +414,30 @@ public class FactIndexServiceImpl implements FactIndexService {
throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
//6.查询指标字典表具体数据
IndexDictResultDTO dictDTO = indexDictDao.selectIndexDict(formDTO.getKey());
if (null == dictDTO) {
throw new RenException(String.format("根据评价指标indexCode未查询到字典表数据,indexCode值:%s", formDTO.getKey()));
}
//7.遍历数据,判断数据类型并处理
/*NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMaximumFractionDigits(1);*/
//小数类型,四舍五入保留小数点后一位
if (FactConstant.DECIMAL.equals(dictDTO.getValueType())) {
resultList.forEach(result -> {
BigDecimal num = new BigDecimal(result.getAblity()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setAblity(num.toString());
});
}
//百分数类型,四舍五入保留小数点后一位并转成百分比
if (FactConstant.PERCENT.equals(dictDTO.getValueType())) {
resultList.forEach(result -> {
BigDecimal num = new BigDecimal(result.getAblity()).setScale(1, BigDecimal.ROUND_HALF_UP);
result.setAblity(num+"%");
});
}
return resultList;
}

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_agency_sub_score fact
@ -23,7 +23,7 @@
<select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_community_sub_score fact
@ -23,7 +23,7 @@
<select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectGridAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_grid_sub_score fact
@ -23,7 +23,7 @@
<select id="selectGridMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity"
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

31
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.fact.IndexDictDao">
<select id="selectList" resultType="com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO">
SELECT
index_name AS "indexName",
index_code AS "indexCode",
value_type AS "valueType"
FROM
index_dict
WHERE
del_flag = '0'
AND value_type != 'none'
</select>
<select id="selectIndexDict" resultType="com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO">
SELECT
index_name AS "indexName",
index_code AS "indexCode",
value_type AS "valueType"
FROM
index_dict
WHERE
del_flag = '0'
AND index_code = #{indexCode}
LIMIT 1
</select>
</mapper>

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml

@ -7,10 +7,10 @@
<select id="selectUserJoinData" resultType="com.epmet.evaluationindex.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO">
SELECT
JOIN_TOTAL AS total,
AVG_JOIN AS averageJoin,
ROUND( AVG_JOIN, 1 ) AS averageJoin,
JOIN_TOTAL_UP_RATE AS monthIncr,
JOIN_TOTAL_UP_FLAG AS monthTrend,
AVG_ISSUE AS averageIssue,
ROUND(AVG_ISSUE,1) AS averageIssue,
AVG_ISSUE_UP_RATE AS issueCompareLatestMonth,
AVG_ISSUE_UP_FLAG AS issueCompareLatestTrend,
AGVG_JOIN_UP_RATE AS joinCompareLatestMonth,

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractScreenFormDTO.java

@ -17,5 +17,9 @@ public class ExtractScreenFormDTO implements Serializable {
private String customerId;
private String monthId;
private String dateId;
private String startMonth;
private String endMonth;
private String startDate;
private String endDate;
}

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ScreenPartyBranchDataFormDTO.java

@ -88,6 +88,9 @@ public class ScreenPartyBranchDataFormDTO implements Serializable {
private String updatedBy;
public ScreenPartyBranchDataFormDTO() {
this.organizeCount = NumConstant.ZERO;
this.joinUserCount = NumConstant.ZERO;
this.averageJoinUserCount = NumConstant.ZERO;
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc: 网格级别小组内的组成员数
*
* @author LiuJanJun
* @date 2020/9/27 2:27 下午
*/
@Data
public class GridGroupUserCountResultDTO implements Serializable {
private static final long serialVersionUID = -4729061928990808187L;
/**
* 客户ID
*/
private String customerId;
private String orgId;
private Integer memberCount;
/**
* 网格的pids
*/
private String pids;
}

9
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java

@ -25,7 +25,12 @@ public class GridUserCountResultDTO implements Serializable {
private Integer partyCount = NumConstant.ZERO;
/**
* 网格ID
* 网格ID 或组织Id
*/
private String gridId;
private String orgId;
/**
* 用户总数
*/
private Integer regTotal;
}

68
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java

@ -0,0 +1,68 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* desc: 议题投票统计结果DTO
*
* @author LiuJanJun
* @date 2020/9/27 11:22 上午
*/
@Data
public class IssueVoteStatisticalResultDTO implements Serializable {
private static final long serialVersionUID = 2631108929053690349L;
/**
* 主键ID
*/
private String id;
/**
* 议题ID
*/
private String issueId;
/**
* 统计日期 yyyy-MM-dd
*/
private Date statisticalDate;
/**
* 到该日的总赞成数
*/
private Integer supportCount;
/**
* 到该日的总反对数
*/
private Integer oppositionCount;
/**
* 到该日的总票数
*/
private Integer totalCount;
/**
* 该日增量
*/
private Integer todayIncrement;
/**
* 该日赞成增量
*/
private Integer supportIncrement;
/**
* 该日反对增量
*/
private Integer oppositionIncrement;
/**
* 到该日的应表决数
*/
private Integer votableCount;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc: 议题投票人数
*
* @author LiuJanJun
* @date 2020/9/27 2:27 下午
*/
@Data
public class IssueVoteUserCountResultDTO implements Serializable {
private static final long serialVersionUID = -4729061928990808187L;
private String orgId;
private Integer voteCount;
private Integer issueCount;
/**
* 网格的pids
*/
private String pids;
}

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author zhaoqifeng
@ -17,5 +18,5 @@ public class OrgStatisticsResultDTO implements Serializable {
private String orgId;
private Integer count;
private Integer sum;
private String ratio;
private BigDecimal ratio;
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java

@ -7,4 +7,12 @@ package com.epmet.constant;
* @date 2020/9/16 10:14
*/
public interface DimObjectStatusConstant {
/**
* 已解决
*/
String RESOLVED="resolved";
/**
* 无需解决
*/
String UNRESOLVED="unresolved";
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -62,4 +62,6 @@ public interface ProjectConstant {
* 下级
*/
String XIA_JI = "xiaji";
String GRID_ID = "GRID_ID";
String AGENCY_ID = "AGENCY_ID";
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -105,6 +105,8 @@ public class DemoController {
private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService;
@Autowired
private GovernRankDataExtractService governRankDataExtractService;
@Autowired
private OrgRankExtractService orgRankExtractService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -673,7 +675,8 @@ public class DemoController {
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@Autowired
private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService;
@PostMapping("insertScreenPioneerData")
public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
@ -692,6 +695,18 @@ public class DemoController {
return new Result();
}
@PostMapping("extractPublicPartiTotalData")
public Result extractPublicPartiTotalData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId){
publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId,dateId);
return new Result();
}
@PostMapping("orgRank")
public Result orgRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenExtractDailyController.java

@ -2,6 +2,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -32,4 +33,16 @@ public class ScreenExtractDailyController {
return new Result();
}
/**
* @param formDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
@PostMapping("extractmonthlyyall")
public Result screenExtractMonthly(@RequestBody ExtractScreenFormDTO formDTO) {
screenExtractService.extractMonthlyAll(formDTO);
return new Result();
}
}

90
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -19,15 +19,18 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -40,86 +43,87 @@ import java.util.List;
public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMainDailyEntity> {
/**
* @Description 查询建群党员数
* @param customerId
* @param monthId
* @Description 查询建群党员数
* @author zxc
* @date 2020/9/19 3:49 下午
*/
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 查询是否存在该客户下的数据
* @param customerId
* @return
* @Description 查询是否存在该客户下的数据
* @author wangc
* @date 2020.09.18 23:30
**/
int selectIfExist(@Param("customerId")String customerId);
**/
int selectIfExist(@Param("customerId") String customerId);
/**
* @Description 按照客户Id清除组数据
* @param customerId
* @return
* @Description 按照客户Id清除组数据
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchByCustomerId(@Param("customerId")String customerId);
**/
void deleteBatchByCustomerId(@Param("customerId") String customerId);
/**
* @Description 按照客户Id清除组员数据
* @param customerId
* @return
* @Description 按照客户Id清除组员数据
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchMemberByCustomerId(@Param("customerId")String customerId,@Param("dimId") String dimId,@Param("dateType") String dateType);
void deleteBatchMemberByCustomerId(@Param("customerId") String customerId, @Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* @Description 按照组Id清除组和组员数据
* @param customerId
* @return
* @Description 按照组Id清除组和组员数据
* @author wangc
* @date 2020.09.20 12:16
**/
void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List<String> list);
**/
void deleteBatchByGroupId(@Param("customerId") String customerId, @Param("list") List<String> list);
/**
* @Description 更新群主的党员信息
* @param list
* @return
* @Description 更新群主的党员信息
* @author wangc
* @date 2020.09.20 12:44
**/
int updatePartyFlag(@Param("list") List<String> list,@Param("customerId")String customerId);
**/
int updatePartyFlag(@Param("list") List<String> list, @Param("customerId") String customerId);
/**
* @Description 更新群主的热心居民信息
* @param list
* @return
* @Description 更新群主的热心居民信息
* @author wangc
* @date 2020.09.20 12:44
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list,@Param("customerId")String customerId);
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list, @Param("customerId") String customerId);
/**
* @Description 批量插入组主表
* @param list
* @return
* @Description 批量插入组主表
* @author wangc
* @date 2020.09.20 15:37
**/
**/
int insertBatchMain(@Param("list") List<FactOriginGroupMainDailyDTO> list);
/**
* @Description 批量插入组员表
* @param list
* @return
* @Description 批量插入组员表
* @author wangc
* @date 2020.09.20 15:37
**/
**/
int insertBatchMembers(List<ExtractGroupMemberActionRecordResultDTO> list);
/**
* @param customerId
* @param groupOwnerId
@ -131,8 +135,8 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
List<String> selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询组成员数去重
* @Date 2020/9/20 21:29
@ -140,11 +144,43 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List<String> gridIds);
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List<String> gridIds);
/**
* desc: 获取所有网格的组中成员人数 去重
*
* @param customerId
* @param groupField
* @return java.util.List<com.epmet.dto.extract.result.GridGroupUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 2:31 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(@Param("customerId") String customerId, @Param("groupField") String groupField);
/**
* 获取网格内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:37
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 获取组织内网格数量
* @author zhaoqifeng
* @date 2020/9/27 14:37
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

58
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.dto.extract.result.PartyActiveResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -27,7 +28,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 议题记录附表
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
@ -36,57 +37,82 @@ import java.util.List;
public interface FactOriginIssueLogDailyDao extends BaseDao<FactOriginIssueLogDailyEntity> {
/**
* @Description 议题记录附表插入
* @param issueLogList
* @Description 议题记录附表插入
* @author zxc
* @date 2020/9/14 5:53 下午
*/
void insertIssueLogList(@Param("issueLogList")List<IssueLogDailyFormDTO> issueLogList);
void insertIssueLogList(@Param("issueLogList") List<IssueLogDailyFormDTO> issueLogList);
/**
* @Description 删除旧的记录
* @param customerId
* @param dateId
* @Description 删除旧的记录
* @author zxc
* @date 2020/9/16 9:33 上午
*/
void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId);
void deleteOldLogRecord(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @return java.lang.Integer
* @param userId 用户id
* @param userId 用户id
* @param customerId
* @param monthId
* @return java.lang.Integer
* @author yinzuomei
* @description 查询用户在这个月内表决的总次数
* @Date 2020/9/20 21:52
**/
Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId")String monthId);
Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 查询 议题表决党员/群众
* @param customerId
* @param monthId
* @param isParty
* @Description 查询 议题表决党员/群众
* @author zxc
* @date 2020/9/21 9:37 上午
*/
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty);
List<PartyActiveResultDTO> selectPartyActiveIssueVote(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("isParty") Integer isParty);
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 18:05
**/
int calPartyPartiIssueTotal(@Param("customerId")String customerId,
@Param("gridId")String gridId,
@Param("communityId")String communityId,
@Param("agencyPath")String agencyPath,
@Param("isParty")String isParty);
int calPartyPartiIssueTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("communityId") String communityId,
@Param("agencyPath") String agencyPath,
@Param("isParty") String isParty);
/**
* @param gridId 网格id
* @param pids 网格的pids
* @return int
* @author yinzuomei
* @description 参与人数: 议题的表决行为的用户数去重的累计值
* @Date 2020/9/27 14:19
**/
int selectCountJoinUserTotal(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("pids") String pids);
/**
* desc: 获取每个议题的表决人数
*
* @param customerId
* @param monthId
* @param pids
* @param groupField
* @return java.util.List<com.epmet.dto.extract.IssueVoteUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("groupField") String groupField);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -183,4 +184,26 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
**/
Integer getAgencyShiftProjectTotal(@Param("customerId")String customerId,
@Param("agencyPath")String agencyPath);
/**
* 网格内议题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织内议题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -136,4 +136,26 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgResponse(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level);
/**
* 网格满意率
* @author zhaoqifeng
* @date 2020/9/27 15:52
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织满意率
* @author zhaoqifeng
* @date 2020/9/27 15:52
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -85,7 +85,6 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
void deleteByDate(@Param("date") String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
@ -180,4 +179,27 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @date 2020.09.28 10:19
*/
List<ScreenDifficultyDataEntity> selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List<String> list);
/**
* 网格解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId);
/**
* 组织解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -116,4 +117,26 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
Integer getAgencyPartyTopicTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("createTopicUserIsParty") String createTopicUserIsParty);
/**
* 网格内话题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织内话题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java

@ -56,4 +56,38 @@ public interface ScreenOrgRankDataDao extends BaseDao<ScreenOrgRankDataEntity> {
* @Date 10:52 2020-08-18
**/
void batchInsertOrgRankData(@Param("list") List<OrgRankDataFormDTO> list, @Param("customerId")String customerId);
/**
* 初始化组织数据
* @author zhaoqifeng
* @date 2020/9/27 10:14
* @param customerId
* @param level
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity>
*/
List<ScreenOrgRankDataEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level);
/**
* 初始化网格数据
* @author zhaoqifeng
* @date 2020/9/27 10:14
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity>
*/
List<ScreenOrgRankDataEntity> initGridDataList(@Param("customerId") String customerId);
/**
* 删除旧数据
* @author zhaoqifeng
* @date 2020/9/27 10:27
* @param customerId
* @param orgType
* @param monthId
* @param deleteSize
* @param orgIds
* @return java.lang.Integer
*/
Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("monthId") String monthId,
@Param("deleteSize") Integer deleteSize,
@Param("orgIds")List<String> orgIds);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java

@ -56,4 +56,13 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao<ScreenPublicParti
* @Date 10:52 2020-08-25
**/
void batchInsertPublicPartiTotalData(@Param("list") List<PublicPartiTotalDataFormDTO> list, @Param("customerId")String customerId);
/**
* @return void
* @param list
* @author yinzuomei
* @description 批量插入entity
* @Date 2020/9/27 14:00
**/
void insertBatchEntity(@Param("list") List<ScreenPublicPartiTotalDataEntity> list);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java

@ -57,4 +57,13 @@ public interface ScreenUserTotalDataDao extends BaseDao<ScreenUserTotalDataEntit
void batchInsertUserTotalData(@Param("list") List<UserTotalDataFormDTO> list, @Param("customerId")String customerId);
void insertBatch(@Param("list") List<ScreenUserTotalDataEntity> list);
/**
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity>
* @param customerId
* @author yinzuomei
* @description 根据条件查询screen_user_total_data表
* @Date 2020/9/27 11:22
**/
List<ScreenUserTotalDataEntity> selectList(@Param("customerId") String customerId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActUserRelationDao.java

@ -20,6 +20,6 @@ public interface ActUserRelationDao {
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
List<JoinUserCountResultDTO> selectJoinUserCount(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("orgType") String orgType);
}

229
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java

@ -1,13 +1,14 @@
package com.epmet.dao.issue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -29,33 +30,36 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
*/
List<IssueAgencyDTO> selectAgencyIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 获取当前日期组织下议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:55
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
*/
/**
* 获取当前日期组织下议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/18 9:55
*/
List<IssueAgencyDTO> selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已关闭议题统计
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
/**
* 已关闭议题统计
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueAgencyDTO> selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 已关闭议题增量
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
/**
* 已关闭议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueAgencyDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueAgencyDTO> selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
@ -66,6 +70,7 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
* @Description 根据客户Id查询议题库已转项目的网格项目关系数据
**/
List<IssueEntity> selectGridProjectList(IssueEntity issueEntity);
/**
* 获取当前日期网格下议题统计结果
*
@ -77,87 +82,103 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
*/
List<IssueGridDTO> selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 获取当前日期网格下议题增量
* @author zhaoqifeng
* @date 2020/6/18 9:55
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
*/
List<IssueGridDTO> selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题统计
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
*/
List<IssueGridDTO> selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题增量
* @author zhaoqifeng
* @date 2020/6/18 14:41
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
*/
List<IssueGridDTO> selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 查询客户下议题和项目关系
* @author zhaoqifeng
* @date 2020/6/19 17:34
* @param customerId
* @return java.util.List<com.epmet.dto.issue.IssueProjectDTO>
/**
* 获取当前日期网格下议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
* @author zhaoqifeng
* @date 2020/6/18 9:55
*/
List<IssueGridDTO> selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题统计
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueGridDTO> selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date);
/**
* 网格已关闭议题增量
*
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.issue.IssueGridDTO>
* @author zhaoqifeng
* @date 2020/6/18 14:41
*/
List<IssueGridDTO> selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date);
/**
* 查询客户下议题和项目关系
*
* @param customerId
* @return java.util.List<com.epmet.dto.issue.IssueProjectDTO>
* @author zhaoqifeng
* @date 2020/6/19 17:34
*/
List<IssueProjectDTO> selectIssueProjectList(@Param("customerId") String customerId);
/**
* 根据ID获取议题信息
* @author zhaoqifeng
* @date 2020/9/15 16:56
* @param ids
* @return java.util.List<com.epmet.dto.issue.IssueDTO>
*/
List<IssueDTO> selectIssueInfoByIds(@Param("ids") List<String> ids);
/**
* @Description 查询议题信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题process信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题满意度评价信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* 根据ID获取议题信息
*
* @param ids
* @return java.util.List<com.epmet.dto.issue.IssueDTO>
* @author zhaoqifeng
* @date 2020/9/15 16:56
*/
List<IssueDTO> selectIssueInfoByIds(@Param("ids") List<String> ids);
/**
* @param customerId
* @param dateId
* @Description 查询议题信息
* @author zxc
* @date 2020/9/15 2:28 下午
*/
List<IssueInfoResultDTO> selectIssueInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题process信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<IssueProcessInfoResultDTO> selectIssueProcessInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题满意度评价信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题支持反对信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* desc: 根据客户id 获取当前议题的情况
*
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO>
* @author LiuJanJun
* @date 2020/9/27 1:22 下午
*/
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java

@ -42,14 +42,26 @@ public interface FactIssueAgencyMonthlyDao extends BaseDao<FactIssueAgencyMonthl
* @return java.util.List<com.epmet.dto.stats.FactIssueAgencyMonthlyDTO>
*/
List<FactIssueAgencyMonthlyDTO> selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
* @author zhaoqifeng
* @date 2020/6/23 14:02
* @param customerId
* @param monthId
* @return void
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 删除
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:02
*/
void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* desc: 获取各机关某月议题增量和议题总数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.stats.FactIssueAgencyMonthlyEntity>
* @author LiuJanJun
* @date 2020/9/27 3:33 下午
*/
List<FactIssueAgencyMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -36,5 +37,20 @@ public interface FactRegUserAgencyMonthlyDao extends BaseDao<FactRegUserAgencyMo
void insertBatch(@Param("list") List<FactRegUserAgencyMonthlyDTO> list);
void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId);
void deleteByParams(@Param("monthId") String monthId, @Param("customerId") String customerId);
List<GridUserCountResultDTO> selectAgencyUserCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 查询机关下各用户数量
* @author zhaoqifeng
* @date 2020/9/27 16:39
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO>
*/
List<FactRegUserAgencyMonthlyDTO> selectOrgUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java

@ -48,4 +48,14 @@ public interface FactRegUserGridMonthlyDao extends BaseDao<FactRegUserGridMonthl
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId, String monthId);
/**
* 查询网格下各用户数量
* @author zhaoqifeng
* @date 2020/9/27 13:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserGridMonthlyDTO> selectGridUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java

@ -86,7 +86,7 @@ public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity {
private Integer regUserTotal;
/**
* 参与人数
* 参与人数参与人数: 议题的表决行为的用户数去重的累计值
*/
private Integer joinUserTotal;

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -1,12 +1,13 @@
package com.epmet.service.Issue;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import java.util.List;
@ -149,14 +150,26 @@ public interface IssueService {
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(String customerId,String dateId);
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId,String dateId);
List<SatisfactionInfoResultDTO> selectIssueSatisfactionInfo(String customerId, String dateId);
/**
* @param customerId
* @param dateId
* @Description 查询议题支持反对信息
* @author zxc
* @date 2020/9/16 1:48 下午
*/
List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId);
/**
* desc: 查询议题支持反对及应表决人数
* 数据由两部分组成 1本月内已经关闭的话题的支持和反对数据 来自issueissue_vote_statistical
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO>
* @author LiuJanJun
* @date 2020/9/27 11:20 上午
*/
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String monthId);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -3,13 +3,14 @@ package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.service.Issue.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
@ -127,14 +128,19 @@ public class IssueServiceImpl implements IssueService {
}
/**
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteInfo(customerId, dateId);
}
* @Description 查询议题支持反对信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/16 1:48 下午
*/
@Override
public List<SatisfactionInfoResultDTO> selectIssueVoteInfo(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteInfo(customerId, dateId);
}
@Override
public List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteStatis(customerId, dateId);
}
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java

@ -2,7 +2,6 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.indexcal.CpcScoreResultDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.todata.*;
@ -57,7 +56,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//1、构造初始值
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId);
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) {
log.info("dim_customer_partymember do not any records");
log.info("dim_customer_partymember do not any records customerId="+customerId);
return;
}
String quarterId= DateUtils.getQuarterId(monthId);
@ -75,11 +74,11 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//可以先查询出每个党员的 自建群
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList);
//6、党员自建群群众人数 (todo 和monthId无关??)
//6、党员自建群群众人数 :和评价周期无关
Map<String, Integer> groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//7、党员自建群活跃群众人数
Map<String, Integer> groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);
//8、党员自建群活跃度——话题数 (todo 校验sql正确性)
//8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。
Map<String, Integer> groupTopicCountMap = calGroupTopicCount(customerId, monthId);
//9、自建群活跃度——议题转项目率
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java

@ -145,7 +145,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
// 1. 网格群众用户数 , 网格党员用户数
if (!CollectionUtils.isEmpty(gridUserCountList)){
gridUserCountList.forEach(count -> {
if (r.getGridId().equals(count.getGridId())){
if (r.getGridId().equals(count.getOrgId())) {
r.setUserCount(count.getUserCount());
r.setPartyCount(count.getPartyCount());
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java

@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -62,14 +64,46 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
* @author wangc
* @date 2020.09.23 16:30
**/
boolean insertExtractedData(boolean isFirst,String customerId,String dateId,List<FactOriginGroupMainDailyDTO> originGroupData,List<ExtractGroupMemberActionRecordResultDTO> memberList);
boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List<FactOriginGroupMainDailyDTO> originGroupData, List<ExtractGroupMemberActionRecordResultDTO> memberList);
/**
* @Description 查询党员建组信息
* @param customerId
* @param monthId
* @Description 查询党员建组信息
* @author zxc
* @date 2020/9/25 9:46 上午
*/
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId,String monthId,List<String> gridIds);
List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId, List<String> gridIds);
/**
* desc: 获取客户下每个网格小组内的 去重人数
*
* @param customerId
* @param groupField
* @return java.util.List<com.epmet.entity.evaluationindex.extract.GridGroupUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 2:24 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId, String groupField);
/**
* 获取网格内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:35
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridGroupCount(String customerId, String monthId);
/**
* 获取组织内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:35
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level);
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java

@ -18,10 +18,13 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import java.util.List;
/**
* 议题记录附表
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
@ -29,15 +32,37 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIssueLogDailyEntity> {
/**
* @return int
* @param customerId
* @param gridId
* @param communityId
* @param agencyPath
* @param isParty
* @return int
* @author yinzuomei
* @description 党员参与议事支持或者反对的次数
* @Date 2020/9/26 17:57
**/
int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty);
/**
* @param orgType 组织类别 agency组织网格grid部门department
* @param orgId 组织Id 可以为网格id
* @return int
* @author yinzuomei
* @description 参与人数参与人数: 议题的表决行为的用户数去重的累计值
* @Date 2020/9/27 14:06
**/
int queryJoinUserTotal(String customerId, String orgType, String orgId);
/**
* desc: 获取每个议题的表决人数
*
* @param customerId
* @param monthId
* @param groupField
* @return java.util.List<com.epmet.dto.extract.FactOriginIssueLogDailyEntity>
* @author LiuJanJun
* @date 2020/9/27 1:58 下午
*/
List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId, String groupField);
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java

@ -18,8 +18,11 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import java.util.List;
/**
* 议题主表
*
@ -86,4 +89,25 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
* @Date 2020/9/24 17:04
**/
Integer getAgencyShiftProjectTotal(String customerId, String agencyPath);
/**
* 网格内议题数
* @author zhaoqifeng
* @date 2020/9/27 15:11
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridIssueCount(String customerId, String monthId);
/**
* 组织内议题数
* @author zhaoqifeng
* @date 2020/9/27 15:11
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgIssueCount(String customerId, String monthId, String level);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java

@ -218,4 +218,25 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
*/
List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level);
/**
* 网格满意率
* @author zhaoqifeng
* @date 2020/9/27 16:06
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridSatisfaction(String customerId, String monthId);
/**
* 组织满意率
* @author zhaoqifeng
* @date 2020/9/27 16:06
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -218,6 +218,27 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
*/
List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId);
/**
* 网格项目数
* @author zhaoqifeng
* @date 2020/9/27 15:18
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId);
/**
* 组织项目数
* @author zhaoqifeng
* @date 2020/9/27 15:19
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgProjectCount(String customerId, String monthId, String level);
/**
* @Description 查询难点赌点基础信息
* @param customerId

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import java.util.List;
@ -90,4 +91,25 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @Date 2020/9/24 15:49
**/
Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty);
/**
* 网格内话题数
* @author zhaoqifeng
* @date 2020/9/27 15:05
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridTopicCount(String customerId, String monthId);
/**
* 组织内话题数
* @author zhaoqifeng
* @date 2020/9/27 15:05
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgTopicCount(String customerId, String monthId, String level);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java

@ -18,10 +18,11 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
@ -108,11 +109,26 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
* @date 2020/9/25 9:46 上午
*/
@Override
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId,List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)){
public List<ScreenPartyLinkMassesDataFormDTO> selectPartyCreateGroupInfo(String customerId, String monthId, List<String> gridIds) {
if (!CollectionUtils.isEmpty(gridIds)) {
return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds);
}
return new ArrayList<>();
}
@Override
public List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId, String groupField) {
return baseDao.selectDistinctGroupMemberCount(customerId, groupField);
}
@Override
public List<OrgStatisticsResultDTO> getGridGroupCount(String customerId, String monthId) {
return baseDao.selectGridGroupCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level) {
return baseDao.selectOrgGroupCount(customerId, monthId, level);
}
}

53
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java

@ -19,22 +19,34 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.stats.DimAgencyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 议题记录附表
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
@Slf4j
@DataSource(DataSourceConstant.STATS)
@Service
public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOriginIssueLogDailyDao, FactOriginIssueLogDailyEntity> implements FactOriginIssueLogDailyService {
@Autowired
private DimAgencyService dimAgencyService;
/**
* @param customerId
@ -51,4 +63,41 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOrig
public int calPartyPartiIssueTotal(String customerId, String gridId, String communityId, String agencyPath, String isParty) {
return baseDao.calPartyPartiIssueTotal(customerId,gridId,communityId,agencyPath,isParty);
}
/**
* @param orgType 组织类别 agency组织网格grid部门department
* @param orgId 组织Id 可以为网格id
* @return int
* @author yinzuomei
* @description 参与人数: 议题的表决行为的用户数去重的累计值
* @Date 2020/9/27 14:06
**/
@Override
public int queryJoinUserTotal(String customerId, String orgType, String orgId) {
if (OrgTypeConstant.GRID.equals(orgType)) {
return baseDao.selectCountJoinUserTotal(customerId, orgId, null);
} else {
//拼接pids,
DimAgencyDTO dimAgencyDTO = dimAgencyService.get(orgId);
if (null == dimAgencyDTO) {
log.error(String.format("根据agencyId=%s,查询dim_agency 返回null", orgId));
} else {
String pids;
if(NumConstant.ZERO_STR.equals(dimAgencyDTO.getPid())){
//如果是根基组织,不需要拼接:
pids=dimAgencyDTO.getId();
}else{
pids = dimAgencyDTO.getPids().concat(StrConstant.COLON).concat(dimAgencyDTO.getId());
}
return baseDao.selectCountJoinUserTotal(customerId, null, pids);
}
}
return NumConstant.ZERO;
}
@Override
public List<IssueVoteUserCountResultDTO> getVoteCount(String customerId, String monthId, String groupField) {
return baseDao.getVoteCount(customerId, monthId, groupField);
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java

@ -21,11 +21,14 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 议题主表
*
@ -114,4 +117,14 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
public Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) {
return baseDao.getAgencyShiftProjectTotal(customerId,agencyPath);
}
@Override
public List<OrgStatisticsResultDTO> getGridIssueCount(String customerId, String monthId) {
return baseDao.selectGridIssueCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgIssueCount(String customerId, String monthId, String level) {
return baseDao.selectOrgIssueCount(customerId, monthId, level);
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java

@ -277,5 +277,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectOrgResponse(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getGridSatisfaction(String customerId, String monthId) {
return baseDao.selectGridSatisfaction(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level) {
return baseDao.selectOrgSatisfaction(customerId, monthId, level);
}
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -215,6 +215,16 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
return baseDao.getGridResolveProject(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId) {
return baseDao.getGridProjectCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgProjectCount(String customerId, String monthId, String level) {
return baseDao.getOrgProjectCount(customerId, monthId, level);
}
/**
* @Description 查询难点赌点基础信息
* @param customerId

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
@ -313,4 +314,14 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
return baseDao.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty);
}
@Override
public List<OrgStatisticsResultDTO> getGridTopicCount(String customerId, String monthId) {
return baseDao.selectGridTopicCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgTopicCount(String customerId, String monthId, String level) {
return baseDao.selectOrgTopicCount(customerId, monthId, level);
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java

@ -128,7 +128,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(pid -> {
if (r.getAgencyId().equals(pid.getAgencyId())){
r.setPid(pid.getPid());
r.setPids(pid.getPids().concat(":").concat(pid.getPid()));
r.setPids(pid.getPids().concat(":").concat(r.getAgencyId()));
}
});
});
@ -227,7 +227,7 @@ public class IssueExtractServiceImpl implements IssueExtractService {
agencyInfoList.forEach(agency -> {
if (r.getAgencyId().equals(agency.getAgencyId())){
r.setPid(agency.getPid());
r.setPids(agency.getPids());
r.setPids(agency.getPids().concat(":").concat(r.getAgencyId()));
}
});
});

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java

@ -0,0 +1,41 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/27 9:37
*/
public interface OrgRankExtractService {
/**
* 网格先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:16
*/
void extractGridData(String customerId, String monthId);
/**
* 社区先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractCommunityData(String customerId, String monthId);
/**
* 街道先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java

@ -0,0 +1,19 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* screen_public_parti_total_data
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计
* @author yinzuomei@elink-cn.com
* @date 2020/9/27 11:09
*/
public interface PublicPartiTotalDataExtractService {
/**
* 按天统计
*
* @param customerId 客户id
* @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd
* @return
*/
void extractPublicPartiTotalData(String customerId,String dateId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenExtractService.java

@ -1,6 +1,7 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
/**
* @Author zxc
@ -16,4 +17,12 @@ public interface ScreenExtractService {
*/
void extractDailyAll(ExtractOriginFormDTO extractOriginFormDTO);
/**
* @param formDTO
* @Description 抽取数据到大屏
* @author zxc
* @date 2020/9/24 10:15 上午
*/
void extractMonthlyAll(ExtractScreenFormDTO formDTO);
}

182
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java

@ -50,38 +50,57 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自治率
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
//自治率
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
if(grid.getResolveProjectCount()!= NumConstant.ZERO) {
entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
if (!CollectionUtils.isEmpty(gridList)) {
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
if (grid.getResolveProjectCount() != NumConstant.ZERO) {
entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@ -92,39 +111,58 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@ -134,39 +172,57 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
}

260
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java

@ -0,0 +1,260 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/27 9:37
*/
@Service
@Slf4j
public class OrgRankExtractServiceImpl implements OrgRankExtractService {
@Autowired
private ScreenOrgRankDataService screenOrgRankDataService;
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserGridMonthlyDTO> partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getProjectTotal() != NumConstant.ZERO) {
BigDecimal total = new BigDecimal(dto.getProjectTotal());
BigDecimal closed = new BigDecimal(dto.getResolveProjectCount());
entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractCommunityData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractStreetData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
}

211
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java

@ -1,8 +1,8 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ScreenConstant;
import com.epmet.dto.extract.form.ScreenExtractFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
@ -76,7 +76,7 @@ public class PartyGuideServiceImpl implements PartyGuideService {
}
String monthId = screenExtractFormDTO.getMonthId();
if (StringUtils.isEmpty(monthId)){
monthId = LocalDate.now().toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
monthId = LocalDate.now().minusMonths(NumConstant.ONE).toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX);
}
if (!CollectionUtils.isEmpty(customerIds)){
String finalMonthId = monthId;
@ -271,55 +271,78 @@ public class PartyGuideServiceImpl implements PartyGuideService {
*/
public void disPoseOrganize(List<CustomerAgencyInfoResultDTO> agencyIdList, Boolean isGrid, String customerId, String monthId){
if (!CollectionUtils.isEmpty(agencyIdList)){
List<ScreenPartyBranchDataFormDTO> result = new ArrayList<>();
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
List<String> orgIds = new ArrayList<>();
List<String> orgIdsAgency = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList());
orgIds.addAll(orgIdsAgency);
orgIdsAgency.forEach(orgId -> {
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(orgId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(orgId);
orgIds.addAll(gridIds);
});
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIdsAgency);
if (isGrid == false){
orgIds.addAll(directGridIds.stream().map(m -> m.getGridId()).collect(Collectors.toList()));
}
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId, null);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByAgencyList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.AGENCY, orgIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataListAgencyAll = gridService.selectAllGridIdToOrganize(customerId, monthId);
screenPartyBranchDataListAgencyAll.addAll(screenPartyBranchData);
List<ScreenPartyBranchDataFormDTO> finalResult = new ArrayList<>();
screenPartyBranchDataListAgencyAll.forEach(rl -> {
orgIds.forEach(orgId -> {
if (rl.getOrgId().equals(orgId)){
finalResult.add(rl);
}
});
});
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, null, orgIds);
if (isGrid == true){
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
Map<String, Object> agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId);
List<String> gridIds = (List<String>) agencyMap.get(agencyId);
orgIds.addAll(gridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, gridIds);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
screenPartyBranchDataList.forEach(party -> {
joinUserCountList.forEach(join -> {
if (party.getOrgId().equals(join.getOrgId())){
party.setAverageJoinUserCount(join.getJoinUserCount());
party.setAverageJoinUserCount(party.getJoinUserCount() / party.getOrganizeCount());
party.setYearId(DateUtils.getYearId(monthId));
}
});
finalResult.forEach(fl -> {
screenPartyBranchDataList.forEach(sp -> {
if (fl.getOrgId().equals(sp.getOrgId())){
fl.setOrganizeCount(sp.getOrganizeCount());
}
});
}
result.addAll(screenPartyBranchDataList);
joinUserCountList.forEach(join -> {
if (fl.getOrgId().equals(join.getOrgId())){
fl.setJoinUserCount(join.getJoinUserCount());
}
});
fl.setAverageJoinUserCount(fl.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : fl.getJoinUserCount() / fl.getOrganizeCount());
});
});
// 社区级别的
Map<String, List<ScreenPartyBranchDataFormDTO>> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId));
List<OrgNameResultDTO> orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds);
groupByAgency.forEach((agencyId,actList) -> {
ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO();
if (!CollectionUtils.isEmpty(orgNameAgencyList)){
orgNameAgencyList.forEach(name -> {
if (agencyId.equals(name.getAgencyId())){
form.setOrgName(name.getAgencyName());
form.setParentId(name.getParentId());
}
Map<String, List<ScreenPartyBranchDataFormDTO>> groupByType = finalResult.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getOrgType));
groupByType.forEach((orgType,list) -> {
if (orgType.equals(ScreenConstant.GRID)){
Map<String, List<ScreenPartyBranchDataFormDTO>> groupByAgency = finalResult.stream().collect(Collectors.groupingBy(ScreenPartyBranchDataFormDTO::getParentId));
groupByAgency.forEach((agencyId,actList) -> {
finalResult.forEach(fl -> {
if (fl.getOrgId().equals(agencyId)){
fl.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
fl.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
screenPartyBranchDataByAgencyList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)){
fl.setOrganizeCount(calAdd(organize.getOrganizeCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountList.forEach(join -> {
if (join.getOrgId().equals(agencyId)){
fl.setJoinUserCount(calAdd(join.getJoinUserCount(),actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
fl.setAverageJoinUserCount(fl.getOrganizeCount()==NumConstant.ZERO?NumConstant.ZERO : (fl.getJoinUserCount() / fl.getOrganizeCount()));
}
});
});
}
form.setOrgId(agencyId);
form.setCustomerId(customerId);
form.setOrgType(ScreenConstant.AGENCY);
form.setMonthId(monthId);
form.setYearId(DateUtils.getYearId(monthId));
form.setOrganizeCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
form.setJoinUserCount(actList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount());
result.add(form);
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
delOrganize(customerId,monthId,orgIds);
insertOrganize(finalResult);
}else {
List<GridInfoResultDTO> directGridIds = gridService.selectDirectGrid(orgIds);
agencyIdList.forEach(agency -> {
String agencyId = agency.getAgencyId();
List<String> disGridIds = new ArrayList<>();
@ -330,45 +353,57 @@ public class PartyGuideServiceImpl implements PartyGuideService {
});
// 存在直属网格
if (!CollectionUtils.isEmpty(disGridIds)){
List<ScreenPartyBranchDataFormDTO> gridResult = new ArrayList<>();
List<JoinUserCountResultDTO> joinUserCountList = actUserRelationService.selectJoinUserCount(customerId, monthId);
List<OrgNameResultDTO> orgNameList = agencyService.selectOrgNameGrid(disGridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = actInfoService.selectActInfo(customerId, monthId, ScreenConstant.GRID, disGridIds);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
screenPartyBranchDataList.forEach(party -> {
orgNameList.forEach(org -> {
if (party.getOrgId().equals(org.getGridId())){
party.setOrgName(org.getGridName());
}
});
ScreenPartyBranchDataFormDTO copyParty = ConvertUtils.sourceToTarget(party, ScreenPartyBranchDataFormDTO.class);
gridResult.add(copyParty);
orgIds.addAll(disGridIds);
finalResult.forEach(r -> {
screenPartyBranchDataList.forEach(party ->{
if (r.getOrgId().equals(party.getOrgId())){
r.setOrganizeCount(party.getOrganizeCount());
}
});
}
joinUserCountList.forEach(join -> {
if (r.getOrgId().equals(join.getOrgId())){
r.setJoinUserCount(join.getJoinUserCount());
}
});
r.setAverageJoinUserCount(r.getOrganizeCount()==NumConstant.ZERO ? NumConstant.ZERO : r.getJoinUserCount() / r.getOrganizeCount());
});
}
delOrganize(customerId,monthId,orgIds);
List<ScreenPartyBranchDataFormDTO> disPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByOrgId(customerId, monthId, disGridIds);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId);
screenPartyBranchDataList.addAll(disPartyBranchDataList);
if (!CollectionUtils.isEmpty(screenPartyBranchDataList)){
ScreenPartyBranchDataFormDTO form = new ScreenPartyBranchDataFormDTO();
form.setOrgId(agencyId);
form.setOrgType(ScreenConstant.AGENCY);
form.setOrgName(screenPartyBranchDataList.get(NumConstant.ZERO).getOrgName());
form.setCustomerId(customerId);
form.setMonthId(monthId);
form.setYearId(DateUtils.getYearId(monthId));
form.setParentId(screenPartyBranchDataList.get(NumConstant.ZERO).getParentId());
form.setJoinUserCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setOrganizeCount(screenPartyBranchDataList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
form.setAverageJoinUserCount(form.getJoinUserCount() / form.getOrganizeCount());
result.add(form);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataByParentList = partyBranchDataService.selectScreenPartyBranchDataByParentId(customerId, monthId, agencyId);
screenPartyBranchDataByParentList.addAll(disPartyBranchDataList);
if (!CollectionUtils.isEmpty(screenPartyBranchDataByParentList)){
finalResult.forEach(form -> {
if (form.getOrgId().equals(agencyId)) {
form.setJoinUserCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount)));
form.setOrganizeCount(screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount)));
screenPartyBranchDataByParentList.forEach(organize -> {
if (organize.getOrgId().equals(agencyId)) {
form.setOrganizeCount(calAdd(organize.getOrganizeCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getOrganizeCount))));
}
});
joinUserCountList.forEach(join -> {
if (join.getOrgId().equals(agencyId)) {
form.setJoinUserCount(calAdd(join.getJoinUserCount(), screenPartyBranchDataByParentList.stream().collect(Collectors.summingInt(ScreenPartyBranchDataFormDTO::getJoinUserCount))));
}
});
form.setAverageJoinUserCount(form.getOrganizeCount() == NumConstant.ZERO ? NumConstant.ZERO : (form.getJoinUserCount() / form.getOrganizeCount()));
}
});
}
});
delAndInsertOrganize(result,customerId,monthId,orgIds);
insertOrganize(finalResult);
}
}
}
public Integer calAdd(Integer a, Integer b){
if (null != a && null != b){
return a + b;
}
return NumConstant.ZERO;
}
/**
* @Description 社区级别的处理
* @Param customerId
@ -447,35 +482,19 @@ public class PartyGuideServiceImpl implements PartyGuideService {
* @date 2020/9/25 5:50 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertOrganize(List<ScreenPartyBranchDataFormDTO> result,String customerId, String monthId, List<String> orgIds){
List<ScreenPartyBranchDataFormDTO> screenPartyBranchData = agencyService.selectAllAgencyIdToOrganize(customerId, monthId);
List<ScreenPartyBranchDataFormDTO> screenPartyBranchDataList = gridService.selectAllGridIdToOrganize(customerId, monthId);
screenPartyBranchDataList.addAll(screenPartyBranchData);
List<ScreenPartyBranchDataFormDTO> finalResult = new ArrayList<>();
screenPartyBranchDataList.forEach(rl -> {
orgIds.forEach(orgId -> {
if (rl.getOrgId().equals(orgId)){
finalResult.add(rl);
}
});
public void insertOrganize(List<ScreenPartyBranchDataFormDTO> result){
List<List<ScreenPartyBranchDataFormDTO>> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
partyBranchDataService.insertScreenPartyBranchData(p);
});
if (!CollectionUtils.isEmpty(result)){
finalResult.forEach(fr -> {
result.forEach(r -> {
if (fr.getOrgId().equals(r.getOrgId())){
BeanUtils.copyProperties(r,fr);
}
});
});
}
}
@Transactional(rollbackFor = Exception.class)
public void delOrganize(String customerId, String monthId, List<String> orgIds){
Integer delNum;
do {
delNum = partyBranchDataService.deleteOldScreenPartyBranchData(customerId, monthId, orgIds);
}while (delNum > NumConstant.ZERO);
List<List<ScreenPartyBranchDataFormDTO>> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
partyBranchDataService.insertScreenPartyBranchData(p);
});
}
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java

@ -2,7 +2,9 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
@ -53,13 +55,14 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractGridPioneerData(String customerId, String dateId) {
//查询客户下所有的网格,初始数据值为0
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid");
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.GRID);
if (CollectionUtils.isEmpty(gridList)) {
return;
}
gridList.forEach(entity -> {
entity.setDataEndTime(dateId);
String gridId = entity.getOrgId();
//何为参与: 议题的表决行为次数总计
//1、党员参与议事
entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR));
if(entity.getIssueTotal()==0){
@ -106,7 +109,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved"));
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -115,7 +118,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", IndexCalConstant.DELETE_SIZE, gridList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.GRID, IndexCalConstant.DELETE_SIZE, gridList);
}
/**
@ -140,7 +143,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的社区,初始数据值为0
List<ScreenPioneerDataEntity> communityList = screenPioneerDataService.initPioneerDataList(customerId, "community");
List<ScreenPioneerDataEntity> communityList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(communityList)) {
return;
}
@ -193,7 +196,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved"));
entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -202,14 +205,14 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList);
}
@Override
public void extractExceptCommunityPioneerData(String customerId, String dateId) {
//查询客户下所有的组织(社区除外),初始数据值为0
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency");
List<ScreenPioneerDataEntity> agencyList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.AGENCY);
if (CollectionUtils.isEmpty(agencyList)) {
return;
}
@ -266,7 +269,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
// 9、已解决项目
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved"));
entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED));
if (entity.getResolvedProjectTotal() == NumConstant.ZERO) {
entity.setResolvedProjectRatio(BigDecimal.ZERO);
} else {
@ -275,7 +278,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList);
screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList);
}

147
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java

@ -6,28 +6,36 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity;
import com.epmet.entity.stats.FactIssueGridMonthlyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService;
import com.epmet.service.evaluationindex.screen.ScreenUserJoinService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimGridService;
import com.epmet.service.stats.FactIssueAgencyMonthlyService;
import com.epmet.service.stats.FactIssueGridMonthlyService;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -48,6 +56,16 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
private FactIssueGridMonthlyService factIssueGridMonthlyService;
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
@Autowired
private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService;
@Autowired
private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
@Autowired
private ScreenUserJoinService screenUserJoinService;
/**
@ -55,7 +73,8 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
* targetscreen_user_join
* 总参与统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数
* 百人人均议题统计周期内总的议题数/注册用户数/100
* 百人平均参与度每个议题的实际参与数/应参与数 的平均值每个议题的实际参与数/应参与数的和/被表决的议题数
* 百人平均参与度每个议题的实际参与数/应参与数 的平均值每个议题的实际参与数/应参与数的和/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据
*
* 不考虑市北人均议题统计周期内议题总数/发过议题的人数 参与度各个行为(表决)的总数/发生行为的人数
*
* @return java.lang.Boolean
@ -83,7 +102,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
Map<String, ScreenUserJoinEntity> insertMap = new HashMap<>();
orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap));
//获取议题月份增量
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId());
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取议题增量为空");
return;
@ -93,24 +112,60 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getGridId, o -> o));
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o));
issueTotal.forEach(issue -> {
String gridId = issue.getGridId();
ScreenUserJoinEntity entity = insertMap.get(gridId);
entity.setJoinTotal(issue.getIssueIncr());
GridUserCountResultDTO user = userCountMap.get(gridId);
//百人人均议题:统计周期内总的议题数/(注册用户数/100)
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getUserCount()).divide(new BigDecimal(NumConstant.ONE_HUNDRED)));
// 需要修改字段类型
entity.setAvgIssue(avgIssueCount);
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
log.debug("issue:{}", JSON.toJSONString(issue));
log.debug("user:{}", JSON.toJSONString(user));
if (!user.getRegTotal().equals(0)) {
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal())
.divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP);
entity.setAvgIssue(avgIssueCount);
}
});
entity.setAvgJoin(new BigDecimal(0));
});
//获取该月 表决的人数
List<IssueVoteUserCountResultDTO> voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.GRID_ID);
Map<String, Integer> gridMemberCount = new HashMap<>();
if (!CollectionUtils.isEmpty(issueTotal)) {
//获取每个网格的应表决人数
List<GridGroupUserCountResultDTO> memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID);
if (CollectionUtils.isEmpty(memberCountList)) {
log.error("抽取【公众参与-人均议题】,获取应表决人数为空");
return;
}
gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount()));
}
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
//遍历实际参与人数
Map<String, List<IssueVoteUserCountResultDTO>> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId));
for (Map.Entry<String, List<IssueVoteUserCountResultDTO>> entry : voteMap.entrySet()) {
String gridId = entry.getKey();
ScreenUserJoinEntity entity = insertMap.get(gridId);
List<IssueVoteUserCountResultDTO> issueList = entry.getValue();
BigDecimal bigDecimal = new BigDecimal(0);
BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount());
for (IssueVoteUserCountResultDTO vote : issueList) {
Integer memberCount = gridMemberCount.get(gridId);
if (memberCount == null) {
memberCount = 0;
}
if (memberCount != 0) {
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0)));
}
}
if (votedByIssueCount.intValue() != 0) {
entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
}
}
screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()));
}
private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) {
@ -121,14 +176,72 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
}
//构建组织数据
Map<String, ScreenUserJoinEntity> insertMap = new HashMap<>();
orgList.forEach(org -> {
buildUserJoinEntity(formDTO, org, insertMap);
orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap));
List<FactIssueAgencyMonthlyEntity> issueTotal = factIssueAgencyMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());
List<GridUserCountResultDTO> userCountList = factRegUserAgencyMonthlyService.selectAgencyUserCount(formDTO.getCustomerId(), formDTO.getMonthId());
if (CollectionUtils.isEmpty(issueTotal)) {
log.error("抽取【公众参与-人均议题】,获取注册用户数为空");
return;
}
Map<String, GridUserCountResultDTO> userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o));
Set<String> agencyIdSet = new HashSet<>();
issueTotal.forEach(issue -> {
String agencyId = issue.getAgencyId();
agencyIdSet.add(agencyId);
ScreenUserJoinEntity entity = insertMap.get(agencyId);
entity.setJoinTotal(issue.getIssueIncr());
GridUserCountResultDTO user = userCountMap.get(agencyId);
//百人人均议题:统计周期内总的议题数/(注册用户数/100)
if (!user.getRegTotal().equals(0)) {
BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal())
.divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP);
entity.setAvgIssue(avgIssueCount);
}
});
List<List<String>> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY);
partition.forEach(list -> {
//获取该月 表决的人数
List<IssueVoteUserCountResultDTO> voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.AGENCY_ID);
Map<String, Integer> orgMemberCount = new HashMap<>();
if (!CollectionUtils.isEmpty(issueTotal)) {
//获取每个网格的应表决人数
List<GridGroupUserCountResultDTO> memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID);
if (CollectionUtils.isEmpty(memberCountList)) {
log.error("抽取【公众参与-人均议题】,获取应表决人数为空");
return;
}
orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount()));
}
//百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数
//遍历实际参与人数
Map<String, List<IssueVoteUserCountResultDTO>> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId));
for (Map.Entry<String, List<IssueVoteUserCountResultDTO>> entry : voteMap.entrySet()) {
String orgId = entry.getKey();
ScreenUserJoinEntity entity = insertMap.get(orgId);
List<IssueVoteUserCountResultDTO> issueList = entry.getValue();
BigDecimal bigDecimal = new BigDecimal(0);
BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount());
for (IssueVoteUserCountResultDTO vote : issueList) {
Integer memberCount = orgMemberCount.get(orgId);
if (memberCount == null) {
memberCount = 0;
}
bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0)));
}
if (votedByIssueCount.intValue() != 0) {
entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
}
}
});
List<FactIssueGridMonthlyEntity> issueTotal = factIssueGridMonthlyService.getIssueCount(formDTO.getCustomerId(), formDTO.getMonthId());
screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()));
}
private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map<String, ScreenUserJoinEntity> result) {
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMMDD));
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM));
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class);
if (org instanceof DimGridEntity) {
DimGridEntity grid = (DimGridEntity) org;

61
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java

@ -0,0 +1,61 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartiTotalDataExtractService;
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService;
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* screen_public_parti_total_data
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计
* @author yinzuomei@elink-cn.com
* @date 2020/9/27 11:09
*/
@Slf4j
@Service
public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalDataExtractService {
@Autowired
private ScreenUserTotalDataService screenUserTotalDataService;
@Autowired
private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService;
@Autowired
private FactOriginIssueLogDailyService factOriginIssueLogDailyService;
/**
* 按天统计
*
* @param customerId 客户id
* @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd
* @return
*/
@Override
public void extractPublicPartiTotalData(String customerId, String dateId) {
List<ScreenUserTotalDataEntity> userTotalDataEntityList = screenUserTotalDataService.selectList(customerId);
if (CollectionUtils.isEmpty(userTotalDataEntityList)) {
log.warn("screen_user_total_data dosen't have any record customerId="+customerId);
return;
}
List<ScreenPublicPartiTotalDataEntity> list = new ArrayList<>();
for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) {
ScreenPublicPartiTotalDataEntity entity = ConvertUtils.sourceToTarget(totalData,ScreenPublicPartiTotalDataEntity.class);
entity.setDataEndTime(dateId);
entity.setRegUserTotal(totalData.getUserTotal());
//参与人数参与人数: 议题的表决行为的用户数去重的累计值
int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId());
entity.setJoinUserTotal(joinUserTotal);
list.add(entity);
}
//先删除,后插入
screenPublicPartiTotalDataService.delAndInsertBatch(customerId, list);
}
}

56
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -3,8 +3,10 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.PartyBaseInfoService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenExtractService;
import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
@ -31,6 +33,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private PartyBaseInfoService partyBaseInfoService;
@Autowired
private PioneerDataExtractService pioneerDataExtractService;
@Autowired
private PublicPartExtractService publicPartExtractService;
/**
* @param extractOriginFormDTO
@ -66,17 +70,59 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}
@Override
public void extractMonthlyAll(ExtractScreenFormDTO formDTO) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCustomerId())) {
customerIds.add(formDTO.getCustomerId());
} else {
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
}
if (!CollectionUtils.isEmpty(customerIds)) {
customerIds.forEach(customerId -> {
if (StringUtils.isNotBlank(formDTO.getStartMonth()) && StringUtils.isNotBlank(formDTO.getEndMonth())) {
List<String> daysBetween = DateUtils.getMonthBetween(formDTO.getStartDate(), formDTO.getEndDate());
daysBetween.forEach(monthId -> {
extractMonthly(customerId, monthId);
});
} else if (StringUtils.isNotBlank(formDTO.getMonthId())) {
extractMonthly(customerId, formDTO.getMonthId());
} else {
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
extractMonthly(customerId, dateId);
}
});
}
}
/**
* @Description 按天计算
* @param customerId
* @param dateId
* @Description 按天计算
* @author zxc
* @date 2020/9/24 10:16 上午
*/
public void extractDaily(String customerId,String dateId){
public void extractDaily(String customerId, String dateId) {
// partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId,dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId,dateId);
pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
}
/**
* @Description 按月计算
* @author zxc
* @date 2020/9/24 10:16 上午
*/
public void extractMonthly(String customerId, String monthId) {
ExtractScreenFormDTO formDTO = new ExtractScreenFormDTO();
formDTO.setCustomerId(customerId);
formDTO.setMonthId(monthId);
publicPartExtractService.extractTotalDataMonthly(formDTO);
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java

@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import java.util.List;
/**
* 党建引领-组织先进排行榜
*
@ -27,4 +29,31 @@ import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenOrgRankDataService extends BaseService<ScreenOrgRankDataEntity> {
/**
* 构造screen_govern_rank_data 初始数据先赋值为0
*
* @param customerId
* @param orgType
* @param agencyLevel
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
* @author zhaoqifeng
* @date 2020/9/24 14:41
*/
List<ScreenOrgRankDataEntity> initList(String customerId, String orgType, String agencyLevel);
/**
* 保存抽取结果
*
* @param customerId
* @param orgType
* @param monthId
* @param deleteSize
* @param entityList
* @return void
* @author zhaoqifeng
* @date 2020/9/25 10:32
*/
void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List<ScreenOrgRankDataEntity> entityList);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java

@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import java.util.List;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
*
@ -28,4 +30,13 @@ import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenPublicPartiTotalDataService extends BaseService<ScreenPublicPartiTotalDataEntity> {
/**
* @return void
* @param customerId
* @param list screen_public_parti_total_data 记录
* @author yinzuomei
* @description 先删除后插入
* @Date 2020/9/27 13:51
**/
void delAndInsertBatch(String customerId, List<ScreenPublicPartiTotalDataEntity> list);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java

@ -19,8 +19,11 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import java.util.List;
/**
* 基层治理-公众参与
*
@ -28,4 +31,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenUserJoinService extends BaseService<ScreenUserJoinEntity> {
/**
* desc: 删除并插入某月的数据
*
* @param formDTO
* @param list
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/9/27 4:40 下午
*/
Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List<ScreenUserJoinEntity> list);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java

@ -40,4 +40,13 @@ public interface ScreenUserTotalDataService extends BaseService<ScreenUserTotalD
* @date 2020.09.24 17:59
**/
void dataClean(List<ScreenUserTotalDataEntity> list,String customerId);
/**
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity>
* @param customerId
* @author yinzuomei
* @description 根据条件查询screen_user_total_data表
* @Date 2020/9/27 11:18
**/
List<ScreenUserTotalDataEntity> selectList(String customerId);
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java

@ -18,12 +18,21 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenOrgRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 党建引领-组织先进排行榜
*
@ -31,7 +40,45 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22
*/
@Service
@Slf4j
public class ScreenOrgRankDataServiceImpl extends BaseServiceImpl<ScreenOrgRankDataDao, ScreenOrgRankDataEntity> implements ScreenOrgRankDataService {
@Override
@DataSource(DataSourceConstant.STATS)
public List<ScreenOrgRankDataEntity> initList(String customerId, String orgType, String agencyLevel) {
List<ScreenOrgRankDataEntity> list = new ArrayList<>();
switch (orgType) {
case OrgTypeConstant.AGENCY:
log.info("组织级别统计");
list = baseDao.initAgencyDataList(customerId, agencyLevel);
break;
case OrgTypeConstant.GRID:
log.info("网格级别统计");
list = baseDao.initGridDataList(customerId);
break;
default:
log.info("部门级别统计");
break;
}
return list;
}
@Override
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List<ScreenOrgRankDataEntity> entityList) {
if (CollectionUtils.isEmpty(entityList)) {
return;
}
List<String> orgIds = new ArrayList<>();
for (ScreenOrgRankDataEntity entity : entityList) {
orgIds.add(entity.getOrgId());
}
int deleteNum;
do {
deleteNum = baseDao.deleteRankData(customerId, orgType, monthId, deleteSize, orgIds);
} while (deleteNum != NumConstant.ZERO);
insertBatch(entityList);
}
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java

@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
@ -58,13 +59,13 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl<ScreenPioneerD
@Override
public List<ScreenPioneerDataEntity> initPioneerDataList(String customerId, String orgType) {
List<ScreenPioneerDataEntity> list = new ArrayList<>();
if ("grid".equals(orgType)) {
if (OrgTypeConstant.GRID.equals(orgType)) {
//按网格构造
list = baseDao.initGridPioneerDataList(customerId);
} else if ("community".equals(orgType)) {
} else if (OrgTypeConstant.COMMUNITY.equals(orgType)) {
//按社构造
list = baseDao.initCommunityPioneerDataList(customerId);
}else if("agency".equals(orgType)){
}else if(OrgTypeConstant.AGENCY.equals(orgType)){
list = baseDao.initExceptCommunityPioneerDataList(customerId);
}
return list;

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java

@ -18,11 +18,20 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.screen.ScreenPublicPartiTotalDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
@ -34,4 +43,29 @@ import org.springframework.stereotype.Service;
public class ScreenPublicPartiTotalDataServiceImpl extends BaseServiceImpl<ScreenPublicPartiTotalDataDao, ScreenPublicPartiTotalDataEntity> implements ScreenPublicPartiTotalDataService {
/**
* @param customerId
* @param entityList screen_public_parti_total_data 记录
* @return void
* @author yinzuomei
* @description 先删除后插入
* @Date 2020/9/27 13:51
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
@Transactional(rollbackFor = Exception.class)
@Override
public void delAndInsertBatch(String customerId, List<ScreenPublicPartiTotalDataEntity> entityList) {
if(CollectionUtils.isEmpty(entityList)){
return;
}
int deleteNum=0;
do{
//沿用原来项目采集的删除方法,一次删除1000
deleteNum=baseDao.deletePublicPartiTotalData(customerId);
}while (deleteNum!= NumConstant.ZERO);
List<List<ScreenPublicPartiTotalDataEntity>> partionList= ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE);
partionList.forEach(list->{
baseDao.insertBatchEntity(list);
});
}
}

157
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java

@ -18,11 +18,27 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.CompareConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenUserJoinDao;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.service.evaluationindex.screen.ScreenUserJoinService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* 基层治理-公众参与
@ -30,8 +46,149 @@ import org.springframework.stereotype.Service;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-22
*/
@Slf4j
@Service
public class ScreenUserJoinServiceImpl extends BaseServiceImpl<ScreenUserJoinDao, ScreenUserJoinEntity> implements ScreenUserJoinService {
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Transactional(rollbackFor = Exception.class)
public Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List<ScreenUserJoinEntity> list) {
if (formDTO == null || StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId()) || CollectionUtils.isEmpty(list)) {
log.error("deleteAndInsertBatch param is error");
return false;
}
int deleteNum;
do {
deleteNum = baseDao.deleteUserJoin(formDTO.getCustomerId(), formDTO.getMonthId());
} while (deleteNum != NumConstant.ZERO);
String[] orgIds = new String[list.size()];
for (int i = NumConstant.ZERO; i < list.size(); i++) {
orgIds[i] = list.get(i).getOrgId();
}
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.addDateMonths(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM), -1));
// 获取上个月的基本数据
List<ScreenUserJoinEntity> lastMonthJoinList = baseDao.selectLastMonthScreenUserJoinList(formDTO.getCustomerId(),
dimIdBean.getYearId(),
dimIdBean.getMonthId(),
orgIds);
// 定义本月待添加数据的集合
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>();
// 增加率计算
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) {
// 存在上个月的数据 (本月-上月)/上月 *100
for (int i = NumConstant.ZERO; i < list.size(); i++) {
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) {
if (list.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())) {
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(list.get(i), ScreenUserJoinEntity.class);
entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), list.get(j).getJoinTotal()));
entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), list.get(j).getJoinTotal()));
entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), list.get(j).getAvgIssue()));
entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), list.get(j).getAvgIssue()));
entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), list.get(j).getAvgJoin()));
entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), list.get(j).getAvgJoin()));
curMonthJoinEntityList.add(entity);
}
}
}
} else {
// 计算增长率后的 待新增数据
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
// 不存在上个月的数据
for (int i = NumConstant.ZERO; i < list.size(); i++) {
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(list.get(i), ScreenUserJoinEntity.class);
entity.setJoinTotalUpRate(zero);
entity.setJoinTotalUpFlag("");
entity.setAvgIssueUpRate(zero);
entity.setAvgIssueUpFlag("");
entity.setAgvgJoinUpRate(zero);
entity.setAgvgJoinUpFlag("");
curMonthJoinEntityList.add(entity);
}
}
this.insertBatch(list, NumConstant.ONE_HUNDRED);
return true;
}
/**
* 计算 本月数值 相较于 上月数值的增长率
*
* @param old 上月数值
* @param now 本月数值
* @return java.math.BigDecimal
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private BigDecimal calculateGrowthRateNumber(Integer old, Integer now) {
if (NumConstant.ZERO == old) {
return new BigDecimal(now * NumConstant.ONE_HUNDRED);
}
BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED);
BigDecimal bignum2 = bignum1.divide(new BigDecimal(old), 2, BigDecimal.ROUND_HALF_UP);
return bignum2;
}
/**
* 计算 本月数值 相较于 上月数值的增长率
*
* @param old 上月数值
* @param now 本月数值
* @return java.math.BigDecimal
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private BigDecimal calculateGrowthRateNumber(BigDecimal old, BigDecimal now) {
BigDecimal oneHundred = new BigDecimal(NumConstant.ONE_HUNDRED);
if (old.compareTo(new BigDecimal(NumConstant.ZERO)) == NumConstant.ZERO) {
return now.multiply(oneHundred);
}
BigDecimal bignum1 = now.subtract(old).multiply(oneHundred);
BigDecimal bignum2 = bignum1.divide(old, 2, BigDecimal.ROUND_HALF_UP);
return bignum2;
}
/**
* 计算 本月数值 相较于 上月数值的增长率 得出标识
*
* @param old 上月数值
* @param now 本月数值
* @return java.util.String
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private String calculateGrowthRateFlag(Integer old, Integer now) {
if (old > now) {
return CompareConstant.DECR_STR;
} else if (old < now) {
return CompareConstant.INCR_STR;
} else {
return CompareConstant.EQ_STR;
}
}
/**
* 计算 本月数值 相较于 上月数值的增长率 得出标识
*
* @param old 上月数值
* @param now 本月数值
* @return java.util.String
* @Author zhangyong
* @Date 15:38 2020-08-21
**/
private String calculateGrowthRateFlag(BigDecimal old, BigDecimal now) {
if (old.compareTo(now) == 1) {
return CompareConstant.DECR_STR;
} else if (old.compareTo(now) == -1) {
return CompareConstant.INCR_STR;
} else {
return CompareConstant.EQ_STR;
}
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java

@ -25,7 +25,6 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenUserTotalDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -61,4 +60,16 @@ public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl<ScreenUserTo
baseDao.insertBatch(list);
}
}
/**
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity>
* @author yinzuomei
* @description 根据条件查询screen_user_total_data表
* @Date 2020/9/27 11:18
**/
@Override
public List<ScreenUserTotalDataEntity> selectList(String customerId) {
return baseDao.selectList(customerId);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActUserRelationService.java

@ -17,6 +17,6 @@ public interface ActUserRelationService {
* @author zxc
* @date 2020/9/25 5:19 下午
*/
List<JoinUserCountResultDTO> selectJoinUserCount(String customerId,String monthId);
List<JoinUserCountResultDTO> selectJoinUserCount(String customerId,String monthId, String orgType);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActUserRelationServiceImpl.java

@ -29,7 +29,7 @@ public class ActUserRelationServiceImpl implements ActUserRelationService {
* @date 2020/9/25 5:19 下午
*/
@Override
public List<JoinUserCountResultDTO> selectJoinUserCount(String customerId, String monthId) {
return actUserRelationDao.selectJoinUserCount(customerId, monthId);
public List<JoinUserCountResultDTO> selectJoinUserCount(String customerId, String monthId, String orgType) {
return actUserRelationDao.selectJoinUserCount(customerId, monthId, orgType);
}
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java

@ -115,10 +115,22 @@ public interface FactIssueAgencyMonthlyService extends BaseService<FactIssueAgen
/**
* 批量保存
* @author zhaoqifeng
* @date 2020/6/23 14:07
*
* @param list
* @return void
* @author zhaoqifeng
* @date 2020/6/23 14:07
*/
void saveList(List<FactIssueAgencyMonthlyEntity> list);
/**
* desc: 获取某月议题总数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.entity.stats.FactIssueGridMonthlyEntity>
* @author LiuJanJun
* @date 2020/9/27 3:30 下午
*/
List<FactIssueAgencyMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java

@ -79,5 +79,5 @@ public interface FactIssueGridMonthlyService extends BaseService<FactIssueGridMo
* @author LiuJanJun
* @date 2020/9/25 5:00 下午
*/
List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId);
List<FactIssueGridMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java

@ -117,4 +117,9 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl<FactIssue
insertBatch(list);
}
@Override
public List<FactIssueAgencyMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId) {
return baseDao.getIssueIncCountAndTotalByMonthId(customerId, monthId);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java

@ -74,7 +74,7 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl<FactIssueGr
* @date 2020/9/25 5:00 下午
*/
@Override
public List<FactIssueGridMonthlyEntity> getIssueCount(String customerId, String monthId) {
public List<FactIssueGridMonthlyEntity> getIssueIncCountAndTotalByMonthId(String customerId, String monthId) {
return baseDao.getIssueCount(customerId, monthId);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java

@ -19,10 +19,10 @@ package com.epmet.service.stats.user;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import java.util.List;
import java.util.Map;
@ -93,4 +93,27 @@ public interface FactRegUserAgencyMonthlyService extends BaseService<FactRegUser
* @date 2020-06-17
*/
void delete(String[] ids);
/**
* desc: 获取用户注册用户数 某月增量
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.GridUserCountResultDTO>
* @author LiuJanJun
* @date 2020/9/27 3:45 下午
*/
List<GridUserCountResultDTO> selectAgencyUserCount(String customerId, String monthId);
/**
* 查询机关下各用户数量
*
* @author zhaoqifeng
* @date 2020/9/27 14:02
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserAgencyMonthlyDTO> getOrgUserCountByCustomer(String customerId, String monthId, String level);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java

@ -103,4 +103,15 @@ public interface FactRegUserGridMonthlyService extends BaseService<FactRegUserGr
* @date 2020/9/19 11:10 上午
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId,String monthId);
/**
* 查询网格下各用户数量
*
* @author zhaoqifeng
* @date 2020/9/27 14:02
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserGridMonthlyDTO> getGridUserCountByCustomer(String customerId, String monthId);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java

@ -20,15 +20,15 @@ package com.epmet.service.stats.user.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.user.FactRegUserAgencyMonthlyDao;
import com.epmet.dto.extract.result.GridUserCountResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -99,4 +99,14 @@ public class FactRegUserAgencyMonthlyServiceImpl extends BaseServiceImpl<FactReg
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<GridUserCountResultDTO> selectAgencyUserCount(String customerId, String monthId) {
return baseDao.selectAgencyUserCount(customerId, monthId);
}
@Override
public List<FactRegUserAgencyMonthlyDTO> getOrgUserCountByCustomer(String customerId, String monthId, String level) {
return baseDao.selectOrgUserCountByCustomer(customerId, monthId, level);
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java

@ -112,4 +112,9 @@ public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl<FactRegUs
return baseDao.selectGridUserCount(customerId, monthId);
}
@Override
public List<FactRegUserGridMonthlyDTO> getGridUserCountByCustomer(String customerId, String monthId) {
return baseDao.selectGridUserCountByCustomer(customerId, monthId);
}
}

41
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -264,4 +264,45 @@
)
GROUP BY GRID_ID
</select>
<select id="selectDistinctGroupMemberCount" resultType="com.epmet.dto.extract.result.GridGroupUserCountResultDTO">
SELECT
COUNT(DISTINCT MEMBER_ID) AS memberCount,
${groupField} AS orgId,
CUSTOMER_ID,
PIDS,
AGENCY_ID
FROM
fact_origin_group_member_daily
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
GROUP by ${groupField}
</select>
<select id="selectGridGroupCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_group_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GROUP_STATE = 'approved'
GROUP BY GRID_ID
</select>
<select id="selectOrgGroupCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_group_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
AND f.GROUP_STATE = 'approved'
GROUP BY f.AGENCY_ID
</select>
</mapper>

34
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml

@ -95,6 +95,23 @@
</select>
<!-- 党员参与议事:支持或者反对的次数 -->
<select id="getVoteCount" resultType="com.epmet.dto.extract.result.IssueVoteUserCountResultDTO">
SELECT
${groupField} AS orgId,
COUNT(1) AS voteCount,
COUNT( DISTINCT ISSUE_ID) issueCount
FROM
fact_origin_issue_log_daily
WHERE
DEL_FLAG = '0'
and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ACTION_CODE LIKE 'vote_%'
group by ${groupField}
</select>
<!-- 参与人数: 议题的表决行为的用户数去重的累计值 -->
<select id="calPartyPartiIssueTotal" parameterType="map" resultType="int">
SELECT
COUNT(1)AS TOTAL
@ -119,4 +136,21 @@
and M.IS_PARTY=#{isParty}
</if>
</select>
<select id="selectCountJoinUserTotal" parameterType="map" resultType="int">
SELECT
count( DISTINCT m.OPERATION_USER_ID ) as total
FROM
fact_origin_issue_log_daily m
WHERE
m.DEL_FLAG = '0'
and m.ACTION_CODE like'vote_%'
and m.CUSTOMER_ID=#{customerId}
<if test='null != gridId and "" != gridId'>
and m.GRID_ID=#{gridId}
</if>
<if test='null != pids and "" != pids'>
and m.PIDS LIKE CONCAT(#{pids},'%')
</if>
</select>
</mapper>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -267,4 +267,28 @@
AND t1.CUSTOMER_ID = #{customerId}
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<select id="selectGridIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_issue_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="selectOrgIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_issue_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

68
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -252,4 +252,72 @@
GROUP BY f.AGENCY_ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
<select id="selectGridSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ORG_ID,
a.sum,
IFNULL(b.count, 0) AS "count"
FROM
(SELECT
ORG_ID,
COUNT( ID ) AS "sum"
FROM
fact_origin_project_log_daily
WHERE
1 = 1
AND ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) a
LEFT JOIN
(SELECT
ORG_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_log_daily
WHERE
1 = 1
AND ( ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) b
ON a.ORG_ID = b.ORG_ID
</select>
<select id="selectOrgSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID,
a.sum,
IFNULL(b.count, 0) AS "count"
FROM
(SELECT
f.AGENCY_ID,
COUNT( f.ID ) AS "sum"
FROM
fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level}
WHERE
1 = 1
AND ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY
f.AGENCY_ID) a
LEFT JOIN
(SELECT
f.AGENCY_ID,
COUNT( f.ID ) AS "count"
FROM
fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level}
WHERE
1 = 1
AND ( ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY
f.AGENCY_ID) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
</mapper>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -282,6 +282,30 @@
fm.GRID_ID) b
ON a.GRID_ID = b.GRID_ID
</select>
<select id="getGridProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_project_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="getOrgProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_project_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
<!-- 根据客户Id查询 -->

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -153,4 +153,28 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<select id="selectGridTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_topic_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="selectOrgTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_topic_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml

@ -120,7 +120,8 @@
AGENCY_ID,
MONTH_ID,
YEAR_ID,
SATISFACTION_RATIO
SATISFACTION_RATIO,
CLOSED_PROJECT_RATIO
FROM
fact_index_govrn_ablity_org_monthly
WHERE

57
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml

@ -8,6 +8,63 @@
where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId}
limit 1000;
</delete>
<delete id="deleteRankData">
delete from screen_org_rank_data
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
<if test='null != orgType and "" != orgType'>
and ORG_TYPE=#{orgType}
</if>
<if test='null!=orgIds and orgIds.size()>0'>
and
(
<foreach collection="orgIds" item="orgId" separator=" OR ">
ORG_ID = #{orgId}
</foreach>
)
</if>
limit #{deleteSize}
</delete>
<select id="initAgencyDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity">
SELECT
CUSTOMER_ID,
'agency' AS ORG_TYPE,
ID AS ORG_ID,
PID AS PARENT_ID,
AGENCY_NAME AS ORG_NAME,
0 AS PARTY_TOTAL,
0 AS GROUP_TOTAL,
0 AS TOPIC_TOTAL,
0 AS ISSUE_TOTAL,
0 AS PROJECT_TOTAL,
0 AS CLOSE_PROJECT_RATIO,
0 AS SATISFACTION_RATIO
FROM
dim_agency
WHERE
CUSTOMER_ID = #{customerId}
AND `LEVEL` = #{level}
AND AGENCY_DIM_TYPE = 'all'
</select>
<select id="initGridDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity">
SELECT DISTINCT
CUSTOMER_ID,
'grid' AS ORG_TYPE,
ID AS ORG_ID,
AGENCY_ID AS PARENT_ID,
GRID_NAME AS ORG_NAME,
0 AS PARTY_TOTAL,
0 AS GROUP_TOTAL,
0 AS TOPIC_TOTAL,
0 AS ISSUE_TOTAL,
0 AS PROJECT_TOTAL,
0 AS CLOSE_PROJECT_RATIO,
0 AS SATISFACTION_RATIO
FROM
dim_grid
WHERE
CUSTOMER_ID = #{customerId}
</select>
<insert id="batchInsertOrgRankData" parameterType="map">
insert into screen_org_rank_data

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml

@ -128,8 +128,8 @@
<select id="selectScreenPartyBranchDataByOrgId" resultType="com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO">
SELECT
ORG_ID,
ORGANIZE_COUNT,
JOIN_USER_COUNT
ORGANIZE_COUNT AS organizeCount,
JOIN_USER_COUNT AS joinUserCount
FROM
screen_party_branch_data
WHERE
@ -151,11 +151,10 @@
spbd.CUSTOMER_ID,
spbd.YEAR_ID,
spbd.MONTH_ID,
spbd.PARENT_ID AS orgId,
spbd.ORG_ID AS orgId,
spbd.ORG_TYPE,
sca.AGENCY_NAME AS orgName,
spbd.ORGANIZE_COUNT,
spbd.JOIN_USER_COUNT
IFNULL(spbd.ORGANIZE_COUNT,0) AS organizeCount,
IFNULL(spbd.JOIN_USER_COUNT,0) AS joinUserCount
FROM
screen_party_branch_data spbd
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = spbd.PARENT_ID
@ -166,6 +165,6 @@
AND spbd.ORG_TYPE = 'agency'
AND spbd.CUSTOMER_ID = #{customerId}
AND spbd.MONTH_ID = #{monthId}
AND spbd.ORG_ID = #{parentId}
AND spbd.PARENT_ID = #{parentId}
</select>
</mapper>

47
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml

@ -77,5 +77,50 @@
</foreach>
</insert>
<!-- 批量插入entity -->
<insert id="insertBatchEntity" parameterType="map">
insert into screen_public_parti_total_data
(
ID,
CUSTOMER_ID,
ORG_TYPE,
ORG_ID,
PARENT_ID,
ORG_NAME,
DATA_END_TIME,
TOPIC_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL,
REG_USER_TOTAL,
JOIN_USER_TOTAL,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.orgType},
#{item.orgId},
#{item.parentId},
#{item.orgName},
#{item.dataEndTime},
#{item.topicTotal},
#{item.issueTotal},
#{item.projectTotal},
#{item.regUserTotal},
#{item.joinUserTotal},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml

@ -105,4 +105,12 @@
</foreach>
</insert>
<!-- 根据条件查询screen_user_total_data表 -->
<select id="selectList" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity">
select * from screen_user_total_data m
where m.DEL_FLAG='0'
<if test='null!=customerId and ""!=customerId'>
and m.CUSTOMER_ID=#{customerId}
</if>
</select>
</mapper>

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

@ -51,7 +51,9 @@
AND ACT_STATUS = 'finished'
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
AND SPONSOR_TYPE = #{orgType}
<if test="orgType != null and orgType != '' ">
AND SPONSOR_TYPE = #{orgType}
</if>
AND
(
<foreach collection="orgIds" item="orgId" separator=" OR ">

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActUserRelation.xml

@ -10,7 +10,7 @@
COUNT(asr.USER_ID) AS joinUserCount
FROM
act_user_relation asr
LEFT JOIN act_info ai ON asr.ACT_ID = ai.ID
LEFT JOIN act_info ai ON asr.ACT_ID = ai.ID
WHERE
ai.DEL_FLAG = 0
AND asr.DEL_FLAG = '0'
@ -18,7 +18,9 @@
AND asr.REWARD_FLAG = 'agree'
AND ai.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( ai.ACTUAL_END_TIME, '%Y%m' ) = #{monthId}
AND ai.SPONSOR_TYPE = 'agency'
<if test="orgType != null and orgType != '' ">
AND ai.SPONSOR_TYPE = #{orgType}
</if>
GROUP BY ai.SPONSOR_ID
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -15,7 +15,8 @@
SELECT
ID,
CUSTOMER_ID,
AGENCY_ID
AGENCY_ID,
GRID_NAME
FROM
dim_grid
WHERE

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml

@ -71,4 +71,13 @@
da.ID
</select>
<select id="getIssueIncCountAndTotalByMonthId" resultType="com.epmet.entity.stats.FactIssueAgencyMonthlyEntity">
select
AGENCY_ID,PID,MONTH_ID,ISSUE_INCR,ISSUE_TOTAL
from fact_issue_agency_monthly
where
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and DEL_FLAG = '0'
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
</select>
</mapper>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml

@ -101,5 +101,31 @@
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
<select id="selectOrgUserCountByCustomer" resultType="com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO">
SELECT
AGENCY_ID,
PARTYMEMBER_TOTAL
FROM
fact_reg_user_agency_monthly f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
f.DEL_FLAG = '0'
AND f.CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<select id="selectAgencyUserCount" resultType="com.epmet.dto.extract.result.GridUserCountResultDTO">
SELECT
REG_INCR,
PARTYMEMBER_INCR,
AGENCY_ID as orgId,
REG_TOTAL
FROM
fact_reg_user_agency_monthly
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>

14
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml

@ -111,7 +111,8 @@
SELECT
REG_INCR,
PARTYMEMBER_INCR,
GRID_ID
GRID_ID as orgId,
REG_TOTAL
FROM
fact_reg_user_grid_monthly
WHERE
@ -119,6 +120,17 @@
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<select id="selectGridUserCountByCustomer" resultType="com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO">
SELECT
GRID_ID,
PARTYMEMBER_TOTAL
FROM
fact_reg_user_grid_monthly
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>
Loading…
Cancel
Save