Browse Source

响应率统计修改

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
90ed6aefac
  1. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  2. 60
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java

@ -375,7 +375,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
@ -444,7 +448,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
@ -525,7 +533,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
@ -606,7 +618,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}

60
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -297,8 +297,7 @@
<select id="selectGridResponse" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.ORG_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT ORG_ID,
COUNT( ID ) AS "count"
@ -323,12 +322,22 @@
AND MONTH_ID = #{monthId}
GROUP BY ORG_ID ) b
ON a.ORG_ID = b.ORG_ID
LEFT JOIN
(SELECT ORG_ID,
COUNT(DISTINCT ID ) AS "count"
FROM fact_origin_project_log_daily
WHERE ORG_TYPE = 'grid'
AND ACTION_CODE = 'response'
AND IS_ACTIVE = 1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY ORG_ID ) c
ON a.ORG_ID = c.ORG_ID
</select>
<select id="selectOrgResponse" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.AGENCY_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT da.ID AS AGENCY_ID,
COUNT( f.ID ) AS "count"
@ -356,6 +365,19 @@
AND f.MONTH_ID = #{monthId}
GROUP BY da.ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
LEFT JOIN
(SELECT da.ID AS AGENCY_ID,
COUNT(DISTINCT f.ID ) AS "count"
FROM fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND da.`LEVEL` = #{level}
WHERE
ACTION_CODE = 'response'
AND f.IS_ACTIVE = 1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY da.ID ) c
ON a.AGENCY_ID = c.AGENCY_ID
</select>
<select id="selectGridSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
@ -570,8 +592,7 @@
<select id="selectOrgResponseDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.AGENCY_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT da.ID AS AGENCY_ID,
COUNT( f.ID ) AS "count"
@ -599,12 +620,24 @@
AND f.DATE_ID &lt;= #{dateId}
GROUP BY da.ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
LEFT JOIN
(SELECT da.ID AS AGENCY_ID,
COUNT(DISTINCT f.ID ) AS "count"
FROM fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' )
AND da.`LEVEL` = #{level}
WHERE
ACTION_CODE = 'response'
AND f.IS_ACTIVE = 1
AND f.CUSTOMER_ID = #{customerId}
AND f.DATE_ID &lt;= #{dateId}
GROUP BY da.ID ) c
ON a.AGENCY_ID = c.AGENCY_ID
</select>
<select id="selectGridResponseDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.ORG_ID,
a.count AS "sum",
IFNULL( b.count,
0 ) AS "count"
IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count"
FROM
(SELECT ORG_ID,
COUNT( ID ) AS "count"
@ -627,6 +660,17 @@
AND DATE_ID &lt;= #{dateId}
GROUP BY ORG_ID ) b
ON a.ORG_ID = b.ORG_ID
LEFT JOIN
(SELECT ORG_ID,
COUNT( DISTINCT ID ) AS "count"
FROM fact_origin_project_log_daily
WHERE ORG_TYPE = 'grid'
AND ACTION_CODE = 'response'
AND IS_ACTIVE = 1
AND CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY ORG_ID ) c
ON a.ORG_ID = c.ORG_ID
</select>
<select id="selectGridSelfDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

Loading…
Cancel
Save