|
|
@@ -1276,6 +1276,32 @@ public class AssetService {
|
|
|
return servicecharge;
|
|
|
}
|
|
|
|
|
|
+ public double getDomainServiceCharge(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("domain_discount");
|
|
|
+ JSONObject json = JSONObject.parseObject(discountCollection);
|
|
|
+ Set<String> keys = json.keySet();
|
|
|
+ List<Long> collectionIds = keys.stream().map(Long::parseLong).collect(Collectors.toList());
|
|
|
+ Set<Long> holdCollections = assetRepo.findDiscounts(userId, collectionIds);
|
|
|
+ double result = sysConfigService.getBigDecimal("domain_service_charge").doubleValue();
|
|
|
+ if (holdCollections.size() > 0) {
|
|
|
+ for (Long id : holdCollections) {
|
|
|
+ double discount = json.getDouble(id.toString());
|
|
|
+ if (discount < result) {
|
|
|
+ result = discount;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+// }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Async
|
|
|
public void hcChain() throws ExecutionException, InterruptedException {
|