| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getCamerasByDeptId(Long deptId,String userId) { |
| | | List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptId,userId); |
| | | List<Long> deptIdList = new ArrayList(); |
| | | deptIdList.add(deptId); |
| | | deptIdList = getOwnAndChildrenDeptIdList(deptIdList,new ArrayList());//递归查询下属部门主键 |
| | | //List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptId,userId); |
| | | List<Map<String, Object>> result = ardCamerasMapper.getCamerasByDeptId(deptIdList,userId); |
| | | return result; |
| | | } |
| | | |
| | | public List<Long> getOwnAndChildrenDeptIdList(List<Long> deptIdList,List<Long> deptIdListr){ |
| | | deptIdListr.addAll(deptIdList); |
| | | List<Long> result = sysDeptMapper.getChildrenDeptIdList(deptIdList); |
| | | if(result.size() != 0){ |
| | | deptIdListr.addAll(result); |
| | | result = getOwnAndChildrenDeptIdList(result,deptIdListr); |
| | | } |
| | | deptIdListr = deptIdListr.stream().distinct().collect(Collectors.toList()); |
| | | return deptIdListr; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean getCameraOperationByCameraId(String id, String userId) { |
| | | Boolean result = ardCamerasMapper.getCameraOperationByCameraId(id,userId); |