|
@ -260,33 +260,37 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc |
|
|
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class); |
|
|
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class); |
|
|
} |
|
|
} |
|
|
// 组织项目分类 项目数
|
|
|
// 组织项目分类 项目数
|
|
|
List<String> orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); |
|
|
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); |
|
|
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId); |
|
|
List<CustomerAgencyInfoResultDTO> levelAgencyInfo = groupByLevel.get(level); |
|
|
if (!CollectionUtils.isEmpty(result)){ |
|
|
if (!CollectionUtils.isEmpty(levelAgencyInfo)){ |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategory)){ |
|
|
List<String> orgIds = levelAgencyInfo.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); |
|
|
result.forEach(r -> { |
|
|
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId); |
|
|
screenProjectCategory.forEach(pc -> { |
|
|
if (!CollectionUtils.isEmpty(result)){ |
|
|
if (r.getOrgId().equals(pc.getOrgId()) && r.getCategoryCode().equals(pc.getCategoryCode())){ |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategory)){ |
|
|
pc.setStatus(true); |
|
|
result.forEach(r -> { |
|
|
r.setProjectTotal(r.getProjectTotal() + pc.getProjectTotal()); |
|
|
screenProjectCategory.forEach(pc -> { |
|
|
} |
|
|
if (r.getOrgId().equals(pc.getOrgId()) && r.getCategoryCode().equals(pc.getCategoryCode())){ |
|
|
|
|
|
pc.setStatus(true); |
|
|
|
|
|
r.setProjectTotal(r.getProjectTotal() + pc.getProjectTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
Map<Boolean, List<ScreenProjectCategoryGridDailyDTO>> groupByStatus = screenProjectCategory.stream().collect(Collectors.groupingBy(ScreenProjectCategoryGridDailyDTO::getStatus)); |
|
|
Map<Boolean, List<ScreenProjectCategoryGridDailyDTO>> groupByStatus = screenProjectCategory.stream().collect(Collectors.groupingBy(ScreenProjectCategoryGridDailyDTO::getStatus)); |
|
|
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategoryNoCal = groupByStatus.get(false); |
|
|
List<ScreenProjectCategoryGridDailyDTO> screenProjectCategoryNoCal = groupByStatus.get(false); |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategoryNoCal)){ |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategoryNoCal)){ |
|
|
List<ScreenProjectCategoryOrgDailyEntity> noCalCategory = ConvertUtils.sourceToTarget(screenProjectCategoryNoCal, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
List<ScreenProjectCategoryOrgDailyEntity> noCalCategory = ConvertUtils.sourceToTarget(screenProjectCategoryNoCal, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
result.addAll(noCalCategory); |
|
|
result.addAll(noCalCategory); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
if (!CollectionUtils.isEmpty(screenProjectCategory)){ |
|
|
|
|
|
result = ConvertUtils.sourceToTarget(screenProjectCategory, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}else { |
|
|
if (!CollectionUtils.isEmpty(result)){ |
|
|
if (!CollectionUtils.isEmpty(screenProjectCategory)){ |
|
|
result.forEach(r -> {r.setOrgType(level);r.setDateId(dateId);}); |
|
|
result = ConvertUtils.sourceToTarget(screenProjectCategory, ScreenProjectCategoryOrgDailyEntity.class); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!CollectionUtils.isEmpty(result)){ |
|
|
|
|
|
result.forEach(r -> {r.setOrgType(level);r.setDateId(dateId);}); |
|
|
|
|
|
} |
|
|
|
|
|
deleteAndInsert(customerId,dateId,result); |
|
|
deleteAndInsert(customerId,dateId,result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|