Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

# Conflicts:
#	epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml
dev_shibei_match
jianjun 5 years ago
parent
commit
6e65c7e71c
  1. 4
      epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java
  3. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java
  4. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  5. 26
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ActTrendMonthlyResultDTO.java
  6. 29
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartActcounttrendResultDTO.java
  7. 43
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HeartSummaryResultDTO.java
  8. 71
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/HomepageSummaryResultDTO.java
  9. 46
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  10. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActTrendMonthlyDao.java
  11. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.java
  12. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.java
  13. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  14. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  15. 55
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  16. 59
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  17. 2
      epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml
  18. 30
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  19. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  20. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml
  21. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml
  22. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.xml
  23. 13
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CalculateStatus.java
  24. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsTrendFormDTO.java
  25. 7
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  26. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  27. 114
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  28. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcNewsTrendMonthlyEntity.java
  29. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java
  30. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  31. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  32. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  33. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  34. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml
  35. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.xml
  36. 16
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java
  37. 9
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.7__add_kongcun_app.sql
  38. 9
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DataStatsProcessPenddingCalService.java
  39. 19
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DataStatsProcessPenddingCalServiceImpl.java
  40. 26
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DataStatsProcessPenddingCalTask.java
  41. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

4
epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java

@ -24,7 +24,9 @@ public class DynamicDataSource extends AbstractRoutingDataSource {
@Override
protected Object determineCurrentLookupKey() {
return DynamicContextHolder.peek();
String ds = DynamicContextHolder.peek();
logger.info("动态数据源:{}" + ds);
return ds;
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java

@ -41,7 +41,7 @@ public class CustomerApplicationRunner implements ApplicationRunner {
//发送启动成功消息
EnvEnum currentEnv = EnvEnum.getCurrentEnv();
logger.info(currentEnv);
if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode())) {
if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) {
InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class);
String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java

@ -11,6 +11,7 @@ import org.springframework.core.env.Environment;
* @date 2020-07-03 11:14
**/
public enum EnvEnum {
LOCAL("local", "本地环境"),
DEV("dev", "开发环境"),
TEST("test", "体验环境"),
PROD("prod", "生产环境"),

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

@ -325,6 +325,14 @@ public class RedisKeys {
* @return
*/
public static String getCustomerStatsCalFlag(String customerId) {
return String.format(rootPrefix + "stats:calflag:%s", customerId);
return getCustomerStatsCalKeyPrefix().concat(":").concat(customerId);
}
/**
* 获取计算标记的key前缀
* @return
*/
public static String getCustomerStatsCalKeyPrefix() {
return rootPrefix.concat("stats:calflag");
}
}

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

@ -0,0 +1,26 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 公益互助-公益活动次数
* @Author sun
*/
@Data
public class ActTrendMonthlyResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 月id :yyyyMM
*/
private String monthId = "";
/**
* 活动数量本月举行的活动
*/
private Integer actCount = 0;
}

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

@ -0,0 +1,29 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import rx.internal.util.LinkedArrayList;
import java.io.Serializable;
import java.util.LinkedList;
/**
* 公益互助-公益活动次数
* @Author sun
*/
@Data
public class HeartActcounttrendResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 横坐标 月份集合
*/
private LinkedList<String> xAxis;
/**
* 活动次数 集合
*/
private LinkedList<String> actCountDataList;
}

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

@ -0,0 +1,43 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 公益互助-各类总数汇总
* @Author sun
*/
@Data
public class HeartSummaryResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 日期Id, 数据更新至yyyyMMdd
*/
private String dateId = "";
/**
* 活动次数
*/
private Integer actCount = 0;
/**
* 志愿者总数
*/
private Integer volunteerCount = 0;
/**
* 参与人次
*/
private Integer partiUserCount = 0;
/**
* 发放积分
*/
private Integer rewardPointCount = 0;
/**
* 公益时长
*/
private Integer heartTime = 0;
}

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

@ -0,0 +1,71 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 首页-平台各类总数
* @Author sun
*/
@Data
public class HomepageSummaryResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 数据更新至yyyyMMdd
*/
private String dateId = "";
/**
* 网格总数
*/
private Integer gridCount = 0;
/**
* 已开通网格数
*/
private Integer openedGridCount = 0;
/**
* 议题总数
*/
private Integer issueCount = 0;
/**
* 项目总数
*/
private Integer projectCount = 0;
/**
* 用户总数
*/
private Integer userCount = 0;
/**
* 党员用户
*/
private Integer partyUserCount = 0;
/**
* 社群总数
*/
private Integer groupCount = 0;
/**
* 话题总数
*/
private Integer topicCount = 0;
/**
* 新闻总数
*/
private Integer newsCount = 0;
/**
* 阅读数量
*/
private Integer readCount = 0;
/**
* 公益活动总数
*/
private Integer actCount = 0;
/**
* 志愿者总数
*/
private Integer volunteerCount = 0;
}

