|
@@ -15,10 +15,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
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.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -43,7 +40,8 @@ public class LaserController extends BaseController {
|
|
|
* 根据手机号码获取 相机 sncode
|
|
|
*/
|
|
|
@RequestMapping(value = "/getSnCodeByPhone",method = RequestMethod.GET)
|
|
|
- public Result getSnCodeByUserName(@RequestParam(required = false)String phone) throws Exception {
|
|
|
+ public Result getSnCodeByUserName(@RequestParam(required = false)String phone,
|
|
|
+ @RequestParam(required = false)Integer sceneSource) throws Exception {
|
|
|
List<Long> userIds = userService.getLikeUserName(phone);
|
|
|
HashMap<String,Object> map = new HashMap<>();
|
|
|
Set<String> snCodeSet = new HashSet<>();
|
|
@@ -52,10 +50,17 @@ public class LaserController extends BaseController {
|
|
|
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);
|
|
|
+ List<CameraAppVo> camera = new ArrayList<>();
|
|
|
+ if(sceneSource == 4){
|
|
|
+ camera = cameraDetailService.getListByUserIdsAndType(userIds, 10);
|
|
|
+ }
|
|
|
+ if(sceneSource == 5){
|
|
|
+ camera = cameraDetailService.getListByUserIdsAndType(userIds, 11);
|
|
|
+ }
|
|
|
+ if(camera.size() >0){
|
|
|
+ snCodeSet = camera.stream().map(CameraAppVo::getSnCode).collect(Collectors.toSet());
|
|
|
+ map.put("snCodes",snCodeSet);
|
|
|
+ }
|
|
|
return Result.success(map);
|
|
|
}
|
|
|
|