Browse Source

Merge remote-tracking branch 'origin/dev'

dev_shibei_match
yinzuomei 5 years ago
parent
commit
222e8fd1b5
  1. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java
  2. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java
  3. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java
  4. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java
  5. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  6. 41
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml
  7. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml
  8. 47
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java

@ -48,12 +48,12 @@ public interface ScreenAnGrassRootsGovernMonthlyDao {
* 基层治理-指标月度趋势
*
* @param agencyId
* @param yearId
* @param curDate
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendDTO>
* @author zhaoqifeng
* @date 2020/10/9 16:49
*/
List<GrassRootsGovernTrendDTO> selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
List<GrassRootsGovernTrendDTO> selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate);
/**
* 基层治理-治理排行

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java

@ -49,12 +49,12 @@ public interface ScreenAnGrassRootsOrgMonthlyDao {
* 基层组织-指标月度趋势
*
* @param agencyId
* @param yearId
* @param curDate
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendDTO>
* @author zhaoqifeng
* @date 2020/10/9 16:32
*/
List<GrassRootsOrgTrendDTO> selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
List<GrassRootsOrgTrendDTO> selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate);
/**
* 基层组织-组织排行榜单

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java

@ -47,12 +47,12 @@ public interface ScreenAnGrassRootsPmTotalMonthlyDao {
* 基层党员-指标月度趋势
*
* @param agencyId
* @param monthId
* @param curDate
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO>
* @author zhaoqifeng
* @date 2020/10/9 15:12
*/
List<PmTotalTrendDTO> selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
List<PmTotalTrendDTO> selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate);
}

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

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -38,6 +39,8 @@ public class AnScreenServiceImpl implements AnScreenService {
private ScreenAnGrassRootsGovernMonthlyDao screenAnGrassRootsGovernMonthlyDao;
@Autowired
private ScreenAnCommunityProjectProfileDao screenAnCommunityProjectProfileDao;
@Autowired
private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl;
/**
* 基层党员-各类总数
@ -65,7 +68,10 @@ public class AnScreenServiceImpl implements AnScreenService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO) {
PmTotalTrendResultDTO resultDTO = new PmTotalTrendResultDTO();
List<PmTotalTrendDTO> list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), formDTO.getMonthId());
String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01";
// 查询近一年的指数值【包括本月】
List<PmTotalTrendDTO> list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), curDate);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
List<Integer> groupMemberTotalList = list.stream().map(PmTotalTrendDTO::getGroupMemberTotal).collect(Collectors.toList());
List<Integer> topicTotalList = list.stream().map(PmTotalTrendDTO::getTopicTotal).collect(Collectors.toList());
@ -123,9 +129,12 @@ public class AnScreenServiceImpl implements AnScreenService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) {
GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO();
String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY);
List<GrassRootsOrgTrendDTO> list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), yearId);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01";
// 查询近一年的指数值【包括本月】
List<GrassRootsOrgTrendDTO> list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), curDate);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
List<Integer> groupTotalList = list.stream().map(GrassRootsOrgTrendDTO::getGroupTotal).collect(Collectors.toList());
List<Integer> issueTotalList = list.stream().map(GrassRootsOrgTrendDTO::getIssueTotal).collect(Collectors.toList());
List<Integer> projectTotal = list.stream().map(GrassRootsOrgTrendDTO::getProjectTotal).collect(Collectors.toList());
@ -176,8 +185,11 @@ public class AnScreenServiceImpl implements AnScreenService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO) {
GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO();
String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY);
List<GrassRootsGovernTrendDTO> list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), yearId);
String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM);
String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01";
// 查询近一年的指数值【包括本月】
List<GrassRootsGovernTrendDTO> list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), curDate);
List<String> xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList());
List<Integer> partiProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getPartiProjectTotal).collect(Collectors.toList());
List<Integer> closedProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectTotal).collect(Collectors.toList());

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -160,7 +160,8 @@
bo.ORG_ID AS agencyId,
sca.agency_name AS name,
IFNULL(sca.area_marks,'') AS areaMarks,
sca.level AS level
sca.level AS level,
sca.level as agencyLevel
FROM
screen_customer_agency sca
LEFT JOIN screen_customer_biz_org bo ON bo.ORG_ID = sca.AGENCY_ID

41
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsGovernMonthlyDao.xml

@ -16,16 +16,37 @@
AND MONTH_ID = #{monthId}
</select>
<select id="selectGrassRootsGovernTrend" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernTrendDTO">
SELECT MONTH_ID,
PARTI_PROJECT_TOTAL,
CLOSED_PROJECT_TOTAL,
0 + cast( TRUNCATE ( PROJECT_RESPONSE_RATIO, 1 ) AS CHAR ) AS "projectResponseRatio",
0 + cast( TRUNCATE ( PROJECT_SATIS_RATIO, 1 ) AS CHAR ) AS "projectSatisRatio",
0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ) AS "closedProjectRatio"
FROM screen_an_grass_roots_govern_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
AND YEAR_ID = #{yearId}
SELECT
d.`month` MONTH_ID,
IFNULL(s.PARTI_PROJECT_TOTAL, 0) PARTI_PROJECT_TOTAL,
IFNULL(s.CLOSED_PROJECT_TOTAL, 0) CLOSED_PROJECT_TOTAL,
IFNULL(s.projectResponseRatio, 0) projectResponseRatio,
IFNULL(s.projectSatisRatio, 0) projectSatisRatio,
IFNULL(s.closedProjectRatio, 0) closedProjectRatio
FROM(
SELECT DATE_FORMAT(#{curDate}, '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 1 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 2 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 3 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 4 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 5 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 6 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 7 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 8 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 9 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 10 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 11 MONTH), '%Y%m') AS `month`
) d LEFT JOIN (
SELECT MONTH_ID,
PARTI_PROJECT_TOTAL,
CLOSED_PROJECT_TOTAL,
0 + cast( TRUNCATE ( PROJECT_RESPONSE_RATIO, 1 ) AS CHAR ) AS "projectResponseRatio",
0 + cast( TRUNCATE ( PROJECT_SATIS_RATIO, 1 ) AS CHAR ) AS "projectSatisRatio",
0 + cast( TRUNCATE ( CLOSED_PROJECT_RATIO, 1 ) AS CHAR ) AS "closedProjectRatio"
FROM screen_an_grass_roots_govern_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
) s ON d.`month` = s.MONTH_ID
ORDER BY MONTH_ID
</select>
<select id="selectGrassRootsGovernRank" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsGovernRankResultDTO">

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml

@ -14,14 +14,33 @@
AND MONTH_ID = #{monthId}
</select>
<select id="selectGrassRootsOrgTrend" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgTrendDTO">
SELECT MONTH_ID,
GROUP_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL
FROM screen_an_grass_roots_org_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
AND YEAR_ID = #{yearId}
SELECT d.`month` MONTH_ID,
IFNULL(s.GROUP_TOTAL, 0) GROUP_TOTAL,
IFNULL(s.ISSUE_TOTAL, 0) ISSUE_TOTAL,
IFNULL(s.PROJECT_TOTAL, 0) PROJECT_TOTAL
FROM(
SELECT DATE_FORMAT(#{curDate}, '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 1 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 2 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 3 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 4 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 5 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 6 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 7 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 8 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 9 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 10 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 11 MONTH), '%Y%m') AS `month`
) d LEFT JOIN (
SELECT
MONTH_ID,
GROUP_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL
FROM screen_an_grass_roots_org_monthly
WHERE DEL_FLAG = 0
AND ORG_ID = #{agencyId}
) s ON d.`month` = s.MONTH_ID
ORDER BY MONTH_ID
</select>
<select id="selectGrassRootsOrgRank" resultType="com.epmet.evaluationindex.screen.dto.result.GrassRootsOrgRankResultDTO">

47
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml

@ -15,20 +15,37 @@
</select>
<select id="selectPmTotalTrend" resultType="com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO">
SELECT
MONTH_ID,
GROUP_MEMBER_TOTAL,
TOPIC_TOTAL,
TOPIC_PARTI_USER_TOTAL,
ISSUE_TOTAL
FROM
screen_an_grass_roots_pm_total_monthly
WHERE
DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
<if test="monthId != null and monthId.trim() != ''">
AND MONTH_ID &lt;= #{monthId}
</if>
ORDER BY MONTH_ID ASC
LIMIT 12
d.`month` MONTH_ID,
IFNULL(s.GROUP_MEMBER_TOTAL, 0) GROUP_MEMBER_TOTAL,
IFNULL(s.TOPIC_TOTAL, 0) TOPIC_TOTAL,
IFNULL(s.TOPIC_PARTI_USER_TOTAL, 0) TOPIC_PARTI_USER_TOTAL,
IFNULL(s.ISSUE_TOTAL, 0) ISSUE_TOTAL
FROM(
SELECT DATE_FORMAT(#{curDate}, '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 1 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 2 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 3 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 4 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 5 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 6 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 7 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 8 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 9 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 10 MONTH), '%Y%m') AS `month`
UNION SELECT DATE_FORMAT((#{curDate} - INTERVAL 11 MONTH), '%Y%m') AS `month`
) d LEFT JOIN (
SELECT
MONTH_ID,
GROUP_MEMBER_TOTAL,
TOPIC_TOTAL,
TOPIC_PARTI_USER_TOTAL,
ISSUE_TOTAL
FROM
screen_an_grass_roots_pm_total_monthly
WHERE
DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
) s ON d.`month` = s.MONTH_ID
ORDER BY MONTH_ID
</select>
</mapper>
Loading…
Cancel
Save