|
|
@ -5,24 +5,19 @@ 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 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 +48,11 @@ public class KcScreenServiceImpl implements KcScreenService { |
|
|
|
@Autowired |
|
|
|
private ScreenKcIssueTrendGridMonthlyDao trendGridMonthlyDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ScreenKcGroupSummaryGridDailyDao screenKcGroupSummaryGridDailyDao; |
|
|
|
@Autowired |
|
|
|
private ScreenKcTopicTrendGridMonthlyDao screenKcTopicTrendGridMonthlyDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param externalAppRequestParam |
|
|
|
* @Description 首页-平台各类总数 |
|
|
@ -150,4 +150,77 @@ public class KcScreenServiceImpl implements KcScreenService { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @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; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|