46
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java

@ -1,7 +1,14 @@
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.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.evaluationindex.screen.dto.result.HeartActcounttrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -19,12 +26,37 @@ public class KcScreenController {
private KcScreenService kcScreenService;
// @ExternalAppRequestAuth
// @PostMapping("homepage/summary")
// public Result<YearAverageIndexResultDTO> yearAverageIndex(){
//// ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class);
//// return new Result<YearAverageIndexResultDTO>().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO));
// }
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("homepage/summary")
public Result<HomepageSummaryResultDTO> homepageSummary(ExternalAppRequestParam externalAppRequestParam){
return new Result<HomepageSummaryResultDTO>().ok(kcScreenService.homepageSummary(externalAppRequestParam));
}
/**
* @param externalAppRequestParam
* @Description 公益互助-各类总数汇总
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("heart/summary")
public Result<HeartSummaryResultDTO> heartSummary(ExternalAppRequestParam externalAppRequestParam){
return new Result<HeartSummaryResultDTO>().ok(kcScreenService.heartSummary(externalAppRequestParam));
}
/**
* @param externalAppRequestParam
* @Description 公益互助-公益活动次数
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("heart/actcounttrend")
public Result<HeartActcounttrendResultDTO> heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){
return new Result<HeartActcounttrendResultDTO>().ok(kcScreenService.heartActcounttrend(externalAppRequestParam));
}
// @RequestBody
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcActTrendMonthlyDao.java

@ -17,8 +17,11 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.result.ActTrendMonthlyResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* KC-活动(次数+时长)趋势(先根据customerId+monthId删除)
*
@ -28,4 +31,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcActTrendMonthlyDao {
/**
* @param customerId
* @Description 按客户查询最近十二个月数据
* @author sun
*/
List<ActTrendMonthlyResultDTO> selectActTrendMonthly(String customerId);
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import org.apache.ibatis.annotations.Mapper;
/**
@ -28,4 +29,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcPlatformSummaryDailyDao {
/**
* @param customerId
* @Description 首页-平台各类总数
* @author sun
*/
HomepageSummaryResultDTO selectSummaryDaily(String customerId);
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO;
import org.apache.ibatis.annotations.Mapper;
/**
@ -28,4 +29,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcVolunteerHeatRankGridDailyDao {
/**
* @param customerId
* @Description 公益互助-各类总数汇总
* @author sun
*/
HeartSummaryResultDTO selectHeartSummary(String customerId);
}

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

@ -1,5 +1,10 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.evaluationindex.screen.dto.result.HeartActcounttrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
/**
* 孔村大屏api
*
@ -8,5 +13,24 @@ package com.epmet.datareport.service.evaluationindex.screen;
*/
public interface KcScreenService {
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam);
/**
* @param externalAppRequestParam
* @Description 公益互助-各类总数汇总
* @author sun
*/
HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam);
/**
* @param externalAppRequestParam
* @Description 公益互助-公益活动次数
* @author sun
*/
HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam);
}

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

