Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

master
jianjun 5 years ago
parent
commit
dc527cbade
  1. 2
      epmet-cloud-generator/src/main/resources/application.yml
  2. 21
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TransferRightRatioResultDTO.java
  3. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  5. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  7. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  8. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictDepartmentServiceImpl.java
  9. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  10. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  11. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectOrgPeriodDailyService.java
  12. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectPeriodExtractService.java
  13. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  14. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  15. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  17. 104
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectPeriodExtractServiceImpl.java
  18. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  19. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java
  20. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java
  21. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  22. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  23. 102
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  24. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  25. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  26. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml
  27. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml
  28. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml
  29. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml
  30. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml

2
epmet-cloud-generator/src/main/resources/application.yml

@ -9,7 +9,7 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false
url: jdbc:mysql://192.168.1.130:3306/epmet_gov_project?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
#oracle配置

21
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TransferRightRatioResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/10/19 2:00 下午
*/
@Data
public class TransferRightRatioResultDTO implements Serializable {
private String projectId;
private String gridId;
private Boolean status;
private Integer notReturnProject;
}

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

@ -33,10 +33,7 @@ import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityService;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
@ -99,6 +96,8 @@ public class DemoController {
@Autowired
private IndexCollStreetService indexCollStreetService;
@Autowired
private IndexCollDistrictDepartmentService indexCollDistrictDepartmentService;
@Autowired
private GovernRankDataExtractService governRankDataExtractService;
@Autowired
private OrgRankExtractService orgRankExtractService;
@ -629,6 +628,12 @@ public class DemoController {
return new Result();
}
@PostMapping("indexCollDept")
public Result indexCollDept(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
indexCollDistrictDepartmentService.saveDepartmentAbility(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
@Autowired
private PartyBaseInfoService partyBaseInfoService;

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

@ -55,6 +55,8 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
*/
List<NotReturnProjectResultDTO> selectNotReturnProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("actionCode") String actionCode,@Param("orgType") String orgType);
List<TransferRightRatioResultDTO> selectNotReturn(@Param("customerId")String customerId,@Param("monthId")String monthId);
/**
* @Description 查询项目评价信息
* @param customerId
@ -204,4 +206,35 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
*/
List<OrgStatisticsResultDTO> selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* 获取部门办结项目数
* @author zhaoqifeng
* @date 2020/10/16 17:09
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDeptClosedProject(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 部门办结项目满意度
* @author zhaoqifeng
* @date 2020/9/20 16:44
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDeptSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 网格结案率统计
* @author zhaoqifeng
* @date 2020/9/20 16:44
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
@ -77,6 +78,8 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
*/
List<GridProjectClosedTotalResultDTO> selectGridClosedProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("status") String status);
List<TransferRightRatioResultDTO> selectTransferRightRatio(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 根据日期删除数据
* @author zhaoqifeng

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

@ -67,8 +67,14 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
List<OrgStatisticsResultDTO> selectResponsiveness(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level,
@Param("orgType")String orgType);
void deleteByProjectId(@Param("list") List<String> list);
/***
* @Description 在插入之前先删除所有与这个项目相关的历时信息
* @param list
* @return void
* @author wangc
* @date 2020.10.19 16:26
*/
void deleteByProjectIds(@Param("list") List<String> list);
/**
* @Description 批量插入
@ -96,4 +102,14 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* 部门处理效率统计
* @author zhaoqifeng
* @date 2020/10/19 9:31
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

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

@ -29,10 +29,7 @@ import org.springframework.util.CollectionUtils;
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.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -275,18 +272,32 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
});
}
//网格办结项目数
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSE);
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED);
//网格吹哨部门准确率 【没被退回的项目数/项目总数 】
List<NotReturnProjectResultDTO> notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE);
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){
notReturnProjectList.forEach(not -> {
gridIssueShiftProjectRatio.forEach(total -> {
if (not.getGridId().equals(total.getGridId())){
not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL)));
}
List<TransferRightRatioResultDTO> transferRightRatioResultDTOS = projectMainService.selectTransferRightRatio(customerId, monthId);
List<TransferRightRatioResultDTO> transferRightRatioResultDTOS1 = projectLogService.selectNotReturn(customerId, monthId);
if (!CollectionUtils.isEmpty(transferRightRatioResultDTOS1)){
transferRightRatioResultDTOS.forEach(r -> {
transferRightRatioResultDTOS1.forEach(t -> {
r.setStatus(r.getProjectId().equals(t.getProjectId()) ? true : false);
});
});
}else {
transferRightRatioResultDTOS.forEach(r -> {
r.setStatus(false);
});
}
Map<String, List<TransferRightRatioResultDTO>> groupByGridProject = transferRightRatioResultDTOS.stream().collect(Collectors.groupingBy(TransferRightRatioResultDTO::getGridId));
Map<String,BigDecimal> notReturnMap = new HashMap<>(16);
groupByGridProject.forEach((grid,project) -> {
AtomicReference<Integer> count = new AtomicReference<>(NumConstant.ZERO);
project.forEach(p -> {
if (p.getStatus().equals(false)){
count.getAndSet(count.get() + NumConstant.ONE);
}
});
notReturnMap.put(grid,getRound(new BigDecimal(count.get()/project.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL)));
});
//网格内解决的项目的满意度
//项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数
List<ProjectEvaluateResultDTO> projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId);
@ -355,10 +366,10 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
});
}
// 4. 网格吹哨部门准确率
if (!CollectionUtils.isEmpty(notReturnProjectList)) {
notReturnProjectList.forEach(not -> {
if (r.getGridId().equals(not.getGridId())) {
r.setTransferRightRatio(not.getTransferRightRatio());
if(notReturnMap != null){
notReturnMap.forEach((grid,transferRightRatio) -> {
if (r.getGridId().equals(grid)){
r.setTransferRightRatio(transferRightRatio);
}
});
}

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

@ -9,13 +9,11 @@ import com.epmet.dto.stats.DimDepartmentDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictDepartmentService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.stats.DimDepartmentService;
import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -41,12 +39,6 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService;
@Autowired
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService;
@Override
public void saveDepartmentAbility(String customerId, String dateId) {
@ -97,10 +89,46 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict
}));
}
//TODO 区直部门办结项目满意度 暂时无法统计
//办结项目数 办结率
List<OrgStatisticsResultDTO > closedList = factOriginProjectLogDailyService.getDeptClosedProject(customerId, dimId.getMonthId());
if (CollectionUtils.isNotEmpty(closedList)) {
list.forEach(entity -> closedList.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> {
entity.setClosedProjectCount(item.getCount());
if (item.getSum() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(item.getCount());
BigDecimal sum = new BigDecimal(item.getSum());
entity.setClosedProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//部门办结项目满意度
List<OrgStatisticsResultDTO > satisfactions = factOriginProjectLogDailyService.getDeptSatisfaction(customerId, dimId.getMonthId());
if (CollectionUtils.isNotEmpty(satisfactions)) {
list.forEach(entity -> satisfactions.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> {
if (item.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(item.getCount());
entity.setClosedProjectRatio(item.getRatio().divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//部门办结项目的处理效率
List<OrgStatisticsResultDTO > handle = factOriginProjectOrgPeriodDailyDao.selectDeptHandle(customerId, dimId.getMonthId());
if (CollectionUtils.isNotEmpty(handle)) {
list.forEach(entity -> handle.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> {
if (item.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(item.getCount());
BigDecimal sum = new BigDecimal(item.getSum());
BigDecimal one = new BigDecimal(NumConstant.ONE);
entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
factIndexGovrnAblityDeptMonthlyService.deleteByCustomer(customerId, dimId.getMonthId());
factIndexGovrnAblityDeptMonthlyService.insertBatch(list);
factIndexGovrnAblityDeptMonthlyService.saveList(list);
}
}
}

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

@ -20,10 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.AutoNoMyResultDTO;
import com.epmet.dto.extract.result.NotReturnProjectResultDTO;
import com.epmet.dto.extract.result.ProjectEvaluateResultDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import java.math.BigDecimal;
@ -118,6 +115,8 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
*/
List<NotReturnProjectResultDTO> selectNotReturnProject(String customerId,String monthId,String actionCode,String orgType);
List<TransferRightRatioResultDTO> selectNotReturn(String customerId,String monthId);
/**
* @Description 查询项目评价信息
* @param customerId
@ -239,4 +238,33 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
*/
List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level);
/**
* 获取部门办结项目数
* @author zhaoqifeng
* @date 2020/10/16 17:08
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getDeptClosedProject(String customerId, String monthId);
/**
* 部门办结项目满意度
* @author zhaoqifeng
* @date 2020/10/16 17:50
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getDeptSatisfaction(String customerId, String monthId);
/**
* 网格结案率统计
* @author zhaoqifeng
* @date 2020/10/19 11:58
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridClosed(String customerId, String monthId);
}

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

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
@ -126,6 +127,8 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
*/
List<GridProjectClosedTotalResultDTO> selectGridClosedProject(String customerId,String monthId,String status);
List<TransferRightRatioResultDTO> selectTransferRightRatio(String customerId,String monthId);
/**
* 项目超期数
* @author zhaoqifeng

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

@ -23,4 +23,14 @@ public interface FactOriginProjectOrgPeriodDailyService extends BaseService<Fact
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getResponsiveness(String customerId, String monthId, String level, String orgType);
/**
* 部门处理效率统计
* @author zhaoqifeng
* @date 2020/10/19 9:38
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getDeptHandle(String customerId, String monthId);
}

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

@ -1,21 +0,0 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @Desc 业务数据抽取 - 项目节点历时
* @Author wangc
* @DateTime 2020/9/14 5:07 下午
*/
public interface ProjectPeriodExtractService {
/**
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractOriginFormDTO param);
}

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

@ -126,6 +126,11 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectNotReturnProject(customerId, monthId, actionCode, orgType);
}
@Override
public List<TransferRightRatioResultDTO> selectNotReturn(String customerId,String monthId){
return baseDao.selectNotReturn(customerId,monthId);
}
/**
* @Description 查询项目评价信息
* @param customerId
@ -295,5 +300,47 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectOrgSatisfaction(customerId, monthId, level);
}
/**
* 获取部门办结项目数
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
* @author zhaoqifeng
* @date 2020/10/16 17:08
*/
@Override
public List<OrgStatisticsResultDTO> getDeptClosedProject(String customerId, String monthId) {
return baseDao.selectDeptClosedProject(customerId, monthId);
}
/**
* 部门办结项目满意度
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
* @author zhaoqifeng
* @date 2020/10/16 17:50
*/
@Override
public List<OrgStatisticsResultDTO> getDeptSatisfaction(String customerId, String monthId) {
return baseDao.selectDeptSatisfaction(customerId, monthId);
}
/**
* 网格结案率统计
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
* @author zhaoqifeng
* @date 2020/10/19 11:58
*/
@Override
public List<OrgStatisticsResultDTO> getGridClosed(String customerId, String monthId) {
return baseDao.selectGridClosed(customerId, monthId);
}
}

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

@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
@ -134,6 +135,11 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
return baseDao.selectGridClosedProject(customerId, monthId,status);
}
@Override
public List<TransferRightRatioResultDTO> selectTransferRightRatio(String customerId, String monthId){
return baseDao.selectTransferRightRatio(customerId,monthId);
}
@Override
public void deleteByDate(String customerId, String date) {
baseDao.deleteByDate(customerId, date);

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

@ -23,4 +23,18 @@ public class FactOriginProjectOrgPeriodDailyServiceImpl extends BaseServiceImpl<
public List<OrgStatisticsResultDTO> getResponsiveness(String customerId, String monthId, String level, String orgType) {
return baseDao.selectResponsiveness(customerId, monthId, level, orgType);
}
/**
* 部门处理效率统计
*
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
* @author zhaoqifeng
* @date 2020/10/19 9:38
*/
@Override
public List<OrgStatisticsResultDTO> getDeptHandle(String customerId, String monthId) {
return baseDao.selectDeptHandle(customerId, monthId);
}
}

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

@ -438,7 +438,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
if(!CollectionUtils.isEmpty(formattingData)) {
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds);
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectIds);
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData);
}
}

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

