|
@@ -137,6 +137,9 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
|
|
|
HashMap<Long, Long> sceneMap = sceneService.getCountGroupByCameraId(new ArrayList<>(cameraIds));
|
|
|
HashMap<Long, Long> scenePlusMap = scenePlusService.getCountGroupByCameraId(new ArrayList<>(cameraIds));
|
|
|
|
|
|
+ HashMap<Long,Camera> cameraHashMap = new HashMap<>();
|
|
|
+ List<Camera> cameraList = cameraService.listByIds(cameraIds);
|
|
|
+ cameraList.forEach(entity -> cameraHashMap.put(entity.getId(),entity));
|
|
|
for (CameraDetail cameraDetail : list) {
|
|
|
Long sceneProCount = sceneProMap.get(cameraDetail.getCameraId()) == null ? 0L : sceneProMap.get(cameraDetail.getCameraId());
|
|
|
Long sceneCount = sceneMap.get(cameraDetail.getCameraId()) == null ? 0L : sceneMap.get(cameraDetail.getCameraId());
|
|
@@ -144,10 +147,12 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
|
|
|
Long count = sceneProCount + sceneCount + scenePlusCount;
|
|
|
|
|
|
SceneParam param = new SceneParam();
|
|
|
- Camera camera = cameraService.getById(cameraDetail.getCameraId());
|
|
|
- param.setSnCode(camera.getSnCode());
|
|
|
- PageInfo pageInfo = laserService.pageList(param);
|
|
|
- count += pageInfo.getTotal();
|
|
|
+ Camera camera = cameraHashMap.get(cameraDetail.getCameraId());
|
|
|
+ if(camera != null){
|
|
|
+ param.setSnCode(camera.getSnCode());
|
|
|
+ PageInfo pageInfo = laserService.pageList(param);
|
|
|
+ count += pageInfo.getTotal();
|
|
|
+ }
|
|
|
|
|
|
resultMap.merge(cameraDetail.getCompanyId(), count, Long::sum);
|
|
|
}
|