@ -86,7 +86,11 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) {
return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId());
PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId());
if(null == ageInfo){
ageInfo = new PartymemberAgeDistributionResultDTO();
}
return ageInfo;
}
/**

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

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Comparator;
@ -53,6 +54,10 @@ public class IndexServiceImpl implements IndexService {
if (null == yearAverageIndexResultDTO){
return new YearAverageIndexResultDTO();
}
yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility()));
yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility()));
yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility()));
yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getYearAverageIndex()));
return yearAverageIndexResultDTO;
}
@ -66,19 +71,23 @@ public class IndexServiceImpl implements IndexService {
@Override
public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) {
MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null);
MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null);
if (null == pieChartDTO){
return new MonthPieChartResultDTO();
}
// 处理小数四舍五入
pieChartDTO.setPartyDevAbility(getRound(pieChartDTO.getPartyDevAbility()));
pieChartDTO.setGovernAbility(getRound(pieChartDTO.getGovernAbility()));
pieChartDTO.setServiceAbility(getRound(pieChartDTO.getServiceAbility()));
String monthId = dateUtils.getCurrentMonthId();
int time = NumConstant.TWELVE;
//保证获取月度指数数据的最大可能性
while(null == monthPieChartResultDTO && time > NumConstant.ONE){
while(null == pieChartDTO && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId);
pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId);
}
if (null == monthPieChartResultDTO){
return new MonthPieChartResultDTO();
}
return monthPieChartResultDTO;
return pieChartDTO;
}
/**
@ -112,6 +121,13 @@ public class IndexServiceImpl implements IndexService {
result.setTotalIndexData(totalIndexData);
return result;
}
// 处理小数四舍五入
monthBarchartResults.forEach(barchart -> {
barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility()));
barchart.setGovernAbility(getRound(barchart.getGovernAbility()));
barchart.setServiceAbility(getRound(barchart.getServiceAbility()));
barchart.setIndexTotal(getRound(barchart.getIndexTotal()));
});
List<MonthBarchartResult> collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList());
//升序 当前月份在队尾
List<String> _ymList = dateUtils.getXpro().keySet().stream().collect(Collectors.toList());
@ -178,6 +194,13 @@ public class IndexServiceImpl implements IndexService {
if (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)){
return new ArrayList<>();
}
// 小数四舍五入
subAgencyIndexRankResultDTOS.forEach(indexRank -> {
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility()));
indexRank.setGovernAbility(getRound(indexRank.getGovernAbility()));
indexRank.setServiceAbility(getRound(indexRank.getServiceAbility()));
indexRank.setTotalIndex(getRound(indexRank.getTotalIndex()));
});
return subAgencyIndexRankResultDTOS;
}
@ -191,7 +214,25 @@ public class IndexServiceImpl implements IndexService {
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){
// 月(上一个月) 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO);
subAgencyIndexRankResultDTOS.forEach(rank -> {
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility()));
rank.setGovernAbility(getRound(rank.getGovernAbility()));
rank.setServiceAbility(getRound(rank.getServiceAbility()));
rank.setTotalIndex(getRound(rank.getTotalIndex()));
});
}
return subAgencyIndexRankResultDTOS;
}
/**
* @Description 小数四舍五入
* @param d
* @author zxc
* @date 2020/9/14 2:01 下午
*/
public Double getRound(Double d){
BigDecimal bigDecimal = new BigDecimal(d);
BigDecimal b = bigDecimal.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP);
return Double.valueOf(b.toString());
}
}

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

@ -1,12 +1,23 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcActTrendMonthlyDao;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcVolunteerHeatRankGridDailyDao;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.evaluationindex.screen.dto.result.ActTrendMonthlyResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HeartActcounttrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
/**
* 孔村大屏api
*
@ -19,6 +30,54 @@ public class KcScreenServiceImpl implements KcScreenService {
@Autowired
private DateUtils dateUtils;
@Autowired
private ScreenKcPlatformSummaryDailyDao screenKcPlatformSummaryDailyDao;
@Autowired
private ScreenKcVolunteerHeatRankGridDailyDao screenKcVolunteerHeatRankGridDailyDao;
@Autowired
private ScreenKcActTrendMonthlyDao screenKcActTrendMonthlyDao;
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
@Override
public HomepageSummaryResultDTO homepageSummary(ExternalAppRequestParam externalAppRequestParam) {
return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId());
}
/**
* @param externalAppRequestParam
* @Description 公益互助-各类总数汇总
* @author sun
*/
@Override
public HeartSummaryResultDTO heartSummary(ExternalAppRequestParam externalAppRequestParam) {
return screenKcVolunteerHeatRankGridDailyDao.selectHeartSummary(externalAppRequestParam.getCustomerId());
}
/**
* @param externalAppRequestParam
* @Description 公益互助-公益活动次数
* @author sun
*/
@Override
public HeartActcounttrendResultDTO heartActcounttrend(ExternalAppRequestParam externalAppRequestParam) {
HeartActcounttrendResultDTO resultDTO = new HeartActcounttrendResultDTO();
LinkedList<String> xAxis = new LinkedList<>();
LinkedList<String> actCountDataList = new LinkedList<>();
//1.按客户查询最近十二个月数据
List<ActTrendMonthlyResultDTO> list = screenKcActTrendMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId());
//2.倒序遍历封装数据
for (int i = list.size() - 1; i >= 0; i--) {
xAxis.add(list.get(i).getMonthId());
actCountDataList.add(list.get(i).getActCount().toString());
}
//3.封装数据并返回
resultDTO.setXAxis(xAxis);
resultDTO.setActCountDataList(actCountDataList);
return resultDTO;
}
}

2
epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml

@ -139,7 +139,7 @@
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.datareport.dao.group" level="DEBUG"/>

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

