|
@@ -30,6 +30,7 @@ import com.fdkankan.ucenter.mapper.ISceneUpgradeMapper;
|
|
import com.fdkankan.ucenter.service.*;
|
|
import com.fdkankan.ucenter.service.*;
|
|
import com.fdkankan.ucenter.util.DateUserUtil;
|
|
import com.fdkankan.ucenter.util.DateUserUtil;
|
|
import com.fdkankan.ucenter.vo.ResponseScene;
|
|
import com.fdkankan.ucenter.vo.ResponseScene;
|
|
|
|
+import com.fdkankan.ucenter.vo.request.RequestScene;
|
|
import com.fdkankan.ucenter.vo.request.SceneParam;
|
|
import com.fdkankan.ucenter.vo.request.SceneParam;
|
|
import com.fdkankan.ucenter.vo.response.GroupByCount;
|
|
import com.fdkankan.ucenter.vo.response.GroupByCount;
|
|
import com.fdkankan.ucenter.vo.response.SceneInfoVo;
|
|
import com.fdkankan.ucenter.vo.response.SceneInfoVo;
|
|
@@ -44,6 +45,7 @@ import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
+import java.util.concurrent.locks.Condition;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -90,6 +92,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
@Autowired
|
|
@Autowired
|
|
private ICameraDetailService cameraDetailService;
|
|
private ICameraDetailService cameraDetailService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ ICameraService cameraService;
|
|
|
|
+ @Autowired
|
|
private IFolderService folderService;
|
|
private IFolderService folderService;
|
|
@Autowired
|
|
@Autowired
|
|
private IFolderSceneService folderSceneService;
|
|
private IFolderSceneService folderSceneService;
|
|
@@ -402,12 +406,33 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Object getScenes(String username, SceneParam param) {
|
|
|
|
- param.setHasFolder(0);
|
|
|
|
- if(StringUtils.isNotBlank(param.getSearchKey())){
|
|
|
|
- param.setSceneName(param.getSearchKey());
|
|
|
|
|
|
+ public Object getScenes(String username, RequestScene param) {
|
|
|
|
+ User user = userService.getByUserName(username);
|
|
|
|
+ String cameraId = null;
|
|
|
|
+ String nums = null;
|
|
|
|
+ log.info("搜索条件是:"+ param.getSearchKey());
|
|
|
|
+ //type为12表示一键换装的请求,不查询相机数据
|
|
|
|
+ if(StringUtils.isNotEmpty(param.getSearchKey()) && !"11".equals(param.getType())){
|
|
|
|
+ List<Camera> cameraEntityList = cameraService.findLikeChildName(param.getSearchKey());
|
|
|
|
+ cameraId = cameraEntityList.parallelStream().map(entity->"'"+entity.getId()+"'").collect(Collectors.joining(","));
|
|
|
|
+ List<Long> userIds = userService.getLikeUserName(param.getSearchKey());
|
|
|
|
+ if(userIds.size() > 0){
|
|
|
|
+ List<String> cooperationList = sceneCooperationService.getNumByUserIds(userIds);
|
|
|
|
+ param.setNumList(cooperationList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ param.setUserId(user.getId());
|
|
|
|
+ Page<SceneVo> sceneList = sceneService.getSceneList(param);
|
|
|
|
+ for (SceneVo record : sceneList.getRecords()) {
|
|
|
|
+ record.setUserName(username);
|
|
|
|
+ SceneCooperation sceneCooperationEntity = sceneCooperationService.getByNum(record.getNum());
|
|
|
|
+ if(sceneCooperationEntity != null){
|
|
|
|
+ record.setCooperationUserId(String.valueOf(sceneCooperationEntity.getUserId()));
|
|
|
|
+ User user1 = userService.getById(sceneCooperationEntity.getUserId());
|
|
|
|
+ record.setCooperationUserName(user1.getUserName());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return this.newList(param,username);
|
|
|
|
|
|
+ return PageInfo.PageInfo(sceneList);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|