修改通过手机号批量查uuid

parent a8eab854
...@@ -819,6 +819,31 @@ public class InnerController implements IBaseController { ...@@ -819,6 +819,31 @@ public class InnerController implements IBaseController {
return JsonResult.buildErrorStateResult("传入用户手机号不可为空", null); return JsonResult.buildErrorStateResult("传入用户手机号不可为空", null);
} }
/**
* 手机号批量查询uuid
* @param userPhones
* @return
*/
@RequestMapping("/uuid/findByPhones")
public JsonResult getUuidsByPhones(@RequestParam("userPhones") String userPhones) {
if (StringUtils.isBlank(userPhones)) {
return JsonResult.buildErrorStateResult("传入用户手机号不可为空", null);
}
List<String> phones = JSONObject.parseObject(userPhones, new TypeReference<List<String>>() {
});
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(phones)) {
if (!(phones.size() > 500)) {
List<User> users = userService.findByPhones(phones);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(users)) {
return JsonResult.buildSuccessResult(null, users.stream().collect(Collectors.toMap(User::getPhoneNo, User::getUuid)));
} else {
return JsonResult.buildSuccessResult(null, null);
}
}
return JsonResult.buildErrorStateResult("uuid单次批量查询不可超过500个手机号", null);
}
return JsonResult.buildErrorStateResult("uuid批量传入用户手机号不可为空", null);
}
/** /**
* 重置密码接口,供内部人员使用(例如绝影) * 重置密码接口,供内部人员使用(例如绝影)
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment