Browse Source

Merge remote-tracking branch 'origin/dev_screen_data_2.0' into dev_temp

dev_shibei_match
wangchao 5 years ago
parent
commit
c3959e345b
  1. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java
  2. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java
  4. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
  5. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
  6. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  7. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  8. 48
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java
  10. 78
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  11. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java

@ -14,11 +14,7 @@ import java.io.Serializable;
public class ProjectParticipatedAgencyResultDTO implements Serializable {
private static final long serialVersionUID = 1071619125612033138L;
private String projectId;
private String agencyId;
private String level;
private int score;
private int count;
}

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

@ -107,14 +107,21 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
@Param("level")String level);
/**
* @Description 查询各项目经受了多少机关
* @param customerId
* @Description 查询各项目处理了多少机关
* @param agencies
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
List<ProjectParticipatedAgencyResultDTO> selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId,
@Param("dateType")String dateType);
List<ProjectParticipatedAgencyResultDTO> selectProjectParticipatedAgency(@Param("agencies") List<String> agencies, @Param("dimId") String dimId);
/***
* @Description 查询机关办结次数
* @param agencies
* @return java.util.List<com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO>
* @author wangc
* @date 2020.10.14 10:27
*/
List<ProjectParticipatedAgencyResultDTO> selectAgencyHandledProjectCount(@Param("agencies") List<String> agencies,@Param("customerId") String customerId,@Param("dimId") String dimId);
/**
* 网格项目响应度

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java

@ -49,5 +49,5 @@ public interface IndexGroupDetailDao extends BaseDao<IndexGroupDetailEntity> {
*/
List<IndexGroupDetailEntity> selectSelfSubIndex(@Param("customerId") String customerId, @Param("allIndexCodePath") String allIndexCodePath);
int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight);
int updateWeight(@Param("indexCode") String indexCode, @Param("customerId") String customerId, @Param("weight") BigDecimal weight,@Param("allParentIndexCode")String allParentIndexCode);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java

