|
|
@@ -55,28 +55,28 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
public class AssetService {
|
|
|
|
|
|
- private AssetRepo assetRepo;
|
|
|
- private UserRepo userRepo;
|
|
|
- private CollectionRepo collectionRepo;
|
|
|
- private OrderRepo orderRepo;
|
|
|
- private TokenHistoryRepo tokenHistoryRepo;
|
|
|
- private SysConfigService sysConfigService;
|
|
|
- private RocketMQTemplate rocketMQTemplate;
|
|
|
- private GeneralProperties generalProperties;
|
|
|
- private ShowroomRepo showroomRepo;
|
|
|
- private ShowCollectionRepo showCollectionRepo;
|
|
|
+ private AssetRepo assetRepo;
|
|
|
+ private UserRepo userRepo;
|
|
|
+ private CollectionRepo collectionRepo;
|
|
|
+ private OrderRepo orderRepo;
|
|
|
+ private TokenHistoryRepo tokenHistoryRepo;
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+ private RocketMQTemplate rocketMQTemplate;
|
|
|
+ private GeneralProperties generalProperties;
|
|
|
+ private ShowroomRepo showroomRepo;
|
|
|
+ private ShowCollectionRepo showCollectionRepo;
|
|
|
private CollectionPrivilegeRepo collectionPrivilegeRepo;
|
|
|
- private PasswordEncoder passwordEncoder;
|
|
|
- private MintActivityRepo mintActivityRepo;
|
|
|
- private DestroyRecordRepo destroyRecordRepo;
|
|
|
- private AirDropService airDropService;
|
|
|
- private HCChainService hcChainService;
|
|
|
- private RockRecordService rockRecordService;
|
|
|
- private RockRecordRepo rockRecordRepo;
|
|
|
- private AssetLockRepo assetLockRepo;
|
|
|
- private UserBalanceService userBalanceService;
|
|
|
- private PhotoAssetRepo photoAssetRepo;
|
|
|
- private NumberSeqRepo numberSeqRepo;
|
|
|
+ private PasswordEncoder passwordEncoder;
|
|
|
+ private MintActivityRepo mintActivityRepo;
|
|
|
+ private DestroyRecordRepo destroyRecordRepo;
|
|
|
+ private AirDropService airDropService;
|
|
|
+ private HCChainService hcChainService;
|
|
|
+ private RockRecordService rockRecordService;
|
|
|
+ private RockRecordRepo rockRecordRepo;
|
|
|
+ private AssetLockRepo assetLockRepo;
|
|
|
+ private UserBalanceService userBalanceService;
|
|
|
+ private PhotoAssetRepo photoAssetRepo;
|
|
|
+ private NumberSeqRepo numberSeqRepo;
|
|
|
|
|
|
public Page<Asset> all(PageQuery pageQuery) {
|
|
|
|
|
|
@@ -264,7 +264,11 @@ public class AssetService {
|
|
|
asset.setNumber(number);
|
|
|
asset.setOrderId(orderId);
|
|
|
asset.setPrice(price);
|
|
|
- asset.setPrefixName("RID");
|
|
|
+ if (domainOrder.getPicName().length() < 6) {
|
|
|
+ asset.setPrefixName("RID" + domainOrder.getPicName().length());
|
|
|
+ } else {
|
|
|
+ asset.setPrefixName("RID");
|
|
|
+ }
|
|
|
asset.setTags(new HashSet<>());
|
|
|
User fakeUser = null;
|
|
|
if (safeFlag) {
|
|
|
@@ -479,7 +483,7 @@ public class AssetService {
|
|
|
throw new BusinessException("星图藏品不可寄售");
|
|
|
}
|
|
|
|
|
|
- if (asset.getType().equals(CollectionType.DOMAIN)) {
|
|
|
+ if (!sysConfigService.getBoolean("domain_transfer")) {
|
|
|
throw new BusinessException("域名暂不可以寄售");
|
|
|
}
|
|
|
|
|
|
@@ -494,22 +498,24 @@ public class AssetService {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- int holdDays;
|
|
|
- if (asset.getSource() == AssetSource.GIFT) {
|
|
|
- LocalDateTime localDateTime = asset.getCreatedAt();
|
|
|
- LocalDateTime gift_change_time = LocalDateTime
|
|
|
- .parse(sysConfigService.getString("gift_change_time"), DateTimeFormatter
|
|
|
- .ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- if (localDateTime.compareTo(gift_change_time) < 0) {
|
|
|
- holdDays = 20;
|
|
|
- } else {
|
|
|
- holdDays = sysConfigService.getInt("gift_days");
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (ObjectUtils.isEmpty(asset.getHoldDays())) {
|
|
|
- holdDays = sysConfigService.getInt("hold_days");
|
|
|
+ int holdDays = 0;
|
|
|
+ if (!asset.getType().equals(CollectionType.DOMAIN)) {
|
|
|
+ if (asset.getSource() == AssetSource.GIFT) {
|
|
|
+ LocalDateTime localDateTime = asset.getCreatedAt();
|
|
|
+ LocalDateTime gift_change_time = LocalDateTime
|
|
|
+ .parse(sysConfigService.getString("gift_change_time"), DateTimeFormatter
|
|
|
+ .ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ if (localDateTime.compareTo(gift_change_time) < 0) {
|
|
|
+ holdDays = 20;
|
|
|
+ } else {
|
|
|
+ holdDays = sysConfigService.getInt("gift_days");
|
|
|
+ }
|
|
|
} else {
|
|
|
- holdDays = asset.getHoldDays();
|
|
|
+ if (ObjectUtils.isEmpty(asset.getHoldDays())) {
|
|
|
+ holdDays = sysConfigService.getInt("hold_days");
|
|
|
+ } else {
|
|
|
+ holdDays = asset.getHoldDays();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (holdDays == 0 && AssetSource.OFFICIAL.equals(asset.getSource())) {
|
|
|
@@ -596,6 +602,9 @@ public class AssetService {
|
|
|
.prefixName(asset.getPrefixName())
|
|
|
.companyId(asset.getCompanyId())
|
|
|
.build();
|
|
|
+ if (asset.getType().equals(CollectionType.DOMAIN)) {
|
|
|
+ collection.setType(CollectionType.DOMAIN);
|
|
|
+ }
|
|
|
if (asset.getTags() != null) {
|
|
|
collection.getTags().addAll(asset.getTags());
|
|
|
}
|
|
|
@@ -735,6 +744,7 @@ public class AssetService {
|
|
|
newAsset.setPublicShow(false);
|
|
|
newAsset.setConsignment(false);
|
|
|
newAsset.setPublicCollectionId(null);
|
|
|
+ asset.setTags(new HashSet<>());
|
|
|
newAsset.setStatus(AssetStatus.NORMAL);
|
|
|
newAsset.setPrice(price);
|
|
|
newAsset.setSellPrice(null);
|
|
|
@@ -742,9 +752,14 @@ public class AssetService {
|
|
|
newAsset.setOasisId(asset.getOasisId());
|
|
|
newAsset.setFromAssetId(asset.getId());
|
|
|
newAsset.setType(CollectionType.DEFAULT);
|
|
|
+ if (asset.getType() == CollectionType.DOMAIN) {
|
|
|
+ newAsset.setType(CollectionType.DOMAIN);
|
|
|
+ }
|
|
|
|
|
|
newAsset.setSource(TransferReason.GIFT == reason ? AssetSource.GIFT : AssetSource.TRANSFER);
|
|
|
- newAsset.setTags(new HashSet<>(asset.getTags()));
|
|
|
+ if (!newAsset.getType().equals(CollectionType.DOMAIN)) {
|
|
|
+ newAsset.setTags(new HashSet<>(asset.getTags()));
|
|
|
+ }
|
|
|
newAsset.setSafeFlag(safeFlag);
|
|
|
newAsset.setHoldDays(asset.getOldHoldDays());
|
|
|
if (asset.getType().equals(CollectionType.PICTURE)) {
|