Browse Source

Merge branches 'dev' and 'dev_customize' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_customize

dev_shibei_match
sunyuchao 5 years ago
parent
commit
ec8c8e7229
  1. 2
      epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  4. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java
  5. 44
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java
  6. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  7. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  8. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  9. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java
  10. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  11. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  12. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  13. 2
      epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml
  14. 23
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  15. 23
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  16. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java
  17. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java
  18. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java
  19. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java
  20. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java
  21. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java
  22. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java
  23. 28
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java
  24. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java
  25. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java
  26. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java
  27. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java
  28. 48
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java
  29. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java
  30. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java
  31. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java
  32. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java
  33. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java
  34. 28
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java
  35. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java
  36. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java
  37. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java
  38. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java
  39. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java
  40. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java
  41. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java
  42. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java
  43. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java
  44. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java
  45. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java
  46. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java
  47. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java
  48. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  49. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java
  50. 75
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java
  51. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  52. 107
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java
  53. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java
  54. 105
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java
  55. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java
  56. 87
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java
  57. 92
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java
  58. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java
  59. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java
  60. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java
  61. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  62. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  63. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
  64. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java
  65. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java
  66. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java
  67. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java
  68. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  69. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java
  70. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  71. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  72. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java
  73. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java
  74. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  75. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  76. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java
  77. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java
  78. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java
  79. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java
  80. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java
  81. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java
  82. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java
  83. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java
  84. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java
  85. 90
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java
  86. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java
  87. 90
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java
  88. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java
  89. 90
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java
  90. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java
  91. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java
  92. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java
  93. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java
  94. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  95. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java
  96. 76
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java
  97. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  98. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  99. 135
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  100. 129
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

2
epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: epmet-admin-server name: epmet-admin-server
#环境 dev|test|prod #环境 dev|test|prod
profiles: profiles:
active: dev active: @spring.profiles.active@
messages: messages:
encoding: UTF-8 encoding: UTF-8
basename: i18n/messages_common basename: i18n/messages_common

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -107,6 +107,8 @@ public enum EpmetErrorCode {
OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"),
OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"), OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"),
OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"),
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"),
// 党建声音 前端提示 88段 // 党建声音 前端提示 88段

2
epmet-gateway/src/main/resources/bootstrap.yml

@ -11,7 +11,7 @@ spring:
name: epmet-gateway-server name: epmet-gateway-server
#环境 dev|test|prod #环境 dev|test|prod
profiles: profiles:
active: dev active: @spring.profiles.active@
messages: messages:
encoding: UTF-8 encoding: UTF-8
basename: i18n/messages_common basename: i18n/messages_common

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java

@ -16,4 +16,7 @@ public interface ScreenConstant {
String COMMA = ","; String COMMA = ",";
String MONTH_ID = "month";
String YEAR_ID = "year";
} }

44
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 5下级部门指数排行安宁数据段用 入参
* @Author zhangyong
* @DateTime 2020/09/08 9:54
*/
@Data
public class AnNingSubAgencyIndexRankFormDTO implements Serializable {
private static final long serialVersionUID = -2920561669035794486L;
public interface SubAgencyIndexRank{}
/**
* 机关ID
*/
@NotBlank(message = "组织id不能为空",groups = {SubAgencyIndexRank.class})
private String agencyId;
/**
* 默认查询前几名
*/
@NotNull(message = "默认查询名次不能为空",groups = {SubAgencyIndexRank.class})
private Integer topNum;
/**
* asc 正序 desc 降序
*/
@NotNull(message = "排序方式不能为空",groups = {SubAgencyIndexRank.class})
private String sort;
/**
* 年度year 月度month
*/
@NotNull(message = "年度、月度不能为空",groups = {SubAgencyIndexRank.class})
private String type;
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -7,12 +7,15 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/** /**
* 组织相关api * 组织相关api
* *
@ -34,7 +37,11 @@ public class AgencyController {
*/ */
//@ExternalAppRequestAuth //@ExternalAppRequestAuth
@PostMapping("tree") @PostMapping("tree")
public Result<TreeResultDTO> tree(ExternalAppRequestParam externalAppRequestParam){ public Result<TreeResultDTO> tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){
String customerId = request.getHeader("CustomerId");
if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){
externalAppRequestParam.setCustomerId(customerId);
}
return new Result<TreeResultDTO>().ok(agencyService.tree(externalAppRequestParam)); return new Result<TreeResultDTO>().ok(agencyService.tree(externalAppRequestParam));
} }

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -3,10 +3,7 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO;
@ -84,4 +81,19 @@ public class IndexController {
return new Result<List<SubAgencyIndexRankResultDTO>>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); return new Result<List<SubAgencyIndexRankResultDTO>>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO));
} }
/**
* 5下级部门指数排行安宁数据段用
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankFormDTO>>
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
//@ExternalAppRequestAuth
@PostMapping("dataclient/subagencyindexrank")
public Result<List<SubAgencyIndexRankResultDTO>> anNingSubAgencyIndexRank(@RequestBody AnNingSubAgencyIndexRankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AnNingSubAgencyIndexRankFormDTO.SubAgencyIndexRank.class);
return new Result<List<SubAgencyIndexRankResultDTO>>().ok(indexService.anNingSubAgencyIndexRank(formDTO));
}
} }

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen; package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult; import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
@ -59,4 +60,14 @@ public interface ScreenIndexDataMonthlyDao{
*/ */
List<SubAgencyIndexRankResultDTO> selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); List<SubAgencyIndexRankResultDTO> selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO);
/**
* 5下级部门指数排行安宁数据段用 - (上一个月)
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankFormDTO>>
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
List<SubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexMonthlyRank(AnNingSubAgencyIndexRankFormDTO formDTO);
} }

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java

@ -17,10 +17,14 @@
package com.epmet.datareport.dao.evaluationindex.screen; package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 指数-指数数据(按年统计) * 指数-指数数据(按年统计)
* *
@ -38,4 +42,13 @@ public interface ScreenIndexDataYearlyDao{
*/ */
YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId); YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId);
/**
* 5下级部门指数排行安宁数据段用 -
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankFormDTO>>
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
List<SubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexYearlyRank(AnNingSubAgencyIndexRankFormDTO formDTO);
} }

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java

@ -1,9 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen; package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO;
@ -51,4 +48,14 @@ public interface IndexService {
*/ */
List<SubAgencyIndexRankResultDTO> subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); List<SubAgencyIndexRankResultDTO> subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO);
/**
* 5下级部门指数排行安宁数据段用
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankFormDTO>>
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
List<SubAgencyIndexRankResultDTO> anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO);
} }

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

@ -12,6 +12,7 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -43,13 +44,13 @@ public class AgencyServiceImpl implements AgencyService {
@Override @Override
public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) {
// 1. 查询客户根组织ID // 1. 查询客户根组织ID
// String customerId = externalAppRequestParam.getCustomerId(); String customerId = externalAppRequestParam.getCustomerId();
// 验签关闭,customerId无法获取,暂时写死 // 验签关闭,customerId无法获取,暂时写死
String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; if(StringUtils.isBlank(customerId)){
customerId = "b09527201c4409e19d1dbc5e3c3429a1";
}
TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId);
if (null == rootAgency){ if (null == rootAgency){
return new TreeResultDTO(); return new TreeResultDTO();

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

@ -7,10 +7,8 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao;
import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.DateUtils;
import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -182,4 +180,17 @@ public class IndexServiceImpl implements IndexService {
} }
return subAgencyIndexRankResultDTOS; return subAgencyIndexRankResultDTOS;
} }
@Override
public List<SubAgencyIndexRankResultDTO> anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) {
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = new ArrayList<>();
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){
// 年 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO);
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){
// 月(上一个月) 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO);
}
return subAgencyIndexRankResultDTOS;
}
} }

2
epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml

@ -10,7 +10,7 @@ spring:
name: data-report-server name: data-report-server
#环境 dev|test|prod #环境 dev|test|prod
profiles: profiles:
active: dev active: @spring.profiles.active@
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss

23
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -60,4 +60,27 @@
ORDER BY index_total DESC ORDER BY index_total DESC
LIMIT #{topNum} LIMIT #{topNum}
</select> </select>
<!-- 下级部门指数排行 安宁 --->
<select id="selectAnNingSubAgencyIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
org_name AS `NAME`,
index_total AS totalIndex,
govern_ablity AS governAbility,
party_dev_ablity AS partyDevAbility,
service_ablity AS serviceAbility
FROM
screen_index_data_monthly
WHERE
del_flag = '0'
AND parent_id = #{agencyId}
AND month_id = left(replace(DATE_SUB( CURDATE(),INTERVAL 1 MONTH),'-',''),6)
<if test="sort == 'asc'">
ORDER BY index_total ASC
</if>
<if test="sort == 'desc'">
ORDER BY index_total DESC
</if>
LIMIT #{topNum}
</select>
</mapper> </mapper>

23
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -18,4 +18,27 @@
AND org_id = #{agencyId} AND org_id = #{agencyId}
AND year_id = DATE_FORMAT(NOW(),'%Y') AND year_id = DATE_FORMAT(NOW(),'%Y')
</select> </select>
<!-- 下级部门指数排行 安宁 --->
<select id="selectAnNingSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
org_name AS `NAME`,
index_total AS totalIndex,
govern_ablity AS governAbility,
party_dev_ablity AS partyDevAbility,
service_ablity AS serviceAbility
FROM
screen_index_data_yearly
WHERE
del_flag = '0'
AND parent_id = #{agencyId}
AND year_id = YEAR(CURDATE())
<if test="sort == 'asc'">
ORDER BY index_total ASC
</if>
<if test="sort == 'desc'">
ORDER BY index_total DESC
</if>
LIMIT #{topNum}
</select>
</mapper> </mapper>

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java

@ -17,14 +17,13 @@
package com.epmet.dto.indexcal; package com.epmet.dto.indexcal;
import java.io.Serializable;
import java.util.Date;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.IndexCalConstant; import com.epmet.constant.IndexCalConstant;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* /街道相关分数表 * /街道相关分数表
@ -87,6 +86,12 @@ public class AgencyScoreDTO implements Serializable {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/** /**
* 数据类型 district 全区street街道 * 数据类型 district 全区street街道
*/ */
@ -127,6 +132,7 @@ public class AgencyScoreDTO implements Serializable {
this.score = new BigDecimal(NumConstant.ZERO); this.score = new BigDecimal(NumConstant.ZERO);
this.indexCode = ""; this.indexCode = "";
this.dataType = IndexCalConstant.STREET_LEVEL; this.dataType = IndexCalConstant.STREET_LEVEL;
this.allParentIndexCode = "";
this.delFlag = 0; this.delFlag = 0;
this.revision = 0; this.revision = 0;
this.createdBy = "APP_USER"; this.createdBy = "APP_USER";

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java

@ -17,11 +17,11 @@
package com.epmet.dto.indexcal; package com.epmet.dto.indexcal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 区直部门分值表 * 区直部门分值表
@ -84,6 +84,12 @@ public class DeptScoreDTO implements Serializable {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/** /**
* *
*/ */

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 8治理能力-部门相关指标 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class DeptGovrnAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<DeptGovrnAbilityFormDTO> dataList;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 6治理能力-网格相关指标 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class GridGovrnAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<GridGovrnAbilityFormDTO> dataList;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 2党建能力-网格相关指标上报(按照月份) 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class GridPartyAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<GridPartyAbilityFormDTO> dataList;
}

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java

@ -48,7 +48,7 @@ public class GridPartyAbilityFormDTO implements Serializable {
/** /**
* 网格党员人均提出的议题转项目数 * 网格党员人均提出的议题转项目数
*/ */
private Integer partyAvgShiftProjectCount; private BigDecimal partyAvgShiftProjectCount;
/** /**
* 网格活跃群众用户数 * 网格活跃群众用户数
@ -78,7 +78,7 @@ public class GridPartyAbilityFormDTO implements Serializable {
/** /**
* 网格群众人均提出的议题转项目数 * 网格群众人均提出的议题转项目数
*/ */
private Integer userAvgShiftProjectCount; private BigDecimal userAvgShiftProjectCount;
/** /**
* 建群党员数累计值 * 建群党员数累计值

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java

@ -29,5 +29,5 @@ public class GridPartyMemberDataFormDTO implements Serializable {
*/ */
private String monthId; private String monthId;
private List<GridPartyMemberDataDetailFormDTO> partyMemberDataList; private List<GridPartyMemberDataDetailFormDTO> dataList;
} }

