|
@@ -41,37 +41,9 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
|
|
|
@Override
|
|
|
public Object pageList(CameraParam param) {
|
|
|
- if(param.getAgentNew().getParentId() != null){ //分销商
|
|
|
- AgentNew agentNew = agentNewService.getById(param.getAgentNew().getParentId());
|
|
|
- param.setSubAgentId(param.getAgentId());
|
|
|
- param.setAgentId(agentNew.getId());
|
|
|
- }
|
|
|
- if(param.getIncrementStatus() != null){
|
|
|
- List<Long> cameraIds = userIncrementService.getByAgentId(param);
|
|
|
- param.setCameraIds(cameraIds);
|
|
|
- }
|
|
|
- if(param.getIncrementTypeId() != null){
|
|
|
- List<Long> cameraIds = userIncrementService.getByAgentId(param);
|
|
|
- param.setCameraIds(cameraIds);
|
|
|
- }
|
|
|
- if(param.getCameraIds() != null && param.getCameraIds().isEmpty()){
|
|
|
+ if(param.getAuthCameraIds() != null && param.getAuthCameraIds().isEmpty()){
|
|
|
return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
|
|
|
}
|
|
|
- if(param.getSubAgentId() != null){ //指定分销商查询
|
|
|
- List<Long> subCameraIds = agentNewCameraService.getBySubAgent(param.getSubAgentId());
|
|
|
- if(subCameraIds.isEmpty()){
|
|
|
- return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
|
|
|
- }
|
|
|
- if(param.getCameraIds() != null && !param.getCameraIds().isEmpty()){
|
|
|
- List<Long> newCameraIds = param.getCameraIds().stream().filter(subCameraIds::contains).collect(Collectors.toList());
|
|
|
- if(newCameraIds.isEmpty()){
|
|
|
- return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
|
|
|
- }
|
|
|
- param.setCameraIds(newCameraIds);
|
|
|
- }else {
|
|
|
- param.setCameraIds(subCameraIds);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
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());
|
|
@@ -87,15 +59,9 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
HashMap<Integer,AgentNew> agentMap = agentNewService.getMapByIds(subAgentIds);
|
|
|
|
|
|
for (CameraDetailVo record : voPage.getRecords()) {
|
|
|
- UserIncrement userIncrement = userIncrementHashMap.get(record.getId());
|
|
|
- if(userIncrement != null){
|
|
|
- record.setIncrementStatus(userIncrement.getIsExpired());
|
|
|
- record.setIncrementTypeId(userIncrement.getIncrementTypeId());
|
|
|
- record.setIncrementEndTime(userIncrement.getIncrementEndTime());
|
|
|
- IncrementType incrementType = typeMap.get(userIncrement.getIncrementTypeId());
|
|
|
- if(incrementType != null){
|
|
|
- record.setValidTimeType(incrementType.getValidTimeType());
|
|
|
- }
|
|
|
+ IncrementType incrementType = typeMap.get(record.getIncrementTypeId());
|
|
|
+ if(incrementType != null){
|
|
|
+ record.setValidTimeType(incrementType.getValidTimeType());
|
|
|
}
|
|
|
AgentNewCamera agentNewCamera = map.get(record.getId());
|
|
|
if(agentNewCamera != null && agentNewCamera.getAgentId().equals( param.getAgentNew().getId())){
|