|
@ -413,7 +413,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc |
|
|
Map<String, List<CategoryProjectResultDTO>> groupByCategoryCode = categoryProjectResultDTOS.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getCategoryCode)); |
|
|
Map<String, List<CategoryProjectResultDTO>> groupByCategoryCode = categoryProjectResultDTOS.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getCategoryCode)); |
|
|
// 这时的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 = new ArrayList<>(); |
|
|
groupByCategoryCode.forEach((code, list) -> { |
|
|
groupByCategoryCode.forEach((code, list) -> { |
|
|
ScreenProjectCategoryOrgDailyEntity e = new ScreenProjectCategoryOrgDailyEntity(); |
|
|
ScreenProjectCategoryOrgDailyEntity e = new ScreenProjectCategoryOrgDailyEntity(); |
|
|
e.setCustomerId(customerId); |
|
|
e.setCustomerId(customerId); |
|
@ -428,7 +428,32 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc |
|
|
}); |
|
|
}); |
|
|
if (!CollectionUtils.isEmpty(sonResult)){ |
|
|
if (!CollectionUtils.isEmpty(sonResult)){ |
|
|
List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(sonResult, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
List<ScreenProjectCategoryOrgDailyEntity> entities = ConvertUtils.sourceToTarget(sonResult, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
result.addAll(entities); |
|
|
finalResult.addAll(entities); |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); |
|
|
|
|
|
List<CustomerAgencyInfoResultDTO> levelAgencyInfo = groupByLevel.get(level); |
|
|
|
|
|
// 计算内部客户的分类
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(levelAgencyInfo)){ |
|
|
|
|
|
List<String> orgIdss = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); |
|
|
|
|
|
orgIds.addAll(orgIdss); |
|
|
|
|
|
List<CategoryProjectResultDTO> selfOrgCategory = baseDao.selectSelfAgencyCategory(dateId, orgIdss); |
|
|
|
|
|
if (!CollectionUtils.isEmpty(selfOrgCategory)){ |
|
|
|
|
|
List<ScreenProjectCategoryOrgDailyEntity> selfResult = ConvertUtils.sourceToTarget(selfOrgCategory, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
|
|
|
selfResult.forEach(s -> { |
|
|
|
|
|
finalResult.forEach(f -> { |
|
|
|
|
|
if (s.getCategoryCode().equals(f.getCategoryCode())){ |
|
|
|
|
|
s.setProjectTotal(s.getProjectTotal() + f.getProjectTotal()); |
|
|
|
|
|
f.setUseStatus(true); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
result.addAll(selfResult); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
Map<Boolean, List<ScreenProjectCategoryOrgDailyEntity>> groupByStatus = finalResult.stream().collect(Collectors.groupingBy(ScreenProjectCategoryOrgDailyEntity::getUseStatus)); |
|
|
|
|
|
List<ScreenProjectCategoryOrgDailyEntity> falseList = groupByStatus.get(false); |
|
|
|
|
|
if (!CollectionUtils.isEmpty(falseList)){ |
|
|
|
|
|
result.addAll(falseList); |
|
|
} |
|
|
} |
|
|
// 添加此 锦水、孔村、榆山 orgId,删除时使用
|
|
|
// 添加此 锦水、孔村、榆山 orgId,删除时使用
|
|
|
orgIds.add(PingYinConstant.JIN_SHUI_AGENCY_ID); |
|
|
orgIds.add(PingYinConstant.JIN_SHUI_AGENCY_ID); |
|
@ -441,9 +466,8 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc |
|
|
List<CustomerAgencyInfoResultDTO> levelAgencyInfo = groupByLevel.get(level); |
|
|
List<CustomerAgencyInfoResultDTO> levelAgencyInfo = groupByLevel.get(level); |
|
|
if (!CollectionUtils.isEmpty(levelAgencyInfo)) { |
|
|
if (!CollectionUtils.isEmpty(levelAgencyInfo)) { |
|
|
List<String> orgIdss = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); |
|
|
List<String> orgIdss = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); |
|
|
orgIds.addAll(orgIdss); |
|
|
|
|
|
// 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】
|
|
|
// 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】
|
|
|
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds, customerId); |
|
|
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIdss, customerId); |
|
|
if (!CollectionUtils.isEmpty(result)) { |
|
|
if (!CollectionUtils.isEmpty(result)) { |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategory)) { |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategory)) { |
|
|
result.forEach(r -> { |
|
|
result.forEach(r -> { |
|
|