Browse Source

Merge remote-tracking branches 'remotes/origin/dev_bugfix' and 'remotes/origin/dev_screen_data' into dev

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

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

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

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

@ -11,7 +11,7 @@ spring:
name: epmet-gateway-server
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
messages:
encoding: UTF-8
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 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.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 组织相关api
*
@ -34,7 +37,11 @@ public class AgencyController {
*/
//@ExternalAppRequestAuth
@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));
}

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.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO;
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.form.*;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO;
@ -84,4 +81,19 @@ public class IndexController {
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));
}
}

15
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;
import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
@ -58,5 +59,15 @@ public interface ScreenIndexDataMonthlyDao{
* @date 2020/8/20 10:04 上午
*/
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);
}

17
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;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 指数-指数数据(按年统计)
*
@ -37,5 +41,14 @@ public interface ScreenIndexDataYearlyDao{
* @date 2020/8/19 3:43 下午
*/
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;
import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO;
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.form.*;
import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO;
import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO;
@ -51,4 +48,14 @@ public interface IndexService {
*/
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.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -43,13 +44,13 @@ public class AgencyServiceImpl implements AgencyService {
@Override
public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) {
// 1. 查询客户根组织ID
// String customerId = externalAppRequestParam.getCustomerId();
String customerId = externalAppRequestParam.getCustomerId();
// 验签关闭,customerId无法获取,暂时写死
String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
if(StringUtils.isBlank(customerId)){
customerId = "b09527201c4409e19d1dbc5e3c3429a1";
}
TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId);
if (null == rootAgency){
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.service.evaluationindex.screen.IndexService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO;
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.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -182,4 +180,17 @@ public class IndexServiceImpl implements IndexService {
}
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
#环境 dev|test|prod
profiles:
active: dev
active: @spring.profiles.active@
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss

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

@ -60,4 +60,27 @@
ORDER BY index_total DESC
LIMIT #{topNum}
</select>
</mapper>
<!-- 下级部门指数排行 安宁 --->
<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>

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

@ -18,4 +18,27 @@
AND org_id = #{agencyId}
AND year_id = DATE_FORMAT(NOW(),'%Y')
</select>
</mapper>
<!-- 下级部门指数排行 安宁 --->
<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>

20
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;
import java.io.Serializable;
import java.util.Date;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.IndexCalConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* /街道相关分数表
@ -80,20 +79,26 @@ public class AgencyScoreDTO implements Serializable {
/**
* 分值
*/
private BigDecimal score;
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli街道相关jiedaoxiangguan全区相关:quanquxiangguan
*/
private String indexCode;
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 数据类型 district 全区street街道
* 数据类型 district 全区street街道
*/
private String dataType;
/**
*
*
*/
private Integer delFlag;
@ -127,6 +132,7 @@ public class AgencyScoreDTO implements Serializable {
this.score = new BigDecimal(NumConstant.ZERO);
this.indexCode = "";
this.dataType = IndexCalConstant.STREET_LEVEL;
this.allParentIndexCode = "";
this.delFlag = 0;
this.revision = 0;
this.createdBy = "APP_USER";

14
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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 区直部门分值表
@ -77,12 +77,18 @@ public class DeptScoreDTO implements Serializable {
/**
* 分值
*/
private BigDecimal score;
private BigDecimal score;
/**
* 治理能力zhilinengli
*/
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 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;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 删除状态
*/
@ -124,6 +129,7 @@ public class FactIndexCommunityScoreDTO implements Serializable {
this.isTotal = "0";
this.score = new BigDecimal(0);
this.indexCode = "";
this.allParentIndexCode = "";
this.delFlag = 0;
this.revision = 0;
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;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.utils.HttpClientManager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -17,6 +15,5 @@ public class DataStatsApplication {
public static void main(String[] 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.tools.utils.Result;
import com.epmet.dto.indexcollect.form.*;
import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 指标采集相关api
@ -51,7 +51,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("gridpartyability")
public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GridPartyAbilityFormDTO> formDTO) {
public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -67,7 +67,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("orgpartyability")
public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgPartyAbilityFormDTO> formDTO) {
public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -83,7 +83,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("gridserviceability")
public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GridServiceAbilityFormDTO> formDTO) {
public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -99,7 +99,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("orgserviceability")
public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgServiceAbilityFormDTO> formDTO) {
public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -115,7 +115,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("gridgovrnability")
public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GridGovrnAbilityFormDTO> formDTO) {
public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -131,7 +131,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("orggovrnability")
public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgGovrnAbilityFormDTO> formDTO) {
public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -147,7 +147,7 @@ public class FactIndexCollectController {
**/
@ExternalAppRequestAuth
@PostMapping("deptgovrnability")
public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<DeptGovrnAbilityFormDTO> formDTO) {
public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) {
factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}

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

@ -1,9 +1,10 @@
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.Result;
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.IndexCalculateService;
import com.epmet.util.DimIdGenerator;
@ -40,10 +41,21 @@ public class IndexCalculateController {
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@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);
if (aBoolean){
if (aBoolean) {
return new Result<Boolean>().ok(true);
}
return new Result<Boolean>().error("指标计算失败");

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.tools.utils.Result;
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.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 大屏数据采集api
* 市北大屏数据采集api
*
* @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:25
*/
@RestController
@RequestMapping("screencoll")
public class ScreenCollController {
public class ShiBeiScreenCollController {
@Autowired
private ScreenCollService screenCollService;
private ShiBeiScreenCollService shiBeiScreenCollService;
/**
* 9党建引领|基层治理-居民党员积分排行榜
@ -37,8 +36,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("partyuserrankdata")
public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PartyUserRankDataFormDTO> formDTO) {
screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId());
public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -53,8 +52,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("partylinkmassesdata")
public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PartyLinkMassesDataFormDTO> formDTO) {
screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId());
public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -69,8 +68,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("meetdata")
public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PartyBranchDataFormDTO> formDTO) {
screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId());
public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -85,8 +84,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("orgrankdata")
public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<OrgRankDataFormDTO> formDTO) {
screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId());
public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -101,8 +100,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("governrankdata")
public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<GovernRankDataFormDTO> formDTO) {
screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId());
public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) {
shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -117,8 +116,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("eventdata")
public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<EventDataFormDTO> formDTO) {
screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId());
public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) {
shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -134,7 +133,7 @@ public class ScreenCollController {
@ExternalAppRequestAuth
@PostMapping("difficultydata")
public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) {
screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId());
shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -149,8 +148,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("cpcbasedata")
public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CpcBaseDataFormDTO> formDTO) {
screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId());
public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) {
shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -165,8 +164,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("indexdatamonthly")
public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<IndexDataMonthlyFormDTO> formDTO) {
screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId());
public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) {
shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -183,8 +182,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("indexdatayearly")
public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<IndexDataYearlyFormDTO> formDTO) {
screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId());
public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) {
shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -199,8 +198,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("customerdept")
public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CustomerDeptFormDTO> formDTO) {
screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId());
public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -215,8 +214,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("customergrid")
public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CustomerGridFormDTO> formDTO) {
screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId());
public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -231,8 +230,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("customeragency")
public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<CustomerAgencyFormDTO> formDTO) {
screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId());
public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) {
shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -247,8 +246,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("usertotaldata")
public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<UserTotalDataFormDTO> formDTO) {
screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId());
public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) {
shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -263,8 +262,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("userjoin")
public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<UserJoinFormDTO> formDTO) {
screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId());
public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) {
shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -279,8 +278,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("pioneerdata")
public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PioneerDataFormDTO> formDTO) {
screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId());
public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
@ -296,8 +295,8 @@ public class ScreenCollController {
**/
@ExternalAppRequestAuth
@PostMapping("publicpartitotaldata")
public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PublicPartiTotalDataFormDTO> formDTO) {
screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId());
public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) {
shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId());
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 删除旧记录
* @param customerId
* @param monthId
* @param indexCode
* @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);
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType);
/**
* @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/>.
*/
package com.epmet.dao.evaluationindex.screen;
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
@ -33,7 +33,7 @@ import java.util.List;
* @since v1.0.0 2020-08-31
*/
@Mapper
public interface FactIndexCommunityScoreDao extends BaseDao<FactIndexCommunityScoreEntity> {
public interface CommunityScoreDao extends BaseDao<FactIndexCommunityScoreEntity> {
/**
* @Description 社区中间表插入
@ -47,11 +47,10 @@ public interface FactIndexCommunityScoreDao extends BaseDao<FactIndexCommunitySc
* @Description 删除旧记录
* @param customerId
* @param monthId
* @param indexCode
* @author zxc
* @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 查询社区相关信息

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

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.dto.indexcal.CalculateCommonFormDTO;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -66,4 +68,45 @@ public interface GridScoreDao extends BaseDao<GridScoreEntity> {
* @Date 2020/8/31 16:42
**/
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);
}

57
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/>.
*/
package com.epmet.dao.evaluationindex.screen;
package com.epmet.dao.evaluationindex.indexcal;
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.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.Param;
@ -30,39 +32,73 @@ import java.util.List;
* 网格相关分值
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-28
* @since v1.0.0 2020-08-31
*/
@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 monthId
* @Description 下属所有网格的平均值
* @author zxc
* @date 2020/8/28 3:20 下午
*/
List<SubGridAvgResultDTO> selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
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);
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);
List<String> selectListGridId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 批量插入 网格相关分值表
@ -73,5 +109,6 @@ public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity>
* @Author zhangyong
* @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> {
/**
* 8治理能力-部门相关指标
* 据CUSTOMER_IDAGENCY_IDDEPT_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
* 据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param agencyId
* @param deptId
* @param yearId
* @param monthId
* @param quarterId
* @param customerId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("deptId") String deptId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
Integer deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 8治理能力-部门相关指标

11
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 monthId
* @param quarterId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("gridId") String gridId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
Integer deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 6治理能力-网格相关指标
@ -92,7 +89,7 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @param formDTO
* @author yinzuomei
* @description 查询治理能力-网格相关事实表当前月共上传了多少条记录
* @Date 2020/8/31 14:31
* @Date 2020/8/31 14:31
**/
int selectCount(CalculateCommonFormDTO formDTO);

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> {
/**
* 7治理能力-街道及社区相关指标
* 据CUSTOMER_IDAGENCY_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
* 据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param quarterId
* @param agencyIds
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId,
@Param("agencyIds") String[] agencyIds);
Integer deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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党建能力-网格相关指标上报(按照月份)
* 1) 根据CUSTOMER_IDAGENCY_IDGRID_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param agencyId
* @param gridId
* @param yearId
* @param monthId
* @param quarterId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("gridId") String gridId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
Integer deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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党建能力-街道及社区相关指标
* 根据CUSTOMER_IDAGENCY_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
* 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param quarterId
* @param agencyIds
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId,
@Param("agencyIds") String[] agencyIds);
Integer deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 3党建能力-街道及社区相关指标

17
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> {
/**
* 4服务能力-网格相关指标
* 根据CUSTOMER_IDAGENCY_IDGRID_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
* 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param agencyId
* @param gridId
* @param yearId
* @param monthId
* @param quarterId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("gridId") String gridId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId);
Integer deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 4服务能力-网格相关指标
@ -91,7 +84,7 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao<FactIndexS
* @param formDTO
* @author yinzuomei
* @description 查询服务能力-网格相关事实表共上传记录数
* @Date 2020/9/2 14:28
* @Date 2020/9/2 14:28
**/
int selectCount(CalculateCommonFormDTO formDTO);

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服务能力-组织街道|社区|全区相关指标
* 根据CUSTOMER_IDAGENCY_IDYEAR_IDMONTH_IDQUARTER_ID进行查询如果有数据则先进行物理删除
* 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param quarterId
* @param agencyIds
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-20
**/
void deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("quarterId") String quarterId,
@Param("agencyIds") String[] agencyIds);
Integer deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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党员基本情况
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteCpcBaseData(@Param("customerId") String customerId,
@Param("orgIds") String[] orgIds);
Integer deleteCpcBaseData(@Param("customerId") String customerId);
/**
* 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> {
/**
*14组织层级
* 1) 根据CUSTOMER_IDAGENCY_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param agencyIds 组织id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteCustomerAgency(@Param("customerId") String customerId,
@Param("agencyIds") String[] agencyIds);
Integer deleteCustomerAgency(@Param("customerId") String customerId);
/**
* 14组织层级
@ -75,4 +74,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
* @Date 16:57 2020-09-03
**/
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部门信息上传
* 1) 根据CUSTOMER_IDDEPT_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param deptIds 部门Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteCustomerDept(@Param("customerId") String customerId,
@Param("deptIds") String[] deptIds);
Integer deleteCustomerDept(@Param("customerId") String customerId);
/**
* 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> {
/**
*15网格信息上传
* 1) 根据CUSTOMER_IDGRID_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param gridIds 网格Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteCustomerGrid(@Param("customerId") String customerId,
@Param("gridIds") String[] gridIds);
Integer deleteCustomerGrid(@Param("customerId") String customerId);
/**
* 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> {
/**
* 3难点赌点
* 1) 根据CUSTOMER_IDEVENT_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除
* @param customerId
* @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> {
/**
* 4事件数据
* 1) 根据CUSTOMER_IDEVENT_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param eventId
* @param orgId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteEventData(@Param("customerId")String customerId,
@Param("eventId")String eventId,
@Param("orgId")String orgId);
Integer deleteEventData(@Param("customerId")String customerId);
/**
* 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.Param;
import java.util.List;
/**
* 中央区-事件数据图片数据
*
@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao<ScreenEventImgDataEntity>
/**
* 根据原始事件Id进行物理删除
*
* @param eventId
* @param eventIds
* @return void
* @Author zhangyong
* @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> {
/**
* 5基层治理-治理能力数据
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteGovernRankData(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
Integer deleteGovernRankData(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteIndexDataMonthly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
Integer deleteIndexDataMonthly(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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指数_按年统计
* 1) 根据CUSTOMER_IDYEAR_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDYEAR_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteIndexDataYearly(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("orgIds") String[] orgIds);
Integer deleteIndexDataYearly(@Param("customerId") String customerId,
@Param("yearId") String yearId);
/**
* 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> {
/**
* 6党建引领-组织排行
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteOrgRankData(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
Integer deleteOrgRankData(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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> {
/**
* 7基层党建-建设情况数据支部联建志愿
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deletePartyBranchData(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
Integer deletePartyBranchData(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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党建引领-党员联系群众数据
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deletePartyLinkMassesData(@Param("customerId") String customerId,
@Param("orgIds") String[] orgIds);
Integer deletePartyLinkMassesData(@Param("customerId") String customerId);
/**
* 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党建引领|基层治理-居民党员积分排行榜
* 1) 根据CUSTOMER_IDGRID_IDUSER_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param gridId
* @param userId
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deletePartyUserRankData(@Param("customerId") String customerId,
@Param("gridId") String gridId,
@Param("userId") String userId);
Integer deletePartyUserRankData(@Param("customerId") String customerId);
/**
* 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党建引领-先锋模范数据
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deletePioneerData(@Param("customerId") String customerId,
@Param("orgIds") String[] orgIds);
Integer deletePioneerData(@Param("customerId") String customerId);
/**
* 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公众参与各类总数
* 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-25
**/
void deletePublicPartiTotalData(@Param("customerId") String customerId,
@Param("orgIds") String[] orgIds);
Integer deletePublicPartiTotalData(@Param("customerId") String customerId);
/**
* 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基层治理-公众参与
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_IDMONTH_ID进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteUserJoin(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
Integer deleteUserJoin(@Param("customerId") String customerId,
@Param("monthId") String monthId);
/**
* 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中央区各类总数
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除
* 1) 根据CUSTOMER_ID 进行查询如果有数据则先进行物理删除, 一次删除1000条
*
* @param customerId
* @param orgIds 组织Id集合
* @return java.util.Integer
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteUserTotalData(@Param("customerId") String customerId,
@Param("orgIds") String[] orgIds);
Integer deleteUserTotalData(@Param("customerId") String customerId);
/**
* 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;
}

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

@ -71,15 +71,20 @@ public class CpcScoreEntity extends BaseEpmetEntity {
/**
* 分值
*/
private BigDecimal score;
private BigDecimal score;
/**
* 指标code
*/
private String indexCode;
private String indexCode;
/**
* 是否是总分 1是0不是
*/
private String isTotal;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 是否是总分 1是0不是
*/
private String isTotal;
}

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

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

@ -75,11 +75,16 @@ public class DeptScoreEntity extends BaseEpmetEntity {
/**
* 分值
*/
private BigDecimal score;
private BigDecimal score;
/**
* 治理能力zhilinengli
*/
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;
}

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

@ -77,14 +77,19 @@ public class GridScoreEntity extends BaseEpmetEntity {
*/
private String isTotal;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli网格相关wanggexiangguan
*/
private String indexCode;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli网格相关wanggexiangguan
*/
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;
}

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

@ -75,11 +75,16 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity {
/**
* 分值
*/
private BigDecimal score;
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli社区相关shequxiangguan
*/
private String indexCode;
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
}

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

@ -35,19 +35,24 @@ public class IndexDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 指标名
*/
/**
* 指标名
*/
private String indexName;
/**
* 指标描述
*/
/**
* 指标编码
*/
private String indexCode;
/**
* 指标描述
*/
private String indexDesc;
/**
* 指标级别1,2,3,4,5
*/
/**
* 指标级别1,2,3,4,5
*/
private String level;
/**

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.setCorrelation(data.getCorrelation());
entity.setLevel("1");
entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel1Index(), false, 4));
indexDicMap.put(data.getLevel1Index(), entity);
}
if (!indexDicMap.containsKey(data.getLevel2Index())) {
@ -273,6 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity2.setIndexName(data.getLevel2Index());
entity2.setCorrelation(data.getCorrelation());
entity2.setLevel("2");
entity2.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4));
indexDicMap.put(data.getLevel2Index(), entity2);
}
if (!indexDicMap.containsKey(data.getLevel3Index())) {
@ -280,6 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity3.setIndexName(data.getLevel3Index());
entity3.setCorrelation(data.getCorrelation());
entity3.setLevel("3");
entity3.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4));
indexDicMap.put(data.getLevel3Index(), entity3);
}
if (!indexDicMap.containsKey(data.getLevel4Index())) {
@ -287,6 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity4.setIndexName(data.getLevel4Index());
entity4.setCorrelation(data.getCorrelation());
entity4.setLevel("4");
entity4.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4));
indexDicMap.put(data.getLevel4Index(), entity4);
}
if (!indexDicMap.containsKey(data.getLevel5Index())) {
@ -294,6 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
entity5.setIndexName(data.getLevel5Index());
entity5.setCorrelation(data.getCorrelation());
entity5.setLevel("5");
entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4));
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;
import com.epmet.dto.screen.form.IndexCalculateForm;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
/**
* 指标计算service
@ -11,8 +11,9 @@ import com.epmet.dto.screen.form.IndexCalculateForm;
public interface IndexCalculateService {
/**
* desc按照客户计算所有指标(按照月份)
*
* @param formDTO
* @return
*/
Boolean indexCalculate(IndexCalculateForm formDTO);
Boolean indexCalculate(CalculateCommonFormDTO formDTO);
}

84
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.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao;
import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
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.screen.IndexGroupDetailEntity;
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.ScoreConstants;
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.SampleValue;
import lombok.extern.slf4j.Slf4j;
@ -48,6 +51,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
private IndexCodeFieldReService indexCodeFieldReService;
@Autowired
private CpcScoreDao cpcScoreDao;
@Autowired
private CpcSubScoreDao cpcSubScoreDao;
@Override
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));
//获取数据
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)) {
log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId());
throw new RenException("客户四级指标分值记录不存在");
@ -82,11 +87,16 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
CpcScoreEntity totalEntity = null;
for (CpcScoreEntity part : partScoreList) {
IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode());
if (indexGroupDetailEntity == null) {
log.error(" indexCode:{} 在指标明细中不存在", part.getIndexCode());
continue;
}
if (totalEntity == null) {
totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class);
totalEntity.setIsTotal(NumConstant.ONE_STR);
totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode());
totalEntity.setScore(new BigDecimal(0));
totalEntity.setAllParentIndexCode(indexGroupDetailEntity.getAllParentIndexCode());
cpcScoreTotalMap.put(userId, totalEntity);
}
//自建群活跃度——议题转项目率 有阈值 >60%按60%算
@ -130,6 +140,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
* @param indexCode 指标code 非必填
* @param values
*/
@Transactional(rollbackFor = Exception.class)
private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection<CpcScoreEntity> values, String indexCode) {
cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode);
cpcScoreDao.insertBatch(values);
@ -156,22 +167,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
do {
list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize);
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()) {
String parentIndexCode = entry.getKey();
List<IndexGroupDetailEntity> details = entry.getValue();
calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode);
}
//遍历指标分组 计算分数
for (Map.Entry<String, List<IndexGroupDetailEntity>> entry : groupIndexDetailsMap.entrySet()) {
String indexCode = entry.getKey();
List<IndexGroupDetailEntity> details = entry.getValue();
calculateScore(formDTO, details, list, minAndMaxMap, indexCode);
}
}
pageNo++;
@ -215,7 +215,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
cpcScoreEntity.setMonthId(formDTO.getMonthId());
cpcScoreEntity.setScore(new BigDecimal(0));
cpcScoreEntity.setIndexCode(parentIndexCode);
cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode());
scoreEntityMap.put(userId, cpcScoreEntity);
//构造样本值对象
@ -224,7 +224,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
}
}
log.info("计算的参数:{}", JSON.toJSONString(indexMap));
HashMap<String, BigDecimal> result = calculateScore(indexMap);
HashMap<String, CalculateResult> result = calculateScore(indexMap);
log.info("计算的结果:{}", result);
//处理结果
@ -244,15 +244,45 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
* @param result
*/
@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<>();
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.setScore(score);
cpcScoreEntity.setScore(score.getTotalScore());
allParentIndexCode = score.getDetails().get(0).getAllParentIndexCode();
cpcScoreEntity.setAllParentIndexCode(allParentIndexCode.substring(0, allParentIndexCode.lastIndexOf(StrConstant.COLON)));
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.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)));
//如果最大值超过阈值 则最大值为阈值
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();
}
//分值计算器
@ -295,7 +325,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
ScoreConstants.MAX_SCORE,
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);
}
return map;
@ -307,11 +337,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
* @param indexMap
* @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());
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<>();
IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(),
index.getAllParentIndexCode(),
sampleValueList,
index.getThreshold(),
// new BigDecimal("-1"), //FOR TEST

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

