|
|
@@ -232,6 +232,19 @@ public class ContractService {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ if (SecurityUtils.getAuthenticatedUser().getCompanyId() != null) {
|
|
|
+ List<Long> storeIds = storeInfoRepo
|
|
|
+ .findAllByCompanyId(SecurityUtils.getAuthenticatedUser().getCompanyId()).stream()
|
|
|
+ .map(StoreInfo::getId).collect(Collectors.toList());
|
|
|
+ Set<Long> ids = contractStoreRepo.findAllByStoreIdIn(storeIds).stream()
|
|
|
+ .map(ContractStore::getContractId).collect(Collectors.toSet());
|
|
|
+ if (!ids.isEmpty()) {
|
|
|
+ predicates.add(root.get("id").in(ids));
|
|
|
+ } else {
|
|
|
+ predicates.add(criteriaBuilder.disjunction());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
if (pageQuery.getQuery().get("storeId") != null) {
|
|
|
Set<Long> ids = contractStoreRepo
|
|
|
.queryStoreContractIds(MapUtils.getLong(pageQuery.getQuery(), "storeId"));
|