28
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 4服务能力-网格相关指标 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class GridServiceAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<GridServiceAbilityFormDTO> dataList;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 7治理能力-街道及社区相关指标 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class OrgGovrnAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<OrgGovrnAbilityFormDTO> dataList;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 3党建能力-街道及社区相关指标 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class OrgPartyAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<OrgPartyAbilityFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 5服务能力-组织街道|社区|全区相关指标 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class OrgServiceAbilityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<OrgServiceAbilityFormDTO> dataList;
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java

@ -84,6 +84,11 @@ public class FactIndexCommunityScoreDTO implements Serializable {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/** /**
* 删除状态 * 删除状态
*/ */
@ -124,6 +129,7 @@ public class FactIndexCommunityScoreDTO implements Serializable {
this.isTotal = "0"; this.isTotal = "0";
this.score = new BigDecimal(0); this.score = new BigDecimal(0);
this.indexCode = ""; this.indexCode = "";
this.allParentIndexCode = "";
this.delFlag = 0; this.delFlag = 0;
this.revision = 0; this.revision = 0;
this.createdBy = "APP_USER"; this.createdBy = "APP_USER";

48
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.screencoll;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 大屏采集通用入参
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/9 10:25
*/
@Data
public class ScreenCollFormDTO<T> implements Serializable {
private static final long serialVersionUID = 4605543711669000348L;
/**
* 当为true时后台将先删除当前维度的数据后新增
*/
private Boolean isFirst;
/**
* 日期Id, 数据更新至yyyyMMdd
*/
private String dateId;
/**
* yyyyMM
*/
private String monthId;
/**
* yyyy
*/
private String yearId;
/**
* 数据集合
*/
private List<T> dataList;
@Override
public String toString() {
return JSON.toJSONString(this);
}
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 2党员基本情况 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class CpcBaseDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<CpcBaseDataFormDTO> dataList;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 14组织层级 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class CustomerAgencyListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<CustomerAgencyFormDTO> dataList;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 16部门信息上传 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class CustomerDeptListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<CustomerDeptFormDTO> dataList;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 15网格信息上传 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class CustomerGridListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<CustomerGridFormDTO> dataList;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java

@ -21,6 +21,6 @@ public class DifficultyDataFormDTO implements Serializable {
/** /**
* 难点堵点数据 * 难点堵点数据
*/ */
private List<DifficultyDataDetailFormDTO> diffcultyDataList; private List<DifficultyDataDetailFormDTO> dataList;
} }

28
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.screencoll.form;
import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO;
import com.epmet.dto.screencoll.ImgDataListDTO;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 4事件数据(中央区-事件数据) 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class EventDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<EventDataFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 5基层治理-治理能力数据 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class GovernRankDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<GovernRankDataFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 1指数_按月统计 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class IndexDataListMonthlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<IndexDataMonthlyFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 17指数_按年统计 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class IndexDataListYearlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyy
*/
private String yearId;
private List<IndexDataYearlyFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 6党建引领-组织排行 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class OrgRankDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<OrgRankDataFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 7基层党建-建设情况数据支部联建志愿 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class PartyBranchDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<PartyBranchDataFormDTO> dataList;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 8党建引领-党员联系群众数据 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class PartyLinkMassesDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<PartyLinkMassesDataFormDTO> dataList;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 9党建引领|基层治理-居民党员积分排行榜 入参
* @Auther: zhangyong
* @Date: 2020-08-21 09:59
*/
@Data
public class PartyUserRankDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<PartyUserRankDataFormDTO> dataList;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 10党建引领-先锋模范数据
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class PioneerDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<PioneerDataFormDTO> dataList;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 18公众参与各类总数 入参
* 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class PublicPartiTotalDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<PublicPartiTotalDataFormDTO> dataList;
}

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 11基层治理-公众参与 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class UserJoinListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
/**
* yyyyMM
*/
private String monthId;
private List<UserJoinFormDTO> dataList;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 12中央区各类总数 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class UserTotalDataListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当为true时后台将删除本月数据
*/
private Boolean isFirst;
private List<UserTotalDataFormDTO> dataList;
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java

@ -1,7 +1,5 @@
package com.epmet; package com.epmet;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.utils.HttpClientManager;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -17,6 +15,5 @@ public class DataStatsApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(DataStatsApplication.class ,args); SpringApplication.run(DataStatsApplication.class ,args);
HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!");
} }
} }

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java

