diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java index d043180705..5a3936db6a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java @@ -26,7 +26,7 @@ public class DifficultyRankFormDTO implements Serializable { /** * 排序类型 耗时最长:timelongest;涉及部门最多:mostdepts;处理次数:mosthandled */ - @NotBlank(message = "排序类型不能为空",groups = {DifficultyRankInternalGroup.class}) + @NotBlank(message = "排序类型不能为空", groups = {DifficultyRankInternalGroup.class}) private String type; /** * 获取数据个数 默认前10 @@ -35,4 +35,9 @@ public class DifficultyRankFormDTO implements Serializable { @Min(value = 1, groups = {DifficultyRankInternalGroup.class}) private Integer pageNo; + + /** + * 组织类型: 网格:grid ; 组织:agency + */ + private String orgType; } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index 8e5bace8d8..2b9fba6e2d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -242,17 +242,24 @@ diff.EVENT_STATUS_CODE AS statusCode, diff.EVENT_SOURCE AS gridName, diff.EVENT_IMG_URL AS imgUrl, - ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours, + floor(diff.EVENT_COST_TIME/60) AS totalHours, diff.EVENT_RE_ORG AS reOrg, diff.EVENT_HANDLED_COUNT AS handledCount FROM screen_difficulty_data diff WHERE diff.DEL_FLAG = '0' - AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') - - AND diff.EVENT_STATUS_CODE = #{status} - + + + AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR} + + + AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') + + + + AND diff.EVENT_STATUS_CODE = #{status} + ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 13a418a773..37d715980c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -7,7 +7,6 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; -import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; @@ -21,7 +20,7 @@ import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; @@ -35,9 +34,7 @@ import com.epmet.entity.stats.DimDateEntity; import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; 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.todata.ProjectExtractService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; @@ -744,4 +741,12 @@ public class DemoController { return new Result(); } + @Autowired + private ScreenGrassrootsGovernDataAbsorptionService wc; + + @PostMapping("wc") + public Result wc(@RequestBody ScreenCentralZoneDataFormDTO param){ + wc.difficultyDataHub(param); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index df6da92b0b..2e15e2aea1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; -import com.epmet.dto.project.ProjectInfoDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -103,4 +102,15 @@ public interface ProjectDao extends BaseDao { * @return java.lang.String */ String selectParameterValueByKey(@Param("customerId") String customerId); + + /** + * @Description 得到超过阈值滞留的项目Id集合 + * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 + * @param customerId + * @param exclude + * @return java.util.List + * @author wangc + * @date 2020.11.06 14:14 + */ + List selectOvertimeProjectIds(@Param("customerId") String customerId,@Param("exclude") List exclude,@Param("value") Integer value); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java index 062990b4ed..13a3103e83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java @@ -135,14 +135,14 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService } - List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList()); //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId()); //办结率 - Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId()); //处理效率 - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); - list.forEach(entity ->{ + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId()); + list.forEach(entity -> { //办结数 entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO)); //办结率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java index aeaa04000c..494f8f51c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java @@ -128,16 +128,16 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { })); } - List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList()); //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId()); //办结率 - Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId()); //处理效率 - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); - list.forEach(entity ->{ + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId()); + list.forEach(entity -> { //办结数 - entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); //办结率 entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); //办结效率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java index 8331905d41..4d21057556 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java @@ -126,16 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService { })); } - List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList()); + List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList()); //办结数 - Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month"); + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId()); //办结率 - Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month"); + Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId()); //处理效率 - Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month"); - list.forEach(entity ->{ + Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId()); + list.forEach(entity -> { //办结数 - entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId())); //办结率 entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); //办结效率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 77ac5f2fc7..80e087bc3f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -2,11 +2,9 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.stats.DimCustomerService; -import com.epmet.util.DimIdGenerator; import com.google.common.util.concurrent.ThreadFactoryBuilder; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -16,7 +14,6 @@ import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.concurrent.*; @@ -107,16 +104,19 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); } try{ + //dimAgency indexCollStreetService.saveStreetAbility(customerId, monthId); }catch (Exception e){ log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } try{ + //dimAgency indexCollCommunityService.saveCommunityAbility(customerId, monthId); }catch (Exception e){ log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); } try{ + //dimAgency indexCollDistrictService.saveDistrictAbility(customerId, monthId); }catch (Exception e){ log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index d473e0aabe..2a3c3ab304 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -168,13 +168,13 @@ public interface FactOriginProjectLogDailyService extends BaseService getDepTransferCount(String customerId, String monthId, String level); /** - * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目 * @param agencies * @return + * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目 * @author wangc * @date 2020.09.20 23:46 **/ - Map getProjectHandledAgency(List agencies, String customerId, String dimId,String dateType); + Map getProjectHandledAgency(List agencies, String customerId, String dimId); /** * @Description 办结率 @@ -184,8 +184,8 @@ public interface FactOriginProjectLogDailyService extends BaseService getHandlingRatio(List agencies, String customerId,String dimId,String dateType); + **/ + Map getHandlingRatio(List agencies, String customerId, String dimId); /** * @Description 计算机关办结项目效率 @@ -193,8 +193,8 @@ public interface FactOriginProjectLogDailyService extends BaseService getAgencyWorkPieceRatio( String customerId,String dimId,String dateType); + **/ + Map getAgencyWorkPieceRatio(String customerId, String dimId); /** * 网格项目响应度 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index ec1429618d..7b3f127cd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -38,7 +38,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import javax.naming.LinkLoopException; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; @@ -171,43 +170,43 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getProjectHandledAgency(List agencies, String customerId,String dimId, String dateType) { + public Map getProjectHandledAgency(List agencies, String customerId, String dimId) { Map result = new HashMap<>(); - List countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId); - if(!CollectionUtils.isEmpty(countList)){ - result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); + List countList = baseDao.selectAgencyHandledProjectCount(agencies, customerId, dimId); + if (!CollectionUtils.isEmpty(countList)) { + result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount)); } return result; } /** - * @Description 办结率 * @param agencies * @param dimId * @param dateType - 日期维度类型 month date week quarter year * @return + * @Description 办结率 * @author wangc * @date 2020.09.23 10:06 **/ @Override - public Map getHandlingRatio(List agencies, String customerId,String dimId, String dateType) { + public Map getHandlingRatio(List agencies, String customerId, String dimId) { //计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数” - Map result = new HashMap<>(); - List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId); - if(!CollectionUtils.isEmpty(projectAgencyCount)){ - Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); - List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies,customerId,dimId); - Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount)); - whistledAndHandledProjectTotalMap.forEach((agencyId,count) -> { + Map result = new HashMap<>(); + List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies, customerId, dimId); + if (!CollectionUtils.isEmpty(projectAgencyCount)) { + Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount)); + List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies, customerId, dimId); + Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount)); + whistledAndHandledProjectTotalMap.forEach((agencyId, count) -> { //分母 被吹哨项目数 Integer denominator = whistledProjectTotalMap.get(agencyId); if(null == denominator || NumConstant.ZERO == denominator){ @@ -222,22 +221,22 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getAgencyWorkPieceRatio(String customerId,String dimId, String dateType) { + public Map getAgencyWorkPieceRatio(String customerId, String dimId) { //计算方法 : 评价周期内办结项目的平均处理时长的倒数 //1.评价周期内结案了的项目 - List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId,dimId); - Map efficiencyMap = new HashMap<>(); - if(!CollectionUtils.isEmpty(projectsHandledByAgency)){ - Map> agencyProjectsMap = new HashMap<>(); + List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId); + Map efficiencyMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(projectsHandledByAgency)) { + Map> agencyProjectsMap = new HashMap<>(); projectsHandledByAgency.forEach(o -> { String agencyId = o.getAgencyId(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 5ce0490463..21caf5f319 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -244,6 +244,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getDifficultyBaseInfo(String customerId, List list) { + if(CollectionUtils.isEmpty(list)) return null; return baseDao.selectDifficultyBaseInfo(customerId,list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index b5e717f713..d791fb239e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -17,6 +17,7 @@ import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.point.UserPointService; import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.project.ProjectService; import com.epmet.service.topic.TopicService; import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; @@ -62,6 +63,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr private ProjectProcessService projectProcessService; @Autowired private TopicService topicService; + @Autowired + private ProjectService projectService; /** * @Description 用户积分、党员分值数据中转站 * @param param @@ -135,8 +138,11 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr @Override public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { + //查询难点赌点中有无已结案的项目,若有则保留 + List existed = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); + //查询数据 - List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),screenDifficultyDataService.selectExistedInfo(param.getCustomerId())); + List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed)); if(CollectionUtils.isEmpty(difficulties)) return; List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); //最近一次操作 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 0b0692ba21..e707c0a64c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -99,4 +99,15 @@ public interface ProjectService extends BaseService { * @return java.lang.String */ String getParameterValueByKey(String customerId); + + /** + * @Description 得到超过阈值滞留的项目Id集合 + * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 + * @param customerId + * @param exclude + * @return java.util.List + * @author wangc + * @date 2020.11.06 14:14 + */ + List getOvertimeProjectByParameter(String customerId,List exclude); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index fa22e2090e..23461db970 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -19,15 +19,15 @@ package com.epmet.service.project.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; -import com.epmet.dto.project.ProjectInfoDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; -import org.springframework.beans.factory.annotation.Autowired; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.List; @@ -82,4 +82,20 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.11.06 14:14 + */ + @Override + public List getOvertimeProjectByParameter(String customerId, List exclude) { + String parameter = baseDao.selectParameterValueByKey(customerId); + if(StringUtils.isBlank(parameter)) parameter = baseDao.selectParameterValueByKey("default"); + return baseDao.selectOvertimeProjectIds(customerId, exclude, StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter)); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index ec08e185d4..baa6a83d25 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -406,8 +406,8 @@ project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId} - - project.ID ]]> #{projectId} + + project.ID = #{projectId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 08c8d78d5b..de792f46db 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -106,4 +106,45 @@ and PARAMETER_KEY ='detention_days' + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 3617f467ad..7808c44d57 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -1002,58 +1002,60 @@ public class ProjectServiceImpl extends BaseServiceImpl unHandledList = projectStaffService.getStaffUnHandledList(customerId); - List form = unHandledList.stream().map(item -> { - CostDayFormDTO dto = new CostDayFormDTO(); - dto.setId(item.getId()); - dto.setStaffId(item.getStaffId()); - if (null != item.getUpdatedTime()) { - dto.setStartDate(item.getUpdatedTime()); + if (CollectionUtils.isNotEmpty(unHandledList)) { + List form = unHandledList.stream().map(item -> { + CostDayFormDTO dto = new CostDayFormDTO(); + dto.setId(item.getId()); + dto.setStaffId(item.getStaffId()); + if (null != item.getUpdatedTime()) { + dto.setStartDate(item.getUpdatedTime()); + } else { + dto.setStartDate(item.getCreatedTime()); + } + dto.setEndDate(new Date()); + return dto; + }).collect(Collectors.toList()); + List costDayList; + if (ParameterKeyConstant.WORK.equals(calculation)) { + //工作日计算 + Result> result = epmetCommonServiceOpenFeignClient.costWorkDays(form); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + costDayList = result.getData(); } else { - dto.setStartDate(item.getCreatedTime()); - } - dto.setEndDate(new Date()); - return dto; - }).collect(Collectors.toList()); - List costDayList; - if (ParameterKeyConstant.WORK.equals(calculation)) { - //工作日计算 - Result> result = epmetCommonServiceOpenFeignClient.costWorkDays(form); - if (!result.success()) { - throw new RenException(result.getCode(), result.getMsg()); + //日历日计算 + Result> result = epmetCommonServiceOpenFeignClient.costCalendarDays(form); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + costDayList = result.getData(); } - costDayList = result.getData(); - } else { - //日历日计算 - Result> result = epmetCommonServiceOpenFeignClient.costCalendarDays(form); - if (!result.success()) { - throw new RenException(result.getCode(), result.getMsg()); + //即将超期项目 + List overdueList = new ArrayList<>(); + //滞留项目 + List delayList = new ArrayList<>(); + List finalCostDayList = costDayList; + List list = new ArrayList<>(); + int finalDetentionDays = detentionDays; + int finalRemindTime = remindTime; + unHandledList.forEach(unHandle -> finalCostDayList.stream().filter(cost -> + unHandle.getId().equals(cost.getId())).forEach(item -> { + int diff = finalDetentionDays - item.getDetentionDays(); + OverdueAndDelayDTO dto = new OverdueAndDelayDTO(); + if (diff < 0) { + dto.setStaffId(unHandle.getStaffId()); + list.add(dto); + delayList.add(unHandle); + } else if (diff <= finalRemindTime) { + dto.setStaffId(unHandle.getStaffId()); + overdueList.add(unHandle); + list.add(dto); + } + })); + if (CollectionUtils.isNotEmpty(list)) { + setMessage(customerId, overdueList, delayList, list); } - costDayList = result.getData(); - } - //即将超期项目 - List overdueList = new ArrayList<>(); - //滞留项目 - List delayList = new ArrayList<>(); - List finalCostDayList = costDayList; - List list = new ArrayList<>(); - int finalDetentionDays = detentionDays; - int finalRemindTime = remindTime; - unHandledList.forEach(unHandle -> finalCostDayList.stream().filter(cost -> - unHandle.getId().equals(cost.getId())).forEach(item -> { - int diff = finalDetentionDays - item.getDetentionDays(); - OverdueAndDelayDTO dto = new OverdueAndDelayDTO(); - if (diff < 0) { - dto.setStaffId(unHandle.getStaffId()); - list.add(dto); - delayList.add(unHandle); - } else if (diff <= finalRemindTime) { - dto.setStaffId(unHandle.getStaffId()); - overdueList.add(unHandle); - list.add(dto); - } - })); - if (CollectionUtils.isNotEmpty(list)) { - setMessage(customerId, overdueList, delayList, list); } }