From 4b0c913729030b2395c79f78edbe90fb00705d56 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 31 May 2021 14:55:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/DemoController.java | 13 +++++++++---- .../extract/FactAgencyGovernDailyDao.java | 10 ++++++++++ .../impl/FactAgencyGovernDailyServiceImpl.java | 8 ++++++++ .../extract/FactAgencyGovernDailyDao.xml | 7 ++++++- 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index a8baf89b38..108f82d575 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/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.StatsPartyMemberVanguardService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; -import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; -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.todata.*; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.screen.*; @@ -120,6 +117,8 @@ public class DemoController { private FactGroupActDailyService factGroupActDailyService; @Autowired private FactGridGovernDailyService factGridGovernDailyService; + @Autowired + private FactAgencyGovernDailyService factAgencyGovernDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -924,4 +923,10 @@ public class DemoController { factGridGovernDailyService.extractFactGridGovernDaily(fromDTO); return new Result(); } + @PostMapping("extractFactAgencyGovernDaily") + public Result extractFactAgencyGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){ + factAgencyGovernDailyService.extractFactAgencyGovernDaily(fromDTO.getCustomerId(), fromDTO.getDateId()); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java index b88d897543..2671d89c4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java +++ b/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.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 组织的治理指数,按天统计 @@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactAgencyGovernDailyDao extends BaseDao { + /** + * 删除数据 + * @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); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 82e599ff4b..1fbabc764b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/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 - + + delete from fact_agency_govern_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + limit #{deleteSize} + \ No newline at end of file From 8745b52bf07bea40b70d8f4a871fab020aa9c088 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Jun 2021 09:17:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0table=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=EF=BC=8C=E5=8F=96=E6=B6=88=E6=B3=A8=E9=87=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.15__govern.sql | 96 +++++++------------ 1 file changed, 37 insertions(+), 59 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql index 59975cc83f..e83d7f5313 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -1,64 +1,42 @@ -- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 --- /* --- Navicat Premium Data Transfer --- --- Source Server : 192.168.1.130 --- Source Server Type : MySQL --- Source Server Version : 50728 --- Source Host : 192.168.1.130:3306 --- Source Schema : epmet_data_statistical --- --- Target Server Type : MySQL --- Target Server Version : 50728 --- File Encoding : 65001 --- --- Date: 25/05/2021 09:31:39 --- */ --- --- SET NAMES utf8mb4; --- SET FOREIGN_KEY_CHECKS = 0; --- --- -- ---------------------------- --- -- Table structure for fact_agency_govern_daily --- -- ---------------------------- --- CREATE TABLE `fact_agency_govern_daily` ( --- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', --- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', --- `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', --- `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id', --- `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)', --- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id', --- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id', --- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', --- `GROUP_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', --- `GRID_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', --- `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;此列存储的是小数', --- `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、当前组织内,话题关闭无需解决数', --- `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_agency_govern_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', + `LEVEL` varchar(30) NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `PID` varchar(64) NOT NULL COMMENT '组织i所属的组织id', + `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', + `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', + `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `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;此列存储的是小数', + `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、当前组织内,话题关闭无需解决数', + `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) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织的治理指数,按天统计'; + CREATE TABLE `fact_grid_govern_daily` ( `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', From fd6989e4ff355fedad9bc36b3183799d607f49d7 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 1 Jun 2021 10:00:40 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index b480c39761..51f6e97426 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/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.indexcal.CalculateCommonFormDTO; 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.toscreen.*; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; @@ -73,6 +74,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; @Autowired private FactGridGovernDailyService factGridGovernDailyService; + @Autowired + private FactAgencyGovernDailyService factAgencyGovernDailyService; /** * @param extractOriginFormDTO @@ -255,6 +258,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch(Exception 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); log.info("===== extractDaily method end ======"); }