|
|
@ -78,10 +78,11 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
private ProjectService projectService; |
|
|
|
@Autowired |
|
|
|
private IssueProjectCategoryDictService issueProjectCategoryDictService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 用户积分、党员分值数据中转站 |
|
|
|
* @param param |
|
|
|
* @return |
|
|
|
* @Description 用户积分、党员分值数据中转站 |
|
|
|
* @author wangc |
|
|
|
* @date 2020.09.25 09:53 |
|
|
|
**/ |
|
|
@ -93,16 +94,16 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
//2.查询出客户下网格的相关信息
|
|
|
|
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId()); |
|
|
|
// list 转 map,以gridId为key,a = gridList,作为value,(o,n)->o 是遇到相同的gridId舍弃,(o,n)->n 是覆盖原来的gridId
|
|
|
|
Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); |
|
|
|
Map<String, GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, a -> a, (o, n) -> o)); |
|
|
|
|
|
|
|
//3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分)
|
|
|
|
Map<String,Integer> pointMap = userPointService.getUserPointMap(param.getCustomerId()); |
|
|
|
Map<String, Integer> pointMap = userPointService.getUserPointMap(param.getCustomerId()); |
|
|
|
//4.查询出客户下党员的分值
|
|
|
|
String dateId = param.getDateId(); |
|
|
|
if(StringUtils.isEmpty(dateId)){ |
|
|
|
if (StringUtils.isEmpty(dateId)) { |
|
|
|
//如果没有传月份,则使用当前时间的上一个月
|
|
|
|
dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
String dateType = DateUtils.identifyTimeDimension(dateId); |
|
|
|
if (StringUtils.isEmpty(dateType) || !StringUtils.equalsAny(dateType, "date", "month")) { |
|
|
|
dateId = DateUtils.getBeforeNMonth(NumConstant.ONE); |
|
|
@ -112,21 +113,21 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
} |
|
|
|
final String finalDateId = dateId; |
|
|
|
// 查询党员积分
|
|
|
|
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); |
|
|
|
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(), dateId); |
|
|
|
|
|
|
|
//剔除垃圾数据
|
|
|
|
registeredUsers.removeIf(user -> null == gridMap.get(user.getGridId())); |
|
|
|
|
|
|
|
//5.整合数据
|
|
|
|
if(!CollectionUtils.isEmpty(registeredUsers)){ |
|
|
|
if (!CollectionUtils.isEmpty(registeredUsers)) { |
|
|
|
registeredUsers.forEach(user -> { |
|
|
|
GridInfoDTO gridInfo = gridMap.get(user.getGridId()); |
|
|
|
if(null != gridInfo){ |
|
|
|
if (null != gridInfo) { |
|
|
|
user.setGridName(gridInfo.getGridName()); |
|
|
|
user.setOrgId(gridInfo.getAgencyId()); |
|
|
|
user.setOrgName(gridInfo.getOrgName()); |
|
|
|
//原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开
|
|
|
|
user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON,StrConstant.COMMA)); |
|
|
|
user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON, StrConstant.COMMA)); |
|
|
|
} |
|
|
|
Integer point = pointMap.get(user.getUserId()); |
|
|
|
BigDecimal score = scoreMap.get(user.getUserId()); |
|
|
@ -141,23 +142,23 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 难点赌点数据中转站 |
|
|
|
* @param param |
|
|
|
* @return |
|
|
|
* @Description 难点赌点数据中转站 |
|
|
|
* @author wangc |
|
|
|
* @date 2020.09.25 10:00 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) { |
|
|
|
//查询数据
|
|
|
|
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId())); |
|
|
|
if(CollectionUtils.isEmpty(difficulties)) { |
|
|
|
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(), projectService.getOvertimeProjectByParameter(param.getCustomerId())); |
|
|
|
if (CollectionUtils.isEmpty(difficulties)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//2.查询出客户下网格的相关信息
|
|
|
|
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId()); |
|
|
|
Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); |
|
|
|
Map<String, GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, a -> a, (o, n) -> o)); |
|
|
|
|
|
|
|
//剔除垃圾数据(本次需要更新的数据集)
|
|
|
|
//for(Iterator<ScreenDifficultyDataEntity> iter = difficulties.iterator(); iter.hasNext();){
|
|
|
@ -166,13 +167,13 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
// iter.remove();
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
difficulties.removeIf( diff -> null == gridMap.get(diff.getOrgId())); |
|
|
|
difficulties.removeIf(diff -> null == gridMap.get(diff.getOrgId())); |
|
|
|
|
|
|
|
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList()); |
|
|
|
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList()); |
|
|
|
//最近一次操作
|
|
|
|
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); |
|
|
|
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds, param.getCustomerId()); |
|
|
|
//图片
|
|
|
|
List<ProjectSourceMapFormDTO> projectSourceMap = difficulties.stream().map(diff->{ |
|
|
|
List<ProjectSourceMapFormDTO> projectSourceMap = difficulties.stream().map(diff -> { |
|
|
|
ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO(); |
|
|
|
map.setProjectId(diff.getEventId()); |
|
|
|
map.setSourceId(diff.getEventImgUrl()); |
|
|
@ -180,22 +181,22 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
//factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
|
|
|
|
|
|
|
|
Map<String,List<ScreenDifficultyImgDataEntity>> imgMap = topicService.getTopicImgs(projectSourceMap); |
|
|
|
Map<String, List<ScreenDifficultyImgDataEntity>> imgMap = topicService.getTopicImgs(projectSourceMap); |
|
|
|
|
|
|
|
Map<String,String> contentMap = topicService.getTopicContent(projectSourceMap); |
|
|
|
Map<String, String> contentMap = topicService.getTopicContent(projectSourceMap); |
|
|
|
|
|
|
|
difficulties.forEach( diff -> { |
|
|
|
difficulties.forEach(diff -> { |
|
|
|
|
|
|
|
List<ScreenDifficultyImgDataEntity> figureList = CollectionUtils.isEmpty(imgMap) ? null : imgMap.get(diff.getEventId()); |
|
|
|
diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); |
|
|
|
List<ScreenDifficultyImgDataEntity> figureList = CollectionUtils.isEmpty(imgMap) ? null : imgMap.get(diff.getEventId()); |
|
|
|
diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); |
|
|
|
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(contentMap)) { |
|
|
|
if (!CollectionUtils.isEmpty(contentMap)) { |
|
|
|
diff.setEventContent(contentMap.get(diff.getEventId())); |
|
|
|
} |
|
|
|
if(! CollectionUtils.isEmpty(latestOperationMap)){ |
|
|
|
if (!CollectionUtils.isEmpty(latestOperationMap)) { |
|
|
|
ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId()); |
|
|
|
if(null != oper){ |
|
|
|
if (null != oper) { |
|
|
|
diff.setLatestOperateDesc(oper.getOperationName()); |
|
|
|
diff.setEventTitle(oper.getTitle()); |
|
|
|
diff.setEventCostTime(oper.getCostTime()); |
|
|
@ -208,6 +209,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
imgMap.values().forEach(imgList::addAll); |
|
|
|
|
|
|
|
//立案后会有 一个process 如果没有则说明是垃圾数据 如果有其他方式立项的项目则需要考虑下兼容
|
|
|
|
difficulties.removeIf(diff -> StringUtils.isBlank(diff.getLatestOperateDesc())); |
|
|
|
|
|
|
|
screenDifficultyDataService.dataClean(param.getCustomerId(), difficulties, imgList); |
|
|
|
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(difficulties)); |
|
|
|
difficulties.removeIf( diff -> StringUtils.isBlank(diff.getLatestOperateDesc())); |
|
|
|
imgList.forEach(item -> { |
|
|
|
item.setCustomerId(param.getCustomerId()); |
|
|
@ -218,17 +223,16 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param) { |
|
|
|
//TODO
|
|
|
|
//1.根据客户Id 获取所有项目数据
|
|
|
|
List<FactOriginProjectMainDailyEntity> difficultyBaseList = factOriginProjectMainDailyService.getProjectForDiff(param); |
|
|
|
if (CollectionUtils.isEmpty(difficultyBaseList)){ |
|
|
|
log.warn("difficultyDataExtract customerId:{} have any project",param.getCustomerId()); |
|
|
|
if (CollectionUtils.isEmpty(difficultyBaseList)) { |
|
|
|
log.warn("difficultyDataExtract customerId:{} have any project", param.getCustomerId()); |
|
|
|
return false; |
|
|
|
} |
|
|
|
//获取业务库项目标题
|
|
|
|
List<ProjectDTO> bizProjectInfoList = projectService.getProjectInfo(param.getCustomerId(), null); |
|
|
|
if (CollectionUtils.isEmpty(bizProjectInfoList)){ |
|
|
|
log.warn("difficultyDataExtract customerId:{} have any project",param.getCustomerId()); |
|
|
|
if (CollectionUtils.isEmpty(bizProjectInfoList)) { |
|
|
|
log.warn("difficultyDataExtract customerId:{} have any project", param.getCustomerId()); |
|
|
|
return false; |
|
|
|
} |
|
|
|
Map<String, ProjectDTO> bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1)); |
|
|
@ -245,108 +249,185 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
//项目分类数据 todo 暂时查询所有
|
|
|
|
List<ProjectCategoryDTO> projectCategoryData = projectService.getProjectCategoryData(param.getCustomerId(), null); |
|
|
|
//key projectId:categoryCode Set
|
|
|
|
Map<String, Set<String>> projectCategoryMap = projectCategoryData.stream() |
|
|
|
.collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toSet()))); |
|
|
|
Map<String, List<String>> projectCategoryMap = projectCategoryData.stream() |
|
|
|
.collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toList()))); |
|
|
|
|
|
|
|
//2.获取项目的所有节点耗时数据
|
|
|
|
List<FactOriginProjectOrgPeriodDailyEntity> projectPeriodList = factOriginProjectMainDailyService.getProjectPeriod(param); |
|
|
|
Map<String,Integer> orgCountMap = new HashMap<>(); |
|
|
|
Map<String,Integer> handleCountMap = new HashMap<>(); |
|
|
|
projectPeriodList.forEach(period->{ |
|
|
|
Integer orgCount = orgCountMap.get(period.getProjectId()); |
|
|
|
if (orgCount == null){ |
|
|
|
orgCount = 0; |
|
|
|
}else{ |
|
|
|
++orgCount; |
|
|
|
} |
|
|
|
orgCountMap.put(period.getProjectId(),orgCount); |
|
|
|
Integer handleCount = handleCountMap.get(period.getProjectId()); |
|
|
|
if (handleCount == null){ |
|
|
|
handleCount = 0; |
|
|
|
}else{ |
|
|
|
++handleCount; |
|
|
|
} |
|
|
|
handleCountMap.put(period.getProjectId(),handleCount); |
|
|
|
}); |
|
|
|
//处理部门数去重(只要流转到就算)
|
|
|
|
Map<String, Set<String>> orgCountMap = new HashMap<>(); |
|
|
|
//被处理次数
|
|
|
|
Map<String, Integer> handleCountMap = new HashMap<>(); |
|
|
|
Set<String> valideProjectIdSet = fillAnyCountAndValidProject(param, projectPeriodList, orgCountMap, handleCountMap); |
|
|
|
|
|
|
|
List<ScreenDifficultyDataEntity> diffList = new ArrayList<>(); |
|
|
|
List<ScreenDifficultyImgDataEntity> imgDataEntities = new ArrayList<>(); |
|
|
|
for (FactOriginProjectMainDailyEntity project : difficultyBaseList) { |
|
|
|
if (agencyMap.get(project.getAgencyId()) == null || bizProjectInfoMap.get(project.getId()) == null) { |
|
|
|
log.error("未获取到相关的项目信息或者项目的所属组织信息"); |
|
|
|
log.warn("未获取到相关的项目信息或者项目的所属组织信息,agencyId:{},projectId:{}",project.getAgencyId(),project.getId()); |
|
|
|
continue; |
|
|
|
} |
|
|
|
//判断是否符合难点堵点条件
|
|
|
|
if (!valideProjectIdSet.contains(project.getId())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
ScreenDifficultyDataEntity diffEntity = buildBaseDiffEntity(project, agencyMap, gridMap, bizProjectInfoMap); |
|
|
|
Integer regCount = orgCountMap.get(project.getId()); |
|
|
|
if (regCount != null){ |
|
|
|
diffEntity.setEventReOrg(regCount); |
|
|
|
Set<String> regCount = orgCountMap.get(project.getId()); |
|
|
|
if (regCount != null) { |
|
|
|
diffEntity.setEventReOrg(regCount.size()); |
|
|
|
} else { |
|
|
|
diffEntity.setEventReOrg(0); |
|
|
|
} |
|
|
|
Integer handleOrgCount = handleCountMap.get(project.getId()); |
|
|
|
if (handleOrgCount != null){ |
|
|
|
if (handleOrgCount != null) { |
|
|
|
diffEntity.setEventHandledCount(handleOrgCount); |
|
|
|
} else { |
|
|
|
diffEntity.setEventHandledCount(0); |
|
|
|
} |
|
|
|
|
|
|
|
diffEntity.setDataEndTime(StringUtils.isBlank(param.getDateId())?DateUtils.getBeforeNDay(NumConstant.ONE):param.getDateId()); |
|
|
|
setCategoryInfo(diffEntity, project.getId(), categoryList, projectCategoryMap); |
|
|
|
|
|
|
|
diffEntity.setDataEndTime(param.getDateId()); |
|
|
|
setCategoryInfo(diffEntity, project.getId(),categoryList,projectCategoryMap); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(project.getTopicId())){ |
|
|
|
if (StringUtils.isNotBlank(project.getTopicId())) { |
|
|
|
//获取图片及话题内容
|
|
|
|
ResiTopicAndImgResultDTO topicInfo = topicService.getTopicAndImgs(project.getTopicId(),"image"); |
|
|
|
if (topicInfo != null){ |
|
|
|
ResiTopicAndImgResultDTO topicInfo = topicService.getTopicAndImgs(project.getTopicId(), "image"); |
|
|
|
if (topicInfo != null) { |
|
|
|
diffEntity.setEventImgUrl(topicInfo.getTopicImgList().get(NumConstant.ZERO).getAttachmentUrl()); |
|
|
|
diffEntity.setEventContent(topicInfo.getTopicContent()); |
|
|
|
topicInfo.getTopicImgList().forEach(img -> { |
|
|
|
ScreenDifficultyImgDataEntity imgData = new ScreenDifficultyImgDataEntity(); |
|
|
|
imgData.setEventId(project.getId()); |
|
|
|
imgData.setEventImgUrl(img.getAttachmentUrl()); |
|
|
|
imgData.setSort(img.getSort()); |
|
|
|
imgDataEntities.add(imgData); |
|
|
|
}); |
|
|
|
log.info("projectId:{} imgs:{}", project.getId(), imgDataEntities.stream().filter(o -> o.getEventId().equals(project.getId())).count()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
diffList.add(diffEntity); |
|
|
|
log.info("========:"+JSON.toJSONString(diffList)); |
|
|
|
} |
|
|
|
List<ScreenDifficultyDataEntity> collect = diffList.stream().filter(o -> o.getEventCostTime() < 5 * 24 * 60).collect(Collectors.toList()); |
|
|
|
log.info("========:" + JSON.toJSONString(collect)); |
|
|
|
log.info("========:" + JSON.toJSONString(diffList)); |
|
|
|
log.info("========:" + JSON.toJSONString(imgDataEntities)); |
|
|
|
|
|
|
|
screenDifficultyDataService.dataClean(param.getCustomerId(),diffList,imgDataEntities); |
|
|
|
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(diffList)); |
|
|
|
//3.获取项目的最后操作记录
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* desc:筛选出符合条件的的项目(超过超期时间的为超期项目)和处理的部门数及处理次数 |
|
|
|
* @param param |
|
|
|
* @param projectPeriodList |
|
|
|
* @param orgCountMap |
|
|
|
* @param handleCountMap |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private Set<String> fillAnyCountAndValidProject(ScreenCentralZoneDataFormDTO param, List<FactOriginProjectOrgPeriodDailyEntity> projectPeriodList, Map<String, Set<String>> orgCountMap, Map<String, Integer> handleCountMap) { |
|
|
|
//已经结案的项目的结案时间
|
|
|
|
Set<String> valideProjectIdSet = new HashSet<>(); |
|
|
|
Map<String, Date> closeProjectDateMap = projectPeriodList.stream().filter(o -> ProjectConstant.CLOSE.equals(o.getOperation())) |
|
|
|
.collect(Collectors.toMap(FactOriginProjectOrgPeriodDailyEntity::getProjectId, FactOriginProjectOrgPeriodDailyEntity::getHandledDate, (o1, o2) -> o1)); |
|
|
|
//超期项目阈值
|
|
|
|
Integer overtimeConfig = projectService.getOvertimeProjectByParameter(param.getCustomerId()); |
|
|
|
projectPeriodList.forEach(period -> { |
|
|
|
Set<String> orgCount = orgCountMap.get(period.getProjectId()); |
|
|
|
if (orgCount == null) { |
|
|
|
orgCount = new HashSet<>(); |
|
|
|
} |
|
|
|
orgCount.add(period.getOrgId()); |
|
|
|
orgCountMap.put(period.getProjectId(), orgCount); |
|
|
|
if (ProjectConstant.RESOLVED.equals(period.getIsResolved())) { |
|
|
|
Integer handleCount = handleCountMap.getOrDefault(period.getProjectId(), 0); |
|
|
|
handleCountMap.put(period.getProjectId(), ++handleCount); |
|
|
|
} |
|
|
|
|
|
|
|
//筛选出 项目的结案时间 未结案的为当前时间(结案只有一条记录)
|
|
|
|
if (period.getHandledDate() != null) { |
|
|
|
if (period.getHandledDate().getTime() - period.getInformedDate().getTime() > overtimeConfig * 1000 * 60 * 60 * 24) { |
|
|
|
valideProjectIdSet.add(period.getProjectId()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
Date finishDate = closeProjectDateMap.getOrDefault(period.getProjectId(), new Date()); |
|
|
|
if (finishDate.getTime() - period.getInformedDate().getTime() > overtimeConfig * 1000 * 60 * 60 * 24) { |
|
|
|
valideProjectIdSet.add(period.getProjectId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//3.获取项目的最后操作记录
|
|
|
|
return false; |
|
|
|
}); |
|
|
|
return valideProjectIdSet; |
|
|
|
} |
|
|
|
|
|
|
|
private void setCategoryInfo(ScreenDifficultyDataEntity diffEntity, String projectId, List<IssueProjectCategoryDictEntity> categoryList, Map<String, Set<String>> projectCategoryMap) { |
|
|
|
Set<String> categorySet = projectCategoryMap.get(projectId); |
|
|
|
if (CollectionUtils.isEmpty(categorySet)){ |
|
|
|
/** |
|
|
|
* desc:设置项目类别 |
|
|
|
* @param diffEntity |
|
|
|
* @param projectId |
|
|
|
* @param categoryList |
|
|
|
* @param projectCategoryMap |
|
|
|
*/ |
|
|
|
private void setCategoryInfo(ScreenDifficultyDataEntity diffEntity, String projectId, List<IssueProjectCategoryDictEntity> categoryList, Map<String, List<String>> projectCategoryMap) { |
|
|
|
List<String> categorySet = projectCategoryMap.get(projectId); |
|
|
|
if (CollectionUtils.isEmpty(categorySet)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
projectCategoryMap.forEach((k,v) ->{ |
|
|
|
List<IssueProjectCategoryDictEntity> childCategory = new ArrayList<>(); |
|
|
|
v.forEach(categoryCode-> getParentNode(childCategory,categoryList,categoryCode)); |
|
|
|
String categoryCodes = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryCode).sorted(Comparator.reverseOrder()).collect(Collectors.joining(StrConstant.COMMA)); |
|
|
|
String categoryNames = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryName).sorted(Comparator.reverseOrder()).collect(Collectors.joining(StrConstant.COMMA)); |
|
|
|
diffEntity.setEventCategoryCode(categoryCodes); |
|
|
|
diffEntity.setEventCategoryName(categoryNames); |
|
|
|
projectCategoryMap.forEach((k, v) -> { |
|
|
|
StringBuilder code = new StringBuilder(); |
|
|
|
StringBuilder name = new StringBuilder(); |
|
|
|
v.forEach(categoryCode -> { |
|
|
|
List<IssueProjectCategoryDictEntity> childCategory = new ArrayList<>(); |
|
|
|
getParentNode(childCategory, categoryList, categoryCode); |
|
|
|
String categoryCodes = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryCode).collect(Collectors.joining(StrConstant.HYPHEN)); |
|
|
|
String categoryNames = childCategory.stream().map(IssueProjectCategoryDictEntity::getCategoryName).collect(Collectors.joining(StrConstant.HYPHEN)); |
|
|
|
|
|
|
|
code.append(categoryCodes).append(StrConstant.COMMA_ZH); |
|
|
|
name.append(categoryNames).append(StrConstant.COMMA_ZH); |
|
|
|
}); |
|
|
|
code.deleteCharAt(code.length() - NumConstant.ONE); |
|
|
|
name.deleteCharAt(name.length() - NumConstant.ONE); |
|
|
|
diffEntity.setEventCategoryCode(code.toString()); |
|
|
|
diffEntity.setEventCategoryName(name.toString()); |
|
|
|
log.info("code:{}",code.toString()); |
|
|
|
log.info("name:{}",name.toString()); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* desc:构建难点堵点基础数据 |
|
|
|
* @param project |
|
|
|
* @param agencyMap |
|
|
|
* @param gridMap |
|
|
|
* @param bizProjectInfoMap |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private ScreenDifficultyDataEntity buildBaseDiffEntity(FactOriginProjectMainDailyEntity project, Map<String, DimAgencyEntity> agencyMap, |
|
|
|
Map<String, GridInfoDTO> gridMap, Map<String, ProjectDTO> bizProjectInfoMap) { |
|
|
|
ProjectDTO projectDTO = bizProjectInfoMap.get(project.getId()); |
|
|
|
ScreenDifficultyDataEntity diff = new ScreenDifficultyDataEntity(); |
|
|
|
diff.setCustomerId(project.getCustomerId()); |
|
|
|
//大屏的是逗号隔开的
|
|
|
|
String allPIds = project.getPids().replaceAll(StrConstant.COLON,StrConstant.COMMA); |
|
|
|
String allPIds = project.getPids().replaceAll(StrConstant.COLON, StrConstant.COMMA); |
|
|
|
DimAgencyEntity agencyInfoDTO = agencyMap.get(project.getAgencyId()); |
|
|
|
if (StringUtils.isBlank(project.getGridId())){ |
|
|
|
diff.setEventTitle(projectDTO.getTitle()); |
|
|
|
if (StringUtils.isBlank(project.getGridId())) { |
|
|
|
diff.setOrgType("agency"); |
|
|
|
diff.setOrgId(project.getAgencyId()); |
|
|
|
diff.setParentId(project.getPid()); |
|
|
|
diff.setAllParentIds(allPIds.replace(StrConstant.COMMA+project.getAgencyId(),StrConstant.EPMETY_STR)); |
|
|
|
diff.setAllParentIds(allPIds.replace(StrConstant.COMMA + project.getAgencyId(), StrConstant.EPMETY_STR)); |
|
|
|
diff.setOrgName(agencyInfoDTO.getAgencyName()); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(agencyInfoDTO.getAllParentName())){ |
|
|
|
if (StringUtils.isNotBlank(agencyInfoDTO.getAllParentName())) { |
|
|
|
diff.setEventSource(agencyInfoDTO.getAllParentName().concat(StrConstant.HYPHEN.concat(diff.getOrgName()))); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
diff.setEventSource(agencyInfoDTO.getAgencyName()); |
|
|
|
} |
|
|
|
//如果是组织的则 设置背景为内容
|
|
|
|
diff.setEventContent(projectDTO.getBackGround()); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
diff.setOrgType("grid"); |
|
|
|
diff.setOrgId(project.getGridId()); |
|
|
|
diff.setParentId(project.getAgencyId()); |
|
|
@ -355,11 +436,9 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
GridInfoDTO gridInfoDTO = gridMap.get(project.getGridId()); |
|
|
|
diff.setOrgName(gridInfoDTO.getGridName()); |
|
|
|
String agencyAndGridName = agencyInfoDTO.getAgencyName().concat(StrConstant.HYPHEN.concat(diff.getOrgName())); |
|
|
|
//todo 市北区的 allParentname 为什么为空
|
|
|
|
//if (!project.getPid().equals(NumConstant.ZERO_STR)){
|
|
|
|
if (StringUtils.isNotBlank(agencyInfoDTO.getAllParentName())){ |
|
|
|
if (StringUtils.isNotBlank(agencyInfoDTO.getAllParentName())) { |
|
|
|
diff.setEventSource(agencyInfoDTO.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyAndGridName)); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
diff.setEventSource(agencyAndGridName); |
|
|
|
} |
|
|
|
} |
|
|
@ -367,23 +446,24 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr |
|
|
|
diff.setEventId(project.getId()); |
|
|
|
String projectStatus = project.getProjectStatus(); |
|
|
|
diff.setEventStatusCode(projectStatus); |
|
|
|
if (ProjectConstant.PENDING.equals(projectStatus)){ |
|
|
|
|
|
|
|
if (ProjectConstant.PENDING.equals(projectStatus)) { |
|
|
|
diff.setEventStatusDesc("处理中"); |
|
|
|
//项目耗时 当前时间-项目创建时间
|
|
|
|
diff.setEventCostTime((int) ((System.currentTimeMillis()-projectDTO.getCreatedTime().getTime())/1000/60)); |
|
|
|
}else{ |
|
|
|
diff.setEventCostTime((int) ((System.currentTimeMillis() - projectDTO.getCreatedTime().getTime()) / 1000 / 60)); |
|
|
|
} else { |
|
|
|
diff.setEventStatusDesc("已结案"); |
|
|
|
//项目耗时 更新时间-项目创建时间
|
|
|
|
diff.setEventCostTime((int) ((projectDTO.getUpdatedTime().getTime() - projectDTO.getCreatedTime().getTime())/1000/60)); |
|
|
|
diff.setEventCostTime((int) ((projectDTO.getUpdatedTime().getTime() - projectDTO.getCreatedTime().getTime()) / 1000 / 60)); |
|
|
|
} |
|
|
|
//暂时不放内容 用不到
|
|
|
|
diff.setLatestOperateDesc(""); |
|
|
|
|
|
|
|
return diff; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 递归查询父节点 |
|
|
|
* |
|
|
|
* @param childCategory |
|
|
|
* @param categoryList |
|
|
|
* @param categoryCode |
|
|
|