Browse Source

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

dev_shibei_match
sunyuchao 4 years ago
parent
commit
68dc3d0b00
  1. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  2. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  3. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  4. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  5. 143
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  6. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  7. 90
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql
  8. 92
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql
  9. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  10. 1
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -71,4 +71,14 @@ public interface ProjectConstant {
String ISSUE = "issue";
/**
* 项目来源于议题
*/
String PROJECT_ORIGIN_ISSUE="issue";
/**
* 项目来源于 工作端立项
*/
String PROJECT_ORIGIN_AGENCY="agency";
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -28,6 +28,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -445,4 +446,23 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectPartyMemberClosedProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO
*/
List<GovernGridTotalCommonDTO> selectGroupByGrid(@Param("customerId")String customerId,
@Param("gridIds")List<String> gridIds,
@Param("projectStatus")String projectStatus,
@Param("origin")String origin,
@Param("isResolved")String isResolved);
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java

@ -129,11 +129,32 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer inGroupTopicUnResolvedCount;
/**
* 11未出当前网格的结案项目数
*/
/**
* 11来源于议题的项目未出网格结案并且已解决的项目数
*/
private Integer fromIssueResolvedInGridCount;
/**
* 12来源于议题的项目未出网格结案并且无需解决的项目数
*/
private Integer fromIssueUnResolvedInGridCount;
/**
* 13来源于项目立项的项目未出网格结案并且已解决的项目数因现在网格不能立项所以此列默认为0
*/
private Integer fromAgencyResolvedInGridCount;
/**
* 14来源于项目立项的项目未出网格结案并且无需解决的项目数因现在网格不能立项所以此列默认为0
*/
private Integer fromAgencyUnResolvedInGridCount;
/**
* 15未出当前网格的结案项目数=11+12+13+14
*/
private Integer gridSelfGovernProjectTotal;
public FactGridGovernDailyEntity() {
this.customerId = StrConstant.EPMETY_STR;
this.dateId = StrConstant.EPMETY_STR;
@ -153,6 +174,10 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
this.approvalProjectUnResolvedCount=NumConstant.ZERO;
this.inGroupTopicResolvedCount=NumConstant.ZERO;
this.inGroupTopicUnResolvedCount=NumConstant.ZERO;
this.fromIssueResolvedInGridCount=NumConstant.ZERO;
this.fromIssueUnResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO;
this.gridSelfGovernProjectTotal=NumConstant.ZERO;
}
}

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

@ -29,6 +29,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import java.util.List;
@ -421,4 +422,18 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
*/
Map<String, OrgStatisticsResultDTO> getPartyMemberClosedProjectStatic(String customerId, String dateId, String type);
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return
*/
List<GovernGridTotalCommonDTO> queryGridProjectValue(String customerId, List<String> gridIds, String projectStatus, String origin, String isResolved);
}

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

