|
|
@@ -757,7 +757,6 @@ public class AssetService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
asset.setConsignment(false);
|
|
|
assetRepo.saveAndFlush(asset);
|
|
|
}
|
|
|
@@ -856,7 +855,26 @@ public class AssetService {
|
|
|
domainOrder.setHyperLinkType(null);
|
|
|
domainOrder.setAddress(null);
|
|
|
domainOrder.setCurrentOwnerId(null);
|
|
|
-
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //铸造清除超链
|
|
|
+ if (asset.getPublicCollectionId() != null) {
|
|
|
+ List<DomainOrder> filteredDomainOrders = domainOrderRepo.findAllByHyperLinkType(HyperLinkType.COLLECTION);
|
|
|
+ for (DomainOrder filteredDomainOrder : filteredDomainOrders) {
|
|
|
+ String url = filteredDomainOrder.getAddress();
|
|
|
+ int secondSlashIndex = url.indexOf('/', url.indexOf('/') + 1);
|
|
|
+ if (url.length() > secondSlashIndex + 1) {
|
|
|
+ String secondNumber = url.substring(secondSlashIndex + 1);
|
|
|
+ if (!secondNumber.isBlank()) {
|
|
|
+ if (asset.getPublicCollectionId() != null && asset.getPublicCollectionId().equals(Long.parseLong(secondNumber))) {
|
|
|
+ filteredDomainOrder.setOpenHyperLink(false);
|
|
|
+ filteredDomainOrder.setHyperLinkType(null);
|
|
|
+ filteredDomainOrder.setAddress(null);
|
|
|
+ filteredDomainOrder.setCurrentOwnerId(null);
|
|
|
+ domainOrderRepo.save(filteredDomainOrder);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -1178,18 +1196,18 @@ public class AssetService {
|
|
|
if (tags.isEmpty()) return new PageImpl<>(Collections.emptyList());
|
|
|
return assetRepo.findAll((Specification<Asset>) (root, query, criteriaBuilder) ->
|
|
|
query.distinct(true).where(
|
|
|
- // where userId=some id
|
|
|
- criteriaBuilder.equal(root.get("userId"), userId),
|
|
|
- // and (lockTo is null or (lockTo is not null and lockTo < now))
|
|
|
- criteriaBuilder.or(criteriaBuilder.isNull(root.get("lockTo")),
|
|
|
- criteriaBuilder.and(criteriaBuilder.isNotNull(root.get("lockTo")),
|
|
|
- criteriaBuilder.lessThan(root.get("lockTo"), LocalDateTime.now()))),
|
|
|
- // and status = 'NORMAL'
|
|
|
- criteriaBuilder.equal(root.get("status"), AssetStatus.NORMAL),
|
|
|
-
|
|
|
- criteriaBuilder.equal(root.get("consignment"), false),
|
|
|
- // and has some tagId
|
|
|
- root.join("tags").get("id").in(tags.stream().map(Tag::getId).toArray()))
|
|
|
+ // where userId=some id
|
|
|
+ criteriaBuilder.equal(root.get("userId"), userId),
|
|
|
+ // and (lockTo is null or (lockTo is not null and lockTo < now))
|
|
|
+ criteriaBuilder.or(criteriaBuilder.isNull(root.get("lockTo")),
|
|
|
+ criteriaBuilder.and(criteriaBuilder.isNotNull(root.get("lockTo")),
|
|
|
+ criteriaBuilder.lessThan(root.get("lockTo"), LocalDateTime.now()))),
|
|
|
+ // and status = 'NORMAL'
|
|
|
+ criteriaBuilder.equal(root.get("status"), AssetStatus.NORMAL),
|
|
|
+
|
|
|
+ criteriaBuilder.equal(root.get("consignment"), false),
|
|
|
+ // and has some tagId
|
|
|
+ root.join("tags").get("id").in(tags.stream().map(Tag::getId).toArray()))
|
|
|
.getRestriction(), pageable);
|
|
|
} else {
|
|
|
return assetRepo
|