|
@@ -38,16 +38,28 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
IAgentNewService agentNewService;
|
|
IAgentNewService agentNewService;
|
|
@Autowired
|
|
@Autowired
|
|
IAgentNewCameraService agentNewCameraService;
|
|
IAgentNewCameraService agentNewCameraService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICameraDetailService cameraDetailService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Object pageList(CameraParam param) {
|
|
public Object pageList(CameraParam param) {
|
|
- if(param.getAuthCameraIds() != null && param.getAuthCameraIds().isEmpty()){
|
|
|
|
- return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
|
|
|
|
|
|
+
|
|
|
|
+ List<CameraDetail> details = cameraDetailService.getListByAgentId(param.getAgentId());
|
|
|
|
+ List<Long> cameraIds = details.stream().map(CameraDetail::getCameraId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<Long> authCameraIds = agentNewCameraService.getBySubAgent(param.getAgentId());
|
|
|
|
+ if(!authCameraIds.isEmpty()) {
|
|
|
|
+ cameraIds.addAll(authCameraIds);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(cameraIds.isEmpty()){
|
|
|
|
+ return PageInfo.PageInfo(new Page<>(param.getPageNum(),param.getPageSize()));
|
|
}
|
|
}
|
|
|
|
+ param.setCameraIds(cameraIds);
|
|
|
|
|
|
Page<CameraDetailVo> voPage = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
Page<CameraDetailVo> voPage = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
- List<Long> cameraIds = voPage.getRecords().stream().map(CameraDetailVo::getId).collect(Collectors.toList());
|
|
|
|
- HashMap<Long, UserIncrement> userIncrementHashMap = userIncrementService.getByCameraIds(cameraIds);
|
|
|
|
|
|
+ List<Long> cameraId1s = voPage.getRecords().stream().map(CameraDetailVo::getId).collect(Collectors.toList());
|
|
|
|
+ HashMap<Long, UserIncrement> userIncrementHashMap = userIncrementService.getByCameraIds(cameraId1s);
|
|
|
|
|
|
Set<Integer> incrementTypeIds = userIncrementHashMap.values().stream().map(UserIncrement::getIncrementTypeId).collect(Collectors.toSet());
|
|
Set<Integer> incrementTypeIds = userIncrementHashMap.values().stream().map(UserIncrement::getIncrementTypeId).collect(Collectors.toSet());
|
|
HashMap<Integer, IncrementType> typeMap = incrementTypeService.getMapByIds(incrementTypeIds);
|
|
HashMap<Integer, IncrementType> typeMap = incrementTypeService.getMapByIds(incrementTypeIds);
|