@ -4,12 +4,12 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcollect.form.*; import com.epmet.dto.indexcollect.form.*;
import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 指标采集相关api * 指标采集相关api
@ -51,7 +51,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("gridpartyability") @PostMapping("gridpartyability")
public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GridPartyAbilityFormDTO> formDTO) { public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -67,7 +67,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("orgpartyability") @PostMapping("orgpartyability")
public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgPartyAbilityFormDTO> formDTO) { public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -83,7 +83,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("gridserviceability") @PostMapping("gridserviceability")
public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GridServiceAbilityFormDTO> formDTO) { public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -99,7 +99,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("orgserviceability") @PostMapping("orgserviceability")
public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgServiceAbilityFormDTO> formDTO) { public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -115,7 +115,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("gridgovrnability") @PostMapping("gridgovrnability")
public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GridGovrnAbilityFormDTO> formDTO) { public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -131,7 +131,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("orggovrnability") @PostMapping("orggovrnability")
public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgGovrnAbilityFormDTO> formDTO) { public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -147,7 +147,7 @@ public class FactIndexCollectController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("deptgovrnability") @PostMapping("deptgovrnability")
public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<DeptGovrnAbilityFormDTO> formDTO) { public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java

@ -1,9 +1,10 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.IndexCalculateForm;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
@ -40,8 +41,19 @@ public class IndexCalculateController {
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
@ExternalAppRequestAuth
@PostMapping("all") @PostMapping("all")
public Result<Boolean> indexCalculate(@RequestBody IndexCalculateForm formDTO) { public Result<Boolean> indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) {
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) {
return new Result<Boolean>().ok(true);
}
return new Result<Boolean>().error("指标计算失败");
}
@PostMapping("reAll")
public Result<Boolean> calculateAll(@RequestBody CalculateCommonFormDTO formDTO) {
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) { if (aBoolean) {
return new Result<Boolean>().ok(true); return new Result<Boolean>().ok(true);

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java

@ -0,0 +1,15 @@
package com.epmet.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 孔村大屏数据采集api
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/9 10:18
*/
@RestController
@RequestMapping("kcscreencoll")
public class KcScreenCollController {
}

75
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java

@ -4,27 +4,26 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.screencoll.form.*; import com.epmet.dto.screencoll.form.*;
import com.epmet.service.evaluationindex.screen.ScreenCollService; import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* 大屏数据采集api * 市北大屏数据采集api
* *
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:25 * @date 2020/8/18 10:25
*/ */
@RestController @RestController
@RequestMapping("screencoll") @RequestMapping("screencoll")
public class ScreenCollController { public class ShiBeiScreenCollController {
@Autowired @Autowired
private ScreenCollService screenCollService; private ShiBeiScreenCollService shiBeiScreenCollService;
/** /**
* 9党建引领|基层治理-居民党员积分排行榜 * 9党建引领|基层治理-居民党员积分排行榜
@ -37,8 +36,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("partyuserrankdata") @PostMapping("partyuserrankdata")
public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PartyUserRankDataFormDTO> formDTO) { public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) {
screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -53,8 +52,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("partylinkmassesdata") @PostMapping("partylinkmassesdata")
public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PartyLinkMassesDataFormDTO> formDTO) { public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) {
screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -69,8 +68,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("meetdata") @PostMapping("meetdata")
public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PartyBranchDataFormDTO> formDTO) { public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) {
screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -85,8 +84,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("orgrankdata") @PostMapping("orgrankdata")
public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgRankDataFormDTO> formDTO) { public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) {
screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -101,8 +100,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("governrankdata") @PostMapping("governrankdata")
public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GovernRankDataFormDTO> formDTO) { public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) {
screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -117,8 +116,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("eventdata") @PostMapping("eventdata")
public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<EventDataFormDTO> formDTO) { public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) {
screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -134,7 +133,7 @@ public class ScreenCollController {
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("difficultydata") @PostMapping("difficultydata")
public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) {
screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -149,8 +148,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("cpcbasedata") @PostMapping("cpcbasedata")
public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CpcBaseDataFormDTO> formDTO) { public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) {
screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -165,8 +164,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("indexdatamonthly") @PostMapping("indexdatamonthly")
public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<IndexDataMonthlyFormDTO> formDTO) { public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) {
screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -183,8 +182,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("indexdatayearly") @PostMapping("indexdatayearly")
public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<IndexDataYearlyFormDTO> formDTO) { public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) {
screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -199,8 +198,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("customerdept") @PostMapping("customerdept")
public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CustomerDeptFormDTO> formDTO) { public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) {
screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -215,8 +214,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("customergrid") @PostMapping("customergrid")
public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CustomerGridFormDTO> formDTO) { public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) {
screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -231,8 +230,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("customeragency") @PostMapping("customeragency")
public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CustomerAgencyFormDTO> formDTO) { public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) {
screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -247,8 +246,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("usertotaldata") @PostMapping("usertotaldata")
public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<UserTotalDataFormDTO> formDTO) { public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) {
screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -263,8 +262,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("userjoin") @PostMapping("userjoin")
public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<UserJoinFormDTO> formDTO) { public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) {
screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -279,8 +278,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("pioneerdata") @PostMapping("pioneerdata")
public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PioneerDataFormDTO> formDTO) { public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) {
screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
@ -296,8 +295,8 @@ public class ScreenCollController {
**/ **/
@ExternalAppRequestAuth @ExternalAppRequestAuth
@PostMapping("publicpartitotaldata") @PostMapping("publicpartitotaldata")
public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PublicPartiTotalDataFormDTO> formDTO) { public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) {
screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId());
return new Result(); return new Result();
} }
} }

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java

@ -48,11 +48,10 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @Description 删除旧记录 * @Description 删除旧记录
* @param customerId * @param customerId
* @param monthId * @param monthId
* @param indexCode
* @author zxc * @author zxc
* @date 2020/9/2 15:47 * @date 2020/9/2 15:47
*/ */
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType);
/** /**
* @Description 查询fact_index_agency_score相关信息 * @Description 查询fact_index_agency_score相关信息

107
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java

@ -0,0 +1,107 @@
/**
* 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.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* /街道相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface AgencySubScoreDao extends BaseDao<AgencyScoreEntity> {
/**
* @param lists
* @Description 街道中间表插入
* @author zxc
* @date 2020/8/27 5:05 下午
*/
void insertStreetRecord(@Param("lists") List<AgencyScoreDTO> lists);
/**
* @param customerId
* @param monthId
* @param indexCode
* @Description 删除旧记录
* @author zxc
* @date 2020/9/2 15:47
*/
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("dataType") String dataType);
/**
* @param customerId
* @param monthId
* @Description 查询fact_index_agency_score相关信息
* @author zxc
* @date 2020/9/1 9:41 上午
*/
List<AgencyScoreDTO> selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType);
/**
* @param customerId
* @param monthId
* @Description 区下级街道得分平均值
* @author zxc
* @date 2020/8/31 1:51 下午
*/
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvg(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("dataType") String dataType);
/**
* 根据入参查询 /街道相关分数表 记录
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.indexcal.AgencyScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<AgencyScoreDTO> selectListAgencyScore(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 批量插入区/街道相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertAgencyScoreData(@Param("list") List<AgencyScoreEntity> list, @Param("customerId") String customerId);
/**
* 根据入参查询 /街道相关分数表id
*
* @param customerId
* @param monthId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListAgencyId(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java

@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.epmet.dao.evaluationindex.screen; package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
@ -33,7 +33,7 @@ import java.util.List;
* @since v1.0.0 2020-08-31 * @since v1.0.0 2020-08-31
*/ */
@Mapper @Mapper
public interface FactIndexCommunityScoreDao extends BaseDao<FactIndexCommunityScoreEntity> { public interface CommunityScoreDao extends BaseDao<FactIndexCommunityScoreEntity> {
/** /**
* @Description 社区中间表插入 * @Description 社区中间表插入
@ -47,11 +47,10 @@ public interface FactIndexCommunityScoreDao extends BaseDao<FactIndexCommunitySc
* @Description 删除旧记录 * @Description 删除旧记录
* @param customerId * @param customerId
* @param monthId * @param monthId
* @param indexCode
* @author zxc * @author zxc
* @date 2020/9/1 9:03 上午 * @date 2020/9/1 9:03 上午
*/ */
void deleteOldRecord(@Param("customerId") String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); void deleteOldRecord(@Param("customerId") String customerId,@Param("monthId")String monthId);
/** /**
* @Description 查询社区相关信息 * @Description 查询社区相关信息

105
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java

@ -0,0 +1,105 @@
/**
* 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.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 社区相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-31
*/
@Mapper
public interface CommunitySubScoreDao extends BaseDao<FactIndexCommunityScoreEntity> {
/**
* @param lists
* @Description 社区中间表插入
* @author zxc
* @date 2020/8/27 5:05 下午
*/
void insertCommunityPartyRecord(@Param("lists") List<FactIndexCommunityScoreDTO> lists);
/**
* @param customerId
* @param monthId
* @Description 删除旧记录
* @author zxc
* @date 2020/9/1 9:03 上午
*/
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @param customerId
* @param monthId
* @Description 查询社区相关信息
* @author zxc
* @date 2020/9/1 9:41 上午
*/
List<FactIndexCommunityScoreDTO> selectCommunityInfo(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 根据入参查询 查询社区相关信息
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.screen.FactIndexCommunityScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<FactIndexCommunityScoreDTO> selectListCommunityScore(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @param customerId
* @param monthId
* @Description 街道下级所有社区得分平均值
* @author zxc
* @date 2020/8/31 1:51 下午
*/
List<SubCommunityAvgResultDTO> selectSubCommAvgScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode);
/**
* 批量插入 社区相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertCommunityScoreData(@Param("list") List<FactIndexCommunityScoreEntity> list, @Param("customerId") String customerId);
/**
* 根据入参查询 查询社区id
*
* @param customerId
* @param monthId
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListCommunityId(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java

@ -80,7 +80,7 @@ public interface CpcScoreDao extends BaseDao<CpcScoreEntity> {
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode);
List<CpcScoreEntity> getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId); List<CpcScoreEntity> getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode);
int insertBatch(@Param("list") Collection<CpcScoreEntity> values); int insertBatch(@Param("list") Collection<CpcScoreEntity> values);
} }

87
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java

@ -0,0 +1,87 @@
/**
* 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.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
/**
* 党员相关分值
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-31
*/
@Mapper
public interface CpcSubScoreDao extends BaseDao<CpcScoreEntity> {
/**
* @param customerId
* @param monthId
* @param gridId
* @return java.math.BigDecimal
* @author yinzuomei
* @description 获取网格内党员的联系群众能力考评分平均值
* @Date 2020/8/31 10:56
**/
BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("gridId") String gridId);
/**
* @param formDTO
* @return java.util.List<java.math.BigDecimal>
* @author yinzuomei
* @description 获取网格内党员的联系群众能力考评分平均值的最大值最小值
* @Date 2020/8/31 12:10
**/
List<BigDecimal> selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO);
/**
* @param calculateCommonFormDTO
* @return java.util.List<java.math.BigDecimal>
* @author yinzuomei
* @description 网格内党员的参与议事能力考评分平均值 最大值最小值
* @Date 2020/8/31 14:42
**/
List<BigDecimal> selectListJoinIssueAvgValue(CalculateCommonFormDTO calculateCommonFormDTO);
/**
* @param customerId
* @param monthId
* @param gridId
* @return java.math.BigDecimal
* @author yinzuomei
* @description 组织内党员的参与议事能力考评分平均值
* @Date 2020/8/31 15:51
**/
BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId);
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode);
List<CpcScoreEntity> getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode);
int insertBatch(@Param("list") Collection<CpcSubScoreEntity> values);
}

92
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java