@ -1,104 +0,0 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.ProjectPeriodExtractService;
import com.epmet.service.project.ProjectProcessService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description 业务数据抽取 - 项目节点历时
* @ClassName ProjectPeriodExtractServiceImpl
* @Auth wangc
* @Date 2020-09-17 13:52
*/
@Service
@Slf4j
public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private ProjectProcessService projectProcessService;
/**
* @param param
* @return
* @Description 抽取项目节点历时逻辑
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractOriginFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
Boolean isFirst = trace <= NumConstant.ZERO ? true : false;
if (StringUtils.isBlank(param.getDateId())) {
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
= ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class);
if(StringUtils.isNotBlank(original.getDepartmentId())){
dest.setOrgType("dept");
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else if(StringUtils.isNotBlank(original.getGridId())){
dest.setOrgType("grid");
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else{
dest.setOrgType("agency");
dest.setPids("");
String[] array = original.getOrgIdPath().split(":");
if(null == array || array.length <= NumConstant.ZERO){
dest.setPid(NumConstant.ZERO_STR);
}
if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){
dest.setPid(NumConstant.ZERO_STR);
}
if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){
dest.setPid(array[array.length - NumConstant.TWO]);
dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),""));
}
if(StringUtils.isNotBlank(dest.getPids())){
while(dest.getPids().endsWith(":")){
dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE));
}
while(dest.getPids().startsWith(":")){
dest.setPids(dest.getPids().replaceFirst(":",""));
}
}
dest.setPids(dest.getPids().replaceAll(" ",""));
}
formattingData.add(dest);
});
if(!CollectionUtils.isEmpty(formattingData)) {
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds);
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData);
}
}
}
}

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

@ -101,15 +101,25 @@ public class OrgRankExtractServiceImpl implements OrgRankExtractService {
));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
if (CollectionUtils.isNotEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getProjectTotal() != NumConstant.ZERO) {
BigDecimal total = new BigDecimal(dto.getProjectTotal());
BigDecimal closed = new BigDecimal(dto.getResolveProjectCount());
entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
// List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
// if (CollectionUtils.isNotEmpty(abilityList)) {
// list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
// if (dto.getProjectTotal() != NumConstant.ZERO) {
// BigDecimal total = new BigDecimal(dto.getProjectTotal());
// BigDecimal closed = new BigDecimal(dto.getResolveProjectCount());
// entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
// }
//
// }));
// }
List<OrgStatisticsResultDTO> closed = factOriginProjectLogDailyService.getGridClosed(customerId, monthId);
if (CollectionUtils.isNotEmpty(closed)) {
list.forEach(entity -> closed.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setCloseProjectRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java

@ -3,6 +3,8 @@ package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
@ -18,4 +20,13 @@ public interface FactIndexGovrnAblityDeptMonthlyService extends BaseService<Fact
* @return void
*/
void deleteByCustomer(String customerId, String monthId);
/**
* 批量插入
* @author zhaoqifeng
* @date 2020/9/21 17:08
* @param list
* @return void
*/
void saveList(List<FactIndexGovrnAblityDeptMonthlyEntity> list);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java

