Browse Source

网格 治理能力 相关

dev
zxc 5 years ago
parent
commit
2422ea3549
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java
  2. 148
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java
  3. 45
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java
  4. 31
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java
  5. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  6. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  7. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java
  8. 93
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java
  9. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java
  10. 35
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  11. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java

@ -18,4 +18,6 @@ public interface ExtractConstant {
String ISSUE_PROCESS = "查询查询议题process集合为空";
String SHIFT_PROJECT = "shift_project";
}

148
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java

@ -0,0 +1,148 @@
/**
* 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.dto.extract.form;
import java.io.Serializable;
import java.util.Date;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.math.BigDecimal;
/**
* 治理能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-18
*/
@Data
public class GovernAbilityGridMonthlyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 网格所属机关Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 月维度IdyyyyMM
*/
private String monthId;
/**
* 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
*/
private String quarterId;
/**
* 年Id:yyyy
*/
private String yearId;
/**
* 网格总议题数
*/
private Integer issueTotal;
/**
* 网格人均议题数目
*/
private Integer avgIssueCount;
/**
* 网格议题转项目率
*/
private BigDecimal issueToProjectRatio;
/**
* 网格总项目数
*/
private Integer projectTotal;
/**
* 网格自治项目数 统计期网格自身内办结的项目数目
*/
private Integer selfSolveProjectCount;
/**
* 网格办结项目数 统计期内办结的项目数目
*/
private Integer resolveProjectCount;
/**
* 网格吹哨部门准确率
*/
private BigDecimal transferRightRatio;
/**
* 网格内解决的项目的满意度
*/
private BigDecimal satisfactionRatio;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public GovernAbilityGridMonthlyFormDTO() {
this.issueTotal = NumConstant.ZERO;
this.avgIssueCount = NumConstant.ZERO;
this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO);
this.projectTotal = NumConstant.ZERO;
this.selfSolveProjectCount = NumConstant.ZERO;
this.resolveProjectCount = NumConstant.ZERO;
this.transferRightRatio = new BigDecimal(NumConstant.ZERO);
this.satisfactionRatio = new BigDecimal(NumConstant.ZERO);
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

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

@ -0,0 +1,45 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/18 10:12 上午
*/
@Data
public class GridIssueCountResultDTO implements Serializable {
private static final long serialVersionUID = -1222149631076688225L;
/**
* 网格总议题数目
*/
private Integer issueTotal;
/**
* 网格人均议题数目
*/
private Integer avgIssueCount;
/**
* 网格ID
*/
private String gridId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
}

31
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
* @DateTime 2020/9/18 1:22 下午
*/
@Data
public class GridProjectCountResultDTO implements Serializable {
private static final long serialVersionUID = -1348707512443965601L;
/**
* 网格总项目数
*/
private Integer projectTotal;
/**
* 网格ID
*/
private String gridId;
/**
* 网格议题转项目率
*/
private BigDecimal issueToProjectRatio;
}

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

@ -18,7 +18,9 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +52,23 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @date 2020/9/16 9:33 上午
*/
void deleteOldMainRecord(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @Description 查询网格议题总数网格人均议题数目
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 网格总项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 1:21 下午
*/
List<GridProjectCountResultDTO> selectGridProjectCount(@Param("customerId") String customerId,@Param("monthId") String monthId, @Param("status") String status);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO;
@ -101,4 +102,12 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @Date 2020/9/2 14:46
**/
String selectTheOneGrid(CalculateCommonFormDTO formDTO);
/**
* @Description 查询全部网格信息
* @param customerId
* @author zxc
* @date 2020/9/18 10:47 上午
*/
List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(String customerId);
}

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

@ -1,6 +1,10 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import java.util.List;
/**
* @Author zxc
@ -23,4 +27,23 @@ public interface IssueExtractService {
* @date 2020/9/16 9:41 上午
*/
Boolean issueExtractLog(ExtractFormDTO extractFormDTO);
/**
* @Description 查询网格议题总数网格人均议题数目
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotal(String customerId, String monthId);
/**
* @Description 网格总项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 1:21 下午
*/
List<GridProjectCountResultDTO> selectGridProjectCount(String customerId, String monthId,String status);
}

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

