Browse Source

Merge remote-tracking branch 'origin/dev_screen_data' into dev_temp

master
yinzuomei 5 years ago
parent
commit
59316e41d0
  1. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  2. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  3. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java
  4. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java
  5. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java
  6. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  7. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java
  8. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  9. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml
  10. 47
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeotScore.java
  11. 32
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDetailDTO.java
  12. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  13. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  14. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java
  15. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java
  16. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java
  17. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java
  18. 87
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  19. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  21. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  22. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  23. 39
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml
  24. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml
  25. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml
  26. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -305,4 +305,15 @@ public class RedisKeys {
public static String getIndexCodeFieldReKey() {
return rootPrefix.concat("data:index:indexcode:field");
}
/**
* 客户统计的计算标记
* 0:未在计算
* 1:正在计算
* @param customerId
* @return
*/
public static String getCustomerStatsCalFlag(String customerId) {
return String.format(rootPrefix+"stats:calflag:%s", customerId);
}
}

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

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -35,7 +36,7 @@ public class AgencyController {
* @author zxc
* @date 2020/8/18 2:04 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("tree")
public Result<TreeResultDTO> tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){
String customerId = request.getHeader("CustomerId");
@ -51,7 +52,7 @@ public class AgencyController {
* @author zxc
* @date 2020/8/18 2:33 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("compartment")
public Result<CompartmentResultDTO> compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){
ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class);

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.DistributionService;
@ -32,7 +33,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 10:59 上午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("branch")
public Result<List<BranchResultDTO>> branch(@RequestBody BranchFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class);
@ -45,7 +46,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 11:10 上午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("user")
public Result<UserResultDTO> user(@RequestBody UserFormDTO userFormDTO){
ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class);
@ -58,7 +59,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 11:20 上午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("parymember")
public Result<ParymemberResultDTO> parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){
ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class);
@ -71,7 +72,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/19 1:29 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("project")
public Result<List<ProjectResultDTO>> project(@RequestBody ProjectFormDTO projectFormDTO){
ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class);
@ -84,7 +85,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/19 1:52 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("topprofile")
public Result<TopProfileResultDTO> topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){
ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class);

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService;
@ -38,7 +39,7 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 11:16
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("userpointrank")
public Result<UserPointRankResultDTO> userPointRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);
@ -53,7 +54,7 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 13:55
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("difficultprojects")
public Result<List<DifficultProjectResultDTO>> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){
ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class);
@ -68,7 +69,7 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 14:37
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("publicpartiprofile")
public Result<PublicPartiProfileResultDTO> publicPartiProfile(@RequestBody AgencyFormDTO param){
ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class);
@ -83,7 +84,7 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 15:32
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("publicpartirank")
public Result<List<PublicPartiRankResultDTO>> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);
@ -98,7 +99,7 @@ public class GrassRootsGovernController {
* @author wangc
* @date 2020.08.20 17:46
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("governcapacityrank")
public Result<List<GovernCapacityRankResultDTO>> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class);

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

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService;
@ -37,7 +38,7 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.18 16:59
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("basicinfo")
public Result<PartymemberPercentResultDTO> baseInfo(@RequestBody ParymemberFormDTO param){
ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class);
@ -52,7 +53,7 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.18 17:54
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("ageinfo")
public Result<PartymemberAgeDistributionResultDTO> ageInfo(@RequestBody ParymemberFormDTO param){
ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class);
@ -67,7 +68,7 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.19 11:02
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("branchbuildtrend")
public Result<BranchBuildTrendResultDTO> branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){
ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class);
@ -82,7 +83,7 @@ public class GrassrootsPartyDevController {
* @author wangc
* @date 2020.08.19 15:25
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("branchbuildrank")
public Result<BranchBuildRankResultDTO> branchBuildRank(@RequestBody BranchBuildRankFormDTO param){
ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class);

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

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.IndexService;
@ -35,7 +36,7 @@ public class IndexController {
* @author zxc
* @date 2020/8/19 2:53 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("yearaverageindex")
public Result<YearAverageIndexResultDTO> yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){
ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class);
@ -48,7 +49,7 @@ public class IndexController {
* @author zxc
* @date 2020/8/19 3:17 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("monthindexanalysis/piechart")
public Result<MonthPieChartResultDTO> monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){
ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class);
@ -61,7 +62,7 @@ public class IndexController {
* @author zxc
* @date 2020/8/19 5:27 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("monthindexanalysis/barchart")
public Result<MonthBarchartResultDTO> monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){
ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class);
@ -74,7 +75,7 @@ public class IndexController {
* @author zxc
* @date 2020/8/20 10:02 上午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("subagencyindexrank")
public Result<List<SubAgencyIndexRankResultDTO>> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){
ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class);
@ -89,7 +90,7 @@ public class IndexController {
* @Author zhangyong
* @Date 09:38 2020-09-08
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("dataclient/subagencyindexrank")
public Result<List<SubAgencyIndexRankResultDTO>> anNingSubAgencyIndexRank(@RequestBody AnNingSubAgencyIndexRankFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AnNingSubAgencyIndexRankFormDTO.SubAgencyIndexRank.class);

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService;
@ -32,7 +33,7 @@ public class PartyMemberLeadController {
* @author zxc
* @date 2020/8/20 1:56 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("fineexample")
public Result<FineExampleResultDTO> fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){
ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class);
@ -45,7 +46,7 @@ public class PartyMemberLeadController {
* @author zxc
* @date 2020/8/20 2:35 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("contactmasslinechart")
public Result<ContactMassLineChartResultDTO> contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){
ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class);
@ -58,7 +59,7 @@ public class PartyMemberLeadController {
* @author zxc
* @date 2020/8/20 3:19 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("volunteerservice")
public Result<VolunteerServiceResultDTO> volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){
ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class);
@ -73,7 +74,7 @@ public class PartyMemberLeadController {
* @author wangc
* @date 2020.08.21 11:05
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("advancedbranchrank")
Result<List<AdvanceBranchRankResultDTO>> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class);
@ -88,7 +89,7 @@ public class PartyMemberLeadController {
* @author wangc
* @date 2020.08.21 14:22
**/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("advancedpartymemberrank")
Result<List<PartyUserPointResultDTO>> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){
ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class);

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -1,5 +1,6 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
@ -30,7 +31,7 @@ public class ScreenProjectController {
* @author zxc
* @date 2020/8/19 4:36 下午
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("detail")
public Result<ProjectDetailResultDTO> projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){
ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class);

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml

@ -15,7 +15,7 @@
screen_cpc_base_data
WHERE
DEL_FLAG = '0'
AND PARENT_ID = #{agencyId}
AND ORG_ID = #{agencyId}
</select>
</mapper>

47
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeotScore.java

@ -0,0 +1,47 @@
package com.epmet.dto.indexcal;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 区直部门-相关分值
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/10 18:13
*/
@Data
public class DeotScore implements Serializable {
/**
* 部门id
*/
private String deptId;
/**
* 客户Id
*/
private String customerId;
/**
* 部门所属的机关Id
*/
private String agencyId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
private List<DeptScoreDetailDTO> detailList;
}

32
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDetailDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.indexcal;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 区直部门相关分值
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/10 17:56
*/
@Data
public class DeptScoreDetailDTO implements Serializable {
private static final long serialVersionUID = -1520962964833708922L;
/**
* 1总分0不是
*/
private String isTotal;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli网格相关quzhibumen
*/
private String indexCode;
}

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

@ -157,6 +157,8 @@ public class DemoController {
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
@Autowired
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
// private static Integer testcal=100;
@PostMapping("testcal")
@ -165,7 +167,9 @@ public class DemoController {
// //查询总记录数
// List<GridScoreDTO> gridScoreDTOList=gridScoreDao.selectList(formDTO);
// return new Result<List<GridScoreDTO>>().ok(gridScoreDTOList);
// gridCorreLationService.calculateGridCorreLation(formDTO);
cpcIndexCalculateService.cpcIndexCalculate(formDTO);
gridCorreLationService.calculateGridCorreLation(formDTO);
deptScoreService.calculateDeptCorreLation(formDTO);
return new Result();
}

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

@ -2,6 +2,8 @@ package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
@ -9,6 +11,7 @@ import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +46,12 @@ public class IndexCalculateController {
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
@Autowired
private RedisUtils redisUtils;
// 计算同步锁
private Object statsCalLock = new Object();
/**
* 按照客户计算所有指标(按照月份)
*
@ -54,14 +63,32 @@ public class IndexCalculateController {
@ExternalAppRequestAuth
@PostMapping("all")
public Result<Boolean> indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) {
singleThreadPool.execute(() -> {
formDTO.setCustomerId(externalAppRequestParam.getCustomerId());
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) {
log.error("全部指标计算完成,总耗时:{}秒", (System.currentTimeMillis() - start) / 1000);
String customerId = externalAppRequestParam.getCustomerId();
Boolean executing = (Boolean) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId));
if (executing == null || !executing) {
synchronized (statsCalLock) {
Boolean executing2 = (Boolean) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId));
if (executing2 != null && executing2) {
log.error(String.format("该客户正在执行计算,请勿重复提交计算请求。", customerId));
return new Result<Boolean>().ok(false);
}
singleThreadPool.execute(() -> {
formDTO.setCustomerId(customerId);
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) {
log.error("全部指标计算完成,总耗时:{}秒", (System.currentTimeMillis() - start) / 1000);
}
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), false);
});
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), true);
}
});
} else {
log.error(String.format("该客户正在执行计算,请勿重复提交计算请求。", customerId));
return new Result<Boolean>().ok(false);
}
return new Result<Boolean>().ok(true);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java

@ -18,6 +18,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.DeotScore;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
@ -79,7 +81,7 @@ public interface DeptScoreDao extends BaseDao<DeptScoreEntity> {
int deleteByDeptIdAndMonthId(@Param("customerId") String customerId,
@Param("monthId")String monthId,
@Param("indexCode") String indexCode,
@Param("deleteSize") int deleteSize);
@Param("deleteSize") Integer deleteSize);
/**
* @return int
@ -89,4 +91,13 @@ public interface DeptScoreDao extends BaseDao<DeptScoreEntity> {
* @Date 2020/9/10 10:40
**/
int insertBatchEntity(@Param("list") List<DeptScoreEntity> deptScoreEntityList);
/**
* @return java.util.List<com.epmet.dto.indexcal.DeptScoreDTO>
* @param formDTO
* @author yinzuomei
* @description 查询每个部门下所有的指标对应的分值
* @Date 2020/9/10 18:07
**/
List<DeotScore> selectList(CalculateCommonFormDTO formDTO);
}

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

@ -53,8 +53,8 @@ public interface DeptSubScoreDao extends BaseDao<DeptSubScoreEntity> {
* @description 批量删除
* @Date 2020/9/10 12:28
**/
int deleteByDeptIdAndMonthId(@Param("customerId") String customerId,
int deleteBatches(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("allParentIndexCode") String allParentIndexCode,
@Param("deleteSize") int deleteSize);
@Param("deleteSize") Integer deleteSize);
}

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

@ -40,16 +40,16 @@ public interface GridScoreDao extends BaseDao<GridScoreEntity> {
* @param customerId
* @param monthId
* @param indexCode
* @param deleteNum
* @param deleteSize
* @return int
* @author yinzuomei
* @description
* @Date 2020/8/31 14:00
**/
int deleteByCusAndMonthId(@Param("customerId") String customerId,
int deleteBatches(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("indexCode") String indexCode,
@Param("deleteNum") int deleteNum);
@Param("deleteSize") Integer deleteSize);
/**
* @return int

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

@ -51,7 +51,7 @@ public interface GridSubScoreDao extends BaseDao<GridSubScoreEntity> {
* @description 批量删除
* @Date 2020/9/10 13:36
**/
int deleteByDeptIdAndMonthId(@Param("customerId") String customerId,
int deleteBatches(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("allParentIndexCode") String allParentIndexCode,
@Param("deleteSize") Integer deleteSize);

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

@ -31,10 +31,9 @@ import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao;
import com.epmet.dao.evaluationindex.indexcal.DeptSubScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.*;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity;
import com.epmet.eum.IndexCodeEnum;
@ -63,6 +62,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -94,26 +95,38 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
* @param formDTO
* @return java.lang.Boolean
* @author yinzuomei
* @description 区直部门分值计算
* @description 区直部门相关-分值计算
* @Date 2020/8/26 10:51
**/
@Override
public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) {
//获取指标权重
calculateZhiLiNengLiScore(formDTO);
calculateDeptTotalScore(formDTO);
return true;
}
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 区直部门-党建能力分值计算
* @Date 2020/9/10 17:21
**/
private void calculateZhiLiNengLiScore(CalculateCommonFormDTO formDTO) {
//获取区直部门的治理能力下,五级指标权重
List<IndexGroupDetailEntity> indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode(),
IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) {
log.warn("calculateDeptCorreLation customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
throw new RenException("客户【区直部门:治理能力】指标权重信息不存在");
throw new RenException("客户【区直部门:治理能力】下级指标权重信息不存在");
}
log.info(JSON.toJSONString(indexGroupDetailEntityList));
// log.info(JSON.toJSONString(indexGroupDetailEntityList));
//1、查询总记录数
int total = factIndexGovrnAblityDeptMonthlyDao.selectCount(formDTO);
if (NumConstant.ZERO == total) {
log.warn(String.format("customerId=%s,monthId=%s,fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId(), formDTO.getMonthId()));
return Boolean.FALSE;
return;
}
//2、计算最大最小值
Map<String, Object> minAndMaxMap = factIndexGovrnAblityDeptMonthlyDao.selectExtremeValue(formDTO);
@ -139,7 +152,61 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
calculateScore(formDTO,indexMap,crrentFactRecordList);
}
} while (!CollectionUtils.isEmpty(list) && pageNo++ > 0);
return true;
log.info("区直部门-治理能力- 计算完成");
}
/**
* @return void
* @param formDTO
* @author yinzuomei
* @description 区直部门总分
* @Date 2020/9/10 17:20
**/
private void calculateDeptTotalScore(CalculateCommonFormDTO formDTO) {
//计算区直部门总分
List<IndexGroupDetailEntity> indexList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
if (CollectionUtils.isEmpty(indexList)) {
log.warn("calculateDeptTotalScore customerId:{} have not any indexGroupDetail", formDTO.getCustomerId());
throw new RenException("客户【区直部门】下级指标权重信息不存在");
}
//查询总记录数
List<DeotScore> deptScoreDTOList = deptScoreDao.selectList(formDTO);
if(CollectionUtils.isEmpty(deptScoreDTOList)){
log.error("calculateDeptTotalScore deptScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId());
throw new RenException("客户一级指标分值记录不存在");
}
Map<String, IndexGroupDetailEntity> indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity()));
List<DeptScoreEntity> deotScoreEntityList = new ArrayList<>();
for (DeotScore deptScore : deptScoreDTOList) {
DeptScoreEntity deptScoreEntity = ConvertUtils.sourceToTarget(deptScore, DeptScoreEntity.class);
deptScoreEntity.setIsTotal(NumConstant.ONE_STR);
deptScoreEntity.setIndexCode(IndexCodeEnum.QU_ZHI_BU_MEN.getCode());
deptScoreEntity.setScore(BigDecimal.ZERO);
deptScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
for (DeptScoreDetailDTO deptScoreDetailDTO : deptScore.getDetailList()) {
BigDecimal indexScore = deptScoreDetailDTO.getScore().multiply(indexMap.get(deptScoreDetailDTO.getIndexCode()).getWeight());
deptScoreEntity.setScore(deptScoreEntity.getScore().add(indexScore));
}
deotScoreEntityList.add(deptScoreEntity);
}
//先删除
int effectRow;
do {
effectRow = deptScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(),
formDTO.getMonthId(),
IndexCodeEnum.QU_ZHI_BU_MEN.getCode(),
IndexCalConstant.DELETE_SIZE);
} while (effectRow > NumConstant.ZERO);
//后新增
if (!CollectionUtils.isEmpty(deotScoreEntityList)) {
//批量插入
List<List<DeptScoreEntity>> partition = ListUtils.partition(deotScoreEntityList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
deptScoreDao.insertBatchEntity(list);
});
}
}
/**
@ -165,7 +232,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
//删除明细时,需要根据分组删,比方说当前计算的是区直部门治理能力,主表需要删除indexCode=zhilinengli的,明细需要删除区直部门:治理能力下面所有的指标明细
int detailDelteNum;
do {
detailDelteNum = deptSubScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(),
detailDelteNum = deptSubScoreDao.deleteBatches(formDTO.getCustomerId(),
formDTO.getMonthId(),
allParentIndexCode,
IndexCalConstant.DELETE_SIZE);

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

@ -18,7 +18,6 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthly
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.*;
import com.epmet.entity.evaluationindex.indexcal.DeptSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity;
import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity;
@ -340,7 +339,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
int masterDeleteNum;
do {
//一次删除50条
masterDeleteNum = gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(),
masterDeleteNum = gridScoreDao.deleteBatches(formDTO.getCustomerId(),
formDTO.getMonthId(),
indexCode,
IndexCalConstant.DELETE_SIZE);
@ -348,7 +347,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
//删除明细时,需要根据分组删,比方说当前计算的是网格相关-党建能力,主表需要删除indexCode=dangjiannengli的,明细需要删除网格相关:党建能力 下面所有的指标明细
int detailDelteNum;
do {
detailDelteNum = gridSubScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(),
detailDelteNum = gridSubScoreDao.deleteBatches(formDTO.getCustomerId(),
formDTO.getMonthId(),
allParentIndexCode,
IndexCalConstant.DELETE_SIZE);
@ -696,18 +695,27 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridScoreEntity.setIndexCode(indexCode);
gridScoreEntity.setScore(BigDecimal.ZERO);
gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR);
if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) {
/*if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) {
log.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值");
continue;
}
}*/
log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失");
for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) {
BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight());
gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore));
}
gridScoreEntityList.add(gridScoreEntity);
}
//先删除
int effectRow;
do {
effectRow =gridScoreDao.deleteBatches(formDTO.getCustomerId(),
formDTO.getMonthId(),
indexCode,
IndexCalConstant.DELETE_SIZE);
} while (effectRow > NumConstant.ZERO);
//批量插入
if (!CollectionUtils.isEmpty(gridScoreEntityList)) {
gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, IndexCalConstant.DELETE_SIZE);
//批量插入
List<List<GridScoreEntity>> partition = ListUtils.partition(gridScoreEntityList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {

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

@ -240,7 +240,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.error("查询社区下级所有网格服务能力得分平均值集合为空");
return;
//todo return;
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE);

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

@ -210,7 +210,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(deptScoreAvgList)) {
log.error("查询所有直属部门治理能力平均值集合为空");
return;
//return;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE);
@ -281,11 +281,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
}
});
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
insertDetail(result);
if (!CollectionUtils.isEmpty(indexInputVOS)) {
HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS));
log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId));
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid);
insertDetail(result);
}
return true;
}
@ -414,7 +416,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setAllParentIndexCode(allParentIndexCode);
score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) {
//todo 确认
if (k != null && k.equals(agency)) {
score.setParentAgencyId(parentAgency);
}
});
@ -432,7 +435,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
s.setAllParentIndexCode(streetScore.getAllParentIndexCode());
s.setDataType(IndexCalConstant.DISTRICT_LEVEL);
pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) {
//todo 确认
if (k != null && k.equals(agency)) {
s.setParentAgencyId(parentAgency);
}
});

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

