Browse Source

Merge remote-tracking branch 'remotes/origin/dev_third_data' into dev_temp

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
#	epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml
dev_shibei_match
jianjun 4 years ago
parent
commit
82c5dfc7f3
  1. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java
  3. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  4. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  5. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  6. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  7. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  8. 96
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql
  9. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml
  10. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -38,10 +38,7 @@ import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.service.StatsDemoService; import com.epmet.service.StatsDemoService;
import com.epmet.service.StatsPartyMemberVanguardService; import com.epmet.service.StatsPartyMemberVanguardService;
import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.screen.*; import com.epmet.service.evaluationindex.screen.*;
@ -120,6 +117,8 @@ public class DemoController {
private FactGroupActDailyService factGroupActDailyService; private FactGroupActDailyService factGroupActDailyService;
@Autowired @Autowired
private FactGridGovernDailyService factGridGovernDailyService; private FactGridGovernDailyService factGridGovernDailyService;
@Autowired
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@GetMapping("testAlarm") @GetMapping("testAlarm")
public void testAlarm() { public void testAlarm() {
@ -924,4 +923,10 @@ public class DemoController {
factGridGovernDailyService.extractFactGridGovernDaily(fromDTO); factGridGovernDailyService.extractFactGridGovernDaily(fromDTO);
return new Result(); return new Result();
} }
@PostMapping("extractFactAgencyGovernDaily")
public Result extractFactAgencyGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){
factAgencyGovernDailyService.extractFactAgencyGovernDaily(fromDTO.getCustomerId(), fromDTO.getDateId());
return new Result();
}
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java

@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 组织的治理指数按天统计 * 组织的治理指数按天统计
@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface FactAgencyGovernDailyDao extends BaseDao<FactAgencyGovernDailyEntity> { public interface FactAgencyGovernDailyDao extends BaseDao<FactAgencyGovernDailyEntity> {
/**
* 删除数据
* @author zhaoqifeng
* @date 2021/5/31 14:47
* @param customerId
* @param dateId
* @return int
*/
int deleteAgencyGovernDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("deleteSize") Integer deleteSize);
} }

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

