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. 14
      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. 17
      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 { public class PatrolDailySumResult implements Serializable {
private static final long serialVersionUID = 310405655189243944L; private static final long serialVersionUID = 310405655189243944L;
private String fullAgencyId; private String orgId;
private Integer patrolTotal; private Integer patrolTotal;
private Integer totalTime; 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:获取巡查次数和时间 * desc:获取巡查次数和时间
* @param agencyFullIdList * @param orgIdList
* @param startDateId * @param startDateId
* @param endDateId * @param endDateId
* @return * @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 直属组织或网格下巡查数据 * @Description 直属组织或网格下巡查数据

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

@ -3,7 +3,6 @@
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; 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.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -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)); 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()); 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->{ subAgencyList.forEach(agency->{
String gridId = agency.getGridId(); String gridId = agency.getGridId();
@ -1567,7 +1566,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,gridId)); resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,gridId));
resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,gridId)); resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,gridId));
PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agency.getAllParentIds()); PatrolDailySumResult patrolRecordDTO = patrolListMap.get(gridId);
setPatrolAttr(resultDTO, patrolRecordDTO); setPatrolAttr(resultDTO, patrolRecordDTO);
result.add(resultDTO); 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> 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)); 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<String> agencyIdList = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
List<PatrolDailySumResult> patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,formDTO.getStartDateId(),formDTO.getEndDateId()); List<PatrolDailySumResult> patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyIdList,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->{ subAgencyList.forEach(agency->{
String agencyId = agency.getAgencyId(); String agencyId = agency.getAgencyId();
@ -1607,8 +1606,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO.setTopicToIssueTotal(getTotal(toIssueStartMap,toIssueEndMap,agencyId)); resultDTO.setTopicToIssueTotal(getTotal(toIssueStartMap,toIssueEndMap,agencyId));
resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,agencyId)); resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,agencyId));
resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,agencyId)); resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,agencyId));
String fullAgencyId = agency.getPids().concat(StrConstant.COLON).concat(agencyId); PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agencyId);
PatrolDailySumResult patrolRecordDTO = patrolListMap.get(fullAgencyId);
setPatrolAttr(resultDTO,patrolRecordDTO); setPatrolAttr(resultDTO,patrolRecordDTO);
result.add(resultDTO); 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:获取组织或网格的 时间段内的总次数等 * desc:获取组织或网格的 时间段内的总次数等
* @param agencyList * @param orgIdList
* @param startDateId * @param startDateId
* @param endDateId * @param endDateId
* @return * @return
*/ */
List<PatrolDailySumResult> getPatrolSumList(List<String> agencyList, String startDateId, String endDateId); List<PatrolDailySumResult> getPatrolSumList(List<String> orgIdList, String startDateId, String endDateId);
/** /**
* @Description 直属组织或网格下巡查数据 * @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:获取组织或网格的 时间段内的总次数等 * desc:获取组织或网格的 时间段内的总次数等
* *
* @param agencyFullIdList * @param orgIdList
* @param startDateId * @param startDateId
* @param endDateId * @param endDateId
* @return * @return
*/ */
@Override @Override
public List<PatrolDailySumResult> getPatrolSumList(List<String> agencyFullIdList, String startDateId, String endDateId) { public List<PatrolDailySumResult> getPatrolSumList(List<String> orgIdList, String startDateId, String endDateId) {
return baseDao.getPatrolSumList(agencyFullIdList,startDateId,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" > <!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"> <mapper namespace="com.epmet.dataaggre.dao.epmetuser.StatsStaffPatrolRecordDailyDao">
<select id="getPatrolSumList" resultType="com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult"> <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 SELECT
LEFT (GRID_PIDS,LENGTH( #{fullAgencyId} )) fullAgencyId, #{orgId} orgId,
sum(patrol_total) patrolTotal, sum(patrol_total) patrolTotal,
sum(TOTAL_TIME) totalTime sum(TOTAL_TIME) totalTime
FROM stats_staff_patrol_record_daily FROM stats_staff_patrol_record_daily
WHERE del_flag = '0' WHERE del_flag = '0'
AND date_id <![CDATA[>=]]> #{startDateId} AND date_id <![CDATA[>=]]> #{startDateId}
AND date_id <![CDATA[<=]]> #{endDateId} AND date_id <![CDATA[<=]]> #{endDateId}
AND GRID_PIDS like CONCAT('%', #{fullAgencyId},'%') AND GRID_PIDS like CONCAT('%', #{orgId},'%')
GROUP BY fullAgencyId GROUP BY orgId
</foreach> </foreach>
</select> </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 lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
* @Author zxc * @Author zxc
@ -27,4 +28,9 @@ public class GridIssueCountResultDTO implements Serializable {
* 网格ID * 网格ID
*/ */
private String gridId; 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); List<GridIssueCountResultDTO> selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId);
/** /**
* @Description 查询俩月的网格议题总数 * @Description 查询议题转项目总数
* @param customerId * @param customerId
* @param monthId * @param monthId
* @author zxc * @author zxc
* @date 2020/9/18 10:20 上午 * @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 网格总项目数 * @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<PublishCountResultDTO> publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId);
// 网格议题转项目率 // 网格议题转项目率
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, DateUtils.minusMonthId(monthId)); List<GridIssueCountResultDTO> gridIssueTotalShiftProjectList = issueExtractService.selectIssueTotalShiftProject(customerId, monthId);
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId);
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); List<GridIssueCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalShiftProjectList, gridIssueTotalList);
// 建群党员数 // 建群党员数
List<PartyCreateGroupCountResultDTO> partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId); 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); List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
log.info("网格总项目数{}", JSON.toJSONString(gridProjectTotalList)); 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)); log.info("网格近两个月的议题{}", JSON.toJSONString(gridIssueCountList));
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList);
List<GridIssueCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridIssueTotalList);
log.info("网格议题转项目率{}", JSON.toJSONString(gridIssueShiftProjectRatio)); log.info("网格议题转项目率{}", JSON.toJSONString(gridIssueShiftProjectRatio));
//网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格 //网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格
List<AutoNoMyResultDTO> projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); List<AutoNoMyResultDTO> projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId);
@ -391,15 +392,23 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
} }
}); });
} }
// 2. 网格总项目数,网格议题转项目率 // 2.网格议题转项目率
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){ if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){
gridIssueShiftProjectRatio.forEach(projectTotal -> { gridIssueShiftProjectRatio.forEach(projectTotal -> {
if (r.getGridId().equals(projectTotal.getGridId())){ if (r.getGridId().equals(projectTotal.getGridId())){
r.setProjectTotal(projectTotal.getProjectTotal());
r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio()); r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio());
} }
}); });
} }
// 网格总项目数
if (!CollectionUtils.isEmpty(gridProjectTotalList)){
gridProjectTotalList.forEach(projectTotal -> {
if (r.getGridId().equals(projectTotal.getGridId())) {
r.setProjectTotal(projectTotal.getProjectTotal());
}
});
}
// 3. 网格办结项目数 // 3. 网格办结项目数
if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){ if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){
gridProjectClosedTotalList.forEach(closed -> { gridProjectClosedTotalList.forEach(closed -> {
@ -539,22 +548,22 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
/** /**
* @Description * @Description
* @param gridIssueTotalList * @param gridIssueTotalList 网格下已转项目的议题
* @param gridProjectTotalList * @param gridIssueAllTotalList 网格下所有议题
* @author zxc * @author zxc
* @date 2020/9/19 2:53 下午 * @date 2020/9/19 2:53 下午
*/ */
public List<GridProjectCountResultDTO> getGridIssueShiftProjectRatio(List<GridIssueCountResultDTO> gridIssueTotalList,List<GridProjectCountResultDTO> gridProjectTotalList){ public List<GridIssueCountResultDTO> getGridIssueShiftProjectRatio(List<GridIssueCountResultDTO> gridIssueTotalList,List<GridIssueCountResultDTO> gridIssueAllTotalList){
if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) { if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridIssueAllTotalList)) {
gridProjectTotalList.forEach(project -> { gridIssueAllTotalList.forEach(allIssue -> {
gridIssueTotalList.forEach(issue -> { gridIssueTotalList.forEach(issue -> {
if (project.getGridId().equals(issue.getGridId())) { if (allIssue.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))); 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 * @author zxc
* @date 2020/9/18 10:20 上午 * @date 2020/9/18 10:20 上午
*/ */
List<GridIssueCountResultDTO> selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId); List<GridIssueCountResultDTO> selectIssueTotalShiftProject(String customerId, String monthId);
/** /**
* @Description 网格总项目数 * @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 上午 * @date 2020/9/18 10:20 上午
*/ */
@Override @Override
public List<GridIssueCountResultDTO> selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) { public List<GridIssueCountResultDTO> selectIssueTotalShiftProject(String customerId, String monthId) {
return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId); return issueMainDailyDao.selectIssueTotalShiftProject(customerId, monthId);
} }
/** /**

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

@ -164,17 +164,16 @@
)t )t
</select> </select>
<!-- 查询俩月的网格议题总数 --> <!-- 查询议题转项目总数 -->
<select id="selectIssueTotalTwoMonthPlus" resultType="com.epmet.dto.extract.form.GridIssueCountResultDTO"> <select id="selectIssueTotalShiftProject" resultType="com.epmet.dto.extract.form.GridIssueCountResultDTO">
SELECT SELECT
COUNT( ID ) AS issueTotal, GRID_ID,
GRID_ID COUNT(ISSUE_ID) AS issueTotal
FROM FROM fact_origin_issue_log_daily
fact_origin_issue_main_daily WHERE DEL_FLAG = '0'
WHERE AND MONTH_ID = #{monthId}
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
AND (MONTH_ID = #{monthId} OR MONTH_ID = #{minusMonthId}) AND ACTION_CODE = 'shift_project'
GROUP BY GRID_ID GROUP BY GRID_ID
</select> </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", f.ORG_ID AS "agencyId",
SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( f.INFORMED_DATE, '%Y-%m-%d %H:%i' )), 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", ( 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 FROM
fact_origin_project_org_period_daily f fact_origin_project_org_period_daily f
INNER JOIN dim_agency da ON f.ORG_ID = da.ID INNER JOIN dim_agency da ON f.ORG_ID = da.ID
@ -128,7 +128,7 @@
fp.ORG_ID, fp.ORG_ID,
SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( fp.INFORMED_DATE, '%Y-%m-%d %H:%i' )), 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", ( 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 FROM
fact_origin_project_org_period_daily fp fact_origin_project_org_period_daily fp
INNER JOIN fact_origin_project_main_daily fm ON fp.PROJECT_ID = fm.ID 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 @Override
public void shiftProjectV2(ShiftProjectFormDTO formDTO) { 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()); 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查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用 //2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId());

Loading…
Cancel
Save