@ -0,0 +1,92 @@
/**
* 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.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 区直部门分值表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Mapper
public interface DeptSubScoreDao extends BaseDao<DeptScoreEntity> {
/**
* 根据入参查询 区直部门分值表 记录
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.indexcal.DeptScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<DeptScoreDTO> selectListDeptScore(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 批量插入 区直部门分值表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertDeptScoreData(@Param("list") List<DeptScoreEntity> list, @Param("customerId") String customerId);
/**
* 根据入参查询 区直部门分值表id
*
* @param customerId
* @param monthId
* @return java.lang.String
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListDeptId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @param customerId
* @param monthId
* @param indexCode
* @Description 所有直属部门治理能力平均值
* @author zxc
* @date 2020/9/4 10:53 上午
*/
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvg(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode);
/**
* @param customerId
* @param monthId
* @param deptId
* @return int
* @author yinzuomei
* @description
* @Date 2020/9/7 14:30
**/
int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("deptId") String deptId);
}

43
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java

@ -20,6 +20,8 @@ package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.GridScoreDTO; import com.epmet.dto.indexcal.GridScoreDTO;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screen.result.SubGridAvgResultDTO;
import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -66,4 +68,45 @@ public interface GridScoreDao extends BaseDao<GridScoreEntity> {
* @Date 2020/8/31 16:42 * @Date 2020/8/31 16:42
**/ **/
List<GridScoreDTO> selectList(CalculateCommonFormDTO formDTO); List<GridScoreDTO> selectList(CalculateCommonFormDTO formDTO);
/**
* @Description 下属所有网格的平均值
* @param customerId
* @param monthId
* @author zxc
* @date 2020/8/28 3:20 下午
*/
List<SubGridAvgResultDTO> selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
/**
* 根据入参查询 网格相关分值记录
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.screen.FactIndexGridScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<FactIndexGridScoreDTO> selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 根据入参查询 网格id
* @param customerId
* @param monthId
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 批量插入 网格相关分值表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertGridScoreData(@Param("list") List<FactIndexGridScoreDTO> list,@Param("customerId")String customerId);
} }

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java

@ -15,12 +15,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.epmet.dao.evaluationindex.screen; package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.GridScoreDTO;
import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO;
import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -30,15 +32,47 @@ import java.util.List;
* 网格相关分值 * 网格相关分值
* *
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-28 * @since v1.0.0 2020-08-31
*/ */
@Mapper @Mapper
public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity> { public interface GridSubScoreDao extends BaseDao<GridScoreEntity> {
/**
* @param customerId
* @param monthId
* @param indexCode
* @param isTotal 1总分0不是
* @return int
* @author yinzuomei
* @description
* @Date 2020/8/31 14:00
**/
int deleteByCusAndMonthId(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("indexCode") String indexCode,
@Param("isTotal") String isTotal);
/**
* @param gridScoreEntityList
* @return int
* @author yinzuomei
* @description
* @Date 2020/8/31 14:01
**/
int insertBatches(List<GridScoreEntity> gridScoreEntityList);
/**
* @param formDTO
* @return java.util.List<com.epmet.dto.indexcal.GridScoreDTO>
* @author yinzuomei
* @description
* @Date 2020/8/31 16:42
**/
List<GridScoreDTO> selectList(CalculateCommonFormDTO formDTO);
/** /**
* @Description 下属所有网格的平均值
* @param customerId * @param customerId
* @param monthId * @param monthId
* @Description 下属所有网格的平均值
* @author zxc * @author zxc
* @date 2020/8/28 3:20 下午 * @date 2020/8/28 3:20 下午
*/ */
@ -46,6 +80,7 @@ public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity>
/** /**
* 根据入参查询 网格相关分值记录 * 根据入参查询 网格相关分值记录
*
* @param customerId * @param customerId
* @param monthId * @param monthId
* @return java.util.List<com.epmet.dto.screen.FactIndexGridScoreDTO> * @return java.util.List<com.epmet.dto.screen.FactIndexGridScoreDTO>
@ -56,6 +91,7 @@ public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity>
/** /**
* 根据入参查询 网格id * 根据入参查询 网格id
*
* @param customerId * @param customerId
* @param monthId * @param monthId
* @return java.util.List<java.util.String> * @return java.util.List<java.util.String>
@ -74,4 +110,5 @@ public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity>
* @Date 11:11 2020-09-04 * @Date 11:11 2020-09-04
**/ **/
void batchInsertGridScoreData(@Param("list") List<FactIndexGridScoreDTO> list, @Param("customerId") String customerId); void batchInsertGridScoreData(@Param("list") List<FactIndexGridScoreDTO> list, @Param("customerId") String customerId);
} }

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java

@ -37,24 +37,16 @@ import java.util.Map;
public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao<FactIndexGovrnAblityDeptMonthlyEntity> { public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao<FactIndexGovrnAblityDeptMonthlyEntity> {
/** /**
* 8治理能力-部门相关指标 * 8治理能力-部门相关指标
* 据CUSTOMER_IDAGENCY_IDDEPT_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除 * 据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param agencyId
* @param deptId
* @param yearId
* @param monthId * @param monthId
* @param quarterId * @return java.util.Integer
* @param customerId
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, Integer deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId, @Param("monthId") String monthId);
@Param("deptId") String deptId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
/** /**
* 8治理能力-部门相关指标 * 8治理能力-部门相关指标

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java

@ -47,15 +47,12 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @param yearId * @param yearId
* @param monthId * @param monthId
* @param quarterId * @param quarterId
* @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId, Integer deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId, @Param("monthId") String monthId);
@Param("gridId") String gridId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
/** /**
* 6治理能力-网格相关指标 * 6治理能力-网格相关指标

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java

@ -36,21 +36,16 @@ import java.util.Map;
public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovrnAblityOrgMonthlyEntity> { public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovrnAblityOrgMonthlyEntity> {
/** /**
* 7治理能力-街道及社区相关指标 * 7治理能力-街道及社区相关指标
* 据CUSTOMER_IDAGENCY_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除 * 据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param quarterId * @return java.util.Integer
* @param agencyIds
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, Integer deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("quarterId") String quarterId,
@Param("agencyIds") String[] agencyIds);
/** /**
* 7治理能力-街道及社区相关指标 * 7治理能力-街道及社区相关指标

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java

@ -39,23 +39,16 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao<FactIndexPar
/** /**
* 2党建能力-网格相关指标上报(按照月份) * 2党建能力-网格相关指标上报(按照月份)
* 1) 根据CUSTOMER_IDAGENCY_IDGRID_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param agencyId
* @param gridId
* @param yearId
* @param monthId * @param monthId
* @param quarterId * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId, Integer deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId, @Param("monthId") String monthId);
@Param("gridId") String gridId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
/** /**
* 2党建能力-网格相关指标上报(按照月份) * 2党建能力-网格相关指标上报(按照月份)

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java

@ -38,21 +38,16 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao<FactIndexPart
/** /**
* 3党建能力-街道及社区相关指标 * 3党建能力-街道及社区相关指标
* 根据CUSTOMER_IDAGENCY_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除 * 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param quarterId * @return java.util.Integer
* @param agencyIds
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId, Integer deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("quarterId") String quarterId,
@Param("agencyIds") String[] agencyIds);
/** /**
* 3党建能力-街道及社区相关指标 * 3党建能力-街道及社区相关指标

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java

@ -38,23 +38,16 @@ import java.util.Map;
public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao<FactIndexServiceAblityGridMonthlyEntity> { public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao<FactIndexServiceAblityGridMonthlyEntity> {
/** /**
* 4服务能力-网格相关指标 * 4服务能力-网格相关指标
* 根据CUSTOMER_IDAGENCY_IDGRID_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除 * 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param agencyId
* @param gridId
* @param yearId
* @param monthId * @param monthId
* @param quarterId * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, Integer deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId, @Param("monthId") String monthId);
@Param("gridId") String gridId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
/** /**
* 4服务能力-网格相关指标 * 4服务能力-网格相关指标

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java

@ -38,21 +38,16 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao<FactIndexSe
/** /**
* 5服务能力-组织街道|社区|全区相关指标 * 5服务能力-组织街道|社区|全区相关指标
* 根据CUSTOMER_IDAGENCY_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除 * 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param quarterId * @return java.util.Integer
* @param agencyIds
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-20 * @Date 10:52 2020-08-20
**/ **/
void deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId, Integer deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("quarterId") String quarterId,
@Param("agencyIds") String[] agencyIds);
/** /**
* 5服务能力-组织街道|社区|全区相关指标 * 5服务能力-组织街道|社区|全区相关指标

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java

@ -36,15 +36,14 @@ public interface ScreenCpcBaseDataDao extends BaseDao<ScreenCpcBaseDataEntity> {
/** /**
* 2党员基本情况 * 2党员基本情况
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteCpcBaseData(@Param("customerId") String customerId, Integer deleteCpcBaseData(@Param("customerId") String customerId);
@Param("orgIds") String[] orgIds);
/** /**
* 2党员基本情况 * 2党员基本情况

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -35,15 +35,14 @@ import java.util.List;
public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEntity> { public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEntity> {
/** /**
*14组织层级 *14组织层级
* 1) 根据CUSTOMER_IDAGENCY_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param agencyIds 组织id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteCustomerAgency(@Param("customerId") String customerId, Integer deleteCustomerAgency(@Param("customerId") String customerId);
@Param("agencyIds") String[] agencyIds);
/** /**
* 14组织层级 * 14组织层级
@ -75,4 +74,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
* @Date 16:57 2020-09-03 * @Date 16:57 2020-09-03
**/ **/
List<ScreenCustomerAgencyEntity> selectListAgencyInfo(@Param("customerId")String customerId); List<ScreenCustomerAgencyEntity> selectListAgencyInfo(@Param("customerId")String customerId);
/**
* @Description 根据agencyId查询上级组织Id
* @param agencyId
* @author zxc
* @date 2020/9/8 3:36 下午
*/
String selectPid(@Param("agencyId")String agencyId);
} }

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java

