jianjun 4 years ago
parent
commit
4938d99554
  1. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java
  3. 110
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java
  5. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java
  6. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml
  7. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java
  8. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  9. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  10. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java
  11. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java
  12. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  13. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  14. 24
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java

@ -15,7 +15,7 @@ import java.io.Serializable;
public class PatrolDailySumResult implements Serializable {
private static final long serialVersionUID = 310405655189243944L;
private String fullAgencyId;
private String orgId;
private Integer patrolTotal;
private Integer totalTime;
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java

@ -39,12 +39,12 @@ public interface StatsStaffPatrolRecordDailyDao extends BaseDao<StatsStaffPatrol
/**
* desc:获取巡查次数和时间
* @param agencyFullIdList
* @param orgIdList
* @param startDateId
* @param endDateId
* @return
*/
List<PatrolDailySumResult> getPatrolSumList(@Param("agencyFullIdList") List<String> agencyFullIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId);
List<PatrolDailySumResult> getPatrolSumList(@Param("orgIdList") List<String> orgIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId);
/**
* @Description 直属组织或网格下巡查数据

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

@ -1,55 +1,54 @@
package com.epmet.dataaggre.service.datastats.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.OrgConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
import com.epmet.dataaggre.excel.CustomerDataManageExcel;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.OrgConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
import com.epmet.dataaggre.excel.CustomerDataManageExcel;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* @Author sun
@ -1556,7 +1555,7 @@ public class DataStatsServiceImpl implements DataStatsService {
Map<String, Integer> closeProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1));
//巡查次数和时间
List<PatrolDailySumResult> patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(gridIdList,formDTO.getStartDateId(),formDTO.getEndDateId());
Map<String, PatrolDailySumResult> patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1));
Map<String, PatrolDailySumResult> patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getOrgId, o -> o, (o1, o2) -> o1));
subAgencyList.forEach(agency->{
String gridId = agency.getGridId();
@ -1567,7 +1566,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,gridId));
resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,gridId));
PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agency.getAllParentIds());
PatrolDailySumResult patrolRecordDTO = patrolListMap.get(gridId);
setPatrolAttr(resultDTO, patrolRecordDTO);
result.add(resultDTO);
});
@ -1595,9 +1594,9 @@ public class DataStatsServiceImpl implements DataStatsService {
Map<String, Integer> closeProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1));
Map<String, Integer> closeProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1));
//巡查次数和时间
List<String> agencyFullIds = subAgencyList.stream().map(o -> o.getPids().concat(StrConstant.COLON).concat(o.getAgencyId())).collect(Collectors.toList());
List<PatrolDailySumResult> patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,formDTO.getStartDateId(),formDTO.getEndDateId());
Map<String, PatrolDailySumResult> patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1));
List<String> agencyIdList = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
List<PatrolDailySumResult> patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyIdList,formDTO.getStartDateId(),formDTO.getEndDateId());
Map<String, PatrolDailySumResult> patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getOrgId, o -> o, (o1, o2) -> o1));
subAgencyList.forEach(agency->{
String agencyId = agency.getAgencyId();
@ -1607,8 +1606,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO.setTopicToIssueTotal(getTotal(toIssueStartMap,toIssueEndMap,agencyId));
resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,agencyId));
resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,agencyId));
String fullAgencyId = agency.getPids().concat(StrConstant.COLON).concat(agencyId);
PatrolDailySumResult patrolRecordDTO = patrolListMap.get(fullAgencyId);
PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agencyId);
setPatrolAttr(resultDTO,patrolRecordDTO);
result.add(resultDTO);
});

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java

@ -35,12 +35,12 @@ public interface StatsStaffPatrolRecordDailyService extends BaseService<StatsSta
/**
* desc:获取组织或网格的 时间段内的总次数等
* @param agencyList
* @param orgIdList
* @param startDateId
* @param endDateId
* @return
*/
List<PatrolDailySumResult> getPatrolSumList(List<String> agencyList, String startDateId, String endDateId);
List<PatrolDailySumResult> getPatrolSumList(List<String> orgIdList, String startDateId, String endDateId);
/**
* @Description 直属组织或网格下巡查数据

6
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java

@ -28,14 +28,14 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl<Stat
/**
* desc:获取组织或网格的 时间段内的总次数等
*
* @param agencyFullIdList
* @param orgIdList
* @param startDateId
* @param endDateId
* @return
*/
@Override
public List<PatrolDailySumResult> getPatrolSumList(List<String> agencyFullIdList, String startDateId, String endDateId) {
return baseDao.getPatrolSumList(agencyFullIdList,startDateId,endDateId);
public List<PatrolDailySumResult> getPatrolSumList(List<String> orgIdList, String startDateId, String endDateId) {
return baseDao.getPatrolSumList(orgIdList,startDateId,endDateId);
}
/**

8
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml

@ -2,17 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.StatsStaffPatrolRecordDailyDao">
<select id="getPatrolSumList" resultType="com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult">
<foreach collection="agencyFullIdList" item="fullAgencyId" separator="UNION ALL">
<foreach collection="orgIdList" item="orgId" separator="UNION ALL">
SELECT
LEFT (GRID_PIDS,LENGTH( #{fullAgencyId} )) fullAgencyId,
#{orgId} orgId,
sum(patrol_total) patrolTotal,
sum(TOTAL_TIME) totalTime
FROM stats_staff_patrol_record_daily
WHERE del_flag = '0'
AND date_id <![CDATA[>=]]> #{startDateId}
AND date_id <![CDATA[<=]]> #{endDateId}
AND GRID_PIDS like CONCAT('%', #{fullAgencyId},'%')
GROUP BY fullAgencyId
AND GRID_PIDS like CONCAT('%', #{orgId},'%')
GROUP BY orgId
</foreach>
</select>

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
@ -27,4 +28,9 @@ public class GridIssueCountResultDTO implements Serializable {
* 网格ID
*/
private String gridId;
/**
* 网格议题转项目率
*/
private BigDecimal issueToProjectRatio;
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -67,13 +67,13 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
List<GridIssueCountResultDTO> selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询俩月的网格议题总数
* @Description 查询议题转项目总数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotalTwoMonthPlus(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("minusMonthId") String minusMonthId);
List<GridIssueCountResultDTO> selectIssueTotalShiftProject(@Param("customerId")String customerId, @Param("monthId") String monthId);
/**
* @Description 网格总项目数

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java

@ -113,9 +113,9 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
// 网格的发文数量
List<PublishCountResultDTO> publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId);
// 网格议题转项目率
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId));
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList);
List<GridIssueCountResultDTO> gridIssueTotalShiftProjectList = issueExtractService.selectIssueTotalShiftProject(customerId, monthId);
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId);
List<GridIssueCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalShiftProjectList, gridIssueTotalList);
// 建群党员数
List<PartyCreateGroupCountResultDTO> partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId);
//结合目前产品,数据来源:话题评论、议题表决
@ -313,9 +313,10 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
log.info("网格总项目数{}", JSON.toJSONString(gridProjectTotalList));
//网格议题转项目率
List<GridIssueCountResultDTO> gridIssueCountList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId));
List<GridIssueCountResultDTO> gridIssueCountList = issueExtractService.selectIssueTotalShiftProject(customerId, monthId);
log.info("网格近两个月的议题{}", JSON.toJSONString(gridIssueCountList));
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList);
List<GridIssueCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridIssueTotalList);
log.info("网格议题转项目率{}", JSON.toJSONString(gridIssueShiftProjectRatio));
//网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格
List<AutoNoMyResultDTO> projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId);
@ -391,15 +392,23 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
}
});
}
// 2. 网格总项目数,网格议题转项目率
// 2.网格议题转项目率
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){
gridIssueShiftProjectRatio.forEach(projectTotal -> {
if (r.getGridId().equals(projectTotal.getGridId())){
r.setProjectTotal(projectTotal.getProjectTotal());
r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio());
}
});
}
// 网格总项目数
if (!CollectionUtils.isEmpty(gridProjectTotalList)){
gridProjectTotalList.forEach(projectTotal -> {
if (r.getGridId().equals(projectTotal.getGridId())) {
r.setProjectTotal(projectTotal.getProjectTotal());
}
});
}
// 3. 网格办结项目数
if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){
gridProjectClosedTotalList.forEach(closed -> {
@ -539,22 +548,22 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
/**
* @Description
* @param gridIssueTotalList
* @param gridProjectTotalList
* @param gridIssueTotalList 网格下已转项目的议题
* @param gridIssueAllTotalList 网格下所有议题
* @author zxc
* @date 2020/9/19 2:53 下午
*/
public List<GridProjectCountResultDTO> getGridIssueShiftProjectRatio(List<GridIssueCountResultDTO> gridIssueTotalList,List<GridProjectCountResultDTO> gridProjectTotalList){
if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) {
gridProjectTotalList.forEach(project -> {
public List<GridIssueCountResultDTO> getGridIssueShiftProjectRatio(List<GridIssueCountResultDTO> gridIssueTotalList,List<GridIssueCountResultDTO> gridIssueAllTotalList){
if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridIssueAllTotalList)) {
gridIssueAllTotalList.forEach(allIssue -> {
gridIssueTotalList.forEach(issue -> {
if (project.getGridId().equals(issue.getGridId())) {
project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal()).divide(new BigDecimal(issue.getIssueTotal()),NumConstant.EIGHT,BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL)));
if (allIssue.getGridId().equals(issue.getGridId())) {
allIssue.setIssueToProjectRatio(getRound(new BigDecimal(allIssue.getIssueTotal()).divide(new BigDecimal(issue.getIssueTotal()),NumConstant.EIGHT,BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL)));
}
});
});
}
return gridProjectTotalList;
return gridIssueAllTotalList;
}
/**

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/IssueExtractService.java

@ -47,7 +47,7 @@ public interface IssueExtractService {
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId);
List<GridIssueCountResultDTO> selectIssueTotalShiftProject(String customerId, String monthId);
/**
* @Description 网格总项目数

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java

@ -268,8 +268,8 @@ public class IssueExtractServiceImpl implements IssueExtractService {
* @date 2020/9/18 10:20 上午
*/
@Override
public List<GridIssueCountResultDTO> selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) {
return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId);
public List<GridIssueCountResultDTO> selectIssueTotalShiftProject(String customerId, String monthId) {
return issueMainDailyDao.selectIssueTotalShiftProject(customerId, monthId);
}
/**

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -164,18 +164,17 @@
)t
</select>
<!-- 查询俩月的网格议题总数 -->
<select id="selectIssueTotalTwoMonthPlus" resultType="com.epmet.dto.extract.form.GridIssueCountResultDTO">
<!-- 查询议题转项目总数 -->
<select id="selectIssueTotalShiftProject" resultType="com.epmet.dto.extract.form.GridIssueCountResultDTO">
SELECT
COUNT( ID ) AS issueTotal,
GRID_ID
FROM
fact_origin_issue_main_daily
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND (MONTH_ID = #{monthId} OR MONTH_ID = #{minusMonthId})
GROUP BY GRID_ID
GRID_ID,
COUNT(ISSUE_ID) AS issueTotal
FROM fact_origin_issue_log_daily
WHERE DEL_FLAG = '0'
AND MONTH_ID = #{monthId}
AND CUSTOMER_ID = #{customerId}
AND ACTION_CODE = 'shift_project'
GROUP BY GRID_ID
</select>
<!-- 查询党员发布议题数 -->

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -53,7 +53,7 @@
f.ORG_ID AS "agencyId",
SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( f.INFORMED_DATE, '%Y-%m-%d %H:%i' )),
( DATE_FORMAT( f.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum",
COUNT( f.ID ) AS "count"
COUNT(DISTINCT f.PROJECT_ID) AS "count"
FROM
fact_origin_project_org_period_daily f
INNER JOIN dim_agency da ON f.ORG_ID = da.ID
@ -128,7 +128,7 @@
fp.ORG_ID,
SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( fp.INFORMED_DATE, '%Y-%m-%d %H:%i' )),
( DATE_FORMAT( fp.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum",
COUNT( fp.ID ) AS "count"
COUNT( DISTINCT fp.PROJECT_ID ) AS "count"
FROM
fact_origin_project_org_period_daily fp
INNER JOIN fact_origin_project_main_daily fm ON fp.PROJECT_ID = fm.ID

24
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -940,6 +940,18 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
*/
@Override
public void shiftProjectV2(ShiftProjectFormDTO formDTO) {
//1:查询议题数据
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
if (IssueConstant.ISSUE_SHIFT_PROJECT.equals(entity.getIssueStatus())) {
throw new RenException(IssueConstant.ISSUE_SHIFT_PROJECT_EXCEPTION);
}
if (!IssueConstant.ISSUE_VOTING.equals(entity.getIssueStatus())) {
throw new RenException(IssueConstant.ISSUE_VOTING_EXCEPTION);
}
formDTO.setIssueDTO(ConvertUtils.sourceToTarget(entity, IssueDTO.class));
//获取议题分类
List<IssueCategoryDTO> categoryList = issueCategoryService.getCategoryByIssue(formDTO.getIssueId());
@ -965,18 +977,6 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
}
//因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据
//1:查询议题数据
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
if (IssueConstant.ISSUE_SHIFT_PROJECT.equals(entity.getIssueStatus())) {
throw new RenException(IssueConstant.ISSUE_SHIFT_PROJECT_EXCEPTION);
}
if (!IssueConstant.ISSUE_VOTING.equals(entity.getIssueStatus())) {
throw new RenException(IssueConstant.ISSUE_VOTING_EXCEPTION);
}
formDTO.setIssueDTO(ConvertUtils.sourceToTarget(entity, IssueDTO.class));
//2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId());

Loading…
Cancel
Save