@ -291,6 +291,14 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
} }
}); });
} }
if (CollectionUtils.isNotEmpty(agencyGovernDailyList)) {
int deleteNum;
do {
deleteNum = baseDao.deleteAgencyGovernDailyData(customerId, dateId, IndexCalConstant.DELETE_SIZE);
} while (deleteNum != NumConstant.ZERO);
//删除旧数据
insertBatch(agencyGovernDailyList);
}
} }
private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) { private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) {

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -10,6 +10,7 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
@ -73,6 +74,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService;
@Autowired @Autowired
private FactGridGovernDailyService factGridGovernDailyService; private FactGridGovernDailyService factGridGovernDailyService;
@Autowired
private FactAgencyGovernDailyService factAgencyGovernDailyService;
/** /**
* @param extractOriginFormDTO * @param extractOriginFormDTO
@ -255,6 +258,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}catch(Exception e){ }catch(Exception e){
log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
try{
factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId);
}catch(Exception e){
log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
extractPartData(customerId, dateId); extractPartData(customerId, dateId);
log.info("===== extractDaily method end ======"); log.info("===== extractDaily method end ======");
} }

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -319,7 +319,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>(); Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>();
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); subGridGovernAvg.forEach(s -> { List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId);
subGridGovernAvg.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount()); gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount());
}); });
if (CollectionUtils.isEmpty(subGridGovernAvg)){ if (CollectionUtils.isEmpty(subGridGovernAvg)){

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -228,10 +228,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
indexDetailList.forEach(detail -> { indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString());
subGridPartyAvgScore.forEach(s -> { subGridPartyAvgScore.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount());
}); });
log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString());
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
} else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) {
@ -317,10 +317,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("districtGovernAvgList:::"+districtGovernAvgList.toString());
districtGovernAvgList.forEach(s -> { districtGovernAvgList.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount());
}); });
log.info("districtGovernAvgList:::"+districtGovernAvgList.toString());
for (int i = 0; i < districtGovernAvgList.size(); i++) { for (int i = 0; i < districtGovernAvgList.size(); i++) {
if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
districtGovernAvgList.remove(districtGovernAvgList.get(i)); districtGovernAvgList.remove(districtGovernAvgList.get(i));
@ -410,10 +410,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId);
log.info("subStreetAvgList:::"+subStreetAvgList.toString());
subStreetAvgList.forEach(s -> { subStreetAvgList.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount());
}); });
log.info("subStreetAvgList:::"+subStreetAvgList.toString());
for (int i = 0; i < subStreetAvgList.size(); i++) { for (int i = 0; i < subStreetAvgList.size(); i++) {
if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
subStreetAvgList.remove(subStreetAvgList.get(i)); subStreetAvgList.remove(subStreetAvgList.get(i));

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -326,7 +326,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) {
List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId);
log.info("streetGovernAbilityCalculate: pjz {}",JSON.toJSONString(subGridGovernAvg));
subGridGovernAvg.forEach(s -> { subGridGovernAvg.forEach(s -> {
gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount()); gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount());
}); });

96
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql

@ -1,64 +1,42 @@
-- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 -- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计
-- /* CREATE TABLE `fact_agency_govern_daily` (
-- Navicat Premium Data Transfer `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
-- Source Server : 192.168.1.130 `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ',
-- Source Server Type : MySQL `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id',
-- Source Server Version : 50728 `LEVEL` varchar(30) NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)',
-- Source Host : 192.168.1.130:3306 `PID` varchar(64) NOT NULL COMMENT '组织i所属的组织id',
-- Source Schema : epmet_data_statistical `PIDS` varchar(255) NOT NULL COMMENT '组织i所有上级id',
-- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8',
-- Target Server Type : MySQL `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数',
-- Target Server Version : 50728 `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- File Encoding : 65001 `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- Date: 25/05/2021 09:31:39 `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- */ `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前组织内,话题关闭已解决数',
-- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前组织内,话题关闭无需解决数',
-- SET NAMES utf8mb4; `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前组织内,议题关闭已解决数',
-- SET FOREIGN_KEY_CHECKS = 0; `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前组织内,议题关闭无需解决数',
-- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前组织内:来源于议题的项目:结案已解决数',
-- -- ---------------------------- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数',
-- -- Table structure for fact_agency_govern_daily `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,',
-- -- ---------------------------- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,',
-- CREATE TABLE `fact_agency_govern_daily` ( `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数',
-- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数',
-- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '11、未出当前网格的,结案项目数',
-- `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由社区结案的项目总数',
-- `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id', `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由街道结案的项目总数',
-- `LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数',
-- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id', `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
-- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id', `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
-- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
-- `GROUP_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致',
-- `GRID_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
-- `COMMUNITY_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
-- `STREET_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', PRIMARY KEY (`ID`) USING BTREE
-- `DISTRICT_DEPT_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织的治理指数,按天统计';
-- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '1、当前组织内,话题关闭已解决数',
-- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '2、当前组织内,话题关闭无需解决数',
-- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '3、当前组织内,议题关闭已解决数',
-- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '4、当前组织内,议题关闭无需解决数',
-- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '5、当前组织内:来源于议题的项目:结案已解决数',
-- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数',
-- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,',
-- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,',
-- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数',
-- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数',
-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT 0 COMMENT '11、未出当前网格的,结案项目数',
-- `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由社区结案的项目总数',
-- `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由街道结案的项目总数',
-- `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数',
-- `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
-- `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致',
-- `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
-- `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
-- PRIMARY KEY (`ID`) USING BTREE
-- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织的治理指数,按天统计' ROW_FORMAT = Dynamic;
--
CREATE TABLE `fact_grid_govern_daily` ( CREATE TABLE `fact_grid_govern_daily` (
`ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml

@ -4,5 +4,10 @@
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao"> <mapper namespace="com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao">
<delete id="deleteAgencyGovernDailyData">
delete from fact_agency_govern_daily
where CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
limit #{deleteSize}
</delete>
</mapper> </mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml

@ -73,7 +73,8 @@
#{monthId} AS monthId, #{monthId} AS monthId,
#{quarterId} AS quarterId, #{quarterId} AS quarterId,
#{yearId} AS yearId, #{yearId} AS yearId,
IFNULL(ROUND(AVG( fics.score ),6),0) AS score, COUNT(1) AS sampleCount, IFNULL(ROUND(AVG( fics.score ),6),0) AS score,
COUNT(1) AS sampleCount,
sca.customer_id, sca.customer_id,
sca.pid AS parentId sca.pid AS parentId
FROM screen_customer_agency sca FROM screen_customer_agency sca

Loading…
Cancel
Save