diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 062c651aaf..ebbbe5e84b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -180,12 +180,12 @@ public interface FactOriginProjectMainDailyDao extends BaseDao * @author wangc * @date 2020.09.28 10:19 */ - List selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("list")List list); + List selectDifficultyBaseInfo(@Param("customerId")String customerId,@Param("thresholdValue") Integer thresholdValue); /** * @Description 查询评价周期内新立的项目,是为了增量新增难点赌点的图片库 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 2e15e2aea1..3d4526a0fe 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 @@ -103,14 +103,5 @@ public interface ProjectDao extends BaseDao { */ 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/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 8f1c0631f7..8b7e1ae06c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -248,12 +248,12 @@ public interface FactOriginProjectMainDailyService extends BaseService * @author wangc * @date 2020.09.28 10:23 */ - List getDifficultyBaseInfo(String customerId , List list); + List getDifficultyBaseInfo(String customerId ,Integer thresholdValue); /** * @Description 得到评价周期内新立项的id 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 21caf5f319..bdc82b519d 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 @@ -237,15 +237,15 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl * @author wangc * @date 2020.09.28 10:23 */ @Override - public List getDifficultyBaseInfo(String customerId, List list) { - if(CollectionUtils.isEmpty(list)) return null; - return baseDao.selectDifficultyBaseInfo(customerId,list); + public List getDifficultyBaseInfo(String customerId, Integer thresholdValue) { + + return baseDao.selectDifficultyBaseInfo(customerId,thresholdValue); } /** 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 f81c2e7259..2f6f0b6a44 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 @@ -100,10 +100,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); //剔除垃圾数据 - for(Iterator iter = registeredUsers.iterator(); - iter.hasNext();){ - if(null == gridMap.get(iter.next().getGridId())) iter.remove(); - } + registeredUsers.removeIf(user -> null == gridMap.get(user.getGridId())); //5.整合数据 if(!CollectionUtils.isEmpty(registeredUsers)){ @@ -124,7 +121,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr user.setDataEndTime(finalDateId); }); - } screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId()); } @@ -138,12 +134,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr **/ @Override public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { - - //查询难点赌点中有无已结案的项目,若有则保留 - List existed = screenDifficultyDataService.selectExistedInfo(param.getCustomerId()); - //查询数据 - List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed)); + List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId())); if(CollectionUtils.isEmpty(difficulties)) return; //2.查询出客户下网格的相关信息 @@ -151,24 +143,13 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); //剔除垃圾数据(本次需要更新的数据集) - for(Iterator iter = difficulties.iterator(); iter.hasNext();){ - ScreenDifficultyDataEntity pointer = iter.next(); - if(null == gridMap.get(pointer.getOrgId())){ - iter.remove(); - } - } - //记录垃圾数(全量) - List missing = new LinkedList<>(); - List population = screenDifficultyDataService.getAllDifficultyByCustomerId(param.getCustomerId()); - if(!CollectionUtils.isEmpty(population)){ - for(Iterator iter = population.iterator(); iter.hasNext();){ - ScreenDifficultyDataEntity pointer = iter.next(); - if(null == gridMap.get(pointer.getOrgId())){ - missing.add(pointer.getEventId()); - } - } - } - + //for(Iterator iter = difficulties.iterator(); iter.hasNext();){ + // ScreenDifficultyDataEntity pointer = iter.next(); + // if(null == gridMap.get(pointer.getOrgId())){ + // iter.remove(); + // } + //} + difficulties.removeIf( diff -> null == gridMap.get(diff.getOrgId())); List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); //最近一次操作 @@ -196,7 +177,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr diff.setEventTitle(oper.getTitle()); diff.setEventCostTime(oper.getCostTime()); } - } diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE)); @@ -204,6 +184,6 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr List imgList = new LinkedList<>(); imgMap.values().forEach(list -> {imgList.addAll(list);}); - screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList,missing); + screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java index 5fc1af8dcd..235dfe856a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -49,7 +49,7 @@ public interface ScreenDifficultyDataService extends BaseService difficulties, List imgs,List missing); + void dataClean(String customerId,List difficulties, List imgs); /** * @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id,因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 89673d1e26..66873e1b6d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -53,17 +53,17 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl difficulties, List imgs,List missing) { - if(!CollectionUtils.isEmpty(missing)){ - baseDao.deleteBatchDifficulty(customerId, missing); - baseDao.deleteBatchDifficultyImg(missing); + public void dataClean(String customerId, List difficulties, List imgs) { + List orient = baseDao.selectAllDifficultyByCustomerId(customerId); + if(!CollectionUtils.isEmpty(orient)){ + baseDao.deleteBatchDifficultyImg(orient.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); } + baseDao.deleteBatchDifficulty(customerId,null); + if (!CollectionUtils.isEmpty(difficulties)) { - baseDao.deleteBatchDifficulty(customerId, difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.insertBatch(difficulties); } if (!CollectionUtils.isEmpty(imgs)) { - baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.insertBatchImg(imgs); } baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE)); 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 e707c0a64c..2dc0e88aa6 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 @@ -104,10 +104,9 @@ public interface ProjectService extends BaseService { * @Description 得到超过阈值滞留的项目Id集合 * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点 * @param customerId - * @param exclude * @return java.util.List * @author wangc * @date 2020.11.06 14:14 */ - List getOvertimeProjectByParameter(String customerId,List exclude); + Integer getOvertimeProjectByParameter(String customerId); } \ 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 23461db970..5ba8ea04d6 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 @@ -86,16 +86,15 @@ public class ProjectServiceImpl extends BaseServiceImpl * @author wangc * @date 2020.11.06 14:14 */ @Override - public List getOvertimeProjectByParameter(String customerId, List exclude) { + public Integer getOvertimeProjectByParameter(String customerId) { 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)); + return 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 f5c56529be..9a21641767 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 @@ -385,11 +385,20 @@ WHERE project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId} - - - project.ID = #{projectId} - - + AND project.ID IN ( + + + SELECT DISTINCT + project_id + FROM + fact_origin_project_org_period_daily + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND TIMESTAMPDIFF( MINUTE, informed_date, IFNULL( handled_date, NOW( ) ) ) > #{thresholdValue} + + ) + 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 de792f46db..08c8d78d5b 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,45 +106,4 @@ and PARAMETER_KEY ='detention_days' - - \ No newline at end of file