@ -36,15 +36,14 @@ public interface ScreenCustomerDeptDao extends BaseDao<ScreenCustomerDeptEntity>
/** /**
*16部门信息上传 *16部门信息上传
* 1) 根据CUSTOMER_IDDEPT_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param deptIds 部门Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteCustomerDept(@Param("customerId") String customerId, Integer deleteCustomerDept(@Param("customerId") String customerId);
@Param("deptIds") String[] deptIds);
/** /**
* 16部门信息上传 * 16部门信息上传

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -37,15 +37,14 @@ import java.util.List;
public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity> { public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity> {
/** /**
*15网格信息上传 *15网格信息上传
* 1) 根据CUSTOMER_IDGRID_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param gridIds 网格Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteCustomerGrid(@Param("customerId") String customerId, Integer deleteCustomerGrid(@Param("customerId") String customerId);
@Param("gridIds") String[] gridIds);
/** /**
* 15网格信息上传 * 15网格信息上传

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java

@ -36,7 +36,7 @@ import java.util.List;
public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEntity> { public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEntity> {
/** /**
* 3难点赌点 * 3难点赌点
* 1) 根据CUSTOMER_IDEVENT_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除
* @param customerId * @param customerId
* @Author zhangyong * @Author zhangyong

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

@ -35,17 +35,14 @@ import java.util.List;
public interface ScreenEventDataDao extends BaseDao<ScreenEventDataEntity> { public interface ScreenEventDataDao extends BaseDao<ScreenEventDataEntity> {
/** /**
* 4事件数据 * 4事件数据
* 1) 根据CUSTOMER_IDEVENT_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param eventId * @return java.util.Integer
* @param orgId
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteEventData(@Param("customerId")String customerId, Integer deleteEventData(@Param("customerId")String customerId);
@Param("eventId")String eventId,
@Param("orgId")String orgId);
/** /**
* 4事件数据 * 4事件数据

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java

@ -22,6 +22,8 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 中央区-事件数据图片数据 * 中央区-事件数据图片数据
* *
@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao<ScreenEventImgDataEntity>
/** /**
* 根据原始事件Id进行物理删除 * 根据原始事件Id进行物理删除
* *
* @param eventId * @param eventIds
* @return void * @return void
* @Author zhangyong * @Author zhangyong
* @Date 16:47 2020-08-18 * @Date 16:47 2020-08-18
**/ **/
void delEventImgDataByEventId(@Param("eventId") String eventId); void delEventImgDataByEvent(@Param("eventIds") String[] eventIds);
void batchInsertEventImgData(@Param("list") List<ScreenEventImgDataEntity> list);
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java

@ -35,19 +35,16 @@ import java.util.List;
public interface ScreenGovernRankDataDao extends BaseDao<ScreenGovernRankDataEntity> { public interface ScreenGovernRankDataDao extends BaseDao<ScreenGovernRankDataEntity> {
/** /**
* 5基层治理-治理能力数据 * 5基层治理-治理能力数据
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteGovernRankData(@Param("customerId") String customerId, Integer deleteGovernRankData(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
/** /**
* 5基层治理-治理能力数据 * 5基层治理-治理能力数据

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -36,19 +36,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
/** /**
*1指数相关 *1指数相关
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteIndexDataMonthly(@Param("customerId") String customerId, Integer deleteIndexDataMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
/** /**
* 1指数相关 * 1指数相关

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

@ -36,17 +36,16 @@ public interface ScreenIndexDataYearlyDao extends BaseDao<ScreenIndexDataYearlyE
/** /**
* 17指数_按年统计 * 17指数_按年统计
* 1) 根据CUSTOMER_IDYEAR_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDYEAR_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId * @param yearId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteIndexDataYearly(@Param("customerId") String customerId, Integer deleteIndexDataYearly(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("yearId") String yearId);
@Param("orgIds") String[] orgIds);
/** /**
* 17指数_按年统计 * 17指数_按年统计

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

@ -35,19 +35,16 @@ import java.util.List;
public interface ScreenOrgRankDataDao extends BaseDao<ScreenOrgRankDataEntity> { public interface ScreenOrgRankDataDao extends BaseDao<ScreenOrgRankDataEntity> {
/** /**
* 6党建引领-组织排行 * 6党建引领-组织排行
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteOrgRankData(@Param("customerId") String customerId, Integer deleteOrgRankData(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
/** /**
* 6党建引领-组织排行 * 6党建引领-组织排行

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java

@ -35,19 +35,16 @@ import java.util.List;
public interface ScreenPartyBranchDataDao extends BaseDao<ScreenPartyBranchDataEntity> { public interface ScreenPartyBranchDataDao extends BaseDao<ScreenPartyBranchDataEntity> {
/** /**
* 7基层党建-建设情况数据支部联建志愿 * 7基层党建-建设情况数据支部联建志愿
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deletePartyBranchData(@Param("customerId") String customerId, Integer deletePartyBranchData(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
/** /**
* 7基层党建-建设情况数据支部联建志愿 * 7基层党建-建设情况数据支部联建志愿

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java

@ -36,15 +36,14 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao<ScreenPartyLinkMas
/** /**
* 8党建引领-党员联系群众数据 * 8党建引领-党员联系群众数据
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deletePartyLinkMassesData(@Param("customerId") String customerId, Integer deletePartyLinkMassesData(@Param("customerId") String customerId);
@Param("orgIds") String[] orgIds);
/** /**
* 8党建引领-党员联系群众数据 * 8党建引领-党员联系群众数据

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

@ -36,17 +36,14 @@ public interface ScreenPartyUserRankDataDao extends BaseDao<ScreenPartyUserRankD
/** /**
* 9党建引领|基层治理-居民党员积分排行榜 * 9党建引领|基层治理-居民党员积分排行榜
* 1) 根据CUSTOMER_IDGRID_IDUSER_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param gridId * @return java.util.Integer
* @param userId
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deletePartyUserRankData(@Param("customerId") String customerId, Integer deletePartyUserRankData(@Param("customerId") String customerId);
@Param("gridId") String gridId,
@Param("userId") String userId);
/** /**
* 9党建引领|基层治理-居民党员积分排行榜 * 9党建引领|基层治理-居民党员积分排行榜

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java

@ -36,15 +36,14 @@ public interface ScreenPioneerDataDao extends BaseDao<ScreenPioneerDataEntity> {
/** /**
* 10党建引领-先锋模范数据 * 10党建引领-先锋模范数据
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deletePioneerData(@Param("customerId") String customerId, Integer deletePioneerData(@Param("customerId") String customerId);
@Param("orgIds") String[] orgIds);
/** /**
* 10党建引领-先锋模范数据 * 10党建引领-先锋模范数据

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

@ -37,15 +37,14 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao<ScreenPublicParti
/** /**
* 18公众参与各类总数 * 18公众参与各类总数
* 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-25 * @Date 10:52 2020-08-25
**/ **/
void deletePublicPartiTotalData(@Param("customerId") String customerId, Integer deletePublicPartiTotalData(@Param("customerId") String customerId);
@Param("orgIds") String[] orgIds);
/** /**
* 18公众参与各类总数 * 18公众参与各类总数

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java

@ -51,19 +51,16 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
/** /**
* 11基层治理-公众参与 * 11基层治理-公众参与
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param yearId
* @param monthId * @param monthId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteUserJoin(@Param("customerId") String customerId, Integer deleteUserJoin(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId);
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
/** /**
* 11基层治理-公众参与 * 11基层治理-公众参与

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

@ -36,15 +36,14 @@ public interface ScreenUserTotalDataDao extends BaseDao<ScreenUserTotalDataEntit
/** /**
* 12中央区各类总数 * 12中央区各类总数
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除 * 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
* *
* @param customerId * @param customerId
* @param orgIds 组织Id集合 * @return java.util.Integer
* @Author zhangyong * @Author zhangyong
* @Date 10:52 2020-08-18 * @Date 10:52 2020-08-18
**/ **/
void deleteUserTotalData(@Param("customerId") String customerId, Integer deleteUserTotalData(@Param("customerId") String customerId);
@Param("orgIds") String[] orgIds);
/** /**
* 12中央区各类总数 * 12中央区各类总数

90
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java

@ -0,0 +1,90 @@
/**
* 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.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* /街道相关分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_sub_agency_score")
public class AgencySubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织id(eg社区或者街道id)
*/
private String agencyId;
/**
* 上级组织id
*/
private String parentAgencyId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 1总分0不是默认0
*/
private String isTotal;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli街道相关jiedaoxiangguan全区相关:quanquxiangguan
*/
private String indexCode;
/**
* 数据类型 district 全区street街道
*/
private String dataType;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java

@ -78,6 +78,11 @@ public class CpcScoreEntity extends BaseEpmetEntity {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/** /**
* 是否是总分 1是0不是 * 是否是总分 1是0不是
*/ */

90
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java

@ -0,0 +1,90 @@
/**
* 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.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 党员相关分值
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_sub_cpc_score")
public class CpcSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 年维度Id: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 用户id
*/
private String userId;
/**
* 分值
*/
private BigDecimal score;
/**
* 指标code
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 是否是总分 1是0不是
*/
private String isTotal;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java

@ -82,4 +82,9 @@ public class DeptScoreEntity extends BaseEpmetEntity {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
} }

90
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java

@ -0,0 +1,90 @@
/**
* 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.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 区直部门分值表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-02
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_sub_dept_score")
public class DeptSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 部门id
*/
private String deptId;
/**
* 部门所属的组织id
*/
private String agencyId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 1总分0不是默认0
*/
private String isTotal;
/**
* 分值
*/
private BigDecimal score;
/**
* 治理能力zhilinengli
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java

@ -87,4 +87,9 @@ public class GridScoreEntity extends BaseEpmetEntity {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
} }

95
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java

@ -0,0 +1,95 @@
/**
* 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.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 网格相关分值
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_sub_grid_score")
public class GridSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 1总分0不是
*/
private String isTotal;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli网格相关wanggexiangguan
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java

@ -82,4 +82,9 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity {
*/ */
private String indexCode; private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
} }

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java

@ -40,6 +40,11 @@ public class IndexDictEntity extends BaseEpmetEntity {
*/ */
private String indexName; private String indexName;
/**
* 指标编码
*/
private String indexCode;
/** /**
* 指标描述 * 指标描述
*/ */

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -266,6 +266,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity.setIndexName(data.getLevel1Index()); entity.setIndexName(data.getLevel1Index());
entity.setCorrelation(data.getCorrelation()); entity.setCorrelation(data.getCorrelation());
entity.setLevel("1"); entity.setLevel("1");
entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel1Index(), false, 4));
indexDicMap.put(data.getLevel1Index(), entity); indexDicMap.put(data.getLevel1Index(), entity);
} }
if (!indexDicMap.containsKey(data.getLevel2Index())) { if (!indexDicMap.containsKey(data.getLevel2Index())) {
@ -273,6 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity2.setIndexName(data.getLevel2Index()); entity2.setIndexName(data.getLevel2Index());
entity2.setCorrelation(data.getCorrelation()); entity2.setCorrelation(data.getCorrelation());
entity2.setLevel("2"); entity2.setLevel("2");
entity2.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4));
indexDicMap.put(data.getLevel2Index(), entity2); indexDicMap.put(data.getLevel2Index(), entity2);
} }
if (!indexDicMap.containsKey(data.getLevel3Index())) { if (!indexDicMap.containsKey(data.getLevel3Index())) {
@ -280,6 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity3.setIndexName(data.getLevel3Index()); entity3.setIndexName(data.getLevel3Index());
entity3.setCorrelation(data.getCorrelation()); entity3.setCorrelation(data.getCorrelation());
entity3.setLevel("3"); entity3.setLevel("3");
entity3.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4));
indexDicMap.put(data.getLevel3Index(), entity3); indexDicMap.put(data.getLevel3Index(), entity3);
} }
if (!indexDicMap.containsKey(data.getLevel4Index())) { if (!indexDicMap.containsKey(data.getLevel4Index())) {
@ -287,6 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity4.setIndexName(data.getLevel4Index()); entity4.setIndexName(data.getLevel4Index());
entity4.setCorrelation(data.getCorrelation()); entity4.setCorrelation(data.getCorrelation());
entity4.setLevel("4"); entity4.setLevel("4");
entity4.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4));
indexDicMap.put(data.getLevel4Index(), entity4); indexDicMap.put(data.getLevel4Index(), entity4);
} }
if (!indexDicMap.containsKey(data.getLevel5Index())) { if (!indexDicMap.containsKey(data.getLevel5Index())) {
@ -294,6 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity5.setIndexName(data.getLevel5Index()); entity5.setIndexName(data.getLevel5Index());
entity5.setCorrelation(data.getCorrelation()); entity5.setCorrelation(data.getCorrelation());
entity5.setLevel("5"); entity5.setLevel("5");
entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4));
indexDicMap.put(data.getLevel5Index(), entity5); indexDicMap.put(data.getLevel5Index(), entity5);
} }
} }

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java