@ -118,7 +118,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subCommPartyAvgScore)) {
log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
return;
//todo return;
} else if (subCommPartyAvgScore.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
Integer indexEnd = NumConstant.TEN;
@ -193,7 +193,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("查询街道下属所有社区治理能力汇总为空");
return;
//todo return;
}else if (subGridGovernAvg.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubCommunityAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
@ -268,7 +268,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.error("查询街道下属社区服务能力得分平均值为空");
return;
//todo return;
} else if (subCommServiceAvg.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubCommunityAvgResultDTO>> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE);

39
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml

@ -63,7 +63,9 @@
<if test="indexCode != null and indexCode !=''">
and INDEX_CODE=#{indexCode}
</if>
limit #{deleteSize}
<if test="deleteSize != null">
limit #{deleteSize}
</if>
</delete>
<!-- 批量插入计算结果 -->
@ -110,4 +112,39 @@
)
</foreach>
</insert>
<resultMap id="DeptScoreDTOMap" type="com.epmet.dto.indexcal.DeotScore">
<result property="deptId" column="DEPT_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="monthId" column="MONTH_ID"/>
<collection property="detailList" ofType="com.epmet.dto.indexcal.DeptScoreDetailDTO" >
<result property="isTotal" column="IS_TOTAL"/>
<result property="score" column="SCORE"/>
<result property="indexCode" column="INDEX_CODE"/>
</collection>
</resultMap>
<!-- 查询每个部门下所有的指标对应的分值 -->
<select id="selectList" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultMap="DeptScoreDTOMap">
SELECT
m.DEPT_ID,
m.CUSTOMER_ID,
m.AGENCY_ID,
m.QUARTER_ID,
m.YEAR_ID,
m.MONTH_ID,
m.IS_TOTAL,
M.SCORE,
M.INDEX_CODE
FROM
fact_index_dept_score m
WHERE
m.DEL_FLAG = '0'
AND m.IS_TOTAL='0'
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID =#{monthId}
</select>
</mapper>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml

