Browse Source

Merge remote-tracking branch 'origin/dev'

dev_shibei_match
zxc 4 years ago
parent
commit
0acdab6d20
  1. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java

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

@ -365,6 +365,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
orgIds.add(PingYinConstant.KONG_CUN_AGENCY_ID); orgIds.add(PingYinConstant.KONG_CUN_AGENCY_ID);
orgIds.add(PingYinConstant.YU_SHAN_AGENCY_ID); orgIds.add(PingYinConstant.YU_SHAN_AGENCY_ID);
} }
log.info("groupByLevel:"+groupByLevel+"orgIds:"+orgIds);
del(customerId,dateId,orgIds); del(customerId,dateId,orgIds);
if (isGrid){ if (isGrid){
// community级别走这 // community级别走这
@ -375,6 +376,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
}else { }else {
// 根据客户ID,时间,组织级别查询 分类标签 // 根据客户ID,时间,组织级别查询 分类标签
List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level); List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level);
log.info("分类标签:"+categoryProjectResultDTOS);
List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level); List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level);
if (!CollectionUtils.isEmpty(belongGridInfos)){ if (!CollectionUtils.isEmpty(belongGridInfos)){
// 存在直属网格 // 存在直属网格
@ -409,6 +411,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
List<String> customerIds = relationInfo.stream().map(m -> m.getCustomerId()).collect(Collectors.toList()); List<String> customerIds = relationInfo.stream().map(m -> m.getCustomerId()).collect(Collectors.toList());
// 父客户存在的分类 // 父客户存在的分类
List<CategoryProjectResultDTO> categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true); List<CategoryProjectResultDTO> categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true);
log.info("父客户存在的分类"+categoryProjectExists);
// 这时的result集合要清空,因为被上边使用 【result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);】 // 这时的result集合要清空,因为被上边使用 【result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);】
result.clear(); result.clear();
/* List<ScreenProjectCategoryOrgDailyEntity> finalResult = result; /* List<ScreenProjectCategoryOrgDailyEntity> finalResult = result;
@ -446,18 +449,22 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
e.setPids(StringUtils.isEmpty(entity.getPids()) ? NumConstant.ZERO_STR : entity.getPids()); e.setPids(StringUtils.isEmpty(entity.getPids()) ? NumConstant.ZERO_STR : entity.getPids());
finalResult.add(e); finalResult.add(e);
}); });
log.info("组合后的数据:"+finalResult);
// 父客户存在分类,但是父客户没有使用过此分类 // 父客户存在分类,但是父客户没有使用过此分类
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectExists.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus)); Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectExists.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
if (!CollectionUtils.isEmpty(groupByStatus.get(false))){ if (!CollectionUtils.isEmpty(groupByStatus.get(false))){
List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(groupByStatus.get(false), ScreenProjectCategoryOrgDailyEntity.class); List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(groupByStatus.get(false), ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(entities); result.addAll(entities);
} }
log.info("父客户存在的分类,但是未使用的分类:"+groupByStatus.get(false));
log.info("父客户存在的分类,但是未使用的分类,组合后:"+result);
// 父客户不存在的分类 // 父客户不存在的分类
List<CategoryProjectResultDTO> categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false); List<CategoryProjectResultDTO> categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false);
if (!CollectionUtils.isEmpty(categoryProjectNotExists)){ if (!CollectionUtils.isEmpty(categoryProjectNotExists)){
List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(categoryProjectNotExists, ScreenProjectCategoryOrgDailyEntity.class); List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(categoryProjectNotExists, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(entities); result.addAll(entities);
} }
log.info("父客户不存在的分类:"+categoryProjectNotExists);
} }
} }
// 目前不考虑计算子客户组织直接创建的项目,只算内部客户 // 目前不考虑计算子客户组织直接创建的项目,只算内部客户
@ -465,6 +472,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
if (!CollectionUtils.isEmpty(levelAgencyInfo)) { if (!CollectionUtils.isEmpty(levelAgencyInfo)) {
// 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 // 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId); List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId);
log.info("直接立项的统计:"+screenProjectCategory);
if (!CollectionUtils.isEmpty(result)) { if (!CollectionUtils.isEmpty(result)) {
if (!CollectionUtils.isEmpty(screenProjectCategory)) { if (!CollectionUtils.isEmpty(screenProjectCategory)) {
result.forEach(r -> { result.forEach(r -> {
@ -501,6 +509,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
}); });
} }
} }
log.info("插入总结果:"+result);
insert(result); insert(result);
} }

Loading…
Cancel
Save