@ -1,10 +1,24 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ExtractConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author zxc
@ -15,6 +29,11 @@ import org.springframework.stereotype.Service;
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class CalGridIndexServiceImpl implements CalGridIndexService {
@Autowired
private IssueExtractService issueExtractService;
@Autowired
private FactIndexGovrnAblityGridMonthlyDao governAbilityDao;
/**
* @Description 计算网格指标党建能力
* @param customerId
@ -36,7 +55,69 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
*/
@Override
public Boolean calGridIndexGovernAbility(String customerId, String monthId) {
return null;
List<GovernAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfo(customerId);
if (CollectionUtils.isEmpty(result)){
throw new RenException("客户【"+customerId+"】未查出网格信息");
}
//网格总议题数目,网格人均议题数目
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId);
//网格总项目数
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
//网格议题转项目率
gridProjectTotalList.forEach(project -> {
gridIssueTotalList.forEach(issue ->{
if (project.getGridId().equals(issue.getGridId())){
project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal()/issue.getIssueTotal())));
}
});
});
//网格自治项目数
//网格办结项目数
//网格吹哨部门准确率
//网格内解决的项目的满意度
//组织内党员的参与议事能力考评分(平均值)
result.forEach(r -> {
// 1. 网格总议题数目,网格人均议题数目
if (!CollectionUtils.isEmpty(gridIssueTotalList)) {
gridIssueTotalList.forEach(total -> {
if (r.getGridId().equals(total.getGridId())) {
BeanUtils.copyProperties(total, r);
}
});
}
// 2. 网格总项目数,网格议题转项目率
if (!CollectionUtils.isEmpty(gridIssueTotalList)){
gridProjectTotalList.forEach(projectTotal -> {
if (r.getGridId().equals(projectTotal.getGridId())){
r.setProjectTotal(projectTotal.getProjectTotal());
r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio());
}
});
}
});
//
return true;
}
/**
@ -50,4 +131,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
public Boolean calGridIndexServiceAbility(String customerId, String monthId) {
return null;
}
/**
* @Description 小数四舍五入
* @param d
* @author zxc
* @date 2020/9/18 2:01 下午
*/
public BigDecimal getRound(BigDecimal d){
return d.setScale(NumConstant.SIX, BigDecimal.ROUND_HALF_UP);
}
}

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

@ -9,13 +9,10 @@ import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dao.stats.DimAgencyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueLogDailyFormDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.extract.result.AgencyInfoResultDTO;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.topic.TopicService;
@ -226,6 +223,31 @@ public class IssueExtractServiceImpl implements IssueExtractService {
return true;
}
/**
* @Description 查询网格议题总数网格人均议题数目
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
@Override
public List<GridIssueCountResultDTO> selectIssueTotal(String customerId, String monthId) {
return issueMainDailyDao.selectIssueTotal(customerId, monthId);
}
/**
* @Description 网格总项目数
* @param customerId
* @param monthId
* @param status
* @author zxc
* @date 2020/9/18 1:21 下午
*/
@Override
public List<GridProjectCountResultDTO> selectGridProjectCount(String customerId, String monthId, String status) {
return issueMainDailyDao.selectGridProjectCount(customerId, monthId, status);
}
/**
* @Description 议题附表删除插入
* @param customerId

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

@ -66,4 +66,39 @@
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
</delete>
<!-- 查询网格议题总数,网格人均议题数目 -->
<select id="selectIssueTotal" resultType="com.epmet.dto.extract.form.GridIssueCountResultDTO">
SELECT
COUNT( ID ) AS issueTotal,
ROUND((COUNT(ID) / COUNT(DISTINCT(USER_ID))),0) AS avgIssueCount,
GRID_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID
FROM
fact_origin_issue_main_daily
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<!-- 网格总项目数 -->
<select id="selectGridProjectCount" resultType="com.epmet.dto.extract.result.GridProjectCountResultDTO">
SELECT
COUNT(ID) AS projectTotal,
GRID_ID
FROM
fact_origin_issue_main_daily
WHERE
DEL_FLAG = 0
<if test="status != null and status != '' ">
AND ISSUE_STATUS = #{status}
</if>
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
</mapper>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml

@ -161,4 +161,17 @@
AND m.CUSTOMER_ID =#{customerId}
AND m.MONTH_ID =#{monthId}
</select>
<!-- 查询全部网格信息 -->
<select id="selectAllGridInfo" resultType="com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO">
SELECT
scg.CUSTOMER_ID,
scg.GRID_ID,
scg.PARENT_AGENCY_ID AS agencyId
FROM
screen_customer_grid scg
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
</select>
</mapper>

Loading…
Cancel
Save