Browse Source

Merge branch 'dev_third_data' into dev_temp

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
29f60c8908
  1. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  2. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  3. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  4. 32
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  5. 44
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  6. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -1,4 +1,4 @@
package com.epmet.dataaggre.service.datastats.impl;
package com.epmet.dataaggre.service.datastats.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
@ -980,6 +980,16 @@ public class DataStatsServiceImpl implements DataStatsService {
} else {
result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId());
}
if (null == result) {
result = new PartyMemberVanguardDetailResultDTO();
result.setGroupRatio(transform(new BigDecimal(NumConstant.ZERO)));
result.setGroupMemberRatio(transform(new BigDecimal(NumConstant.ZERO)));
result.setTopicRatio(transform(new BigDecimal(NumConstant.ZERO)));
result.setIssueRatio(transform(new BigDecimal(NumConstant.ZERO)));
result.setProjectRatio(transform(new BigDecimal(NumConstant.ZERO)));
result.setProjectClosedRatio(transform(new BigDecimal(NumConstant.ZERO)));
return result;
}
result.setGroupRatio(transform(result.getGroupRatio()));
result.setGroupMemberRatio(transform(result.getGroupMemberRatio()));
result.setTopicRatio(transform(result.getTopicRatio()));

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java

@ -266,7 +266,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
// 社区解决占比
OrgStatisticsResultDTO community = map.get(ScreenConstant.COMMUNITY);
if (null != community) {
int count = community.getCount();
int count = community.getSum();
BigDecimal selfCount = new BigDecimal(count);
item.setCommunityClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
item.setCommunityClosedCount(count);
@ -274,7 +274,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
// 街道解决占比
OrgStatisticsResultDTO street = map.get(ScreenConstant.STREET);
if (null != street) {
int count = street.getCount();
int count = street.getSum();
BigDecimal selfCount = new BigDecimal(count);
item.setStreetClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
item.setStreetClosedCount(count);

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -345,17 +345,22 @@
</select>
<select id="selectAgencyClosedIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) AS "sum"
FROM fact_origin_issue_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
a.ID AS AGENCY_ID,
COUNT( b.ID ) AS "sum"
FROM
dim_agency a
INNER JOIN fact_origin_issue_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
AND b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
<if test='null != closedStatus and "" != closedStatus'>
AND ISSUE_STATUS = #{closedStatus}
AND b.ISSUE_STATUS = #{closedStatus}
</if>
<if test='null == closedStatus or "" == closedStatus'>
AND (ISSUE_STATUS = 'closed_resolved' OR ISSUE_STATUS = 'closed_unresolved')
AND (b.ISSUE_STATUS = 'closed_resolved' OR b.ISSUE_STATUS = 'closed_unresolved')
</if>
GROUP BY AGENCY_ID
WHERE
a.CUSTOMER_ID = #{customerId}
GROUP BY
a.ID
</select>
</mapper>

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

@ -688,21 +688,25 @@
AND m.PROJECT_ID = #{projectId}
</select>
<select id="selectAgencyGridSelfDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
fm.AGENCY_ID,
COUNT( ID ) AS "sum",
IFNULL(a.count,0) AS "count"
da.ID AS AGENCY_ID,
COUNT( fm.ID ) AS "sum",
IFNULL( a.count, 0 ) AS "count"
FROM
fact_origin_project_main_daily fm
dim_agency da
INNER JOIN fact_origin_project_main_daily fm ON fm.PIDS LIKE CONCAT( '%', da.ID, '%' )
LEFT JOIN (
SELECT
AGENCY_ID,
agency.ID,
orgId,
COUNT( PROJECT_ID ) AS "count"
FROM
(
dim_agency agency
INNER JOIN (
SELECT
AGENCY_ID,
PIDS,
ORG_ID AS orgId,
PROJECT_ID
FROM
@ -711,20 +715,24 @@
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND ( ACTION_CODE = 'response' OR ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'created' )
AND PROJECT_ID IN ( SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = "issue")
AND PROJECT_ID IN ( SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = "issue" )
GROUP BY
PROJECT_ID
HAVING
COUNT(DISTINCT ( ORG_ID )) = 1) a
COUNT(
DISTINCT ( ORG_ID )) = 1
) a ON a.PIDS LIKE CONCAT( '%', agency.ID, '%' )
WHERE
agency.CUSTOMER_ID = #{customerId}
GROUP BY
AGENCY_ID
) a ON fm.AGENCY_ID = a.AGENCY_ID
agency.ID
) a ON a.ID = da.ID
WHERE
PROJECT_STATUS = 'closed'
AND ORIGIN = "issue"
AND CUSTOMER_ID = #{customerId}
AND da.CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY
fm.AGENCY_ID
da.ID
</select>
</mapper>

44
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -949,26 +949,41 @@
</select>
<select id="selectAgencyClosedProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) AS "sum"
FROM fact_origin_project_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
a.ID AS AGENCY_ID,
COUNT( b.ID ) AS "sum"
FROM
dim_agency a
INNER JOIN fact_origin_project_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
AND b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
AND PROJECT_STATUS = 'closed'
<if test='null != origin and "" != origin'>
AND ORIGIN = #{origin}
AND b.ORIGIN = #{origin}
</if>
<if test='null != closedStatus and "" != closedStatus'>
AND IS_RESOLVED = #{closedStatus}
AND b.IS_RESOLVED = #{closedStatus}
</if>
GROUP BY AGENCY_ID
WHERE
a.CUSTOMER_ID = #{customerId}
GROUP BY
a.ID
</select>
<select id="selectAgencyClosedProjectStaticDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID,
a.ID AS AGENCY_ID,
b.`LEVEL`,
COUNT( b.ID ) AS "sum",
SUM(
IF
( b.ORG_TYPE = 'department', 1, 0 )) AS "count"
FROM
dim_agency a
INNER JOIN (
SELECT
a.ID,
a.PIDS,
c.`LEVEL`,
COUNT(a.ID) AS "sum",
SUM(IF(b.ORG_TYPE = 'department', 1, 0)) AS "count"
b.ORG_TYPE
FROM
fact_origin_project_main_daily a
INNER JOIN fact_origin_project_log_daily b ON a.ID = b.PROJECT_ID
@ -978,9 +993,12 @@
a.CUSTOMER_ID = #{customerId}
AND a.DATE_ID &lt;= #{dateId}
AND a.PROJECT_STATUS = 'closed'
) b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
a.CUSTOMER_ID = #{customerId}
GROUP BY
a.AGENCY_ID,
c.`LEVEL`
a.ID,
b.`LEVEL`
</select>

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -243,18 +243,23 @@
</select>
<select id="selectAgencyClosedTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT(ID) as "sum"
FROM fact_origin_topic_main_daily
WHERE CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
AND TOPIC_STATUS = 'closed'
a.ID AS AGENCY_ID,
COUNT( b.ID ) AS "sum"
FROM
dim_agency a
INNER JOIN fact_origin_topic_main_daily b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
AND b.CUSTOMER_ID = #{customerId}
AND b.DATE_ID &lt;= #{dateId}
AND b.TOPIC_STATUS = 'closed'
<if test='null != closedStatus and "" != closedStatus'>
AND CLOSED_STATUS = #{closedStatus}
AND b.CLOSED_STATUS = #{closedStatus}
</if>
<if test='null != shiftIssue'>
AND SHIFT_ISSUE = #{shiftIssue}
AND b.SHIFT_ISSUE = #{shiftIssue}
</if>
GROUP BY AGENCY_ID
WHERE
a.CUSTOMER_ID = #{customerId}
GROUP BY
a.ID
</select>
</mapper>
Loading…
Cancel
Save