|
|
@@ -927,16 +927,16 @@ 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),
|
|
|
- // 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),
|
|
|
+ // and has some tagId
|
|
|
+ root.join("tags").get("id").in(tags.stream().map(Tag::getId).toArray()))
|
|
|
.getRestriction(), pageable);
|
|
|
} else {
|
|
|
return assetRepo.findByUserIdAndStatusAndCompanyIdAndNameLike(userId, AssetStatus.NORMAL, companyId,
|
|
|
@@ -1093,6 +1093,25 @@ public class AssetService {
|
|
|
return royalties;
|
|
|
}
|
|
|
|
|
|
+ public double getServicecharge(double servicecharge, Long userId) {
|
|
|
+// if (servicecharge == 3) {
|
|
|
+// return 3;
|
|
|
+// }
|
|
|
+ LongArrayConverter converter = new LongArrayConverter();
|
|
|
+// String discountMinter = sysConfigService.getString("discount_minter");
|
|
|
+// List<Long> minterIds = converter.convertToEntityAttribute(discountMinter);
|
|
|
+// if (minterIds.contains(minterId)) {
|
|
|
+ String discountCollection = sysConfigService.getString("discount_charge");
|
|
|
+ List<Long> collectionIds = converter.convertToEntityAttribute(discountCollection);
|
|
|
+ Long assetId = assetRepo.findDiscount(userId, collectionIds);
|
|
|
+ if (ObjectUtils.isNotEmpty(assetId)) {
|
|
|
+ return 3;
|
|
|
+ }
|
|
|
+// }
|
|
|
+ return servicecharge;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Async
|
|
|
public void hcChain() throws ExecutionException, InterruptedException {
|
|
|
new ForkJoinPool(1000).submit(() -> {
|
|
|
@@ -1190,7 +1209,9 @@ public class AssetService {
|
|
|
metaPlayerRole.setType(UserHoldTypeEnum.ASSET);
|
|
|
metaPlayerRole.setAddress("https://www.raex.vip/9th/productSearch?search=" + metaPlayerRole
|
|
|
.getName() + "&source=TRANSFER");
|
|
|
- List<Asset> assets = assetRepo.findAllByUserIdAndStatusInAndNameLike(userId, Constants.META_NORMAL_STATUS, "%" + metaPlayerRole.getName() + "%");
|
|
|
+ List<Asset> assets = assetRepo
|
|
|
+ .findAllByUserIdAndStatusInAndNameLike(userId, Constants.META_NORMAL_STATUS, "%" + metaPlayerRole
|
|
|
+ .getName() + "%");
|
|
|
metaPlayerRole.setHold(CollectionUtils.isNotEmpty(assets));
|
|
|
});
|
|
|
return metaPlayerRoleList;
|