Browse Source

Merge remote-tracking branch 'origin/dev_screen_data' into dev_temp

master
yinzuomei 5 years ago
parent
commit
10c9316e57
  1. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java
  2. 11
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java
  3. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueGridTotalRankDTO.java
  4. 26
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GridNameGroupCountResultDTO.java
  5. 28
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupGridgroupcountrankResultDTO.java
  6. 28
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupPartitopictrendResultDTO.java
  7. 48
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupSummaryResultDTO.java
  8. 26
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/KcTopicTrendGridMonthlyResultDTO.java
  9. 81
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  10. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcGroupSummaryGridDailyDao.java
  11. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcIssueSummaryGridDailyDao.java
  12. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcTopicTrendGridMonthlyDao.java
  13. 31
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcUserHeatRankGridDailyDao.java
  14. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcVolunteerHeatRankGridDailyDao.java
  15. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  16. 113
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  17. 53
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupSummaryGridDailyDao.xml
  18. 40
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcIssueSummaryGridDailyDao.xml
  19. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml
  20. 7
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserHeatRankGridDailyDao.xml
  21. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcUserHeatRankGridDailyDao.java
  22. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserHeatRankGridDailyEntity.java
  23. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.xml
  24. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserHeatRankGridDailyDao.xml

15
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueAvgAuditTimeDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.result.issue;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class IssueAvgAuditTimeDTO {
private String gridName;
private Integer avgAuditTime;
}

11
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/issue/IssueEffectResultDTO.java

@ -0,0 +1,11 @@
package com.epmet.dto.result.issue;
import lombok.Data;
@Data
public class IssueEffectResultDTO {
private Double reportEffectiveRatio;
private Double conversionRatio;
}

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

@ -0,0 +1,18 @@
package com.epmet.dto.result.issue;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class IssueGridTotalRankDTO {
private String gridId;
private String gridName;
private Integer issueCount;
private List<String> gridNameDataList = new ArrayList<>();
private List<Integer> issueCountDataList = new ArrayList<>();
}

26
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GridNameGroupCountResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 邻里党群-社群数量排名
* @Author sun
*/
@Data
public class GridNameGroupCountResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 网格名称
*/
private String gridName = "";
/**
* 社群数量
*/
private Integer groupCount = 0;
}

28
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupGridgroupcountrankResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.LinkedList;
/**
* 邻里党群-社群数量排名
* @Author sun
*/
@Data
public class GroupGridgroupcountrankResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 网格名称集合
*/
private LinkedList<String> gridNameDataList;
/**
* 社群数量集合
*/
private LinkedList<Integer> groupCountDataList;
}

28
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupPartitopictrendResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.LinkedList;
/**
* 邻里党群-话题参与趋势
* @Author sun
*/
@Data
public class GroupPartitopictrendResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 横坐标月份集合
*/
private LinkedList<String> xAxis;
/**
* 话题数量 集合
*/
private LinkedList<Integer> actCountDataList;
}

48
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GroupSummaryResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* 公益互助-各类总数汇总
* @Author sun
*/
@Data
public class GroupSummaryResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 日期Id, 数据更新至yyyyMMdd
*/
private String dateId = "";
/**
* 社群总数
*/
private Integer groupCount = 0;
/**
* 群员总数
*/
private Integer memberCount = 0;
/**
* 话题数量
*/
private Integer topicCount = 0;
/**
* 话题参与量
*/
private Integer partiCount = 0;
/**
* 转化议题率这个后端自己算
*/
private String shiftIssueRatio = "";
/**
* 话题转议题总数
*/
@JsonIgnore
private Integer shiftIssueCount = 0;
}

26
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/KcTopicTrendGridMonthlyResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 邻里党群-话题参与趋势
* @Author sun
*/
@Data
public class KcTopicTrendGridMonthlyResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 月id :yyyyMM
*/
private String monthId = "";
/**
* 话题数量(所在月新增话题数)
*/
private Integer topicCount = 0;
}

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

