Browse Source

Merge branch 'dev_third_data' into dev_temp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
acd2135f99
  1. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  2. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java
  3. 22
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java
  4. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java
  5. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  7. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  8. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java
  9. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java
  10. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java
  11. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java
  12. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  13. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  14. 246
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  15. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  16. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java
  17. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java
  18. 36
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql
  19. 22
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql
  20. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  21. 59
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  22. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  23. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml
  24. BIN
      epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx

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

@ -1224,6 +1224,9 @@ public class DataStatsServiceImpl implements DataStatsService {
dto.setProblemResolvedCount(re.getProblemResolvedCount());
dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio());
dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio());
dto.setCommunityResolvedRatio(re.getCommunityResolvedRatio());
dto.setDistrictDeptResolvedRatio(re.getDistrictDeptResolvedRatio());
dto.setStreetResolvedRatio(re.getStreetResolvedRatio());
}
}
resultList.add(dto);

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto.extract;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -44,7 +45,7 @@ public class FactOriginProjectLogDailyDTO implements Serializable {
private String customerId;
/**
* 网格grid,部门department
* 网格grid,部门department,组织agency
*/
private String orgType;
@ -90,6 +91,11 @@ public class FactOriginProjectLogDailyDTO implements Serializable {
*/
private String yearId;
/**
* 项目ID
*/
private String projectId;
/**
* 议题ID
*/

22
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 治理指数网格-计算入参
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/27 17:28
*/
@Data
public class ExtractFactGridGovernDailyFromDTO implements Serializable {
private static final long serialVersionUID = -4511693100253244749L;
@NotBlank(message = "customer")
private String customerId;
private String dateId;
private List<String> gridIds;
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java

@ -11,4 +11,17 @@ public interface DimObjectActionConstant {
* 发布话题
*/
String TOPIC_PUBLISH="discussing";
// response 处理/响应
// close 结案
// transfer 流转
// return 退回
// resolved 结案_已解决
// unresolved 结案_无需解决
// evaluate 满意度评价
// bad 不满意
// good 基本满意
// perfect 非常满意
// created 立项
String PROJECT_RETURN="return";
}

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

@ -19,6 +19,7 @@ import com.epmet.dao.stats.DimDateDao;
import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
@ -534,6 +535,14 @@ public class DemoController {
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param customerId
* @param dateId
* @author yinzuomei
* @description 话题原始表抽取方法
* @Date 2021/5/28 10:23
**/
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
@ -903,9 +912,16 @@ public class DemoController {
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param fromDTO
* @author yinzuomei
* @description
* @Date 2021/5/27 17:28
**/
@PostMapping("extractgridgoverndaily")
public Result extractFactGridGovernDaily(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){
factGridGovernDailyService.extractFactGridGovernDaily(customerId,dateId);
public Result extractFactGridGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){
factGridGovernDailyService.extractFactGridGovernDaily(fromDTO);
return new Result();
}
}

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

@ -18,12 +18,12 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -298,4 +298,22 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @return java.util.List<com.epmet.dto.extract.FactOriginProjectLogDailyDTO>
* @param projectId
* @author yinzuomei
* @description 根据项目id 查询处理明细
* @Date 2021/5/27 12:58
**/
List<FactOriginProjectLogDailyDTO> selectListByProjectId(String projectId);
/**
* @return com.epmet.dto.extract.FactOriginProjectLogDailyDTO
* @param projectId
* @author yinzuomei
* @description 查询某一个项目的结案操作明细
* @Date 2021/5/27 12:58
**/
FactOriginProjectLogDailyDTO selectClosedLog(String projectId);
}

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

@ -29,6 +29,7 @@ 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.extract.GovernProjectInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -487,4 +488,22 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectAgencyClosedProjectStaticDaily(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 当前网格内已结案的项目
*
* @author zhaoqifeng
* @date 2021/5/26 15:09
* @param customerId
* @param gridId
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO
*/
List<GovernProjectInfoDTO> getGridClosedProjectList(@Param("customerId")String customerId,
@Param("gridId") String gridId,
@Param("projectStatus")String projectStatus,
@Param("origin") String origin,
@Param("isResolved")String isResolved);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java

@ -35,4 +35,12 @@ public interface StatsCustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
CustomerAgencyEntity getRootAgencyInfo(String customerId);
List<CustomerAgencyEntity> queryAgencyListByCustomerId(String customerId);
/**
* 查询部门所属组织信息
*
* @param deptId
* @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity
*/
CustomerAgencyEntity selectByDeptId(String deptId);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java

@ -0,0 +1,20 @@
package com.epmet.entity.evaluationindex.extract;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/26 18:00
*/
@Data
public class GovernProjectInfoDTO extends FactOriginProjectMainDailyDTO implements Serializable {
private FactOriginProjectLogDailyDTO closeLogDTO;
private List<FactOriginProjectLogDailyDTO> projectLogDTOList;
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java

@ -1,15 +0,0 @@
package com.epmet.entity.evaluationindex.extract;
import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/26 18:00
*/
@Data
public class ProjectInfoDTO implements Serializable {
}

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

@ -18,6 +18,7 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
/**
@ -35,10 +36,9 @@ public interface FactGridGovernDailyService extends BaseService<FactGridGovernDa
* 治理指数-网格相关问题解决总数党群自治占比网格自治占比
*
*
* @param customerId
* @param dateId
* @param fromDTO
* @return
*/
void extractFactGridGovernDaily(String customerId, String dateId);
void extractFactGridGovernDaily(ExtractFactGridGovernDailyFromDTO fromDTO);
}

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

@ -30,6 +30,7 @@ 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.extract.GovernProjectInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import java.util.List;
@ -458,4 +459,22 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @return java.util.Map<java.lang.String,java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>>
*/
Map<String, List<OrgStatisticsResultDTO>> getAgencyClosedProjectStatic(String customerId, String dateId);
/**
* 当前网格内已结案的项目
*
* @author zhaoqifeng
* @date 2021/5/26 15:09
* @param customerId
* @param gridId
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO
*/
List<GovernProjectInfoDTO> getGridClosedProjectList(String customerId,
String gridId,
String projectStatus,
String origin,
String isResolved);
}

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

@ -18,11 +18,25 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService;
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.stats.DimAgencyService;
import com.epmet.util.DimIdGenerator;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 组织的治理指数按天统计
*
@ -32,6 +46,14 @@ import org.springframework.stereotype.Service;
@Service
public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgencyGovernDailyDao, FactAgencyGovernDailyEntity> implements FactAgencyGovernDailyService {
@Resource
private DimAgencyService dimAgencyService;
@Resource
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Resource
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Resource
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
/**
* 治理指数-组织相关
@ -44,8 +66,14 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
*/
@Override
public void extractFactAgencyGovernDaily(String customerId, String dateId) {
List<DimAgencyDTO> agencyList = dimAgencyService.getAgencyInfoByCustomerId(customerId);
List<FactAgencyGovernDailyEntity> agencyGovernDailyList = agencyList.stream().map(agency -> {
FactAgencyGovernDailyEntity entity = initEntity(agency, dateId);
return entity;
}).collect(Collectors.toList());
// 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和
Map<String, OrgStatisticsResultDTO> topicTotal = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, null,
null);
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
// 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
// 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算
@ -61,4 +89,35 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
// A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决)
// 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案
}
private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) {
FactAgencyGovernDailyEntity entity = new FactAgencyGovernDailyEntity();
entity.setCustomerId(agency.getCustomerId());
entity.setAgencyId(agency.getId());
entity.setLevel(agency.getLevel());
entity.setPid(agency.getPid());
entity.setPids(agency.getPids());
entity.setDateId(dateId);
entity.setProblemResolvedCount(NumConstant.ZERO);
entity.setGroupSelfGovernRatio(new BigDecimal(NumConstant.ZERO));
entity.setGridSelfGovernRatio(new BigDecimal(NumConstant.ZERO));
entity.setCommunityClosedRatio(new BigDecimal(NumConstant.ZERO));
entity.setStreetClosedRatio(new BigDecimal(NumConstant.ZERO));
entity.setDistrictDeptClosedRatio(new BigDecimal(NumConstant.ZERO));
entity.setTopicResolvedCount(NumConstant.ZERO);
entity.setTopicUnResolvedCount(NumConstant.ZERO);
entity.setIssueResolvedCount(NumConstant.ZERO);
entity.setIssueUnResolvedCount(NumConstant.ZERO);
entity.setIssueProjectResolvedCount(NumConstant.ZERO);
entity.setIssueProjectUnResolvedCount(NumConstant.ZERO);
entity.setApprovalProjectResolvedCount(NumConstant.ZERO);
entity.setApprovalProjectUnResolvedCount(NumConstant.ZERO);
entity.setInGroupTopicResolvedCount(NumConstant.ZERO);
entity.setInGroupTopicUnResolvedCount(NumConstant.ZERO);
entity.setGridSelfGovernProjectTotal(NumConstant.ZERO);
entity.setCommunityClosedCount(NumConstant.ZERO);
entity.setStreetClosedCount(NumConstant.ZERO);
entity.setDistrictDeptClosedCount(NumConstant.ZERO);
return entity;
}
}

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

@ -19,17 +19,23 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DimObjectActionConstant;
import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
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.CustomerAgencyService;
import com.epmet.service.org.CustomerGridService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -39,10 +45,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -62,7 +65,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private CustomerAgencyService customerAgencyService;
// 指标解释:
// 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和
@ -71,12 +75,13 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
/**
* 治理指数-网格相关问题解决总数党群自治占比网格自治占比
*
* @param customerId
* @param dateId
* @param fromDTO
* @return
*/
@Override
public void extractFactGridGovernDaily(String customerId, String dateId) {
public void extractFactGridGovernDaily(ExtractFactGridGovernDailyFromDTO fromDTO) {
String customerId=fromDTO.getCustomerId();
String dateId=fromDTO.getDateId();
log.info("extractFactGridGovernDaily start customerId="+customerId+";dateId="+dateId);
//客户id, dateId不能为空
if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){
@ -90,7 +95,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
}
List<String> gridIds=gridInfoDTOList.stream().map(GridInfoDTO::getGridId).collect(Collectors.toList());
List<FactGridGovernDailyEntity> insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList);
// log.info(JSON.toJSONString(insertEntityList,true));
log.info("==========================当前客户下多少个网格? "+insertEntityList.size());
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
@ -155,26 +160,27 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setInGroupTopicUnResolvedCount(inGroupTopicUnResolvedMap.get(insertEntity.getGridId()));
}
// todo
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(666);
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(666);
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(666);
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(666);
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
if (dtoMap.containsKey(insertEntity.getGridId()) && null != dtoMap.get(insertEntity.getGridId())) {
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromIssueResolvedInGridCount());
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromIssueUnResolvedInGridCount());
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyResolvedInGridCount());
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyUnResolvedInGridCount());
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount());
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
insertEntity.setCommunityClosedCount(666);
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setStreetClosedCount(666);
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setDistrictDeptClosedCount(666);
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
insertEntity.setCommunityClosedCount(dtoMap.get(insertEntity.getGridId()).getCommunityClosedCount());
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setStreetClosedCount(dtoMap.get(insertEntity.getGridId()).getStreetClosedCount());
//当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
insertEntity.setDistrictDeptClosedCount(dtoMap.get(insertEntity.getGridId()).getDistrictDeptClosedCount());
}
//界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount()
@ -242,13 +248,193 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
}
private Map<String, GovernGridClosedTotalCommonDTO> getGovernGridClosedTotalCommonDTOMap(String customerId, List<String> gridIds) {
Map<String, GovernGridClosedTotalCommonDTO> resultMap=new HashMap<>();
for(String gridId:gridIds){
Map<String, GovernGridClosedTotalCommonDTO> resultMap = new HashMap<>();
for (String gridId : gridIds) {
GovernGridClosedTotalCommonDTO governGridClosedTotalCommonDTO = new GovernGridClosedTotalCommonDTO();
governGridClosedTotalCommonDTO.setGridId(gridId);
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
int fromIssueResolvedInGridCount = NumConstant.ZERO;
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
int fromIssueUnResolvedInGridCount = NumConstant.ZERO;
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
int fromAgencyResolvedInGridCount = NumConstant.ZERO;
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
int fromAgencyUnResolvedInGridCount = NumConstant.ZERO;
// 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
int communityClosedCount= NumConstant.ZERO;
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
int streetClosedCount=NumConstant.ZERO;;
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
int districtDeptClosedCount=NumConstant.ZERO;
//当前网格内已结案的项目
List<GovernProjectInfoDTO> currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId,
ProjectConstant.CLOSED,null,null);
for (GovernProjectInfoDTO governProjectInfoDTO : currentGridClosedProjectList) {
// 1、先判断当前项目是否出了网格
// 举例:A社区下有A1、A2两个网格;A1网格下的一个项目,流转给了A2网格的某人,他结案了。 只要项目流转部门未出grid ;就算是网格自治。
boolean inGridClosed = checkIsInGridClosed(governProjectInfoDTO.getGridId(),
governProjectInfoDTO.getProjectLogDTOList());
if (inGridClosed) {
// 2、在网格内流转结案的,计算以下下值
if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(governProjectInfoDTO.getOrigin())) {
if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) {
// 11、来源于议题的项目,未出网格(在网格内流转的)结案并且已解决的项目数
fromIssueResolvedInGridCount += 1;
} else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) {
// 12、来源于议题的项目,未出网格(在网格内流转的)结案并且无需解决的项目数
fromIssueUnResolvedInGridCount += 1;
}
} else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(governProjectInfoDTO.getOrigin())) {
if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) {
// 13、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
fromAgencyResolvedInGridCount += 1;
} else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) {
// 14、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
fromAgencyUnResolvedInGridCount += 1;
}
}
} else {
// 3、出了网格的判断是由谁解决的?
String resolveOrgType=getProjectResolveOrgType(governProjectInfoDTO.getProjectLogDTOList());
if("community".equals(resolveOrgType)){
// 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
communityClosedCount+=1;
}else if("street".equals(resolveOrgType)){
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
streetClosedCount+=1;
}else if("districtdept".equals(resolveOrgType)){
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
districtDeptClosedCount+=1;
}
// todo 可能是 市级解决、省级解决呢???
}
}
governGridClosedTotalCommonDTO.setFromIssueResolvedInGridCount(fromIssueResolvedInGridCount);
governGridClosedTotalCommonDTO.setFromIssueUnResolvedInGridCount(fromIssueUnResolvedInGridCount);
governGridClosedTotalCommonDTO.setFromAgencyResolvedInGridCount(fromAgencyResolvedInGridCount);
governGridClosedTotalCommonDTO.setFromAgencyUnResolvedInGridCount(fromAgencyUnResolvedInGridCount);
governGridClosedTotalCommonDTO.setCommunityClosedCount(communityClosedCount);
governGridClosedTotalCommonDTO.setStreetClosedCount(streetClosedCount);
governGridClosedTotalCommonDTO.setDistrictDeptClosedCount(districtDeptClosedCount);
resultMap.put(gridId, governGridClosedTotalCommonDTO);
}
return resultMap;
}
/**
* 已经出网格的项目到底归谁解决呢
*
* @param projectLogDTOList 当前项目所有的处理明细
* @return String 社区解决community街道解决street区直部门解决districtdept
*/
private String getProjectResolveOrgType(List<FactOriginProjectLogDailyDTO> projectLogDTOList) {
List<Integer> handleLevelList=new ArrayList<>();
for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) {
if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){
//当前操作如果是退回,不参与比较
continue;
}
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
// orgType: 网格grid,部门department,组织:agency
if ("grid".equals(logDailyDTO.getOrgType())) {
handleLevelList.add(NumConstant.ONE);
} else if ("agency".equals(logDailyDTO.getOrgType())) {
CustomerAgencyEntity agencyEntity=customerAgencyService.getAgencyById(logDailyDTO.getOrgId());
if("community".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.TWO);
}else if("street".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.THREE);
}else if("district".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.FOUR);
}else if("city".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.FIVE);
}else if("province".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.SIX);
}
} else if ("department".equals(logDailyDTO.getOrgType())) {
CustomerAgencyEntity deptAgencyEntity=customerAgencyService.getAgencyByDeptId(logDailyDTO.getOrgId());
if("district".equals(deptAgencyEntity.getLevel())){
// 区直部门直接返回
return "districtdept";
}else if("community".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.TWO);
}else if("street".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.THREE);
}else if("city".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.FIVE);
}else if("province".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.SIX);
}
}
}
//网格:1 grid
//社区:2 community
//街道:3 street
//区县:4 district
//市级:5 city
//省:6 province
//区直部门:7 districtdept
//求出最高的处理部门级别
String result = "";
int max = Collections.max(handleLevelList);
switch (max) {
case NumConstant.ONE:
return "grid";
case NumConstant.TWO:
result = "community";
break;
case NumConstant.THREE:
result = "street";
break;
case NumConstant.FOUR:
result = "district";
break;
case NumConstant.FIVE:
result = "city";
break;
case NumConstant.SIX:
result = "province";
break;
case NumConstant.SEVEN:
result = "districtdept";
}
return result;
}
/**
* 根据项目处理的明细,判断当前项目是否在网格内自己解决的
*
* @param gridId 当前项目所属网格
* @param projectLogDTOList
* @return boolean
*/
private boolean checkIsInGridClosed(String gridId, List<FactOriginProjectLogDailyDTO> projectLogDTOList) {
boolean flag = true;
for (FactOriginProjectLogDailyDTO detail : projectLogDTOList) {
if(detail.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){
//当前操作如果是退回,不参与比较
continue;
}
//只要出了网格,就不算自治
if (!"grid".equals(detail.getOrgType())) {
flag = false;
break;
}
}
return flag;
}
/**
* 构造要插入的数据每个网格一天一条数据初始赋值0
*
@ -264,7 +450,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
entity.setCustomerId(customerId);
entity.setDateId(dateId);
entity.setGridId(gridInfoDTO.getGridId());
entity.setPid(gridInfoDTO.getPid());
entity.setPid(gridInfoDTO.getAgencyId());
entity.setPids(gridInfoDTO.getPids());
insertEntityList.add(entity);
}

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

@ -40,6 +40,7 @@ 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.extract.GovernProjectInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
@ -696,5 +697,27 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getAgencyId));
}
/**
* 当前网格内已结案的项目
*
* @author zhaoqifeng
* @date 2021/5/26 15:09
* @param customerId
* @param gridId
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO
*/
@Override
public List<GovernProjectInfoDTO> getGridClosedProjectList(String customerId,
String gridId,
String projectStatus,
String origin,
String isResolved) {
List<GovernProjectInfoDTO> resultList=baseDao.getGridClosedProjectList(customerId,gridId,projectStatus,origin,isResolved);
return resultList;
}
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java

