|
@@ -114,10 +114,10 @@ public class DataService implements IDataService {
|
|
|
List<TmDepartment> deptList = tmDepartmentService.getDeptList();
|
|
|
TmDepartment department1 = deptList.get(0);
|
|
|
if(department1.getParentId() == null){ //超管
|
|
|
- deptList = department1.getChildren().get(0).getChildren();
|
|
|
+ return department1.getChildren().get(0).getChildren();
|
|
|
}
|
|
|
- if(department1.getParentId() != null && department1.getParentId().equals("0")){ //总队
|
|
|
- deptList = department1.getChildren();
|
|
|
+ if(department1.getChildren()!= null && department1.getChildren().size() >=0){ //总队
|
|
|
+ return department1.getChildren();
|
|
|
}
|
|
|
return deptList;
|
|
|
}
|
|
@@ -147,7 +147,8 @@ public class DataService implements IDataService {
|
|
|
|
|
|
@Override
|
|
|
public Object cameraGroupType(DataParam param) {
|
|
|
- List<TmCamera> tmCameras = tmCameraService.getByDeptIds();
|
|
|
+
|
|
|
+ List<TmCamera> tmCameras = tmCameraService.getByDeptIds(getSonDeptIds());
|
|
|
List<Long> cameraIds = tmCameras.stream().map(TmCamera::getFdCameraId).collect(Collectors.toList());
|
|
|
List<DataGroupVo> groupVoList = scenePlusService.groupByType(param,cameraIds);
|
|
|
|
|
@@ -160,6 +161,14 @@ public class DataService implements IDataService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private List<String> getSonDeptIds(){
|
|
|
+ String deptId = tmDepartmentService.getDeptId();
|
|
|
+ List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(deptId);
|
|
|
+ List<String> deptIds = sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList());
|
|
|
+ deptIds.add(deptId);
|
|
|
+ return deptIds;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Object FireTrend(DataParam param) {
|
|
|
List<String> monthdateList = DateUtils.getMonthdateList(param.getStartTime(), param.getEndTime());
|
|
@@ -178,7 +187,7 @@ public class DataService implements IDataService {
|
|
|
|
|
|
@Override
|
|
|
public Object FirePlaceTrend(DataParam param) {
|
|
|
- List<DataGroupVo> groupVoList = tmProjectService.groupByPlace(param,tmDepartmentService.getDeptIds());
|
|
|
+ List<DataGroupVo> groupVoList = tmProjectService.groupByPlace(param,this.getSonDeptIds());
|
|
|
HashMap<String,Long> countMap = new HashMap<>();
|
|
|
for (String key : DataUtil.firePlace) {
|
|
|
countMap.put(key,0L);
|
|
@@ -193,7 +202,7 @@ public class DataService implements IDataService {
|
|
|
|
|
|
@Override
|
|
|
public Object FireReasonTrend(DataParam param) {
|
|
|
- List<DataGroupVo> groupVoList = tmProjectService.groupByReason(param,tmDepartmentService.getDeptIds());
|
|
|
+ List<DataGroupVo> groupVoList = tmProjectService.groupByReason(param,this.getSonDeptIds());
|
|
|
HashMap<String,Long> countMap = new HashMap<>();
|
|
|
for (String key : DataUtil.fireReason) {
|
|
|
countMap.put(key,0L);
|