@ -5,6 +5,7 @@ import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.dto.result.issue.IssueGridTotalRankDTO;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.dto.result.issue.KcIssueSummary;
@ -83,15 +84,54 @@ public class KcScreenController {
* @param externalAppRequestParam
* @return
*/
//@ExternalAppRequestAuth
@ExternalAppRequestAuth
@PostMapping("issue/partitrend")
public Result getIssuePartiTrend(ExternalAppRequestParam externalAppRequestParam) {
//String customerId = externalAppRequestParam.getCustomerId();
String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
KcPartiTrendResultDTO trendResultDTO = kcScreenService.getIssuePartiTrend(customerId);
return new Result().ok(trendResultDTO);
}
/**
* 按照议题总数排名
* @param externalAppRequestParam
* @return
*/
@ExternalAppRequestAuth
@PostMapping("issue/gridtotalrank")
public Result getIssueGridTotalRank(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
return new Result().ok(kcScreenService.getIssueGridTotalRank(customerId));
}
/**
* 议题分析-审核效率排名
* @param externalAppRequestParam
* @return
*/
@ExternalAppRequestAuth
@PostMapping("issue/avgaudittimerank")
public Result getAvgAuditTimeRank(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
return new Result().ok(kcScreenService.getAvgAuditTimeRank(customerId));
}
/**
* 议题分析-审核效率
* @param externalAppRequestParam
* @return
*/
@ExternalAppRequestAuth
@PostMapping("issue/effective")
public Result getIssueEffective(ExternalAppRequestParam externalAppRequestParam) {
String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "2fe0065f70ca0e23ce4c26fca5f1d933";
return new Result().ok(kcScreenService.getIssueEffective(customerId));
}
/**
* @param externalAppRequestParam
@ -117,4 +157,39 @@ public class KcScreenController {
return new Result<List<HeartVolunteerrankResultDTO>>().ok(kcScreenService.heartVolunteerrank(formDTO));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-各类总数
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("group/summary")
public Result<GroupSummaryResultDTO> groupSummary(ExternalAppRequestParam externalAppRequestParam){
return new Result<GroupSummaryResultDTO>().ok(kcScreenService.groupSummary(externalAppRequestParam));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题参与趋势
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("group/partitopictrend")
public Result<GroupPartitopictrendResultDTO> groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam){
return new Result<GroupPartitopictrendResultDTO>().ok(kcScreenService.groupPartitopictrend(externalAppRequestParam));
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
@ExternalAppRequestAuth
@PostMapping("group/gridgroupcountrank")
public Result<GroupGridgroupcountrankResultDTO> groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam){
return new Result<GroupGridgroupcountrankResultDTO>().ok(kcScreenService.groupGridgroupcountrank(externalAppRequestParam));
}
}

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

@ -17,7 +17,12 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.result.GridNameGroupCountResultDTO;
import com.epmet.evaluationindex.screen.dto.result.GroupSummaryResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
/**
* KC-小组分析各类总数(先根据customerId+dateId删除)
@ -28,4 +33,17 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcGroupSummaryGridDailyDao {
/**
* @param customerId
* @Description 邻里党群-各类总数
* @author sun
*/
GroupSummaryResultDTO selectGroupSummaryDaily(@Param("customerId") String customerId);
/**
* @param customerId
* @Description 按日期降序查询客户最近一天所有网格数据按每个网格的社区总数降序排列
* @author sun
*/
LinkedList<GridNameGroupCountResultDTO> selectGridDailyList(@Param("customerId") String customerId);
}

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

@ -17,10 +17,15 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.dto.result.issue.IssueAvgAuditTimeDTO;
import com.epmet.dto.result.issue.IssueEffectResultDTO;
import com.epmet.dto.result.issue.IssueGridTotalRankDTO;
import com.epmet.dto.result.issue.KcIssueSummary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* KC-议题分析(各类总数)
*
@ -31,4 +36,10 @@ import org.apache.ibatis.annotations.Param;
public interface ScreenKcIssueSummaryGridDailyDao {
KcIssueSummary getIssueSummary(@Param("customerId") String customerId);
List<IssueGridTotalRankDTO> getIssueGridTotalRank(@Param("customerId") String customerId);
List<IssueAvgAuditTimeDTO> getAvgAuditTimeRank(@Param("customerId") String customerId);
IssueEffectResultDTO getIssueEffective(@Param("customerId") String customerId);
}

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

@ -17,7 +17,11 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.result.KcTopicTrendGridMonthlyResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* KC-话题参与趋势(先根据customerId+monthId删除)
@ -28,4 +32,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenKcTopicTrendGridMonthlyDao {
/**
* @param customerId
* @Description 按客户查询最近十二个月所有网格汇总数据
* @author sun
*/
List<KcTopicTrendGridMonthlyResultDTO> selectActTrendMonthly(@Param("customerId") String customerId);
}

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