@ -23,4 +23,20 @@ public interface CustomerAgencyService {
List<CustomerAgencyEntity> queryAgencyListByCustomerId(String customerId);
/**
* 根据组织id查询基本信息
*
* @param agencyId
* @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity
*/
CustomerAgencyEntity getAgencyById(String agencyId);
/**
* 查询部门所属组织信息
*
* @param deptId
* @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity
*/
CustomerAgencyEntity getAgencyByDeptId(String deptId);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java

@ -55,4 +55,26 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService {
public List<CustomerAgencyEntity> queryAgencyListByCustomerId(String customerId) {
return customerAgencyDao.queryAgencyListByCustomerId(customerId);
}
/**
* 根据组织id查询基本信息
*
* @param agencyId
* @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity
*/
@Override
public CustomerAgencyEntity getAgencyById(String agencyId) {
return customerAgencyDao.selectById(agencyId);
}
/**
* 查询部门所属组织信息
*
* @param deptId
* @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity
*/
@Override
public CustomerAgencyEntity getAgencyByDeptId(String deptId) {
return customerAgencyDao.selectByDeptId(deptId);
}
}

36
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql

@ -18,6 +18,42 @@ CREATE TABLE `index_explain` (
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标说明文案';
#插入指标结束
BEGIN;
INSERT INTO `index_explain` VALUES ('1', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'grid', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('10', 'default', '1/2下级党建指数得分', 'shequxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'community', '8', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('11', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'community', '0', 4, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('12', 'default', '2/1本级治理指数得分', 'shequxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'community', '11', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('13', 'default', '2/2下级治理指数得分', 'shequxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'community', '11', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('14', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'community', '0', 3, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('15', 'default', '3/1本级服务指数得分', 'shequxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'community', '14', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('16', 'default', '3/2下级服务指数得分', 'shequxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'community', '14', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('17', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'street', '0', 5, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('18', 'default', '1/1本级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'street', '17', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('19', 'default', '1/2下级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'street', '17', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('2', 'default', '1/1本级党建指数得分', 'wanggexiangguan:dangjiannengli', '本级党建指数得分=网格各项党建指数指标数据得分*相关权重之和', 'grid', '1', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('20', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'street', '0', 6, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('21', 'default', '2/1本级治理指数得分', 'jiedaoxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'street', '20', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('22', 'default', '2/2下级治理指数得分', 'jiedaoxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'street', '20', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('23', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'street', '0', 7, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('24', 'default', '3/1本级服务指数得分', 'jiedaoxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'street', '23', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('25', 'default', '3/2下级服务指数得分', 'jiedaoxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'street', '23', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('26', 'default', '党建指数', '', '含义:自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'district', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('27', 'default', '1/1本级党建指数得分', 'quanquxiangguan:dangjiannengli', '本级党建指数得分=区名义发文数量得分*相关权重', 'district', '26', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('28', 'default', '1/2下级党建指数得分', 'quanquxiangguan:dangjiannengli', '下级党建指数得分=区下级街道党建指数汇总(平均值)*相关权重', 'district', '26', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('29', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=所有街道治理指数(平均值)*相关权重(d%)+所有直属部门治理指数(平均值)*相关权重(d%)', 'district', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('3', 'default', '1/2下级党建指数得分', 'dangyuanxiangguan:lianxiqunzhong', '下级党建指数得分=组织内党员的联系群众指数考评分(平均值)*相关权重', 'grid', '1', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('30', 'default', '2/1所有街道治理指数(平均值)', 'quanquxiangguan:zhilinengli', '所有街道治理指数(平均值)得分=区下级所有街道治理指数得分总和/街道总数', 'district', '29', 1, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('31', 'default', '2/2所有直属部门治理指数(平均值)', 'quzhibumen:zhilinengli', '所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和', 'district', '29', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('32', 'default', '服务指数', 'quanquxiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=区下属街道服务指数汇总(平均值)=区下属所有街道服务指数得分之和/街道总数', 'district', '0', 3, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('4', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'grid', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('5', 'default', '2/1本级治理指数得分', 'wanggexiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'grid', '4', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('6', 'default', '2/2下级治理指数得分', 'dangyuanxiangguan:canyuyishi', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'grid', '4', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('7', 'default', '服务指数', 'wanggexiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=活动组织次数得分*相关权重+志愿者占比得分*相关权重+党员志愿者率得分*相关权重', 'grid', '0', 3, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('8', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'community', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
INSERT INTO `index_explain` VALUES ('9', 'default', '1/1本级党建指数得分', 'shequxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'community', '8', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16');
COMMIT;
#更新含义
update index_dict SET INDEX_DESC='自然月周期内,网格内注册群众用户数。' WHERE INDEX_CODE = 'wanggequnzhongyhs';
update index_dict SET INDEX_DESC='自然月周期内,网格内注册党员用户数。' WHERE INDEX_CODE = 'wanggedangyuanyhs';

22
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql

@ -0,0 +1,22 @@
#修改党员相关 三会一课权重
UPDATE index_group_detail_template SET WEIGHT = 0.1 WHERE INDEX_CODE = 'dangwuhuodong';
UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'canyuyishi';
UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'lianxiqunzhong';
UPDATE index_group_detail_template SET WEIGHT = 1 WHERE INDEX_CODE = 'canjiasanhykcs';
UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz';
UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'wanggedifawsl';
UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'zuzhisanhykcs';
UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'dangyuancanjiashykrc';
#开发和测试的 对应的客户已经修改执行完了
#修改生产的 先给党群e事通和亿联员工互助会设置一下权重。再加上我们自己的 微笑崂山
UPDATE index_group_detail SET WEIGHT = 0.1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangwuhuodong';
UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canyuyishi';
UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'lianxiqunzhong';
UPDATE index_group_detail SET WEIGHT = 1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canjiasanhykcs';
UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz';
UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'wanggedifawsl';
UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhisanhykcs';
UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangyuancanjiashykrc';

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -664,4 +664,27 @@
GROUP BY
GRID_ID
</select>
<!-- 根据项目id, 查询处理明细-->
<select id="selectListByProjectId" parameterType="java.lang.String" resultType="com.epmet.dto.extract.FactOriginProjectLogDailyDTO">
SELECT
m.*
FROM
fact_origin_project_log_daily m
WHERE
m.DEL_FLAG = '0'
AND m.PROJECT_ID = #{projectId}
</select>
<!-- 查询某一个项目的结案操作明细 -->
<select id="selectClosedLog" parameterType="java.lang.String" resultType="com.epmet.dto.extract.FactOriginProjectLogDailyDTO">
SELECT
m.*
FROM
fact_origin_project_log_daily m
WHERE
m.DEL_FLAG = '0'
and m.ACTION_CODE='close'
AND m.PROJECT_ID = #{projectId}
</select>
</mapper>

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

@ -982,4 +982,63 @@
a.AGENCY_ID,
c.`LEVEL`
</select>
<resultMap type="com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO" id="GetGridClosedProjectListMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="issueCreatorId" column="ISSUE_CREATOR_ID"/>
<result property="issueId" column="ISSUE_ID"/>
<result property="topicId" column="TOPIC_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pid" column="PID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="projectStatus" column="PROJECT_STATUS"/>
<result property="topicCreatorId" column="TOPIC_CREATOR_ID"/>
<result property="isParty" column="IS_PARTY"/>
<result property="isOverdue" column="IS_OVERDUE"/>
<result property="isSatisfied" column="IS_SATISFIED"/>
<result property="finishOrgIds" column="FINISH_ORG_IDS"/>
<association property="closeLogDTO"
select="com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao.selectClosedLog"
column="ID">
</association>
<collection property="projectLogDTOList" column="ID" ofType="com.epmet.dto.extract.FactOriginProjectLogDailyDTO"
select="com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao.selectListByProjectId">
<result property="orgType" column="ORG_TYPE"/>
<result property="orgId" column="ORG_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="projectId" column="PROJECT_ID"/>
<result property="operationUserId" column="OPERATION_USER_ID"/>
<result property="actionCode" column="ACTION_CODE"/>
<result property="isActive" column="IS_ACTIVE"/>
</collection>
</resultMap>
<select id="getGridClosedProjectList" parameterType="map" resultMap="GetGridClosedProjectListMap">
SELECT
*
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 != gridId and "" != gridId'>
AND m.GRID_ID = #{gridId}
</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>
</select>
</mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -80,7 +80,8 @@
ca.ORGANIZATION_NAME as ORG_NAME
FROM
customer_grid cg
LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID )
LEFT JOIN customer_agency ca
ON ( cg.PID = CA.ID and ca.del_flag='0')
WHERE
CG.CUSTOMER_ID =#{customerId}
and cg.del_flag='0'

18
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml

@ -132,4 +132,22 @@
where ca.del_flag='0'
and ca.CUSTOMER_ID=#{customerId}
</select>
<select id="selectByDeptId" parameterType="java.lang.String" resultType="com.epmet.entity.org.CustomerAgencyEntity">
SELECT
*
FROM
customer_agency ca
WHERE
ca.DEL_FLAG = '0'
AND ca.id =(
SELECT
cd.AGENCY_ID
FROM
customer_department cd
WHERE
cd.id = #{deptId}
AND cd.DEL_FLAG = '0'
)
</select>
</mapper>

BIN
epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx

Binary file not shown.
Loading…
Cancel
Save