@ -1,6 +1,6 @@
package com.epmet.service.evaluationindex.indexcal; package com.epmet.service.evaluationindex.indexcal;
import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
/** /**
* 指标计算service * 指标计算service
@ -11,8 +11,9 @@ import com.epmet.dto.screen.form.IndexCalculateForm;
public interface IndexCalculateService { public interface IndexCalculateService {
/** /**
* desc按照客户计算所有指标(按照月份) * desc按照客户计算所有指标(按照月份)
*
* @param formDTO * @param formDTO
* @return * @return
*/ */
Boolean indexCalculate(IndexCalculateForm formDTO); Boolean indexCalculate(CalculateCommonFormDTO formDTO);
} }

76
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -9,9 +9,11 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant; import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.eum.IndexCodeEnum; import com.epmet.eum.IndexCodeEnum;
@ -23,6 +25,7 @@ import com.epmet.support.normalizing.Correlation;
import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreCalculator;
import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.ScoreConstants;
import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.BatchScoreCalculator;
import com.epmet.support.normalizing.batch.CalculateResult;
import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexInputVO;
import com.epmet.support.normalizing.batch.SampleValue; import com.epmet.support.normalizing.batch.SampleValue;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -48,6 +51,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
private IndexCodeFieldReService indexCodeFieldReService; private IndexCodeFieldReService indexCodeFieldReService;
@Autowired @Autowired
private CpcScoreDao cpcScoreDao; private CpcScoreDao cpcScoreDao;
@Autowired
private CpcSubScoreDao cpcSubScoreDao;
@Override @Override
public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) {
@ -72,7 +77,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
Map<String, IndexGroupDetailEntity> indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); Map<String, IndexGroupDetailEntity> indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o));
//获取数据 //获取数据
List<CpcScoreEntity> list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); List<CpcScoreEntity> list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId());
throw new RenException("客户四级指标分值记录不存在"); throw new RenException("客户四级指标分值记录不存在");
@ -82,11 +87,16 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
CpcScoreEntity totalEntity = null; CpcScoreEntity totalEntity = null;
for (CpcScoreEntity part : partScoreList) { for (CpcScoreEntity part : partScoreList) {
IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode());
if (indexGroupDetailEntity == null) {
log.error(" indexCode:{} 在指标明细中不存在", part.getIndexCode());
continue;
}
if (totalEntity == null) { if (totalEntity == null) {
totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class);
totalEntity.setIsTotal(NumConstant.ONE_STR); totalEntity.setIsTotal(NumConstant.ONE_STR);
totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
totalEntity.setScore(new BigDecimal(0)); totalEntity.setScore(new BigDecimal(0));
totalEntity.setAllParentIndexCode(indexGroupDetailEntity.getAllParentIndexCode());
cpcScoreTotalMap.put(userId, totalEntity); cpcScoreTotalMap.put(userId, totalEntity);
} }
//自建群活跃度——议题转项目率 有阈值 >60%按60%算 //自建群活跃度——议题转项目率 有阈值 >60%按60%算
@ -130,6 +140,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
* @param indexCode 指标code 非必填 * @param indexCode 指标code 非必填
* @param values * @param values
*/ */
@Transactional(rollbackFor = Exception.class)
private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection<CpcScoreEntity> values, String indexCode) { private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection<CpcScoreEntity> values, String indexCode) {
cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
cpcScoreDao.insertBatch(values); cpcScoreDao.insertBatch(values);
@ -156,22 +167,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
do { do {
list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
//如果是第一页且仅有一条数据 则直接给50分
if (pageNo == NumConstant.ONE && list.size() == NumConstant.ONE) {
List<CpcScoreEntity> insertList = new ArrayList<>();
for (String parentIndexCode : groupIndexDetailsMap.keySet()) {
insertList.add(handleOneGridScene(formDTO, parentIndexCode, list.get(0)));
}
if (CollectionUtils.isEmpty(insertList)) {
deleteAndInsertBatch(formDTO, insertList, null);
}
} else {
//遍历指标分组 计算分数 //遍历指标分组 计算分数
for (Map.Entry<String, List<IndexGroupDetailEntity>> entry : groupIndexDetailsMap.entrySet()) { for (Map.Entry<String, List<IndexGroupDetailEntity>> entry : groupIndexDetailsMap.entrySet()) {
String parentIndexCode = entry.getKey(); String indexCode = entry.getKey();
List<IndexGroupDetailEntity> details = entry.getValue(); List<IndexGroupDetailEntity> details = entry.getValue();
calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode); calculateScore(formDTO, details, list, minAndMaxMap, indexCode);
}
} }
} }
pageNo++; pageNo++;
@ -215,7 +215,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
cpcScoreEntity.setMonthId(formDTO.getMonthId()); cpcScoreEntity.setMonthId(formDTO.getMonthId());
cpcScoreEntity.setScore(new BigDecimal(0)); cpcScoreEntity.setScore(new BigDecimal(0));
cpcScoreEntity.setIndexCode(parentIndexCode); cpcScoreEntity.setIndexCode(parentIndexCode);
cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode());
scoreEntityMap.put(userId, cpcScoreEntity); scoreEntityMap.put(userId, cpcScoreEntity);
//构造样本值对象 //构造样本值对象
@ -224,7 +224,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
} }
} }
log.info("计算的参数:{}", JSON.toJSONString(indexMap)); log.info("计算的参数:{}", JSON.toJSONString(indexMap));
HashMap<String, BigDecimal> result = calculateScore(indexMap); HashMap<String, CalculateResult> result = calculateScore(indexMap);
log.info("计算的结果:{}", result); log.info("计算的结果:{}", result);
//处理结果 //处理结果
@ -244,15 +244,45 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
* @param result * @param result
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void saveCpcScore(CalculateCommonFormDTO formDTO, Map<String, CpcScoreEntity> indexDetails, String parentIndexCode, HashMap<String, BigDecimal> result) { public void saveCpcScore(CalculateCommonFormDTO formDTO, Map<String, CpcScoreEntity> indexDetails, String parentIndexCode, HashMap<String, CalculateResult> result) {
List<CpcScoreEntity> list = new ArrayList<>(); List<CpcScoreEntity> list = new ArrayList<>();
result.forEach((userId, score) -> { List<CpcSubScoreEntity> subList = new ArrayList<>();
String allParentIndexCode = null;
for (Map.Entry<String, CalculateResult> entry : result.entrySet()) {
String userId = entry.getKey();
CalculateResult score = entry.getValue();
CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); CpcScoreEntity cpcScoreEntity = indexDetails.get(userId);
cpcScoreEntity.setScore(score); cpcScoreEntity.setScore(score.getTotalScore());
allParentIndexCode = score.getDetails().get(0).getAllParentIndexCode();
cpcScoreEntity.setAllParentIndexCode(allParentIndexCode.substring(0, allParentIndexCode.lastIndexOf(StrConstant.COLON)));
list.add(cpcScoreEntity); list.add(cpcScoreEntity);
CpcScoreEntity parent = ConvertUtils.sourceToTarget(cpcScoreEntity, CpcScoreEntity.class);
score.getDetails().forEach(o -> {
CpcSubScoreEntity child = ConvertUtils.sourceToTarget(parent, CpcSubScoreEntity.class);
child.setIndexCode(o.getIndexCode());
child.setAllParentIndexCode(o.getAllParentIndexCode());
child.setScore(o.getScore());
subList.add(child);
}); });
}
System.out.println("value:" + JSON.toJSONString(list));
this.deleteAndInsertBatch(formDTO, list, parentIndexCode); this.deleteAndInsertBatch(formDTO, list, parentIndexCode);
this.deleteAndInsertSubBatch(formDTO, subList, allParentIndexCode);
}
/**
* desc:根据客户id和月份Id 指标code 非必填 删除数据
*
* @param formDTO
* @param subList
* @param parentIndexCode 指标code 非必填
*/
@Transactional(rollbackFor = Exception.class)
public void deleteAndInsertSubBatch(CalculateCommonFormDTO formDTO, List<CpcSubScoreEntity> subList, String parentIndexCode) {
cpcSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode);
cpcSubScoreDao.insertBatch(subList);
} }
@ -285,7 +315,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey)));
//如果最大值超过阈值 则最大值为阈值 //如果最大值超过阈值 则最大值为阈值
if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO
&& maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE) { && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) {
maxValue = index.getThreshold(); maxValue = index.getThreshold();
} }
//分值计算器 //分值计算器
@ -295,7 +325,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
ScoreConstants.MAX_SCORE, ScoreConstants.MAX_SCORE,
Correlation.getCorrelation(index.getCorrelation()) Correlation.getCorrelation(index.getCorrelation())
); );
IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), index.getAllParentIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator);
map.put(index.getIndexCode(), indexInputVO); map.put(index.getIndexCode(), indexInputVO);
} }
return map; return map;
@ -307,11 +337,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
* @param indexMap * @param indexMap
* @return * @return
*/ */
private HashMap<String, BigDecimal> calculateScore(Map<String, IndexInputVO<BigDecimal>> indexMap) { private HashMap<String, CalculateResult> calculateScore(Map<String, IndexInputVO<BigDecimal>> indexMap) {
//构造入参 //构造入参
List<IndexInputVO> indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); List<IndexInputVO> indexInputVOS = indexMap.values().stream().collect(Collectors.toList());
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); return batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
} }

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java