@ -454,11 +454,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
);
List<SampleValue<BigDecimal>> sampleValueList = new ArrayList<>();
IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(),
sampleValueList,
index.getThreshold(),
index.getAllParentIndexCode(),
sampleValueList,
index.getThreshold(),
// new BigDecimal("-1"),//FOR TEST
index.getWeight(),
scoreCalculator);
index.getWeight(),
scoreCalculator);
map.put(index.getIndexCode(), indexInputVO1);
}
return map;

171
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.constant.DataSourceConstant;
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.FactIndexPartyAblityOrgMonthlyDao;
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.result.MaxAndMinBigDecimalResultDTO;
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.ScoreConstants;
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.SampleValue;
import lombok.extern.slf4j.Slf4j;
@ -59,9 +60,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
@Autowired
private IndexCodeFieldReService indexCodeFieldReService;
@Autowired
private FactIndexCommunityScoreDao factIndexCommunityScoreDao;
private CommunityScoreDao factIndexCommunityScoreDao;
@Autowired
private FactIndexGridScoreDao factIndexGridScoreDao;
private GridScoreDao factIndexGridScoreDao;
/**
* @param customerId
@ -78,7 +79,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
return false;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String,String> pid = new HashMap<>();
Map<String, String> pid = new HashMap<>();
//下属所有网格的党建能力平均值
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) {
@ -86,23 +87,19 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.GRID_PARTY_AVG_NULL);
return;
}else if (subGridPartyAvgScore.size() == NumConstant.ONE){
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) {
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
Integer indexEnd = NumConstant.TEN;
List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd);
subPartyAvgList.forEach( party -> {
subPartyAvgList.forEach(party -> {
List<SampleValue> index1SampleValues = new ArrayList<>();
party.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
pid.put(c.getAgencyId(), c.getParentId());
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
index1SampleValues.add(s);
});
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);
});
}
@ -115,25 +112,21 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
return;
}else if (publishArticleCountList.size() == NumConstant.ONE){
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);
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
return;
}else if (publishArticleCountList.size() > NumConstant.ONE) {
} else {
List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList());
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
publishArticleList.forEach( publish -> {
publishArticleList.forEach(publish -> {
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
publish.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString());
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
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);
});
}
@ -141,10 +134,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result);
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId);
deleteAndInsert(result);
return true;
}
@ -162,30 +156,25 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
return false;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String,String> pid = new HashMap<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("社区下级治理能力平均分集合为空");
return;
}
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) {
}else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
governAvg.forEach(avg -> {
List<SampleValue> index1SampleValues = new ArrayList<>();
avg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
pid.put(c.getAgencyId(), c.getParentId());
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
index1SampleValues.add(s);
});
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);
});
}
@ -195,11 +184,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
return;
}else if (communityGovernAbility.size() == NumConstant.ONE) {
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) {
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
@ -212,11 +197,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
governAbility.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString());
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
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);
});
}
@ -224,10 +209,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result);
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(result);
return true;
}
@ -245,27 +230,26 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
return false;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String,String> pid = new HashMap<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) {
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (subGridServiceAvg.size() == NumConstant.ONE) {
pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId());
sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.error("查询社区下级所有网格服务能力得分平均值集合为空");
return;
} else if (subGridServiceAvg.size() > NumConstant.ONE) {
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> {
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
pid.put(c.getAgencyId(), c.getParentId());
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
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);
});
}
@ -274,11 +258,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL);
return;
}else if (communityActivityCountList.size() == NumConstant.ONE) {
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) {
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
@ -291,11 +271,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
communityActivity.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString());
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
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);
});
}
@ -303,10 +283,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result);
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(result);
return true;
}
@ -338,13 +318,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
score.setYearId(DateUtils.getYearId(monthId));
score.setQuarterId(DateUtils.getQuarterId(monthId));
score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE);
score.setAllParentIndexCode(NumConstant.ZERO_STR);
value.forEach(community -> {
score.setScore(score.getScore().add(community.getScore()));
score.setParentAgencyId(community.getParentAgencyId());
});
result.add(score);
});
deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result);
deleteAndInsert(result);
return true;
}
@ -391,33 +372,29 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
}
/**
* @param customerId
* @param monthId
* @param indexCode
* @param subAllGridList
* @Description 先删除记录在插入
* @author zxc
* @date 2020/9/1 4:24 下午
*/
@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)) {
factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode);
factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList);
}
}
/**
* @param scoreCountOfSampleId 指标计算结果
* @param customerId 客户ID
* @param monthId 月份ID
* @param isTotal 是否 总分党建+治理+服务
* @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关
* @Description
* @param scoreCountOfSampleId 指标计算结果
* @param customerId 客户ID
* @param monthId 月份ID
* @param isTotal 是否 总分党建+治理+服务
* @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关
* @author zxc
* @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<>();
scoreCountOfSampleId.forEach((k, v) -> {
FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO();
@ -428,29 +405,35 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
score.setYearId(DateUtils.getYearId(monthId));
score.setIsTotal(isTotal);
score.setIndexCode(indexCode);
score.setScore(v);
pid.forEach((agency,parentAgency) -> {
if (k.equals(agency)){
score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode);
pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) {
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);
});
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);
}
}

155
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.DeptScoreDao;
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.SubAgencyScoreAvgResultDTO;
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.ScoreConstants;
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.SampleValue;
import lombok.extern.slf4j.Slf4j;
@ -55,6 +57,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
private AgencyScoreDao agencyScoreDao;
@Autowired
private DeptScoreDao deptScoreDao;
@Autowired
private ScreenCustomerAgencyDao customerAgencyDao;
/**
* @Description 计算全区相关总分
@ -99,7 +103,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
return false;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String,String> pid = new HashMap<>();
Map<String, String> pid = new HashMap<>();
//党建能力平均值
indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
@ -107,22 +111,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
return;
}else if (subGridPartyAvgScore.size() == NumConstant.ONE){
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) {
} else if (subGridPartyAvgScore.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE);
subPartyAvgList.forEach( party -> {
subPartyAvgList.forEach(party -> {
List<SampleValue> index1SampleValues = new ArrayList<>();
party.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId()));
SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s);
});
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);
});
}
@ -135,34 +135,31 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
return;
}else if (publishArticleCountList.size() == NumConstant.ONE){
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);
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode()));
return;
}else if (publishArticleCountList.size() > NumConstant.ONE) {
} else{
List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList());
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
publishArticleList.forEach( publish -> {
publishArticleList.forEach(publish -> {
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
publish.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString());
SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode))));
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);
});
}
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result);
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
agencyScoreDao.deleteOldRecord(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
deleteAndInsert(result);
return true;
}
@ -180,36 +177,34 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
return false;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String,String> pid = new HashMap<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
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);
if (districtGovernAvgList.size() == NumConstant.ONE) {
pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId());
sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
if (CollectionUtils.isEmpty(districtGovernAvgList)) {
log.error("查询所有街道治理能力平均值集合为空");
return;
} else if (districtGovernAvgList.size() > NumConstant.ONE) {
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE);
governAvg.forEach(avg -> {
List<SampleValue> index1SampleValues = new ArrayList<>();
avg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId()));
SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s);
});
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);
});
}
} 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());
if (deptScoreAvgList.size() == NumConstant.ONE) {
pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId());
sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
if (CollectionUtils.isEmpty(deptScoreAvgList)) {
log.error("查询所有直属部门治理能力平均值集合为空");
return;
} else if (deptScoreAvgList.size() > NumConstant.ONE) {
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE);
governAvg.forEach(avg -> {
@ -220,7 +215,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
index1SampleValues.add(s);
});
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);
});
}
@ -229,9 +224,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result);
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(result);
return true;
}
@ -249,27 +244,26 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
return false;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String,String> pid = new HashMap<>();
Map<String, String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
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);
if (subStreetAvgList.size() == NumConstant.ONE) {
pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId());
sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
if (CollectionUtils.isEmpty(subStreetAvgList)) {
log.error("查询区下属街道服务能力汇总平均值集合为空");
return;
} else if (subStreetAvgList.size() > NumConstant.ONE) {
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> {
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
SampleValue s = new SampleValue(c.getAgencyId(), c.getScore());
pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
SampleValue s = new SampleValue(c.getParentId(), c.getScore());
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);
});
}
@ -278,9 +272,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result);
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
List<AgencyScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
deleteAndInsert(result);
return true;
}
@ -313,13 +307,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setQuarterId(DateUtils.getQuarterId(monthId));
score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode());
score.setAllParentIndexCode(NumConstant.ZERO_STR);
value.forEach(community -> {
score.setScore(score.getScore().add(community.getScore()));
score.setParentAgencyId(community.getParentAgencyId());
});
result.add(score);
});
deleteAndInsert(customerId, monthId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), result);
deleteAndInsert(result);
return true;
}
@ -339,33 +334,29 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
/**
* @param customerId
* @param monthId
* @param indexCode
* @param subAllDistrict
* @Description 先删除记录在插入
* @author zxc
* @date 2020/9/1 4:24 下午
*/
@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)) {
agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL);
agencyScoreDao.insertStreetRecord(subAllDistrict);
}
}
/**
* @param scoreCountOfSampleId 指标计算结果
* @param customerId 客户ID
* @param monthId 月份ID
* @param isTotal 是否 总分党建+治理+服务
* @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关
* @Description
* @param scoreCountOfSampleId 指标计算结果
* @param customerId 客户ID
* @param monthId 月份ID
* @param isTotal 是否 总分党建+治理+服务
* @param indexCode 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunenglixx相关xx相关
* @author zxc
* @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<>();
scoreCountOfSampleId.forEach((k, v) -> {
AgencyScoreDTO score = new AgencyScoreDTO();
@ -376,30 +367,38 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setYearId(DateUtils.getYearId(monthId));
score.setIsTotal(isTotal);
score.setIndexCode(indexCode);
score.setScore(v);
score.setScore(v.getTotalScore());
score.setAllParentIndexCode(allParentIndexCode);
score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
pid.forEach((agency,parentAgency) -> {
if (k.equals(agency)){
pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) {
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);
});
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);
}
}

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

@ -2,21 +2,22 @@ package com.epmet.service.evaluationindex.indexcal.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.IndexCalculateForm;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.redis.IndexCodeFieldReRedis;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -44,78 +45,98 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private IndexCalculateDistrictService indexCalculateDistrictService;
@Autowired
private DeptScoreService deptScoreService;
@Autowired
private FactIndexCollectService factIndexCollectService;
@Override
public Boolean indexCalculate(IndexCalculateForm formDTO) {
public Boolean indexCalculate(CalculateCommonFormDTO formDTO) {
try {
if (StringUtils.isBlank(formDTO.getMonthId())) {
//默认 当前月份-1
formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1)));
}
//按照客户分组
if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isBlank(formDTO.getCustomerId())) {
Result<List<String>> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds();
if (!externalCustomerIdsResult.success()) {
log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail");
return false;
}
formDTO.setCustomerIds(externalCustomerIdsResult.getData());
customerIds = externalCustomerIdsResult.getData();
} else {
customerIds.add(formDTO.getCustomerId());
}
Boolean flag = false;
for (String customerId : formDTO.getCustomerIds()) {
for (String customerId : customerIds) {
CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId());
//计算党员相关的
try {
CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId());
flag = cpcIndexCalculateService.cpcIndexCalculate(param);
log.info("indexCalculate cpcIndexCalculate return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate cpcIndexCalculate exception", e);
break;
}
//计算党员相关的
try {
CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId());
flag = cpcIndexCalculateService.cpcIndexCalculate(param);
log.info("indexCalculate cpcIndexCalculate return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate cpcIndexCalculate exception", e);
throw new RenException("indexCalculate cpcIndexCalculate exception", e);
}
//计算网格
try {
flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO);
log.info("indexCalculate calculateGridCorreLation return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calculateGridCorreLation exception", e);
break;
}
//计算社区
try {
indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId());
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
}
//计算网格
try {
flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO);
log.info("indexCalculate calculateGridCorreLation return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calculateGridCorreLation exception", e);
throw new RenException("indexCalculate calculateGridCorreLation exception", e);
}
//计算社区
try {
flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId());
log.info("indexCalculate calCommunityAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calCommunityAll exception", e);
throw new RenException("indexCalculate calAll exception", e);
}
//计算街道
try {
indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId());
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
}
//计算街道
try {
flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId());
log.info("indexCalculate calStreetAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calStreetAll exception", e);
throw new RenException("indexCalculate calStreetAll exception", e);
}
//计算区直属
try {
deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO);
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
//计算区直属
try {
flag = deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO);
log.info("indexCalculate calculateDeptCorreLation return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calculateDeptCorreLation exception", e);
throw new RenException("indexCalculate calculateDeptCorreLation exception", e);
}
//计算全区
try {
indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId());
log.info("indexCalculate calDistrictAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calDistrictAll exception", e);
throw new RenException("indexCalculate calDistrictAll exception", e);
}
} catch (RenException e) {
flag = false;
}
//计算全区
try {
indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId());
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
//计算完毕后 将结果插入大屏相关数据表
if (flag) {
try {
factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId());
} catch (Exception e) {
log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e);
flag = false;
}
}
}
return flag;

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

Loading…
Cancel
Save