lyhzzz il y a 1 an
Parent
commit
23fc0b6af8

+ 5 - 1
src/main/java/com/fdkankan/fusion/service/impl/DataService.java

@@ -36,7 +36,11 @@ public class DataService implements IDataService {
 
         HashMap<String,List<Long>> deptIdMap = new HashMap<>();
         HashMap<Long,Long> cameraIdMap = new HashMap<>();
-        List<TmCamera> list = tmCameraService.getByDeptIds();
+        String deptId = tmDepartmentService.getDeptId();
+        List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(deptId);
+        List<String> deptIds = sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList());
+        deptIds.add(deptId);
+        List<TmCamera> list = tmCameraService.getByDeptIds(deptIds);
         for (TmCamera tmCamera : list) {
             if(deptIdMap.get(tmCamera.getDeptId()) == null){
                 List<Long> cameraIdList = new ArrayList<>();