@ -8,6 +8,8 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthl
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
@ -21,4 +23,17 @@ public class FactIndexGovrnAblityDeptMonthlyServiceImpl extends BaseServiceImpl<
public void deleteByCustomer(String customerId, String monthId) {
baseDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, monthId);
}
/**
* 批量插入
*
* @param list
* @return void
* @author zhaoqifeng
* @date 2020/9/21 17:08
*/
@Override
public void saveList(List<FactIndexGovrnAblityDeptMonthlyEntity> list) {
insertBatch(list);
}
}

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

@ -31,6 +31,7 @@ import com.epmet.dto.screencoll.form.*;
import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -229,7 +230,10 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
} while (deleteNum != NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO.getDataList(), customerId);
List<List<CpcBaseDataFormDTO>> pageByOneHundred = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED);
pageByOneHundred.forEach(one -> {
screenCpcBaseDataDao.batchInsertCpcBaseData(one, customerId);
});
}
}
@ -305,7 +309,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
List<CustomerAgencyFormDTO> pidIsZeroList = formDTO.getDataList().stream().filter(d -> d.getPid().equals(NumConstant.ZERO_STR) || "".equals(d.getPid())).collect(Collectors.toList());
if (pidIsZeroList.size()>=NumConstant.ONE){
if (pidIsZeroList.size()>NumConstant.ONE){
Object o = JSONObject.toJSON(pidIsZeroList);
throw new RenException("多个pid为【0】的数据:"+o.toString());
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -1,7 +1,10 @@
package com.epmet.support.normalizing.batch;
import com.alibaba.fastjson.JSON;
import com.epmet.support.normalizing.BigDecimalScoreCalculator;
import com.epmet.support.normalizing.Correlation;
import com.epmet.support.normalizing.ScoreCalculator;
import com.epmet.support.normalizing.ScoreConstants;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -59,30 +62,28 @@ public class BatchScoreCalculator {
String sampleId = vo.getSampleId();
//归一后的值
BigDecimal normalizeValue;// = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
//如果不需要归一 则 直接value*权重
if (idx.isScore()) {
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}
//反正切函数 [-pi/2,pi/2]
BigDecimal maxValue = idx.getScoreCalculator().getMaxValue();
BigDecimal minValue = idx.getScoreCalculator().getMinValue();
BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore();
if (maxValue.compareTo(minValue) == 0) {
BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore();
if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) {
//*((max-min)/ (Math.PI/2))+min
//Math.atan(new Double(vo.getSampleValue().toString()))*
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString())))
.multiply(
(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.UNNECESSARY)))
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)))
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP);
//
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) {
normalizeValue = maxValue.subtract(normalizeValue);
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
}else {
//如果不需要归一 则 直接value*权重
if (idx.isScore()) {
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}
}
BigDecimal score = normalizeValue.multiply(weight).setScale(6, RoundingMode.HALF_UP);
CalculateResult result = scoreCountOfSamples.get(sampleId);
@ -120,4 +121,16 @@ public class BatchScoreCalculator {
? bdRealValue
: threshold;
}
public static void main(String[] args) {
List<IndexInputVO> indexInputVOS = new ArrayList<>();
String jsonStr = "{\"allParentIndexCode\":\"quanquxiangguan:zhilinengli\",\"indexId\":\"suoyoujiedaozlnlpjz\",\"indexValueVOs\":[{\"sampleId\":\"7b6f9a9f9f38d5f9fa7ce94a93d6eb28\",\"sampleValue\":69.830369}],\"score\":true,\"scoreCalculator\":{\"coefficient\":0,\"correlation\":\"POSITIVE\",\"maxScore\":100,\"maxValue\":69.830369,\"minScore\":60,\"minValue\":69.830369},\"threshold\":-1.0000,\"weight\":0.8000}";
IndexInputVO vo = JSON.parseObject(jsonStr, IndexInputVO.class);
BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(new BigDecimal("69.830369"), new BigDecimal("69.830369"), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(Correlation.POSITIVE.getCode()));
vo.setScoreCalculator(sc);
indexInputVOS.add(vo);
BatchScoreCalculator sc2 = new BatchScoreCalculator();
HashMap<String, CalculateResult> scoreTotalOfSampleId = sc2.getScoreTotalOfSampleId(indexInputVOS);
System.out.println(JSON.toJSONString(scoreTotalOfSampleId));
}
}

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