@ -135,9 +135,10 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
List<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfDealingAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(agencies,customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = new BigDecimal(entity.getClosedProjectCount());

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java

@ -128,9 +128,10 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService {
}));
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
List<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfDealingAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(agencies,customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = new BigDecimal(entity.getClosedProjectCount());

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java

@ -126,9 +126,10 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
}));
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfProjectsHandledByAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
List<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String,Integer> agencyParticipatedCount = factOriginProjectLogDailyService.getCountOfDealingAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(agencies,customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = new BigDecimal(entity.getClosedProjectCount());

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

@ -170,32 +170,32 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
/**
* @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @param customerId
* @param agencies
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
Map<String,Integer> getProjectHandledAgency(String customerId, String dimId,String dateType);
Map<String,Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId,String dateType);
/**
* @Description 查询机关单位经手的项目数
* @param customerId
* @Description 查询机关单位经手的项目数去重
* @param agencies
* @param dimId
* @param dateType - 日期维度类型 month date week quarter year
* @return
* @author wangc
* @date 2020.09.23 10:06
**/
Map<String,Integer> getCountOfProjectsHandledByAgency(String customerId, String dimId,String dateType);
Map<String,Integer> getCountOfDealingAgency(List<String> agencies, String customerId,String dimId,String dateType);
/**
* @Description 计算机关办结项目效率
* @param customerId
* @param agencies
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId,String dateType);
Map<String, BigDecimal> getAgencyWorkPieceRatio(List<String> agencies, String customerId,String dimId,String dateType);
/**
* 网格项目响应度

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

@ -165,42 +165,26 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
}
/**
* @Description 查询各项目经手的最高机关Id
* @param customerId
* @Description 查询各机关办结的项目数
* @param agencies
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
@Override
public Map<String, Integer> getProjectHandledAgency(String customerId, String dimId, String dateType) {
public Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId,String dimId, String dateType) {
Map<String, Integer> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgency = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType);
if(!CollectionUtils.isEmpty(projectAgency)){
Map<String,List<ProjectParticipatedAgencyResultDTO>> map
= projectAgency.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId));
map.forEach((key ,agencies) ->{
if(!CollectionUtils.isEmpty(agencies)) {
String highest = agencies.get(NumConstant.ZERO).getLevel();
for (int i = NumConstant.ZERO; i < agencies.size(); i++) {
if(StringUtils.equals(agencies.get(i).getLevel(),highest)){
if(null != result.get(agencies.get(i).getAgencyId())){
result.put(key,result.get(agencies.get(i).getAgencyId()) + NumConstant.ONE);
}else{
result.put(key,NumConstant.ONE);
}
}else break;
}
}
});
List<ProjectParticipatedAgencyResultDTO> countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId);
if(!CollectionUtils.isEmpty(countList)){
result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
}
return result;
}
/**
* @Description 查询机关单位经手的项目数
* @param customerId
* @Description 查询机关单位经手的项目数去重
* @param agencies
* @param dimId
* @param dateType - 日期维度类型 month date week quarter year
* @return
@ -208,30 +192,24 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
* @date 2020.09.23 10:06
**/
@Override
public Map<String, Integer> getCountOfProjectsHandledByAgency(String customerId, String dimId, String dateType) {
public Map<String, Integer> getCountOfDealingAgency(List<String> agencies, String customerId,String dimId, String dateType) {
Map<String,Integer> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType);
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectProjectParticipatedAgency(agencies,dimId);
if(!CollectionUtils.isEmpty(projectAgencyCount)){
Map<String,List<ProjectParticipatedAgencyResultDTO>> map =
projectAgencyCount.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId));
map.forEach((agency,handledProjectList) -> {
result.put(agency,handledProjectList.size());
});
return result;
result = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
}
return result;
}
/**
* @Description 计算机关办结项目效率
* @param customerId
* @param agencies
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
@Override
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId, String dateType) {
public Map<String, BigDecimal> getAgencyWorkPieceRatio(List<String> agencies, String customerId,String dimId, String dateType) {
//网格、部门的办结系数
List<OrgResponseTimeResultDTO> gridDeptResponse = projectOrgPeriodDailyDao.selectSubOrgResponseCoefficient(customerId, dimId, dateType);
//机关的办结系数

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java

@ -93,7 +93,7 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl<IndexGroupDetai
public void updateCustomerIndexGroupDetail(Collection<IndexGroupDetailTemplateEntity> values, String customerId) {
int updatedNum=0;
for(IndexGroupDetailTemplateEntity entity:values){
updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight());
updatedNum+=baseDao.updateWeight(entity.getIndexCode(),customerId,entity.getWeight(),entity.getAllParentIndexCode());
}
log.info("修改客户权重信息,影响行数="+updatedNum);
}

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

@ -138,56 +138,50 @@
fopld.ORG_ID
</select>
<!-- 查询各项目处理了多少机关 -->
<select id="selectProjectParticipatedAgency" resultType="com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO">
SELECT
DISTINCT
project.ID AS projectId,
log.AGENCY_ID,
agency.LEVEL,
CASE agency.LEVEL WHEN 'community' THEN 1 WHEN 'street' THEN 2 WHEN 'district' THEN 3
WHEN 'city' THEN 4 WHEN 'province' THEN 5 END AS score
AGENCY_ID,
COUNT(DISTINCT PROJECT_ID) AS count
FROM
fact_origin_project_main_daily project
LEFT JOIN
fact_origin_project_log_daily log
ON log.PROJECT_ID = project.ID AND log.DEL_FLAG = '0' AND log.IS_ACTIVE = '1'
LEFT JOIN
dim_object_status dimStatus
ON project.PROJECT_STATUS = dimStatus.STATUS_CODE AND dimStatus.DEL_FLAG = '0' AND dimStatus.STATUS_TYPE = 'project'
LEFT JOIN
dim_object_action dimAction
ON log.ACTION_CODE = dimAction.ACTION_CODE AND dimAction.DEL_FLAG = '0' AND dimAction.ACTION_TYPE = 'project'
LEFT JOIN
dim_agency agency
ON log.AGENCY_ID = agency.ID AND agency.DEL_FLAG = '0' AND agency.CUSTOMER_ID = #{customerId}
fact_origin_project_log_daily
WHERE
project.DEL_FLAG = '0'
AND
dimStatus.STATUS_CODE = 'closed'
AND
dimAction.ACTION_CODE != 'return'
AND
project.CUSTOMER_ID = #{customerId}
<if test='null != dimId and "" != dimId'>
<choose>
<when test='"month" == dateType'>
AND log.MONTH_ID = #{dimId}
</when>
<otherwise>
AND log.DATE_ID = #{dimId}
</otherwise>
</choose>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND ACTION_CODE IN ('created','transfer','return','response','close')
<if test="agencies != null and agencies.size() > 0">
<foreach collection="agencies" item="agencyId" open="AND ( " separator=" OR " close=" ) ">
AGENCY_ID = #{item}
</foreach>
</if>
<if test='null != dimId and "" != dimId.trim()'>
MONTH_ID <![CDATA[>=]]> #{dimId}
</if>
GROUP BY AGENCY_ID
</select>
<!-- 查询机关办结次数 -->
<select id="selectAgencyHandledProjectCount" resultType="com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO">
SELECT
SUBSTRING_INDEX(main.FINISH_ORG_IDS,':',1) AS agencyId,
COUNT(main.*) AS count
FROM fact_origin_project_main_daily main
LEFT JOIN fact_origin_project_log_daily log
ON main.ID = log.PROJECT_ID AND log.DEL_FLAG = '0' AND log.ACTION_CODE = 'close'
WHERE main.DEL_FLAG = '0'
AND main.CUSTOMER_ID = #{customerId}
<if test="null != agencies and agencies.size() > 0">
<foreach collection="agencies" item="item" open="AND ( " separator=" OR " close=" ) ">
main.FINISH_ORG_I DS LIKE concat(#{item},'%')
</foreach>
</if>
ORDER BY project.ID,score DESC
<if test='null != dimId and "" != dimId.trim()'>
AND ((log.ID IS NOT NULL AND log.MONTH_ID <![CDATA[>=]]> #{dimId}) OR log.ID IS NULL )
</if>
GROUP BY main.SUBSTRING_INDEX(FINISH_ORG_IDS,':',1)
</select>
<select id="selectGridResponse" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT a.ORG_ID,
a.count AS "sum",

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml

@ -34,10 +34,11 @@
<update id="updateWeight" parameterType="map">
UPDATE index_group_detail
SET WEIGHT =#{weight}
SET WEIGHT =#{weight},UPDATED_TIME=NOW()
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND INDEX_CODE = #{indexCode}
and ALL_PARENT_INDEX_CODE=#{allParentIndexCode}
</update>
</mapper>
Loading…
Cancel
Save