Commit 1ee52a4d authored by jim's avatar jim

log

parent b89daafd
...@@ -379,7 +379,7 @@ public class ShopServiceImpl implements ShopService { ...@@ -379,7 +379,7 @@ public class ShopServiceImpl implements ShopService {
.map(UserShop::getShopId).collect(Collectors.toList()); .map(UserShop::getShopId).collect(Collectors.toList());
} }
List<String> shopIds = null; List<String> shopIds = new ArrayList<>();
if (shopFilterDto.getBindIp() == 0) { if (shopFilterDto.getBindIp() == 0) {
shopIds = allIds; shopIds = allIds;
...@@ -400,7 +400,7 @@ public class ShopServiceImpl implements ShopService { ...@@ -400,7 +400,7 @@ public class ShopServiceImpl implements ShopService {
} }
} }
amount = amount > 100 ? 100 : amount; amount = Math.min(amount, 100);
Pageable pageable = PageRequest.of(pageNum, amount); Pageable pageable = PageRequest.of(pageNum, amount);
// 根据商铺ids 与 过滤条件 得到商铺 // 根据商铺ids 与 过滤条件 得到商铺
Page<Shop> shops = getShopsByFilter(shopFilterDto, shopIds, pageable); Page<Shop> shops = getShopsByFilter(shopFilterDto, shopIds, pageable);
...@@ -408,7 +408,7 @@ public class ShopServiceImpl implements ShopService { ...@@ -408,7 +408,7 @@ public class ShopServiceImpl implements ShopService {
ShopPageResultDto<ShopResultDto> shopPageResultDto = new ShopPageResultDto<>(); ShopPageResultDto<ShopResultDto> shopPageResultDto = new ShopPageResultDto<>();
if (shops != null && shops.getNumberOfElements() >= 1) { if (shops != null && shops.getNumberOfElements() >= 1) {
List<ShopResultDto> shopResultDtos = new ArrayList<>(); List<ShopResultDto> shopResultDtos = new ArrayList<>();
shops.getContent().stream().forEach( shops.getContent().forEach(
x -> { x -> {
IpResource ipResource = ipResourceRepository.findFirstByShopIdsIsAndIsDeleted(x.getShopId(), false); IpResource ipResource = ipResourceRepository.findFirstByShopIdsIsAndIsDeleted(x.getShopId(), false);
// 如果 ip资源非空 且 addr 也非空 // 如果 ip资源非空 且 addr 也非空
...@@ -476,7 +476,6 @@ public class ShopServiceImpl implements ShopService { ...@@ -476,7 +476,6 @@ public class ShopServiceImpl implements ShopService {
public ShopSummary getShopSummary(String username) { public ShopSummary getShopSummary(String username) {
Account account = accountRepository.findByName(username).orElseThrow(() -> new ClientRequestException(AccountErrorCode.NAMENOTEXIST)); Account account = accountRepository.findByName(username).orElseThrow(() -> new ClientRequestException(AccountErrorCode.NAMENOTEXIST));
ShopSummary shopSummary = new ShopSummary(); ShopSummary shopSummary = new ShopSummary();
List<String> allShopIds = userShopRepository.findByUsername(username).stream() List<String> allShopIds = userShopRepository.findByUsername(username).stream()
.map(UserShop::getShopId).collect(Collectors.toList()); .map(UserShop::getShopId).collect(Collectors.toList());
......
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