mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
蓝牙桩分享
This commit is contained in:
@@ -499,7 +499,7 @@ public class PileService {
|
||||
// 使用stream把relationList转为map, key为type, value为List<PileMemberRelation>
|
||||
Map<String, List<PileMemberRelation>> map = relationList.stream().collect(Collectors.groupingBy(PileMemberRelation::getType));
|
||||
List<PileMemberRelation> adminMemberRelationList = map.get(Constants.ONE); // 管理员列表
|
||||
List<PileMemberRelation> userMemberRelations = map.get(Constants.TWO); // 普通用户列表
|
||||
|
||||
if (CollectionUtils.isEmpty(adminMemberRelationList)) {
|
||||
// 充电桩没有管理员
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_NO_ADMIN_FOR_PILE);
|
||||
@@ -512,7 +512,9 @@ public class PileService {
|
||||
// 如果不为空,说明被分享的用户是管理员,抛出异常
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_ALREADY_AN_ADMIN);
|
||||
}
|
||||
|
||||
List<String> userList = Lists.newArrayList();
|
||||
List<PileMemberRelation> userMemberRelations = map.get(Constants.TWO); // 普通用户列表
|
||||
if (CollectionUtils.isNotEmpty(userMemberRelations)) {
|
||||
userList = userMemberRelations.stream()
|
||||
.map(PileMemberRelation::getMemberId)
|
||||
|
||||
Reference in New Issue
Block a user