Browse Source

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

# Conflicts:
#	epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
#	epmet-module/epmet-third/epmet-third-server/pom.xml
master
zxc 5 years ago
parent
commit
643d9f3a1b
  1. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java
  2. 43
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java
  3. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java
  5. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexCodeFieldReDao.java
  6. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java
  7. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java
  8. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  10. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java
  11. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/CpcIndexCalculateServiceImpl.java
  12. 32
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml
  13. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexCodeFieIdReDao.xml
  14. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml
  15. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  16. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml

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

@ -78,7 +78,11 @@ public class IndexServiceImpl implements IndexService {
@DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true)
@Override
public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
// String customerId = externalAppRequestParam.getCustomerId();
// 验签关闭,customerId无法获取,暂时写死
String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
MonthBarchartResultDTO result = new MonthBarchartResultDTO();
List<Double> serviceAbilityData = new ArrayList<>();
List<Double> partyDevAbilityData = new ArrayList<>();

43
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.indexcal;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 最值通用DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/8/26 10:39
*/
@Data
public class ExtremeValueDTO implements Serializable {
private static final long serialVersionUID = -2227402439857459667L;
/**
* 最小值
*/
private BigDecimal minValue1;
private BigDecimal minValue2;
private BigDecimal minValue3;
private BigDecimal minValue4;
private BigDecimal minValue5;
private BigDecimal minValue6;
private BigDecimal minValue7;
private BigDecimal minValue8;
private BigDecimal minValue9;
private BigDecimal minValue10;
private BigDecimal maxValue1;
private BigDecimal maxValue2;
private BigDecimal maxValue3;
private BigDecimal maxValue4;
private BigDecimal maxValue5;
private BigDecimal maxValue6;
private BigDecimal maxValue7;
private BigDecimal maxValue8;
private BigDecimal maxValue9;
private BigDecimal maxValue10;
}

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

@ -2,7 +2,9 @@ package com.epmet.controller;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.IndexCalculateForm;
import com.epmet.service.screen.CpcIndexCalculateService;
import com.epmet.service.screen.IndexCalculateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -21,7 +23,10 @@ import org.springframework.web.bind.annotation.RestController;
public class IndexCalculateController {
@Autowired
private IndexCalculateService indexCalculateService;
private IndexCalculateService indexCalculateService;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
/**
* 1按照客户计算指标(按照月份)
@ -37,6 +42,12 @@ public class IndexCalculateController {
indexCalculateService.indexCalculate(formDTO);
return new Result();
}
@PostMapping("getMax")
public Result getMax(){
CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO("c1","202008");
cpcIndexCalculateService.cpcIndexCalculate(calculateCommonFormDTO);
return new Result();
}
/* *//**
* 2党建能力-网格相关指标上报(按照月份)

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java

@ -23,7 +23,9 @@ import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 党建能力-党员相关的事实表
@ -69,4 +71,6 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao<FactIndexPart
@Param("customerId") String customerId);
List<FactIndexPartyAblityCpcMonthlyEntity> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId);
Map<String, BigDecimal> getExtremeValue(@Param("customerId") String customerId);
}

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

@ -0,0 +1,9 @@
package com.epmet.dao.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.screen.IndexCodeFieldReEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IndexCodeFieldReDao extends BaseDao<IndexCodeFieldReEntity> {
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexCodeFieldReEntity.java

@ -0,0 +1,21 @@
package com.epmet.entity.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("index_code_field_re")
public class IndexCodeFieldReEntity extends BaseEpmetEntity {
/**
* 指标code
*/
private String indexCode;
/**
* 字段名
*/
private String fieldId;
}

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

@ -52,6 +52,11 @@ public class IndexGroupDetailEntity extends BaseEpmetEntity {
*/
private String indexId;
/**
* 指标code
*/
private String indexCode;
/**
* 权重同一组权重总和=1
*/

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

@ -47,6 +47,11 @@ public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity {
*/
private String indexId;
/**
* 指标code
*/
private String indexCode;
/**
* 权重同一组权重总和=1
*/

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

@ -207,10 +207,12 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setIndexId(indexDictEntity.getId());
if (level == 5) {
templateEntity.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(index.getLevel5Index(),true));
String level5WeightStr = index.getLevel5Weight().replace("%", "");
templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP));
indexGroupDetailMap.put(index.getLevel5Index(), templateEntity);
} else {
templateEntity.setIndexCode(Pinyin4jUtil.getFirstSpellPinYin(indexDictEntity.getIndexName(),true));
indexGroupDetailMap.put(indexDictEntity.getIndexName(), templateEntity);
templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP));
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/CpcIndexCalculateService.java