@ -249,6 +249,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
); );
List<SampleValue<BigDecimal>> sampleValueList = new ArrayList<>(); List<SampleValue<BigDecimal>> sampleValueList = new ArrayList<>();
IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(),
index.getAllParentIndexCode(),
sampleValueList, sampleValueList,
index.getThreshold(), index.getThreshold(),
// new BigDecimal("-1"), //FOR TEST // new BigDecimal("-1"), //FOR TEST

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -454,6 +454,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
); );
List<SampleValue<BigDecimal>> sampleValueList = new ArrayList<>(); List<SampleValue<BigDecimal>> sampleValueList = new ArrayList<>();
IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(),
index.getAllParentIndexCode(),
sampleValueList, sampleValueList,
index.getThreshold(), index.getThreshold(),
// new BigDecimal("-1"),//FOR TEST // new BigDecimal("-1"),//FOR TEST

135
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -8,11 +8,11 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant; import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao;
import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao;
import com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO;
import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO;
@ -26,6 +26,7 @@ import com.epmet.support.normalizing.Correlation;
import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreCalculator;
import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.ScoreConstants;
import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.BatchScoreCalculator;
import com.epmet.support.normalizing.batch.CalculateResult;
import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexInputVO;
import com.epmet.support.normalizing.batch.SampleValue; import com.epmet.support.normalizing.batch.SampleValue;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -59,9 +60,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
@Autowired @Autowired
private IndexCodeFieldReService indexCodeFieldReService; private IndexCodeFieldReService indexCodeFieldReService;
@Autowired @Autowired
private FactIndexCommunityScoreDao factIndexCommunityScoreDao; private CommunityScoreDao factIndexCommunityScoreDao;
@Autowired @Autowired
private FactIndexGridScoreDao factIndexGridScoreDao; private GridScoreDao factIndexGridScoreDao;
/** /**
* @param customerId * @param customerId
@ -86,11 +87,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); log.error(IndexCalConstant.GRID_PARTY_AVG_NULL);
return; return;
}else if (subGridPartyAvgScore.size() == NumConstant.ONE){ } else {
pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId());
sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid);
return;
}else if (subGridPartyAvgScore.size() > NumConstant.ONE) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
Integer indexEnd = NumConstant.TEN; Integer indexEnd = NumConstant.TEN;
List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd);
@ -102,7 +99,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -117,11 +114,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (StringUtils.isEmpty(fieldNameByIndexCode)) { if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
return; return;
}else if (publishArticleCountList.size() == NumConstant.ONE){ } else {
pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString());
sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid);
return;
}else if (publishArticleCountList.size() > NumConstant.ONE) {
List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList());
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
@ -133,7 +126,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -141,10 +134,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}); });
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId);
deleteAndInsert(result);
return true; return true;
} }
@ -169,12 +163,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(subGridGovernAvg)){ if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("社区下级治理能力平均分集合为空"); log.error("社区下级治理能力平均分集合为空");
return; return;
} }else{
if (subGridGovernAvg.size() == NumConstant.ONE) {
pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId());
sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
return;
} else if (subGridGovernAvg.size() > NumConstant.ONE) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
governAvg.forEach(avg -> { governAvg.forEach(avg -> {
@ -185,7 +174,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -195,11 +184,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(communityGovernAbility)){ if (CollectionUtils.isEmpty(communityGovernAbility)){
log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
return; return;
}else if (communityGovernAbility.size() == NumConstant.ONE) { }else{
pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString());
sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
return;
} else if (communityGovernAbility.size() > NumConstant.ONE) {
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) { if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
@ -216,7 +201,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -224,10 +209,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}); });
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); deleteAndInsert(result);
return true; return true;
} }
@ -250,11 +235,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) {
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (subGridServiceAvg.size() == NumConstant.ONE) { if (CollectionUtils.isEmpty(subGridServiceAvg)) {
pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); log.error("查询社区下级所有网格服务能力得分平均值集合为空");
sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
return; return;
} else if (subGridServiceAvg.size() > NumConstant.ONE) { } else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> { serviceAvgList.forEach(serviceAvg -> {
@ -265,7 +249,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -274,11 +258,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(communityActivityCountList)) { if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL);
return; return;
}else if (communityActivityCountList.size() == NumConstant.ONE) { }else{
pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString());
sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
return;
} else if (communityActivityCountList.size() > NumConstant.ONE) {
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) { if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
@ -295,7 +275,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -303,10 +283,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}); });
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); deleteAndInsert(result);
return true; return true;
} }
@ -338,13 +318,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
score.setYearId(DateUtils.getYearId(monthId)); score.setYearId(DateUtils.getYearId(monthId));
score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId));
score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE);
score.setAllParentIndexCode(NumConstant.ZERO_STR);
value.forEach(community -> { value.forEach(community -> {
score.setScore(score.getScore().add(community.getScore())); score.setScore(score.getScore().add(community.getScore()));
score.setParentAgencyId(community.getParentAgencyId()); score.setParentAgencyId(community.getParentAgencyId());
}); });
result.add(score); result.add(score);
}); });
deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result); deleteAndInsert(result);
return true; return true;
} }
@ -391,33 +372,29 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
} }
/** /**
* @param customerId
* @param monthId
* @param indexCode
* @param subAllGridList * @param subAllGridList
* @Description 先删除记录在插入 * @Description 先删除记录在插入
* @author zxc * @author zxc
* @date 2020/9/1 4:24 下午 * @date 2020/9/1 4:24 下午
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteAndInsert(String customerId, String monthId, String indexCode, List<FactIndexCommunityScoreDTO> subAllGridList) { public void deleteAndInsert(List<FactIndexCommunityScoreDTO> subAllGridList) {
if (!CollectionUtils.isEmpty(subAllGridList)) { if (!CollectionUtils.isEmpty(subAllGridList)) {
factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode);
factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList);
} }
} }
/** /**
* @Description
* @param scoreCountOfSampleId 指标计算结果 * @param scoreCountOfSampleId 指标计算结果
* @param customerId 客户ID * @param customerId 客户ID
* @param monthId 月份ID * @param monthId 月份ID
* @param isTotal 是否 总分党建+治理+服务 * @param isTotal 是否 总分党建+治理+服务
* @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关 * @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关
* @Description
* @author zxc * @author zxc
* @date 2020/9/2 2:37 下午 * @date 2020/9/2 2:37 下午
*/ */
public List<FactIndexCommunityScoreDTO> getResult(HashMap<String, BigDecimal> scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map<String,String> pid) { public List<FactIndexCommunityScoreDTO> getResultB(HashMap<String, CalculateResult> scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,String allParentIndexCode, Map<String, String> pid) {
List<FactIndexCommunityScoreDTO> result = new ArrayList<>(); List<FactIndexCommunityScoreDTO> result = new ArrayList<>();
scoreCountOfSampleId.forEach((k, v) -> { scoreCountOfSampleId.forEach((k, v) -> {
FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO();
@ -428,29 +405,35 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
score.setYearId(DateUtils.getYearId(monthId)); score.setYearId(DateUtils.getYearId(monthId));
score.setIsTotal(isTotal); score.setIsTotal(isTotal);
score.setIndexCode(indexCode); score.setIndexCode(indexCode);
score.setScore(v); score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode);
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
score.setParentAgencyId(parentAgency); score.setParentAgencyId(parentAgency);
} }
}); });
if (!CollectionUtils.isEmpty(v.getDetails())) {
v.getDetails().forEach(fiveDetail -> {
FactIndexCommunityScoreDTO s = new FactIndexCommunityScoreDTO();
s.setCustomerId(customerId);
s.setAgencyId(k);
s.setMonthId(monthId);
s.setQuarterId(DateUtils.getQuarterId(monthId));
s.setYearId(DateUtils.getYearId(monthId));
s.setIsTotal(isTotal);
s.setIndexCode(fiveDetail.getIndexCode());
s.setScore(fiveDetail.getScore());
s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode());
pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) {
s.setParentAgencyId(parentAgency);
}
});
result.add(s);
});
}
result.add(score); result.add(score);
}); });
return result; return result;
} }
/**
* @Description 当查询结果为一条时调用此方法
* @param agencyId
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/2 2:40 下午
*/
public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map<String,String> pid){
HashMap<String, BigDecimal> scoreCountOfSampleId = new HashMap<>();
scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid);
deleteAndInsert(customerId, monthId, indexCode, result);
}
} }

