Browse Source

新增:议题summary+议题趋势图

master
wxz 5 years ago
parent
commit
d5ee8b7da8
  1. 2
      epmet-cloud-generator/src/main/resources/application.yml
  2. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java
  3. 16
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java
  4. 31
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  5. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java
  6. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java
  7. 156
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java
  8. 106
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java
  9. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  10. 32
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  11. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml
  12. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml
  13. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml
  14. 10
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
#oracle配置

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcIssueSummary.java

@ -0,0 +1,18 @@
package com.epmet.dto.result.issue;
import lombok.Data;
@Data
public class KcIssueSummary {
private String dateId;
private Integer reportCount;
private Integer issueCount;
private Integer pendingCount;
private Integer rejectedCount;
private Integer processingCount;
private Integer closedCount;
private Integer issueViewCount;
private Integer voteCount;
}

16
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/KcPartiTrendResultDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.result.issue;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class KcPartiTrendResultDTO {
private String monthId;
private Integer reportCount;
private List<String> xAxis = new ArrayList<>();
private List<Integer> reportCountDataList = new ArrayList<>();
}

31
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java

@ -7,6 +7,9 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.dto.result.issue.KcIssueSummary;
import com.epmet.dto.result.issue.KcPartiTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -61,6 +64,34 @@ public class KcScreenController {
public Result<HeartActcounttrendResultDTO> heartActcounttrend(ExternalAppRequestParam externalAppRequestParam){
return new Result<HeartActcounttrendResultDTO>().ok(kcScreenService.heartActcounttrend(externalAppRequestParam));
}
/**
* 议题分析-各类总数
* @param externalAppRequestParam
* @return
*/
@ExternalAppRequestAuth
@PostMapping("issue/summary")
public Result getIssueSummary(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
KcIssueSummary issueSummary = kcScreenService.getIssueSummary(customerId);
return new Result().ok(issueSummary);
}
/**
* 参与趋势
* @param externalAppRequestParam
* @return
*/
//@ExternalAppRequestAuth
@PostMapping("issue/partitrend")
public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) {
//String customerId = externalAppRequestParam.getCustomerId();
String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId);
return new Result().ok(trendResultDTO);
}
/**
* @param externalAppRequestParam

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java

@ -17,7 +17,9 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.dto.result.issue.KcIssueSummary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* KC-议题分析(各类总数)
@ -28,4 +30,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcIssueSummaryGridDailyDao {
KcIssueSummary getIssueSummary(@Param("customerId") String customerId);
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueTrendGridMonthlyDao.java

@ -17,7 +17,11 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.dto.result.issue.KcPartiTrendResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增
@ -28,4 +32,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcIssueTrendGridMonthlyDao {
List<KcPartiTrendResultDTO> getIssuePartiTrend(@Param("customerId") String customerId);
}

156
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueSummaryGridDailyDTO.java

@ -0,0 +1,156 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.issue;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* KC-议题分析(各类总数)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Data
public class ScreenKcIssueSummaryGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键先根据customerId+dateId删除后插入
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 网格所属的组织id
*/
private String parentAgencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 上报总数
*/
private Integer reportCount;
/**
* 议题总数
*/
private Integer issueCount;
/**
* 待审核数
*/
private Integer pendingCount;
/**
* 已驳回数
*/
private Integer rejectedCount;
/**
* 处理中数
*/
private Integer processingCount;
/**
* 已关闭数
*/
private Integer closedCount;
/**
* 议题浏览数
*/
private Integer issueViewCount;
/**
* 表态数
*/
private Integer voteCount;
/**
* 审核通过数 为了算议题效率
*/
private Integer passedCount;
/**
* 转化成项目数 为了算议题效率
*/
private Integer shiftToProjectCount;
/**
* 平均审核时间单位分钟
*/
private Integer avgAuditTime;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/ScreenKcIssueTrendGridMonthlyDTO.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.datareport.dao.issue;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* KC-议题参与趋势(每天上报当前月)customerId+monthId先删后增
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-14
*/
@Data
public class ScreenKcIssueTrendGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键(每天上报当前月),按照customerId+monthId先删除记录再插入
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 月id :yyyyMM
*/
private String monthId;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 网格所属的组织id
*/
private String parentAgencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 议题上报数本月内上报的议题数量
*/
private Integer reportCount;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -5,6 +5,9 @@ import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import java.util.List;
import com.epmet.dto.result.issue.KcIssueSummary;
import com.epmet.dto.result.issue.KcPartiTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
/**
* 孔村大屏api
@ -48,4 +51,7 @@ public interface KcScreenService {
* @author sun
*/
List<HeartVolunteerrankResultDTO> heartVolunteerrank(HeartVolunteerrankFormDTO formDTO);
KcIssueSummary getIssueSummary(String customerId);
KcPartiTrendResultDTO getIssuePartiTrend(String customerId);
}

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