@ -0,0 +1,18 @@
package com.epmet.service.screen;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
/**
* 党员指标计算service
*
* @author liujianjun@elink-cn.com
* @date 2020/8/18 10:25
*/
public interface CpcIndexCalculateService {
/**
* desc计算党员相关指标
* @param formDTO
* @return
*/
Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO);
}

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

@ -0,0 +1,34 @@
package com.epmet.service.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.dao.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.screen.CpcIndexCalculateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
@Autowired
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao;
@Override
public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) {
//计算最大最小值
Map<String, BigDecimal> minAndMaxList = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId());
if (CollectionUtils.isEmpty(minAndMaxList)){
log.warn("customerId:{} have not any record",formDTO.getCustomerId());
return false;
}
log.info(JSON.toJSONString(minAndMaxList));
List<FactIndexPartyAblityCpcMonthlyEntity> list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId());
return null;
}
}

32
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml

@ -13,7 +13,7 @@
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="createTopicCount" column="CREATE_TOPIC_COUNT"/>
<result property="joinTopicCount" column="JOIN__TOPIC_COUNT"/>
<result property="joinTopicCount" column="JOIN_TOPIC_COUNT"/>
<result property="shiftIssueCount" column="SHIFT_ISSUE_COUNT"/>
<result property="shiftProjectCount" column="SHIFT_PROJECT_COUNT"/>
<result property="joinThreeMeetsCount" column="JOIN_THREE_MEETS_COUNT"/>
@ -48,7 +48,7 @@
QUARTER_ID,
YEAR_ID,
CREATE_TOPIC_COUNT,
JOIN__TOPIC_COUNT,
JOIN_TOPIC_COUNT,
SHIFT_ISSUE_COUNT,
SHIFT_PROJECT_COUNT,
JOIN_THREE_MEETS_COUNT,
@ -97,7 +97,7 @@
<select id="getCountByMonthId" resultMap="factIndexPartyAblityCpcMonthlyMap">
SELECT
CREATE_TOPIC_COUNT,
JOIN__TOPIC_COUNT,
JOIN_TOPIC_COUNT,
SHIFT_ISSUE_COUNT,
SHIFT_PROJECT_COUNT,
JOIN_THREE_MEETS_COUNT,
@ -112,4 +112,30 @@
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
</select>
<select id="getExtremeValue" resultType="java.util.Map">
SELECT
MIN( CREATE_TOPIC_COUNT ) minValue1,
MAX( CREATE_TOPIC_COUNT ) maxValue1,
MAX( JOIN_TOPIC_COUNT ) minValue2,
MAX( JOIN_TOPIC_COUNT ) maxValue2,
MIN( SHIFT_ISSUE_COUNT ) minValue3,
MAX( SHIFT_ISSUE_COUNT ) maxValue3,
MIN( SHIFT_PROJECT_COUNT ) minValue4,
MAX( SHIFT_PROJECT_COUNT ) maxValue4,
MIN( JOIN_THREE_MEETS_COUNT ) minValue5,
MAX( JOIN_THREE_MEETS_COUNT ) maxValue5,
MIN( GROUP_USER_COUNT ) minValue6,
MAX( GROUP_USER_COUNT ) maxValue6,
MIN( GROUP_ACTIVE_USER_COUNT ) minValue7,
MAX( GROUP_ACTIVE_USER_COUNT ) maxValue7,
MIN( GROUP_TOPIC_COUNT ) minValue8,
MAX( GROUP_TOPIC_COUNT ) maxValue8,
MIN( TOPIC_TO_ISSUE_RATIO ) minValue9,
MAX( TOPIC_TO_ISSUE_RATIO ) maxValue9
FROM
fact_index_party_ablity_cpc_monthly
WHERE
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DEL_FLAG = '0'
</select>
</mapper>

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.screen.IndexCodeFieldReDao">
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml

@ -5,7 +5,7 @@
<select id="getDetailListByParentCode" resultType="com.epmet.entity.screen.IndexGroupDetailEntity">
select ID, INDEX_GROUP_ID, INDEX_ID, WEIGHT, THRESHOLD FROM index_group_detail_template
select ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD FROM index_group_detail
where STATUS = 'enable' and DEL_FLAG = '0'
</select>
</mapper>

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.135
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.134
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.135</version>
<version>0.0.134</version>
<parent>
<groupId>com.epmet</groupId>

Loading…
Cancel
Save