129
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -10,6 +10,7 @@ import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO;
@ -23,6 +24,7 @@ import com.epmet.support.normalizing.Correlation;
import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreCalculator;
import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.ScoreConstants;
import com.epmet.support.normalizing.batch.BatchScoreCalculator; import com.epmet.support.normalizing.batch.BatchScoreCalculator;
import com.epmet.support.normalizing.batch.CalculateResult;
import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.IndexInputVO;
import com.epmet.support.normalizing.batch.SampleValue; import com.epmet.support.normalizing.batch.SampleValue;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -55,6 +57,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
private AgencyScoreDao agencyScoreDao; private AgencyScoreDao agencyScoreDao;
@Autowired @Autowired
private DeptScoreDao deptScoreDao; private DeptScoreDao deptScoreDao;
@Autowired
private ScreenCustomerAgencyDao customerAgencyDao;
/** /**
* @Description 计算全区相关总分 * @Description 计算全区相关总分
@ -107,22 +111,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
return; return;
}else if (subGridPartyAvgScore.size() == NumConstant.ONE){ } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) {
pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId());
sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid);
return;
}else if (subGridPartyAvgScore.size() > NumConstant.ONE) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); List<List<SubAgencyScoreAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE);
subPartyAvgList.forEach(party -> { subPartyAvgList.forEach(party -> {
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
party.forEach(c -> { party.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId()); pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId()));
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -137,11 +137,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
if (StringUtils.isEmpty(fieldNameByIndexCode)) { if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
return; return;
}else if (publishArticleCountList.size() == NumConstant.ONE){ } else{
pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString());
sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid);
return;
}else if (publishArticleCountList.size() > NumConstant.ONE) {
List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList());
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
@ -153,16 +149,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
} }
}); });
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); List<AgencyScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); agencyScoreDao.deleteOldRecord(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
deleteAndInsert(result);
return true; return true;
} }
@ -184,32 +181,30 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (districtGovernAvgList.size() == NumConstant.ONE) { if (CollectionUtils.isEmpty(districtGovernAvgList)) {
pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); log.error("查询所有街道治理能力平均值集合为空");
sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
return; return;
} else if (districtGovernAvgList.size() > NumConstant.ONE) { } else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE);
governAvg.forEach(avg -> { governAvg.forEach(avg -> {
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
avg.forEach(c -> { avg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId()); pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId()));
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
} else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){
List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (deptScoreAvgList.size() == NumConstant.ONE) { if (CollectionUtils.isEmpty(deptScoreAvgList)) {
pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId()); log.error("查询所有直属部门治理能力平均值集合为空");
sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
return; return;
} else if (deptScoreAvgList.size() > NumConstant.ONE) { } else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE);
governAvg.forEach(avg -> { governAvg.forEach(avg -> {
@ -220,7 +215,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -229,9 +224,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
}); });
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); List<AgencyScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); deleteAndInsert(result);
return true; return true;
} }
@ -254,22 +249,21 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (subStreetAvgList.size() == NumConstant.ONE) { if (CollectionUtils.isEmpty(subStreetAvgList)) {
pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); log.error("查询区下属街道服务能力汇总平均值集合为空");
sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
return; return;
} else if (subStreetAvgList.size() > NumConstant.ONE) { } else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); List<List<SubAgencyScoreAvgResultDTO>> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> { serviceAvgList.forEach(serviceAvg -> {
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> { serviceAvg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId()); pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1);
indexInputVOS.add(index1VO); indexInputVOS.add(index1VO);
}); });
} }
@ -278,9 +272,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
}); });
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); List<AgencyScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); deleteAndInsert(result);
return true; return true;
} }
@ -313,13 +307,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId));
score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode());
score.setAllParentIndexCode(NumConstant.ZERO_STR);
value.forEach(community -> { value.forEach(community -> {
score.setScore(score.getScore().add(community.getScore())); score.setScore(score.getScore().add(community.getScore()));
score.setParentAgencyId(community.getParentAgencyId()); score.setParentAgencyId(community.getParentAgencyId());
}); });
result.add(score); result.add(score);
}); });
deleteAndInsert(customerId, monthId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), result); deleteAndInsert(result);
return true; return true;
} }
@ -339,33 +334,29 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
/** /**
* @param customerId
* @param monthId
* @param indexCode
* @param subAllDistrict * @param subAllDistrict
* @Description 先删除记录在插入 * @Description 先删除记录在插入
* @author zxc * @author zxc
* @date 2020/9/1 4:24 下午 * @date 2020/9/1 4:24 下午
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteAndInsert(String customerId, String monthId, String indexCode, List<AgencyScoreDTO> subAllDistrict) { public void deleteAndInsert(List<AgencyScoreDTO> subAllDistrict) {
if (!CollectionUtils.isEmpty(subAllDistrict)) { if (!CollectionUtils.isEmpty(subAllDistrict)) {
agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL);
agencyScoreDao.insertStreetRecord(subAllDistrict); agencyScoreDao.insertStreetRecord(subAllDistrict);
} }
} }
/** /**
* @Description
* @param scoreCountOfSampleId 指标计算结果 * @param scoreCountOfSampleId 指标计算结果
* @param customerId 客户ID * @param customerId 客户ID
* @param monthId 月份ID * @param monthId 月份ID
* @param isTotal 是否 总分党建+治理+服务 * @param isTotal 是否 总分党建+治理+服务
* @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关 * @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关
* @Description
* @author zxc * @author zxc
* @date 2020/9/2 2:37 下午 * @date 2020/9/2 2:37 下午
*/ */
public List<AgencyScoreDTO> getResult(HashMap<String, BigDecimal> scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map<String,String> pid) { public List<AgencyScoreDTO> getResultB(HashMap<String, CalculateResult> scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, String allParentIndexCode, Map<String, String> pid) {
List<AgencyScoreDTO> result = new ArrayList<>(); List<AgencyScoreDTO> result = new ArrayList<>();
scoreCountOfSampleId.forEach((k, v) -> { scoreCountOfSampleId.forEach((k, v) -> {
AgencyScoreDTO score = new AgencyScoreDTO(); AgencyScoreDTO score = new AgencyScoreDTO();
@ -376,30 +367,38 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setYearId(DateUtils.getYearId(monthId)); score.setYearId(DateUtils.getYearId(monthId));
score.setIsTotal(isTotal); score.setIsTotal(isTotal);
score.setIndexCode(indexCode); score.setIndexCode(indexCode);
score.setScore(v); score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode);
score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
score.setParentAgencyId(parentAgency); score.setParentAgencyId(parentAgency);
} }
}); });
if (!CollectionUtils.isEmpty(v.getDetails())){
v.getDetails().forEach(streetScore -> {
AgencyScoreDTO s = new AgencyScoreDTO();
s.setCustomerId(customerId);
s.setAgencyId(k);
s.setMonthId(monthId);
s.setQuarterId(DateUtils.getQuarterId(monthId));
s.setYearId(DateUtils.getYearId(monthId));
s.setIsTotal(isTotal);
s.setIndexCode(streetScore.getIndexCode());
s.setScore(streetScore.getScore());
s.setAllParentIndexCode(streetScore.getAllParentIndexCode());
s.setDataType(IndexCalConstant.DISTRICT_LEVEL);
pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) {
s.setParentAgencyId(parentAgency);
}
});
result.add(s);
});
}
result.add(score); result.add(score);
}); });
return result; return result;
} }
/**
* @Description 当查询结果为一条时调用此方法
* @param agencyId
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/2 2:40 下午
*/
public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map<String,String> pid){
HashMap<String, BigDecimal> scoreCountOfSampleId = new HashMap<>();
scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY));
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid);
deleteAndInsert(customerId, monthId, indexCode, result);
}
} }

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save