|
@@ -42,8 +42,10 @@ public class FusionService implements IFusionService {
|
|
SceneProEntityVo vo = new SceneProEntityVo();
|
|
SceneProEntityVo vo = new SceneProEntityVo();
|
|
vo.setSceneName(scenePlusVo.getTitle());
|
|
vo.setSceneName(scenePlusVo.getTitle());
|
|
vo.setStatus(scenePlusVo.getSceneStatus());
|
|
vo.setStatus(scenePlusVo.getSceneStatus());
|
|
- BeanUtils.copyProperties(scenePlusVo,vo);
|
|
|
|
- BeanUtils.copyProperties(scenePlusVo.getPlusExt(),vo);
|
|
|
|
|
|
+ if(scenePlusVo.getPlusExt() !=null){
|
|
|
|
+ BeanUtils.copyProperties(scenePlusVo.getPlusExt(),vo);
|
|
|
|
+ }
|
|
|
|
+ BeanUtils.copyProperties(scenePlusVo, vo);
|
|
proEntityVos.add(vo);
|
|
proEntityVos.add(vo);
|
|
}
|
|
}
|
|
Page<SceneProEntityVo> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
|
|
Page<SceneProEntityVo> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
|
|
@@ -56,7 +58,15 @@ public class FusionService implements IFusionService {
|
|
@Override
|
|
@Override
|
|
public PageInfo scenePageList(SceneParam param, String token) {
|
|
public PageInfo scenePageList(SceneParam param, String token) {
|
|
LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
|
|
-
|
|
|
|
|
|
+ if(param.getSnCodes() != null && param.getSnCodes().size() >0){
|
|
|
|
+ List<Camera> cameras = cameraService.getBySnCodes(param.getSnCodes());
|
|
|
|
+ if(cameras.size() >0){
|
|
|
|
+ List<Long> cameraIds = cameras.stream().map(Camera::getId).collect(Collectors.toList());
|
|
|
|
+ wrapper.in(ScenePlus::getCameraId,cameraIds);
|
|
|
|
+ }else {
|
|
|
|
+ return PageInfo.PageInfo(new Page<>(param.getPageNum(),param.getPageSize()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if(StringUtils.isNotBlank(token)){
|
|
if(StringUtils.isNotBlank(token)){
|
|
User user = userService.getByToken(token);
|
|
User user = userService.getByToken(token);
|
|
if(user == null){
|
|
if(user == null){
|
|
@@ -71,6 +81,10 @@ public class FusionService implements IFusionService {
|
|
resourceList = Collections.singletonList(3);
|
|
resourceList = Collections.singletonList(3);
|
|
}else if(param.getType()!=null && param.getType() == 4){
|
|
}else if(param.getType()!=null && param.getType() == 4){
|
|
resourceList = Collections.singletonList(4);
|
|
resourceList = Collections.singletonList(4);
|
|
|
|
+ }else if(param.getType() !=null && param.getType() == 6){
|
|
|
|
+ resourceList = Collections.singletonList(5);
|
|
|
|
+ }
|
|
|
|
+ if(param.getType() !=null && (param.getType() == 4 || param.getType() == 6 )){
|
|
List<ScenePlusExt> plusExtList = scenePlusExtService.getSsObj();
|
|
List<ScenePlusExt> plusExtList = scenePlusExtService.getSsObj();
|
|
List<Long> plusIds = plusExtList.stream().map(ScenePlusExt::getPlusId).collect(Collectors.toList());
|
|
List<Long> plusIds = plusExtList.stream().map(ScenePlusExt::getPlusId).collect(Collectors.toList());
|
|
if(plusIds.size() >0){
|
|
if(plusIds.size() >0){
|
|
@@ -104,6 +118,7 @@ public class FusionService implements IFusionService {
|
|
HashMap<Long, ScenePlusExt> extMap = scenePlusExtService.getByPlusIds(plusIds);
|
|
HashMap<Long, ScenePlusExt> extMap = scenePlusExtService.getByPlusIds(plusIds);
|
|
HashMap<Long, ScenePlusVoid> voidMap = scenePlusVoidService.getByPlusIds(plusIds);
|
|
HashMap<Long, ScenePlusVoid> voidMap = scenePlusVoidService.getByPlusIds(plusIds);
|
|
HashMap<Long, Camera> cameraMap = cameraService.getByIds(cameraIds);
|
|
HashMap<Long, Camera> cameraMap = cameraService.getByIds(cameraIds);
|
|
|
|
+ HashMap<Long, User> userMap = userService.getByIds(page.getRecords().stream().map(ScenePlus::getUserId).collect(Collectors.toList()));
|
|
for (ScenePlus record : page.getRecords()) {
|
|
for (ScenePlus record : page.getRecords()) {
|
|
ScenePlusVo scenePlusVo = new ScenePlusVo();
|
|
ScenePlusVo scenePlusVo = new ScenePlusVo();
|
|
BeanUtils.copyProperties(record,scenePlusVo);
|
|
BeanUtils.copyProperties(record,scenePlusVo);
|
|
@@ -112,6 +127,7 @@ public class FusionService implements IFusionService {
|
|
scenePlusVo.setSnCode(snCode);
|
|
scenePlusVo.setSnCode(snCode);
|
|
scenePlusVo.setSceneType(param.getType());
|
|
scenePlusVo.setSceneType(param.getType());
|
|
scenePlusVo.setPlusVoid(voidMap.get(record.getId()));
|
|
scenePlusVo.setPlusVoid(voidMap.get(record.getId()));
|
|
|
|
+ scenePlusVo.setPhone(userMap.get(record.getUserId()) == null ?null : userMap.get(record.getUserId()).getUserName());
|
|
list.add(scenePlusVo);
|
|
list.add(scenePlusVo);
|
|
}
|
|
}
|
|
Page<ScenePlusVo> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
|
|
Page<ScenePlusVo> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
|