Commit f22e948f authored by renjie's avatar renjie

分配店铺bug

parent 80bc3a4c
......@@ -264,7 +264,10 @@ public class ShopServiceImpl implements ShopService {
throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST);
for (Account ac : accounts) {
if (ac.getParent() == null || !ac.getParent().equals(username))
{
throw new ClientRequestException(AccountErrorCode.NOPERMISSION);
}
}
shops.stream().forEach(shop -> {
try {
......@@ -407,7 +410,7 @@ public class ShopServiceImpl implements ShopService {
throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST);
if (account.getParent() != null)
throw new ClientRequestException(AccountErrorCode.NOPERMISSION);
List<String> shopUsers = userShopRepository.findByShopId(shopId).stream().map(x -> x.getUsername()).filter(x -> x!=username).collect(Collectors.toList());
List<String> shopUsers = userShopRepository.findByShopId(shopId).stream().map(x -> x.getUsername()).filter(x -> x==username).collect(Collectors.toList());
return shopUsers;
}
}
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