|
|
@ -100,8 +100,21 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
businessAlertBo.setDeptId(String.valueOf(LoginHelper.getDeptId())); |
|
|
|
businessAlertBo.setAiLabelEnList(getAiLabel(businessAlertBo.getPostCode()).stream().map(RemoteAiLabelPostVo::getLabelEn).collect(Collectors.toList())); |
|
|
|
|
|
|
|
List<Map<String, Object>> mapList = baseMapper.listDepartAlert(businessAlertBo); |
|
|
|
//判断是否存在下级
|
|
|
|
Long deptId = LoginHelper.getDeptId(); |
|
|
|
List<RemoteDeptVo> remoteDeptVoList = Optional.ofNullable(remoteDeptService.selectListByParentId(String.valueOf(deptId))) |
|
|
|
.orElse(Collections.emptyList()) |
|
|
|
.stream() |
|
|
|
.filter(p -> !p.getDeptId().equals(deptId)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
//排除自己如果没有下级则默认使用下边的逻辑查询
|
|
|
|
if (ObjectUtil.isEmpty(remoteDeptVoList)) { |
|
|
|
List<Map<String, Object>> mapList = baseMapper.listOneDepartAlert(businessAlertBo); |
|
|
|
return mapList.stream().map(data -> new StatObj(data.get("deptName") + "", Long.parseLong(data.get("total") + ""),"deptId",data.get("deptId"))).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
//如果有则使用这个查询
|
|
|
|
List<Map<String, Object>> mapList = baseMapper.listDepartAlert(businessAlertBo); |
|
|
|
return mapList.stream().map(data -> new StatObj(data.get("deptName") + "", Long.parseLong(data.get("total") + ""),"deptId",data.get("deptId"))).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
@ -134,6 +147,33 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
businessAlertBo.setDeptId(String.valueOf(LoginHelper.getDeptId())); |
|
|
|
businessAlertBo.setAiLabelEnList(getAiLabel(businessAlertBo.getPostCode()).stream().map(RemoteAiLabelPostVo::getLabelEn).collect(Collectors.toList())); |
|
|
|
|
|
|
|
//判断是否存在下级
|
|
|
|
Long deptId = LoginHelper.getDeptId(); |
|
|
|
List<RemoteDeptVo> remoteDeptVoList = Optional.ofNullable(remoteDeptService.selectListByParentId(String.valueOf(deptId))) |
|
|
|
.orElse(Collections.emptyList()) |
|
|
|
.stream() |
|
|
|
.filter(p -> !p.getDeptId().equals(deptId)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
//排除自己如果没有下级则默认使用下边的逻辑查询
|
|
|
|
if (ObjectUtil.isEmpty(remoteDeptVoList)) { |
|
|
|
List<Map<String, Object>> mapList = baseMapper.listOneDepartAlertStatus(businessAlertBo); |
|
|
|
|
|
|
|
return mapList.stream() |
|
|
|
.map(map -> new StatObj( |
|
|
|
Objects.toString(map.get("deptName")), |
|
|
|
List.of( |
|
|
|
new StatObj("total", map.get("total")), |
|
|
|
new StatObj("todoCount", map.get("todoCount")), |
|
|
|
new StatObj("finishCount", map.get("finishCount")), |
|
|
|
new StatObj("cancelCount", map.get("cancelCount")) |
|
|
|
),"deptId",map.get("deptId") |
|
|
|
)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//如果有下级则使用下方方法
|
|
|
|
List<Map<String, Object>> mapList = baseMapper.listDepartAlertStatus(businessAlertBo); |
|
|
|
|
|
|
|
return mapList.stream() |
|
|
|