@ -6,9 +6,9 @@
<!-- 2、月度指数分析-饼状图 -->
<select id="selectMonthPieChart" resultType="com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO">
SELECT
ROUND(service_ablity,1) AS serviceAbility,
ROUND(party_dev_ablity,1) AS partyDevAbility,
ROUND(govern_ablity,1) AS governAbility
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility
FROM
screen_index_data_monthly
WHERE
@ -30,10 +30,10 @@
<select id="selectMonthBarchart" resultType="com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult">
SELECT
month_id AS monthId,
ROUND(service_ablity,1) AS serviceAbility,
ROUND(party_dev_ablity,1) AS partyDevAbility,
ROUND(govern_ablity,1) AS governAbility,
ROUND(index_total,1) AS indexTotal
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
(service_ablity * SERVICE_ABLITY_WEIGHT + party_dev_ablity * PARTY_DEV_WEIGHT + govern_ablity * GOVERN_ABLITY_WEIGHT) AS indexTotal
FROM
screen_index_data_monthly
WHERE
@ -47,10 +47,10 @@
<select id="selectSubAgencyIndexRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
org_name AS NAME,
ROUND(index_total,1) AS totalIndex,
ROUND(govern_ablity,1) AS governAbility,
ROUND(party_dev_ablity,1) AS partyDevAbility,
ROUND(service_ablity,1) AS serviceAbility
index_total AS totalIndex,
govern_ablity AS governAbility,
party_dev_ablity AS partyDevAbility,
service_ablity AS serviceAbility
FROM
screen_index_data_yearly
WHERE
@ -66,10 +66,10 @@
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
org_name AS `NAME`,
ROUND(index_total, 1) AS totalIndex,
ROUND(govern_ablity, 1) AS governAbility,
ROUND(party_dev_ablity, 1) AS partyDevAbility,
ROUND(service_ablity, 1) AS serviceAbility,
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
(service_ablity * SERVICE_ABLITY_WEIGHT + party_dev_ablity * PARTY_DEV_WEIGHT + govern_ablity * GOVERN_ABLITY_WEIGHT) AS totalIndex,
ORG_ID orgId
FROM
screen_index_data_monthly

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

@ -6,10 +6,10 @@
<!-- 1、年度平均指数 -->
<select id="selectYearAverageIndex" resultType="com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO">
SELECT
ROUND(index_total,1) AS yearAverageIndex,
ROUND(service_ablity,1) AS serviceAbility,
ROUND(party_dev_ablity,1) AS partyDevAbility,
ROUND(govern_ablity,1) AS governAbility
index_total AS yearAverageIndex,
service_ablity AS serviceAbility,
party_dev_ablity AS partyDevAbility,
govern_ablity AS governAbility
FROM
screen_index_data_yearly
WHERE

15
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcActTrendMonthlyDao.xml

@ -4,5 +4,18 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcActTrendMonthlyDao">
<select id="selectActTrendMonthly"
resultType="com.epmet.evaluationindex.screen.dto.result.ActTrendMonthlyResultDTO">
SELECT
month_id AS "monthId",
act_count AS "actCount"
FROM
screen_kc_act_trend_monthly
WHERE
del_flag = '0'
AND customer_id = #{customerId}
ORDER BY
month_id DESC
LIMIT 12
</select>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml

@ -3,5 +3,29 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao">
<select id="selectSummaryDaily" resultType="com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO">
SELECT
date_id AS "dateId",
grid_count AS "gridCount",
opened_grid_count AS "openedGridCount",
issue_count AS "issueCount",
project_count AS "projectCount",
user_count AS "userCount",
party_user_count AS "partyUserCount",
group_count AS "groupCount",
topic_count AS "topicCount",
news_count AS "newsCount",
read_count AS "readCount",
act_count AS "actCount",
volunteer_count AS "volunteerCount"
FROM
screen_kc_platform_summary_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
ORDER BY
date_id DESC
LIMIT 1
</select>
</mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.xml

@ -4,4 +4,21 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcVolunteerHeatRankGridDailyDao">
<select id="selectHeartSummary" resultType="com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO">
SELECT
date_id AS "dateId",
act_count AS "actCount",
volunteer_count AS "volunteerCount",
parti_user_count AS "partiUserCount",
reward_point_count AS "rewardPointCount",
heart_time AS "heartTime"
FROM
screen_kc_act_summary_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
ORDER BY
date_id DESC
LIMIT 1
</select>
</mapper>

13
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CalculateStatus.java

