Browse Source

Merge branch 'dev_third_data' into dev_temp

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
29f60c8908
  1. 10
      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. 28
      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

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

@ -980,6 +980,16 @@ public class DataStatsServiceImpl implements DataStatsService {
} else { } else {
result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId()); 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.setGroupRatio(transform(result.getGroupRatio()));
result.setGroupMemberRatio(transform(result.getGroupMemberRatio())); result.setGroupMemberRatio(transform(result.getGroupMemberRatio()));
result.setTopicRatio(transform(result.getTopicRatio())); 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); OrgStatisticsResultDTO community = map.get(ScreenConstant.COMMUNITY);
if (null != community) { if (null != community) {
int count = community.getCount(); int count = community.getSum();
BigDecimal selfCount = new BigDecimal(count); BigDecimal selfCount = new BigDecimal(count);
item.setCommunityClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); item.setCommunityClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
item.setCommunityClosedCount(count); item.setCommunityClosedCount(count);
@ -274,7 +274,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
// 街道解决占比 // 街道解决占比
OrgStatisticsResultDTO street = map.get(ScreenConstant.STREET); OrgStatisticsResultDTO street = map.get(ScreenConstant.STREET);
if (null != street) { if (null != street) {
int count = street.getCount(); int count = street.getSum();
BigDecimal selfCount = new BigDecimal(count); BigDecimal selfCount = new BigDecimal(count);
item.setStreetClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); item.setStreetClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
item.setStreetClosedCount(count); 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>
<select id="selectAgencyClosedIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO"> <select id="selectAgencyClosedIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT SELECT
AGENCY_ID, a.ID AS AGENCY_ID,
COUNT(ID) AS "sum" COUNT( b.ID ) AS "sum"
FROM fact_origin_issue_main_daily FROM
WHERE CUSTOMER_ID = #{customerId} dim_agency a
AND DATE_ID &lt;= #{dateId} 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'> <if test='null != closedStatus and "" != closedStatus'>
AND ISSUE_STATUS = #{closedStatus} AND b.ISSUE_STATUS = #{closedStatus}
</if> </if>
<if test='null == closedStatus or "" == closedStatus'> <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> </if>
GROUP BY AGENCY_ID WHERE
a.CUSTOMER_ID = #{customerId}
GROUP BY
a.ID
</select> </select>
</mapper> </mapper>

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

@ -688,21 +688,25 @@
AND m.PROJECT_ID = #{projectId} AND m.PROJECT_ID = #{projectId}
</select> </select>
<select id="selectAgencyGridSelfDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO"> <select id="selectAgencyGridSelfDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT SELECT
fm.AGENCY_ID, da.ID AS AGENCY_ID,
COUNT( ID ) AS "sum", COUNT( fm.ID ) AS "sum",
IFNULL( a.count, 0 ) AS "count" IFNULL( a.count, 0 ) AS "count"
FROM 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 ( LEFT JOIN (
SELECT SELECT
AGENCY_ID, agency.ID,
orgId, orgId,
COUNT( PROJECT_ID ) AS "count" COUNT( PROJECT_ID ) AS "count"
FROM FROM
( dim_agency agency
INNER JOIN (
SELECT SELECT
AGENCY_ID, AGENCY_ID,
PIDS,
ORG_ID AS orgId, ORG_ID AS orgId,
PROJECT_ID PROJECT_ID
FROM FROM
@ -715,16 +719,20 @@
GROUP BY GROUP BY
PROJECT_ID PROJECT_ID
HAVING 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 GROUP BY
AGENCY_ID agency.ID
) a ON fm.AGENCY_ID = a.AGENCY_ID ) a ON a.ID = da.ID
WHERE WHERE
PROJECT_STATUS = 'closed' PROJECT_STATUS = 'closed'
AND ORIGIN = "issue" AND ORIGIN = "issue"
AND CUSTOMER_ID = #{customerId} AND da.CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId} AND DATE_ID &lt;= #{dateId}
GROUP BY GROUP BY
fm.AGENCY_ID da.ID
</select> </select>
</mapper> </mapper>

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

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

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

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