@ -1,31 +0,0 @@
/**
* 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.evaluationindex.screenkc;
import org.apache.ibatis.annotations.Mapper;
/**
* KC-用户公益时长排名(先根据customerId删除)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-09
*/
@Mapper
public interface ScreenKcUserHeatRankGridDailyDao {
}

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

@ -18,10 +18,8 @@
package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.HeartSummaryResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HeartVolunteerrankResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

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

@ -1,12 +1,12 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.dto.result.issue.*;
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;
/**
@ -54,4 +54,33 @@ public interface KcScreenService {
KcIssueSummary getIssueSummary(String customerId);
KcPartiTrendResultDTO getIssuePartiTrend(String customerId);
IssueGridTotalRankDTO getIssueGridTotalRank(String customerId);
List<IssueAvgAuditTimeDTO> getAvgAuditTimeRank(String customerId);
IssueEffectResultDTO getIssueEffective(String customerId);
/**
* @param externalAppRequestParam
* @Description 邻里党群-各类总数
* @author sun
*/
GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam);
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题参与趋势
* @author sun
*/
GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam);
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam);
}

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

@ -5,24 +5,23 @@ 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.dto.result.issue.*;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import com.epmet.dto.result.issue.KcIssueSummary;
import com.epmet.dto.result.issue.KcPartiTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.HomepageSummaryResultDTO;
import com.epmet.evaluationindex.screen.dto.form.HeartVolunteerrankFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.NumberFormat;
import java.util.LinkedList;
import java.util.List;
import java.util.List;
/**
* 孔村大屏api
*
@ -53,6 +52,12 @@ public class KcScreenServiceImpl implements KcScreenService {
@Autowired
private ScreenKcIssueTrendGridMonthlyDao trendGridMonthlyDao;
@Autowired
private ScreenKcGroupSummaryGridDailyDao screenKcGroupSummaryGridDailyDao;
@Autowired
private ScreenKcTopicTrendGridMonthlyDao screenKcTopicTrendGridMonthlyDao;
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
@ -150,4 +155,100 @@ public class KcScreenServiceImpl implements KcScreenService {
return result;
}
@Override
public IssueGridTotalRankDTO getIssueGridTotalRank(String customerId) {
List<IssueGridTotalRankDTO> issueGridTotals = screenKcIssueSummaryGridDailyDao.getIssueGridTotalRank(customerId);
IssueGridTotalRankDTO resultDTO = new IssueGridTotalRankDTO();
issueGridTotals.stream().forEach(igt -> {
resultDTO.getGridNameDataList().add(igt.getGridName());
resultDTO.getIssueCountDataList().add(igt.getIssueCount());
});
return resultDTO;
}
@Override
public List<IssueAvgAuditTimeDTO> getAvgAuditTimeRank(String customerId) {
return screenKcIssueSummaryGridDailyDao.getAvgAuditTimeRank(customerId);
}
@Override
public IssueEffectResultDTO getIssueEffective(String customerId) {
return screenKcIssueSummaryGridDailyDao.getIssueEffective(customerId);
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-各类总数
* @author sun
*/
@Override
public GroupSummaryResultDTO groupSummary(ExternalAppRequestParam externalAppRequestParam) {
//1.按客户查询最近一天各网格各项数据的汇总值
GroupSummaryResultDTO resultDTO = screenKcGroupSummaryGridDailyDao.selectGroupSummaryDaily(externalAppRequestParam.getCustomerId());
if (null == resultDTO) {
return new GroupSummaryResultDTO();
}
//2.计算转化议题率,保留两位小数
if (resultDTO.getTopicCount() < NumConstant.ONE || resultDTO.getShiftIssueCount() < NumConstant.ONE) {
resultDTO.setShiftIssueRatio("0%");
} else {
NumberFormat numberFormat = NumberFormat.getInstance();
//设置精确到小数点后2位
numberFormat.setMaximumFractionDigits(2);
String ratio = numberFormat.format((float) resultDTO.getShiftIssueCount() / (float) resultDTO.getTopicCount() * 100);
resultDTO.setShiftIssueRatio(ratio + "%");
}
return resultDTO;
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-话题参与趋势
* @author sun
*/
@Override
public GroupPartitopictrendResultDTO groupPartitopictrend(ExternalAppRequestParam externalAppRequestParam) {
GroupPartitopictrendResultDTO resultDTO = new GroupPartitopictrendResultDTO();
LinkedList<String> xAxis = new LinkedList<>();
LinkedList<Integer> actCountDataList = new LinkedList<>();
//1.按客户查询最近十二个月所有网格汇总数据
List<KcTopicTrendGridMonthlyResultDTO> list = screenKcTopicTrendGridMonthlyDao.selectActTrendMonthly(externalAppRequestParam.getCustomerId());
//2.倒序遍历封装数据
for (int i = list.size() - 1; i >= 0; i--) {
xAxis.add(list.get(i).getMonthId());
actCountDataList.add(list.get(i).getTopicCount());
}
//3.封装数据并返回
resultDTO.setXAxis(xAxis);
resultDTO.setActCountDataList(actCountDataList);
return resultDTO;
}
/**
* @param externalAppRequestParam
* @Description 邻里党群-社群数量排名
* @author sun
*/
@Override
public GroupGridgroupcountrankResultDTO groupGridgroupcountrank(ExternalAppRequestParam externalAppRequestParam) {
GroupGridgroupcountrankResultDTO resultDTO = new GroupGridgroupcountrankResultDTO();
LinkedList<String> gridNameDataList = new LinkedList<>();
LinkedList<Integer> groupCountDataList = new LinkedList<>();
//1.按日期降序,查询客户最近一天所有网格数据,按每个网格的社区总数降序排列
LinkedList<GridNameGroupCountResultDTO> list = screenKcGroupSummaryGridDailyDao.selectGridDailyList(externalAppRequestParam.getCustomerId());
//2.封装数据
list.forEach(l -> {
gridNameDataList.add(l.getGridName());
groupCountDataList.add(l.getGroupCount());
});
resultDTO.setGridNameDataList(gridNameDataList);
resultDTO.setGroupCountDataList(groupCountDataList);
return resultDTO;
}
}