@ -46,11 +46,13 @@
</insert>
<!-- 批量删除 -->
<delete id="deleteByDeptIdAndMonthId" parameterType="map">
<delete id="deleteBatches" parameterType="map">
delete from fact_index_dept_sub_score
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
and ALL_PARENT_INDEX_CODE=#{allParentIndexCode}
limit #{deleteSize}
<if test="deleteSize != null">
limit #{deleteSize}
</if>
</delete>
</mapper>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml

@ -24,7 +24,7 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByCusAndMonthId" parameterType="map">
<delete id="deleteBatches" parameterType="map">
DELETE
FROM
fact_index_grid_score
@ -32,7 +32,9 @@
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND INDEX_CODE = #{indexCode}
limit #{deleteNum}
<if test="deleteSize != null">
limit #{deleteSize}
</if>
</delete>
<!-- 批量插入计算结果 -->

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

@ -49,7 +49,7 @@
</insert>
<!-- 批量删除 -->
<delete id="deleteByDeptIdAndMonthId">
<delete id="deleteBatches">
DELETE
FROM
fact_index_grid_sub_score
@ -57,6 +57,8 @@
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND ALL_PARENT_INDEX_CODE = #{allParentIndexCode}
limit #{deleteSize}
<if test="deleteSize != null">
limit #{deleteSize}
</if>
</delete>
</mapper>
Loading…
Cancel
Save