@ -0,0 +1,13 @@
package com.epmet.constant;
/**
* 计算状态
* calculating:正在计算中有实例正在计算
* pendding:计算暂停说明计算过程中实例发生重启等待重新计算
*/
public interface CalculateStatus {
String PENDDING = "pendding";
String CALCULATING = "calculating";
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcNewsTrendFormDTO.java

@ -15,11 +15,6 @@ public class KcNewsTrendFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 阅读数量
*/
private Integer readCount;
/**
* 参与数量
*/

7
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -173,4 +173,11 @@ public interface DataStatisticalOpenFeignClient {
@PostMapping("/data/stats/statstopic/execute")
Result execTopicStatistical(@RequestParam(value = "date",required = false) String date);
/**
* 处理暂停的计算
* @return
*/
@PostMapping("/data/stats/indexcalculate/process-pendding-cals")
Result processPenddingCalculate();
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -170,4 +170,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result execTopicStatistical(String date) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical",date);
}
@Override
public Result processPenddingCalculate() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate");
}
}

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

@ -2,13 +2,17 @@ package com.epmet.controller;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.RenException;
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.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.CalculateStatus;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.model.CalculateFlagModel;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.util.DimIdGenerator;
@ -25,6 +29,7 @@ import javax.annotation.PreDestroy;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.*;
/**
@ -59,20 +64,43 @@ public class IndexCalculateController {
private Map<String, Future> futureMap = new HashMap<>();
@PreDestroy
public void clearDataCalFlag() {
// 实例销毁之前,将正在本实例中执行计算的客户列表的计算状态清空
public void saveCalStatus() {
// 实例销毁之前,将正在本实例中执行计算的客户列表的计算状态修改为pendding,等待其他实例重新计算
futureMap.forEach((customerId, future) -> {
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId));
CalculateFlagModel flag = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId));
flag.setStatus(CalculateStatus.PENDDING);
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), flag);
log.info("客户【%s】正在执行计算,实例发生重启,修改计算状态为:calculation->pendding", customerId);
});
}
/**
* 处理暂停中的计算
*/
@PostMapping("process-pendding-cals")
public Result processPenddingCalculate() {
String keyPrefix = RedisKeys.getCustomerStatsCalKeyPrefix();
Set<String> calFlagKeys = redisUtils.keys(keyPrefix.concat("*"));
calFlagKeys.forEach(key -> {
CalculateFlagModel flag = (CalculateFlagModel) redisUtils.get(key);
if (flag != null && CalculateStatus.PENDDING.equals(flag.getStatus())) {
// 找到状态是pendding的key,执行计算
CalculateCommonFormDTO form = new CalculateCommonFormDTO();
form.setCustomerId(flag.getForm().getCustomerId());
form.setMonthId(flag.getForm().getMonthId());
indexCalculate(form);
}
});
return new Result();
}
/**
* 按照客户计算所有指标(按照月份)
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Author zhangyongç
* @Date 10:52 2020-08-20
**/
@ExternalAppRequestAuth
@ -80,34 +108,66 @@ public class IndexCalculateController {
public Result<Boolean> indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "epmettest";
Boolean executing = (Boolean) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId));
if (executing == null || !executing) {
formDTO.setCustomerId(customerId);
indexCalculate(formDTO);
return new Result<Boolean>().ok(true);
}
/**
* 指标计算
* @param formDTO
*/
private void indexCalculate(CalculateCommonFormDTO formDTO) {
CalculateFlagModel executeFlag = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()));
if (executeFlag == null || !CalculateStatus.CALCULATING.equals(executeFlag.getStatus())) {
// 可以计算
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);
CalculateFlagModel executingFlag2 = (CalculateFlagModel) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()));
if (executingFlag2 != null && CalculateStatus.CALCULATING.equals(executingFlag2.getStatus())) {
//log.error(String.format("客户【%s】正在执行计算,请勿重复提交计算请求。", customerId));
throw new RenException(String.format("客户【%s】正在执行计算,请勿重复提交计算请求。", formDTO.getCustomerId()));
}
Future<?> future = singleThreadPool.submit(() -> {
formDTO.setCustomerId(customerId);
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) {
log.error("客户Id:{},全部指标计算完成,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000);
}
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId));
futureMap.remove(customerId);
});
futureMap.put(customerId, future);
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), true);
// 提交异步计算
submitCalculate(formDTO);
}
} else {
log.error(String.format("该客户正在执行计算,请勿重复提交计算请求。", customerId));
return new Result<Boolean>().ok(false);
throw new RenException(String.format("客户【%s】正在执行计算,请勿重复提交计算请求。", formDTO.getCustomerId()));
}
}
/**
* 提交异步计算
* @param formDTO
* @return
*/
private void submitCalculate(CalculateCommonFormDTO formDTO) {
Future<?> future = singleThreadPool.submit(() -> {
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
if (aBoolean) {
log.error("客户Id:{},全部指标计算完成,总耗时:{}秒", formDTO.getCustomerId(), (System.currentTimeMillis() - start) / 1000);
}
return new Result<Boolean>().ok(true);
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()));
futureMap.remove(formDTO.getCustomerId());
//测试代码
//try {
// Thread.sleep(20000l);
// System.out.println(System.currentTimeMillis());
//} catch (InterruptedException e) {
// e.printStackTrace();
//}
//redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()));
//futureMap.remove(formDTO.getCustomerId());
});
futureMap.put(formDTO.getCustomerId(), future);
CalculateFlagModel flag = new CalculateFlagModel();
flag.setStatus(CalculateStatus.CALCULATING);
flag.setForm(formDTO);
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId()), flag);
}
/**
@ -126,7 +186,7 @@ public class IndexCalculateController {
future.cancel(true);
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId));
futureMap.remove(customerId);
HttpClientManager.getInstance().sendAlarmMsg(String.format("数据统计服务-中止计算成功,customerId:%s", customerId));
HttpClientManager.getInstance().sendAlarmMsg(String.format(EnvEnum.getCurrentEnv().getName() + "数据统计服务-中止计算成功,customerId:%s", customerId));
}
return new Result();
}
@ -135,7 +195,7 @@ public class IndexCalculateController {
public Result<Boolean> calculateAll(@RequestBody CalculateCommonFormDTO formDTO) {
long start = System.currentTimeMillis();
Boolean aBoolean = indexCalculateService.indexCalculate(formDTO);
HttpClientManager.getInstance().sendAlarmMsg("客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒");
HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒");
if (aBoolean) {
return new Result<Boolean>().ok(true);
}

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

@ -48,11 +48,6 @@ public class ScreenKcNewsTrendMonthlyEntity extends BaseEpmetEntity {
*/
private String monthId;
/**
* 阅读数量
*/
private Integer readCount;
/**
* 参与数量
*/

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/CalculateFlagModel.java