53
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcGroupSummaryGridDailyDao.xml

@ -3,5 +3,58 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcGroupSummaryGridDailyDao">
<select id="selectGroupSummaryDaily" resultType="com.epmet.evaluationindex.screen.dto.result.GroupSummaryResultDTO">
SELECT
date_id,
sum(group_count) "groupCount",
sum(member_count) "memberCount",
sum(topic_count) "topicCount",
sum(parti_count) "partiCount",
sum(shift_issue_count) "shiftIssueCount"
FROM
screen_kc_group_summary_grid_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND date_id = (
select
date_id
from
screen_kc_group_summary_grid_daily
where
del_flag = '0'
and customer_id = #{customerId}
order by
date_id desc,
created_time desc
limit 1
)
</select>
<select id="selectGridDailyList" resultType="com.epmet.evaluationindex.screen.dto.result.GridNameGroupCountResultDTO">
SELECT
grid_name AS "gridName",
group_count AS "groupCount"
FROM
screen_kc_group_summary_grid_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND date_id = (
select
date_id
from
screen_kc_group_summary_grid_daily
where
del_flag = '0'
and customer_id = #{customerId}
order by
date_id desc,
created_time desc
limit 1
)
ORDER BY
group_count DESC
</select>
</mapper>

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

@ -15,8 +15,44 @@
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
select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id from screen_kc_issue_summary_grid_daily t21 where t21.CUSTOMER_ID=#{customerId}) t2
on (t1.CUSTOMER_ID = t2.customerId and t1.DATE_ID = t2.max_date_id)
where t1.CUSTOMER_ID = #{customerId}
</select>
<select id="getIssueGridTotalRank" resultType="com.epmet.dto.result.issue.IssueGridTotalRankDTO">
select
GRID_ID gridId,
GRID_NAME gridName,
ISSUE_COUNT issueCount
from screen_kc_issue_summary_grid_daily isd
inner join (
select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id
from screen_kc_issue_summary_grid_daily t21
where t21.CUSTOMER_ID = #{customerId}) latest
on (isd.CUSTOMER_ID = latest.customerId and isd.DATE_ID = latest.max_date_id)
order by isd.ISSUE_COUNT desc
</select>
<select id="getAvgAuditTimeRank" resultType="com.epmet.dto.result.issue.IssueAvgAuditTimeDTO">
select isd.GRID_ID gridId, isd.GRID_NAME gridName, isd.AVG_AUDIT_TIME avgAuditTime
from screen_kc_issue_summary_grid_daily isd
inner join (
select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id
from screen_kc_issue_summary_grid_daily t21
where t21.CUSTOMER_ID = #{customerId}) latest
on (isd.CUSTOMER_ID = latest.customerId and isd.DATE_ID = latest.max_date_id)
order by isd.AVG_AUDIT_TIME desc
</select>
<select id="getIssueEffective" resultType="com.epmet.dto.result.issue.IssueEffectResultDTO">
select (sum(isd.PASSED_COUNT) / sum(REPORT_COUNT)) * 100 reportEffectiveRatio,
(sum(isd.SHIFT_TO_PROJECT_COUNT) / sum(REPORT_COUNT)) * 100 conversionRatio
from screen_kc_issue_summary_grid_daily isd
inner join (
select t21.CUSTOMER_ID as customerId, max(t21.DATE_ID) max_date_id
from screen_kc_issue_summary_grid_daily t21
where t21.CUSTOMER_ID = #{customerId}) latest
on (isd.CUSTOMER_ID = latest.customerId and isd.CUSTOMER_ID = latest.customerId and
isd.DATE_ID = latest.max_date_id)
</select>
</mapper>

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcTopicTrendGridMonthlyDao.xml

@ -4,5 +4,27 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcTopicTrendGridMonthlyDao">
<select id="selectActTrendMonthly" resultType="com.epmet.evaluationindex.screen.dto.result.KcTopicTrendGridMonthlyResultDTO">
SELECT DISTINCT
month_id AS "monthId",
(
select
sum(topic_count)
from
screen_kc_topic_trend_grid_monthly
where
del_flag = '0'
and customer_id = #{customerId}
and month_id = monthId
)
FROM
screen_kc_topic_trend_grid_monthly
WHERE
del_flag = '0'
AND customer_id = #{customerId}
ORDER BY
month_id DESC,
created_time DESC
LIMIT 12
</select>
</mapper>

7
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcUserHeatRankGridDailyDao.xml

@ -1,7 +0,0 @@
<?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.evaluationindex.screenkc.ScreenKcUserHeatRankGridDailyDao">
</mapper>

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenKcUserHeatRankGridDailyDao.java

@ -1,33 +0,0 @@
/**
* 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.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.screen.ScreenKcUserHeatRankGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* KC-用户公益时长排名(先根据customerId删除)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-09
*/
@Mapper
public interface ScreenKcUserHeatRankGridDailyDao extends BaseDao<ScreenKcUserHeatRankGridDailyEntity> {
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcUserHeatRankGridDailyEntity.java

@ -1,96 +0,0 @@
/**
* 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.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* KC-用户公益时长排名(先根据customerId删除)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-09
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_kc_user_heat_rank_grid_daily")
public class ScreenKcUserHeatRankGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 网格所属组织id
*/
private String parentAgencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 用户id
*/
private String userId;
/**
* 用户姓名
*/
private String userName;
/**
* 1志愿者 0不是志愿者
*/
private Integer volunteerFlag;
/**
* 爱心时长 单位分钟
*/
private Integer heartTime;
/**
* 积分
*/
private Integer points;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcGroupDetailGridDailyDao.xml

@ -27,7 +27,7 @@
<delete id="deleteGroupDetailGrid">
delete from screen_kc_group_detail_grid_daily
where CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId}
where CUSTOMER_ID = #{customerId}
limit 1000;
</delete>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcUserHeatRankGridDailyDao.xml

@ -1,28 +0,0 @@
<?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.dao.evaluationindex.screen.ScreenKcUserHeatRankGridDailyDao">
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenKcUserHeatRankGridDailyEntity" id="screenKcUserHeatRankGridDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="gridName" column="GRID_NAME"/>
<result property="parentAgencyId" column="PARENT_AGENCY_ID"/>
<result property="allParentIds" column="ALL_PARENT_IDS"/>
<result property="userId" column="USER_ID"/>
<result property="userName" column="USER_NAME"/>
<result property="volunteerFlag" column="VOLUNTEER_FLAG"/>
<result property="heartTime" column="HEART_TIME"/>
<result property="points" column="POINTS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save