@ -5,16 +5,24 @@ import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screenkc.*;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueSummaryGridDailyDao;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueTrendGridMonthlyDao;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.dto.result.issue.KcIssueSummary;
import com.epmet.dto.result.issue.KcPartiTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
import java.util.List;
/**
* 孔村大屏api
*
@ -27,6 +35,7 @@ public class KcScreenServiceImpl implements KcScreenService {
@Autowired
private DateUtils dateUtils;
@Autowired
private ScreenKcPlatformSummaryDailyDao screenKcPlatformSummaryDailyDao;
@Autowired
@ -38,6 +47,12 @@ public class KcScreenServiceImpl implements KcScreenService {
@Autowired
private ScreenKcVolunteerHeatRankGridDailyDao screenKcVolunteerHeatRankGridDailyDao;
@Autowired
private ScreenKcIssueSummaryGridDailyDao screenKcIssueSummaryGridDailyDao;
@Autowired
private ScreenKcIssueTrendGridMonthlyDao trendGridMonthlyDao;
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
@ -118,4 +133,21 @@ public class KcScreenServiceImpl implements KcScreenService {
return list;
}
@Override
public KcIssueSummary getIssueSummary(String customerId) {
return screenKcIssueSummaryGridDailyDao.getIssueSummary(customerId);
}
@Override
public KcPartiTrendResultDTO getIssuePartiTrend(String customerId) {
List<KcPartiTrendResultDTO> trend = trendGridMonthlyDao.getIssuePartiTrend(customerId);
KcPartiTrendResultDTO result = new KcPartiTrendResultDTO();
trend.stream().forEach(t -> {
String month = t.getMonthId().substring(4);
result.getXAxis().add(new Integer(month).toString().concat("月"));
result.getReportCountDataList().add(t.getReportCount());
});
return result;
}
}

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueSummaryGridDailyDao.xml

@ -0,0 +1,8 @@
<?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.datareport.dao.issue.ScreenKcIssueSummaryGridDailyDTO">
</mapper>

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/ScreenKcIssueTrendGridMonthlyDao.xml

@ -0,0 +1,8 @@
<?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.datareport.dao.issue.ScreenKcIssueTrendGridMonthlyDTO">
</mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml

@ -3,5 +3,20 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueSummaryGridDailyDao">
<select id="getIssueSummary" resultType="com.epmet.dto.result.issue.KcIssueSummary">
select t1.DATE_ID dateId,
sum(REPORT_COUNT) reportCount,
sum(ISSUE_COUNT) issueCount,
sum(PENDING_COUNT) pendingCount,
sum(REJECTED_COUNT) rejectedCount,
sum(PROCESSING_COUNT) processingCount,
sum(CLOSED_COUNT) closedCount,
sum(ISSUE_VIEW_COUNT) issueViewCount,
sum(VOTE_COUNT) voteCount
from screen_kc_issue_summary_grid_daily t1
inner join (
select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id from screen_kc_issue_summary_grid_daily t21) t2
on (t1.CUSTOMER_ID = t2.customerId and t1.DATE_ID = t2.max_date_id)
where t1.CUSTOMER_ID = #{customerId}
</select>
</mapper>

10
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueTrendGridMonthlyDao.xml

@ -3,6 +3,12 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcIssueTrendGridMonthlyDao">
<select id="getIssuePartiTrend" resultType="com.epmet.dto.result.issue.KcPartiTrendResultDTO">
select MONTH_ID monthId,
sum(trend.REPORT_COUNT) reportCount
from screen_kc_issue_trend_grid_monthly trend
where CUSTOMER_ID = #{customerId}
group by MONTH_ID
order by MONTH_ID asc
</select>
</mapper>

Loading…
Cancel
Save