|
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -43,17 +44,23 @@ public class LaserController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/getSnCodeByPhone",method = RequestMethod.GET)
|
|
|
public Result getSnCodeByUserName(@RequestParam(required = false)String phone) throws Exception {
|
|
|
- User userEntity = userService.getByUserName(phone);
|
|
|
- List<CameraAppVo> cameraAppVos = cameraDetailService.getListByUserAndType(userEntity.getId(), 10);//深时相机
|
|
|
- Set<String> collect = cameraAppVos.stream().map(CameraAppVo::getSnCode).collect(Collectors.toSet());
|
|
|
+ List<Long> userIds = userService.getLikeUserName(phone);
|
|
|
HashMap<String,Object> map = new HashMap<>();
|
|
|
+ Set<String> snCodeSet = new HashSet<>();
|
|
|
map.put("phone",phone);
|
|
|
- map.put("snCodes",collect);
|
|
|
+ map.put("snCodes",snCodeSet);
|
|
|
+ if(userIds.size() <=0){
|
|
|
+ return Result.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<CameraAppVo> camera = cameraDetailService.getListByUserIdsAndType(userIds, 10);
|
|
|
+ snCodeSet = camera.stream().map(CameraAppVo::getSnCode).collect(Collectors.toSet());
|
|
|
+ map.put("snCodes",snCodeSet);
|
|
|
return Result.success(map);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取场景数据 废弃
|
|
|
+ * 获取场景数据
|
|
|
*/
|
|
|
@RequestMapping(value = "/getSceneByNum",method = RequestMethod.GET)
|
|
|
public Result getSceneByNum(@RequestParam(required = false)String num) throws Exception {
|