|
@@ -140,23 +140,33 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
|
|
|
HashMap<Long,Camera> cameraHashMap = new HashMap<>();
|
|
|
List<Camera> cameraList = cameraService.listByIds(cameraIds);
|
|
|
cameraList.forEach(entity -> cameraHashMap.put(entity.getId(),entity));
|
|
|
+ HashMap<Long,List<String>> companySnCodeMap = new HashMap<>();
|
|
|
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());
|
|
|
Long scenePlusCount = scenePlusMap.get(cameraDetail.getCameraId()) == null ? 0L : scenePlusMap.get(cameraDetail.getCameraId());
|
|
|
Long count = sceneProCount + sceneCount + scenePlusCount;
|
|
|
-
|
|
|
- SceneParam param = new SceneParam();
|
|
|
- Camera camera = cameraHashMap.get(cameraDetail.getCameraId());
|
|
|
- if(camera != null){
|
|
|
- param.setSnCode(camera.getSnCode());
|
|
|
- PageInfo pageInfo = laserService.pageList(param);
|
|
|
- count += pageInfo.getTotal();
|
|
|
+ List<String> snCodeList = companySnCodeMap.get(cameraDetail.getCompanyId());
|
|
|
+ if(snCodeList == null){
|
|
|
+ snCodeList = new ArrayList<>();
|
|
|
+ Camera camera = cameraHashMap.get(cameraDetail.getCameraId());
|
|
|
+ if(camera != null){
|
|
|
+ snCodeList.add(camera.getSnCode());
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
resultMap.merge(cameraDetail.getCompanyId(), count, Long::sum);
|
|
|
}
|
|
|
|
|
|
+ for (Long companyId : companySnCodeMap.keySet()) {
|
|
|
+ List<String> snCodeList = companySnCodeMap.get(companyId);
|
|
|
+ if(snCodeList == null || snCodeList.size() <=0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ SceneParam param = new SceneParam();
|
|
|
+ param.setSnCodes(snCodeList);
|
|
|
+ PageInfo pageInfo = laserService.pageList(param);
|
|
|
+ resultMap.merge(companyId, pageInfo.getTotal(), Long::sum);
|
|
|
+ }
|
|
|
return resultMap;
|
|
|
}
|
|
|
|