@ -0,0 +1,20 @@
package com.epmet.model;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import lombok.Data;
@Data
public class CalculateFlagModel {
/**
* 提交计算时候的参数
*/
private CalculateCommonFormDTO form;
/**
* 计算状态
* CalculateStatus.java
*/
private String status;
}

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

@ -69,6 +69,33 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
@Autowired
private CommunitySubScoreDao communitySubScoreDao;
/**
* @param customerId
* @param monthId
* @Description 计算社区相关总分
* @author zxc
* @date 2020/9/1 4:12 下午
*/
public Boolean calCommunityAll(String customerId, String monthId) {
Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力
if (!aBoolean.equals(true)) {
throw new RenException("calculate community-party-ability failure ......");
}
Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力
if (!bBoolean.equals(true)) {
throw new RenException("calculate community-govern-ability failure ......");
}
Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力
if (!cBoolean.equals(true)) {
throw new RenException("calculate community-service-ability failure ......");
}
Boolean dBoolean = communityRelate(customerId, monthId);
if (!dBoolean.equals(true)) {
throw new RenException("calculate community-all insert failure ......");
}
return true;
}
/**
* @param customerId
* @Description 社区名义发文数量计算党建能力
@ -91,7 +118,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.GRID_PARTY_AVG_NULL);
return;
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE);
@ -112,7 +138,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL);
return;
}
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -166,7 +191,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("社区下级治理能力平均分集合为空");
return;
}else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
@ -187,7 +211,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -241,7 +264,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.error("查询社区下级所有网格服务能力得分平均值集合为空");
//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);
@ -261,7 +283,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -336,33 +357,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
return true;
}
/**
* @param customerId
* @param monthId
* @Description 计算社区相关总分
* @author zxc
* @date 2020/9/1 4:12 下午
*/
public Boolean calCommunityAll(String customerId, String monthId) {
Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力
if (!aBoolean.equals(true)) {
throw new RenException("calculate community-party-ability failure ......");
}
Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力
if (!bBoolean.equals(true)) {
throw new RenException("calculate community-govern-ability failure ......");
}
Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力
if (!cBoolean.equals(true)) {
throw new RenException("calculate community-service-ability failure ......");
}
Boolean dBoolean = communityRelate(customerId, monthId);
if (!dBoolean.equals(true)) {
throw new RenException("calculate community-all insert failure ......");
}
return true;
}
/**
* @param list
* @Description BigDecimal类型获取最大数和最小数

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

@ -116,7 +116,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
return;
} 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);
@ -137,7 +136,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL);
return;
}
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -191,7 +189,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(districtGovernAvgList)) {
log.error("查询所有街道治理能力平均值集合为空");
return;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE);
@ -211,7 +208,6 @@ 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;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE);
@ -261,7 +257,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(subStreetAvgList)) {
log.error("查询区下属街道服务能力汇总平均值集合为空");
return;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE);

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

@ -119,7 +119,6 @@ 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);
//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;
@ -141,7 +140,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(mapList)) {
log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL);
return;
}
String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldName)) {
@ -194,7 +192,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("查询街道下属所有社区治理能力汇总为空");
//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);
@ -215,7 +212,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -269,7 +265,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.error("查询街道下属社区服务能力得分平均值为空");
//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);
@ -289,7 +284,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -37,7 +37,7 @@ public class BatchScoreCalculator {
}
/**
* 执行计算以样本的所有指标总得分及明细分数值
* 执行计算以样本的所有指标总得分原始值及明细分数归一后的值 不乘以权重
*
* @param indexInputVOS
* @return
@ -56,7 +56,9 @@ public class BatchScoreCalculator {
//遍历该指标下的每个数据
for (SampleValue vo : indexValueVOs) {
String sampleId = vo.getSampleId();
BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);
//归一后的值
BigDecimal normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP);
CalculateResult result = scoreCountOfSamples.get(sampleId);
if (result == null) {
@ -67,7 +69,7 @@ public class BatchScoreCalculator {
result.setDetails(new ArrayList<>());
scoreCountOfSamples.put(sampleId, result);
}
IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score, idx.getWeight());
IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight());
result.getDetails().add(sampleScore);
result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP));
}
@ -76,40 +78,6 @@ public class BatchScoreCalculator {
return scoreCountOfSamples;
}
/**
* 执行计算以样本的所有指标总得分
*
* @param indexInputVOS
* @return
*/
public HashMap<String, BigDecimal> getScoreCountOfSampleId(List<IndexInputVO> indexInputVOS) {
// 每个样本的总得分
HashMap<String, BigDecimal> scoreCountOfSamples = new HashMap<>();
for (IndexInputVO idx : indexInputVOS) {
// 每个指标循环一次
List<SampleValue> indexValueVOs = idx.getIndexValueVOs();
BigDecimal weight = idx.getWeight();
ScoreCalculator scoreCalculator = idx.getScoreCalculator();
BigDecimal threshold = idx.getThreshold();
for (SampleValue vo : indexValueVOs) {
String sampleId = vo.getSampleId();
BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight);
if (scoreCountOfSamples.containsKey(sampleId)) {
BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score).setScale(6, RoundingMode.HALF_UP);
scoreCountOfSamples.put(sampleId, newScore);
} else {
score.setScale(6, RoundingMode.HALF_UP);
scoreCountOfSamples.put(sampleId, score);
}
}
}
return scoreCountOfSamples;
}
/**
* 获取最终样本值
*

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml

@ -71,9 +71,9 @@
PARENT_ID parentId,
ORG_NAME orgName,
SUM(INDEX_TOTAL) / #{monthCount} as indexTotal,
SUM(PARTY_DEV_ABLITY) / #{monthCount} as partyDevAblity,
SUM(SERVICE_ABLITY) / #{monthCount} as serviceAblity,
SUM(GOVERN_ABLITY) / #{monthCount} as governAblity
SUM(PARTY_DEV_ABLITY * PARTY_DEV_WEIGHT) / #{monthCount} as partyDevAblity,
SUM(SERVICE_ABLITY * SERVICE_ABLITY_WEIGHT) / #{monthCount} as serviceAblity,
SUM(GOVERN_ABLITY * GOVERN_ABLITY_WEIGHT) / #{monthCount} as governAblity
FROM screen_index_data_monthly
WHERE DEL_FLAG = '0'
AND YEAR_ID = #{yearId}

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcNewsTrendMonthlyDao.xml

@ -7,7 +7,6 @@
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="readCount" column="READ_COUNT"/>
<result property="partiCount" column="PARTI_COUNT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
@ -29,7 +28,6 @@
ID,
CUSTOMER_ID,
MONTH_ID,
READ_COUNT,
PARTI_COUNT,
DEL_FLAG,
REVISION,
@ -43,7 +41,6 @@
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{monthId},
#{item.readCount},
#{item.partiCount},
0,
0,

16
epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java

@ -170,13 +170,22 @@ public class DemoScoreCal {
List<IndexInputVO> indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO);
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
HashMap<String, BigDecimal> result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
HashMap<String, CalculateResult> result = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
HashMap<String, CalculateResult> result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
System.err.println("----------------1----------------");
result.forEach((key, value) -> {
System.out.println(key.concat("的得分为:").concat(value.toString()));
});
System.err.println("-----------------2---------------");
System.err.println("----------------123123123123----------------");
result2.forEach((key, value) -> {
System.out.println(key.concat("的得分为:").concat(value.toString()));
});
System.err.println("-----------------2---------------");
}
@ -235,13 +244,8 @@ public class DemoScoreCal {
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
System.out.println("param:" + JSON.toJSONString(indexInputVOS));
HashMap<String, BigDecimal> result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
HashMap<String, CalculateResult> result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
System.err.println("----------------1----------------");
result.forEach((key, value) -> {
System.out.println(key.concat("的得分为:").concat(value.toString()));
});
System.err.println("-----------------2---------------");
System.err.println("----------------11111111----------------");

9
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.7__add_kongcun_app.sql

@ -0,0 +1,9 @@
INSERT INTO `epmet_common_service`.`external_customer`(`ID`, `CUSTOMER_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2fe0065f70ca0e23ce4c26fca5f1d933', '大美孔村', 0, 0, 'APP_USER', '2020-09-15 09:00:57', 'APP_USER', '2020-09-15 09:00:57');
INSERT INTO `epmet_common_service`.`external_app`(`ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG`) VALUES ('4733fda58aba5024b776f22f135350df', '孔村数据采集', '2fe0065f70ca0e23ce4c26fca5f1d933', 'external', 0, 'APP_USER', '2020-09-15 09:01:31', 'APP_USER', '2020-09-15 09:01:31', 0);
INSERT INTO `epmet_common_service`.`external_app`(`ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG`) VALUES ('5efcfb775125d656f39583b8110a3d7d', '孔村大屏', '2fe0065f70ca0e23ce4c26fca5f1d933', 'external', 0, 'APP_USER', '2020-09-15 09:01:39', 'APP_USER', '2020-09-15 09:01:39', 0);
INSERT INTO `epmet_common_service`.`external_app_secret`(`ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('362d4fce3311f67edb40b0e5291d37eb', '5efcfb775125d656f39583b8110a3d7d', '657cd46d385a4c2ba6d9355aee24654ac3951deab7e6436e91201561b94969b5', 0, 0, 'APP_USER', '2020-09-15 09:01:39', 'APP_USER', '2020-09-15 09:01:39');
INSERT INTO `epmet_common_service`.`external_app_secret`(`ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7853487c79dab384b4c681d734d9eb3a', '4733fda58aba5024b776f22f135350df', '61224b4d747f4853b9551fe078b90b2355f72c3256a14bdb8faac4a4d7ed68a0', 0, 0, 'APP_USER', '2020-09-15 09:01:31', 'APP_USER', '2020-09-15 09:01:31');

9
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DataStatsProcessPenddingCalService.java

@ -0,0 +1,9 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
public interface DataStatsProcessPenddingCalService {
Result processPenddingCal();
}

19
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DataStatsProcessPenddingCalServiceImpl.java

@ -0,0 +1,19 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.service.DataStatsProcessPenddingCalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class DataStatsProcessPenddingCalServiceImpl implements DataStatsProcessPenddingCalService {
@Autowired
private DataStatisticalOpenFeignClient feignClient;
@Override
public Result processPenddingCal() {
return feignClient.processPenddingCalculate();
}
}

26
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DataStatsProcessPenddingCalTask.java

@ -0,0 +1,26 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.DataStatsProcessPenddingCalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component("dataStatsProcessPenddingCalTask")
public class DataStatsProcessPenddingCalTask implements ITask {
@Autowired
private DataStatsProcessPenddingCalService dataStatsProcessPenddingCalService;
@Override
public void run(String params) {
log.debug("DataStatsProcessPenddingCalTask定时任务正在执行,参数为:{}", params);
Result result = dataStatsProcessPenddingCalService.processPenddingCal();
if (result.success()){
log.debug("DataStatsProcessPenddingCalTask定时任务正在执行定时任务执行成功");
}else {
log.debug("DataStatsProcessPenddingCalTask定时任务正在执行定时任务执行失败:" + result.getMsg());
}
}
}

8
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -230,9 +230,11 @@
cs.del_flag = 0
AND cs.enable_flag = 'enable'
AND
<foreach collection="userIds" item="userId" separator="OR">
cs.user_id = #{userId}
</foreach>
(
<foreach collection="userIds" item="userId" separator="OR">
cs.user_id = #{userId}
</foreach>
)
</select>

Loading…
Cancel
Save