|
|
@@ -1656,11 +1656,43 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
|
|
1656
|
1656
|
}
|
|
1657
|
1657
|
});
|
|
1658
|
1658
|
}
|
|
|
1659
|
+ //补充被检查班科室数据
|
|
|
1660
|
+ List<Long> checkedTeamIdListTemp = all.stream().filter(item -> ObjectUtil.isNull(item.getCheckedDepartmentId())).map(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedTeamId).distinct().collect(Collectors.toList());
|
|
|
1661
|
+ if (CollUtil.isNotEmpty(checkedTeamIdListTemp)) {
|
|
|
1662
|
+ List<SysDept> checkedTeamListTemp = sysDeptService.selectDeptByIdList(checkedTeamIdListTemp);
|
|
|
1663
|
+ if (CollUtil.isNotEmpty(checkedTeamListTemp)) {
|
|
|
1664
|
+ Map<Long, Long> deptIdMap = checkedTeamListTemp.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getParentId, (oldValue, newValue) -> newValue));
|
|
|
1665
|
+ List<Long> checkedDepartmentIdListTemp = checkedTeamListTemp.stream().map(SysDept::getParentId).collect(Collectors.toList());
|
|
|
1666
|
+ List<SysDept> checkedDepartmentListTemp = sysDeptService.selectDeptByIdList(checkedDepartmentIdListTemp);
|
|
|
1667
|
+ if (CollUtil.isNotEmpty(checkedDepartmentListTemp)) {
|
|
|
1668
|
+ Map<Long, String> deptMap = checkedDepartmentListTemp.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName, (oldValue, newValue) -> newValue));
|
|
|
1669
|
+ all.forEach(item -> {
|
|
|
1670
|
+ if (ObjectUtil.isNull(item.getCheckedDepartmentId())) {
|
|
|
1671
|
+ item.setCheckedDepartmentId(deptIdMap.getOrDefault(item.getCheckedTeamId(), 0L));
|
|
|
1672
|
+ item.setCheckedTeamName(deptMap.getOrDefault(item.getCheckedDepartmentId(), ""));
|
|
|
1673
|
+ }
|
|
|
1674
|
+ });
|
|
|
1675
|
+ }
|
|
|
1676
|
+ }
|
|
|
1677
|
+ }
|
|
1659
|
1678
|
|
|
1660
|
1679
|
// 对全量数据进行过滤+处理返回数据
|
|
1661
|
1680
|
SysDept sysDept = sysDeptService.selectDeptById(dto.getDeptId());
|
|
1662
|
1681
|
if (StrUtil.equals(DeptTypeEnum.STATION.getCode(), sysDept.getDeptType())) {
|
|
1663
|
1682
|
List<CheckLargeScreenCorrectionPortraitSqlDto> target = all;
|
|
|
1683
|
+ Map<Long, String> map = target.stream().collect(Collectors.toMap(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedBrigadeId, CheckLargeScreenCorrectionPortraitSqlDto::getCheckedBrigadeName, (oldValue, newValue) -> newValue));
|
|
|
1684
|
+ Map<Long, List<CheckLargeScreenCorrectionPortraitSqlDto>> groupingBy = target.stream().collect(Collectors.groupingBy(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedBrigadeId));
|
|
|
1685
|
+ groupingBy.forEach((key, value) -> {
|
|
|
1686
|
+ SysLargeScreenDetailDto temp = new SysLargeScreenDetailDto();
|
|
|
1687
|
+ temp.setId(key);
|
|
|
1688
|
+ temp.setName(map.getOrDefault(key, ""));
|
|
|
1689
|
+ int sum = value.size();
|
|
|
1690
|
+ long count = value.stream().map(CheckLargeScreenCorrectionPortraitSqlDto::getUserId).distinct().count();
|
|
|
1691
|
+ temp.setCheckCount(BigDecimal.valueOf(sum).divide(BigDecimal.valueOf(count), 1, RoundingMode.HALF_UP));
|
|
|
1692
|
+ result.add(temp);
|
|
|
1693
|
+ });
|
|
|
1694
|
+ } else if (StrUtil.equals(DeptTypeEnum.BRIGADE.getCode(), sysDept.getDeptType())) {
|
|
|
1695
|
+ List<CheckLargeScreenCorrectionPortraitSqlDto> target = all.stream().filter(item -> ObjUtil.equals(item.getCheckedBrigadeId(), dto.getDeptId())).collect(Collectors.toList());
|
|
1664
|
1696
|
Map<Long, String> map = target.stream().collect(Collectors.toMap(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedDepartmentId, CheckLargeScreenCorrectionPortraitSqlDto::getCheckedDepartmentName, (oldValue, newValue) -> newValue));
|
|
1665
|
1697
|
Map<Long, List<CheckLargeScreenCorrectionPortraitSqlDto>> groupingBy = target.stream().collect(Collectors.groupingBy(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedDepartmentId));
|
|
1666
|
1698
|
groupingBy.forEach((key, value) -> {
|
|
|
@@ -1672,7 +1704,7 @@ public class CheckLargeScreenServiceImpl implements ICheckLargeScreenService {
|
|
1672
|
1704
|
temp.setCheckCount(BigDecimal.valueOf(sum).divide(BigDecimal.valueOf(count), 1, RoundingMode.HALF_UP));
|
|
1673
|
1705
|
result.add(temp);
|
|
1674
|
1706
|
});
|
|
1675
|
|
- } else if (StrUtil.equals(DeptTypeEnum.DEPARTMENT.getCode(), sysDept.getDeptType())) {
|
|
|
1707
|
+ } else if (StrUtil.equals(DeptTypeEnum.MANAGER.getCode(), sysDept.getDeptType())) {
|
|
1676
|
1708
|
List<CheckLargeScreenCorrectionPortraitSqlDto> target = all.stream().filter(item -> ObjUtil.equals(item.getCheckedDepartmentId(), dto.getDeptId())).collect(Collectors.toList());
|
|
1677
|
1709
|
Map<Long, String> map = target.stream().collect(Collectors.toMap(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedTeamId, CheckLargeScreenCorrectionPortraitSqlDto::getCheckedTeamName, (oldValue, newValue) -> newValue));
|
|
1678
|
1710
|
Map<Long, List<CheckLargeScreenCorrectionPortraitSqlDto>> groupingBy = target.stream().collect(Collectors.groupingBy(CheckLargeScreenCorrectionPortraitSqlDto::getCheckedTeamId));
|