@ -27,6 +27,7 @@ import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.org.CustomerGridService;
import lombok.extern.slf4j.Slf4j;
@ -56,6 +57,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
@Autowired
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private CustomerGridService customerGridService;
@ -89,11 +92,17 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
Map<String, Integer> topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR);
Map<String, Integer> topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR);
Map<String, Integer> topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,null);
Map<String, Integer> topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,null);
Map<String, Integer> issueResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED);
Map<String, Integer> issueUnResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> issueProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED);
Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR);
Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR);
for(FactGridGovernDailyEntity insertEntity:insertEntityList){
//1、当前网格内,话题关闭已解决数
@ -104,6 +113,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
if(topicUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setTopicUnResolvedCount(topicUnResolvedMap.get(insertEntity.getGridId()));
}
//3、当前网格内,议题关闭已解决数
if(issueResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueResolvedCount(issueResolvedMap.get(insertEntity.getGridId()));
@ -113,23 +124,47 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setIssueUnResolvedCount(issueUnResolvedMap.get(insertEntity.getGridId()));
}
// todo
// 5、当前网格内:来源于议题的项目:结案已解决数
insertEntity.setIssueProjectResolvedCount(calIssueProjectResolvedCount(customerId,insertEntity.getGridId()));
if(issueProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueProjectResolvedCount(issueProjectResolvedMap.get(insertEntity.getGridId()));
}
// 6、当前网格内:来源于议题的项目:结案无需解决数
insertEntity.setIssueProjectUnResolvedCount(calIssueProjectUnResolvedCount(customerId,insertEntity.getGridId()));
if(issueProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueProjectUnResolvedCount(issueProjectUnResolvedMap.get(insertEntity.getGridId()));
}
//7、当前网格内:项目立项,结案已解决数;默认为0,
insertEntity.setApprovalProjectResolvedCount(calApprovalProjectResolvedCount(customerId,insertEntity.getGridId()));
if(approvalProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setApprovalProjectResolvedCount(approvalProjectResolvedMap.get(insertEntity.getGridId()));
}
// 8、当前网格内:项目立项,结案无需解决数;默认为0,
insertEntity.setApprovalProjectUnResolvedCount(calApprovalProjectUnResolvedCount(customerId,insertEntity.getGridId()));
if(approvalProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setApprovalProjectUnResolvedCount(approvalProjectUnResolvedMap.get(insertEntity.getGridId()));
}
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
// 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
insertEntity.setInGroupTopicResolvedCount(calInGroupTopicResolvedCount(customerId,insertEntity.getGridId()));
if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setInGroupTopicResolvedCount(inGroupTopicResolvedMap.get(insertEntity.getGridId()));
}
// 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数
insertEntity.setInGroupTopicUnResolvedCount(calInGroupTopicUnResolvedCount(customerId,insertEntity.getGridId()));
// 11、未出当前网格的,结案项目数
insertEntity.setGridSelfGovernProjectTotal(calGridSelfGovernProjectTotal(customerId,insertEntity.getGridId()));
if(inGroupTopicUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setInGroupTopicUnResolvedCount(inGroupTopicUnResolvedMap.get(insertEntity.getGridId()));
}
// todo
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(0);
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(0);
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(0);
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(0);
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount());
//界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
@ -138,6 +173,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
+insertEntity.getIssueProjectResolvedCount()+insertEntity.getIssueProjectUnResolvedCount()
+insertEntity.getApprovalProjectResolvedCount()+insertEntity.getApprovalProjectUnResolvedCount());
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
//界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount();
if (NumConstant.ZERO == groupSelfGovernRatioFz || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
@ -147,6 +183,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setGroupSelfGovernRatio(new BigDecimal(groupSelfGovernRatioStr));
}
// 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
//界面展示:3、网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()){
insertEntity.setGridSelfGovernRatio(BigDecimal.ZERO);
@ -230,77 +267,31 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
return resultMap;
}
/**
* 5当前网格内来源于议题的项目结案已解决数
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridId
*/
private Integer calIssueProjectResolvedCount(String customerId, String gridId) {
// todo
return 0;
}
/**
* 6当前网格内来源于议题的项目结案无需解决数
*
* @param customerId
* @param gridId
*/
private Integer calIssueProjectUnResolvedCount(String customerId, String gridId) {
// todo
return 0;
}
/**
* 7当前网格内项目立项结案已解决数默认为0
*
* @param customerId
* @param gridId
*/
private Integer calApprovalProjectResolvedCount(String customerId, String gridId) {
// todo
return 0;
}
/**
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridId
*/
private Integer calApprovalProjectUnResolvedCount(String customerId, String gridId) {
// todo
return 0;
}
/**
* 9当前网格内未出小组即未转议题的话题关闭已解决数
*
* @param customerId
* @param gridId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return
*/
private Integer calInGroupTopicResolvedCount(String customerId, String gridId) {
// todo
return 0;
private Map<String, Integer> getGridProjectMap(String customerId, List<String> gridIds, String projectStatus, String origin, String isResolved) {
Map<String, Integer> resultMap = new HashMap<>();
List<GovernGridTotalCommonDTO> list = factOriginProjectMainDailyService.queryGridProjectValue(customerId, gridIds, projectStatus, origin, isResolved);
for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) {
resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal());
}
return resultMap;
}
/**
* 10当前网格内未出小组即未转议题的话题关闭无需解决数
*
* @param customerId
* @param gridId
*/
private Integer calInGroupTopicUnResolvedCount(String customerId, String gridId) {
// todo
return 0;
}
/**
* 11未出当前网格的结案项目数
* 15未出当前网格的结案项目数=11+12+13+14
*
* @param customerId
* @param gridId

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

@ -39,6 +39,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
@ -639,5 +640,23 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
}
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO
*/
@Override
public List<GovernGridTotalCommonDTO> queryGridProjectValue(String customerId, List<String> gridIds, String projectStatus, String origin, String isResolved) {
return baseDao.selectGroupByGrid(customerId,gridIds,projectStatus,origin,isResolved);
}
}

90
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql

@ -1,49 +1,47 @@
-- epmet_data_statistical 库执行以下脚本
-- CREATE TABLE `fact_group_act_daily` (
-- `ID` varchar(64) NOT NULL COMMENT '主键',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
-- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd',
-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
-- `LEVEL` int(11) NOT NULL COMMENT '分类等级',
-- `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据',
-- `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据',
-- `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据',
-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
-- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
-- `UPDATED_BY` varchar(64) 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_group_act_daily` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd',
`ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
`ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
`PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
`PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
`CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
`PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
`LEVEL` int(11) NOT NULL COMMENT '分类等级',
`ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据',
`PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据',
`AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) 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_group_act_monthly` (
-- `ID` varchar(64) NOT NULL COMMENT '主键',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
-- `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM',
-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
-- `LEVEL` int(11) NOT NULL COMMENT '分类等级',
-- `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数',
-- `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数',
-- `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数',
-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
-- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
-- `UPDATED_BY` varchar(64) 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_group_act_monthly` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM',
`ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
`ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
`PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
`PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
`CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
`PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
`LEVEL` int(11) NOT NULL COMMENT '分类等级',
`ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数',
`PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数',
`AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析';

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

@ -64,34 +64,70 @@
-- -- Table structure for fact_grid_govern_daily
-- -- ----------------------------
-- DROP TABLE IF EXISTS `fact_grid_govern_daily`;
-- CREATE TABLE `fact_grid_govern_daily` (
-- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+grid_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; ',
-- `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格id',
-- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织id',
-- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所有上级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;此列存储的是小数',
-- `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 COMMENT '11、未出当前网格的,结案项目数',
-- `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 '更新时间',
-- 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',
-- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ',
-- `GRID_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id',
-- `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级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;此列存储的是小数',
-- `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、当前网格内,未出小组即未转议题的:话题关闭无需解决数',
-- `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数',
-- `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数',
-- `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0',
-- `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0',
-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14',
-- `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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格的治理指数,按天统计' ROW_FORMAT = Dynamic;
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计';
--
-- SET FOREIGN_KEY_CHECKS = 1;
# 小组成员添加是否是党员
ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily`
ADD COLUMN `IS_PARTY` tinyint(1) NULL DEFAULT 0 COMMENT '是否是党员' AFTER `ACTION_CODE`;
# 项目主表添加结案项目是否满意
ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily`
ADD COLUMN `IS_SATISFIED` tinyint(1) NULL COMMENT '是否满意 1:是' AFTER `IS_OVERDUE`;
# 添加治理能力按日统计表
CREATE TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` (
`ID` varchar(64) NOT NULL COMMENT 'ID 主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',
`YEAR_ID` varchar(32) NOT NULL COMMENT '年Id',
`MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id',
`DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd',
`ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid',
`ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id',
`PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id',
`ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称',
`RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率',
`RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率',
`GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率',
`SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL 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`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按日统计)';

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -914,4 +914,37 @@
ON a.AGENCY_ID = b.AGENCY_ID
</select>
<!-- 5、当前网格内:来源于议题的项目:结案已解决数、6、当前网格内:来源于议题的项目:结案无需解决数、7、当前网格内:项目立项,结案已解决数;默认为0、8、当前网格内:项目立项,结案无需解决数;默认为0、 -->
<select id="selectGroupByGrid" parameterType="map" resultType="com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO">
SELECT
m.CUSTOMER_ID AS customerId,
m.GRID_ID AS gridId,
count( 1 ) AS total
FROM
fact_origin_project_main_daily m
WHERE
m.DEL_FLAG = '0'
<if test='null != customerId and "" != customerId'>
AND m.CUSTOMER_ID = #{customerId}
</if>
<if test='null != origin and "" != origin'>
AND m.ORIGIN = #{origin}
</if>
<if test='null != projectStatus and "" != projectStatus'>
AND m.PROJECT_STATUS = #{projectStatus}
</if>
<if test='null != isResolved and "" != isResolved'>
AND m.IS_RESOLVED = #{isResolved}
</if>
<if test="gridIds != null and gridIds.size() > 0">
AND m.GRID_ID in
<foreach item="gridId" collection="gridIds" open="(" separator="," close=")">
#{gridId}
</foreach>
</if>
GROUP BY
m.CUSTOMER_ID,
m.GRID_ID
</select>
</mapper>

1
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql

@ -0,0 +1 @@
INSERT INTO `customer_project_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1007', 'default', 'satisfaction', '项目满意指标', '75', '评分小于当前分的为不满意', '0', 1, '1', '2020-10-26 10:57:41', '1', '2020-10-26 10:57:45');
Loading…
Cancel
Save