@ -125,7 +125,6 @@
FROM
fact_origin_project_log_daily fopld
INNER JOIN dim_agency da ON fopld.AGENCY_ID = da.ID
AND da.`LEVEL` = #{level}
WHERE
fopld.IS_ACTIVE = 0
AND fopld.ACTION_CODE = 'transfer'
@ -425,4 +424,105 @@
GROUP BY
AGENCY_ID
</select>
<select id="selectDeptClosedProject" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ORG_ID,
a.count AS "sum",
IFNULL(b.count,0) AS "count"
FROM
(SELECT
ORG_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_log_daily
WHERE
ORG_TYPE = 'department'
AND IS_ACTIVE = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) a
LEFT JOIN
(SELECT
ORG_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_log_daily
WHERE
ORG_TYPE = 'department'
AND ACTION_CODE = 'close'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) b ON a.ORG_ID = b.ORG_ID
</select>
<select id="selectDeptSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
ORG_ID,
COUNT( a.PROJECT_ID ) AS "count",
SUM( IFNULL( b.score, 80 ) ) AS "ratio"
FROM
(SELECT
ORG_ID,
PROJECT_ID
FROM
fact_origin_project_log_daily
WHERE
ORG_TYPE = 'department'
AND ACTION_CODE = 'close'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}) a
LEFT JOIN
(SELECT
PROJECT_ID,
AVG( CASE ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score
FROM
fact_origin_project_log_daily
WHERE
( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
PROJECT_ID) b ON a.PROJECT_ID = b.PROJECT_ID
GROUP BY ORG_ID
</select>
<select id="selectGridClosed" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ORG_ID,
a.count AS "sum",
IFNULL(b.count,0)AS "count"
FROM
(SELECT ORG_ID,
COUNT(DISTINCT PROJECT_ID) AS "count"
FROM fact_origin_project_log_daily
WHERE( ACTION_CODE = 'created' OR ACTION_CODE = 'transfer')
AND IS_ACTIVE = 0
AND ORG_TYPE = 'grid'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY ORG_ID) a
LEFT JOIN
(SELECT fl.ORG_ID,
COUNT(DISTINCT fl.PROJECT_ID) AS "count"
FROM fact_origin_project_log_daily fl
INNER JOIN fact_origin_project_main_daily fm ON fl.PROJECT_ID = fm.ID AND fm.PROJECT_STATUS = 'closed'
WHERE( fl.ACTION_CODE = 'created' OR fl.ACTION_CODE = 'transfer')
AND fl.IS_ACTIVE = 0
AND fl.ORG_TYPE = 'grid'
AND fl.CUSTOMER_ID = #{customerId}
AND fl.MONTH_ID = #{monthId}
GROUP BY fl.ORG_ID) b ON a.ORG_ID = b.ORG_ID
</select>
<select id="selectNotReturn" resultType="com.epmet.dto.extract.result.TransferRightRatioResultDTO">
SELECT
DISTINCT(PROJECT_ID) AS projectId
FROM
fact_origin_project_log_daily
WHERE
ORG_TYPE = 'grid'
AND ACTION_CODE != 'return'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>

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

@ -427,4 +427,15 @@
</foreach>
</if>
</select>
<select id="selectTransferRightRatio" resultType="com.epmet.dto.extract.result.TransferRightRatioResultDTO">
SELECT
ID as projectId,
GRID_ID
FROM
fact_origin_project_main_daily
WHERE
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -34,7 +34,7 @@
</select>
<!-- 在插入之前,先删除所有与这个项目相关的历时信息 -->
<delete id="deleteByProjectId">
<delete id="deleteByProjectIds">
DELETE FROM
fact_origin_project_org_period_daily
WHERE
@ -54,7 +54,9 @@
FROM
fact_origin_project_org_period_daily f
INNER JOIN dim_agency da ON f.ORG_ID = da.ID
<if test='"dept" != orgType'>
AND da.`LEVEL` = #{level}
</if>
WHERE
f.ORG_TYPE = #{orgType}
AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId}
@ -180,4 +182,21 @@
GROUP BY ORG_ID
</select>
<select id="selectDeptHandle" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
fp.ORG_ID,
SUM( TIMESTAMPDIFF( MINUTE, ( DATE_FORMAT( fp.INFORMED_DATE, '%Y-%m-%d %H:%i' )),
( DATE_FORMAT( fp.PERIOD_TILL_REPLY_FIRSTLY, '%Y-%m-%d %H:%i' )) ) ) AS "sum",
COUNT( fp.ID ) AS "count"
FROM
fact_origin_project_org_period_daily fp
INNER JOIN fact_origin_project_main_daily fm ON fp.PROJECT_ID = fm.ID
AND fm.PROJECT_STATUS = 'closed'
WHERE
fp.ORG_TYPE = 'dept'
AND fp.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId}
GROUP BY
fp.ORG_ID
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml

@ -56,6 +56,7 @@
DEL_FLAG = '0'
AND data_type = #{dataType}
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR}
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml

@ -54,6 +54,7 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR}
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml

@ -79,6 +79,7 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR}
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

@ -86,6 +86,7 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
AND ALL_PARENT_INDEX_CODE = #{allIndexCodePath,jdbcType=VARCHAR}
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml

@ -60,7 +60,6 @@
FROM
dim_department dd
INNER JOIN dim_agency da ON dd.AGENCY_ID = da.ID
AND da.`LEVEL` = 'district'
WHERE
dd.CUSTOMER_ID = #{customerId}
</select>

Loading…
Cancel
Save