|
|
@@ -15,6 +15,7 @@ import com.izouma.nineth.dto.*;
|
|
|
import com.izouma.nineth.enums.*;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.*;
|
|
|
+import com.izouma.nineth.repo.nftdomain.DomainAskRepo;
|
|
|
import com.izouma.nineth.utils.JpaUtils;
|
|
|
import com.izouma.nineth.utils.SecurityUtils;
|
|
|
import com.izouma.nineth.utils.TokenUtils;
|
|
|
@@ -80,6 +81,7 @@ public class AssetService {
|
|
|
private UserBalanceService userBalanceService;
|
|
|
private PhotoAssetRepo photoAssetRepo;
|
|
|
private NumberSeqRepo numberSeqRepo;
|
|
|
+ private DomainAskRepo domainAskRepo;
|
|
|
|
|
|
public Page<Asset> all(PageQuery pageQuery) {
|
|
|
|
|
|
@@ -495,6 +497,12 @@ public class AssetService {
|
|
|
|
|
|
public synchronized void consignment(Long id, BigDecimal price, String tradeCode, boolean safeFlag) {
|
|
|
Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
+ Set<DomainAskStatus> statuses = new HashSet<>();
|
|
|
+ statuses.add(DomainAskStatus.ASKING);
|
|
|
+ if (domainAskRepo
|
|
|
+ .countByAssetIdAndOwnerIdAndStatusInAndDelFalse(asset.getId(), asset.getOwnerId(), statuses) > 0) {
|
|
|
+ throw new BusinessException("已有叫价,不可上架");
|
|
|
+ }
|
|
|
String mapString = sysConfigService.getString("collection_price");
|
|
|
if (StringUtils.isNotBlank(mapString)) {
|
|
|
JSONObject json = JSONObject.parseObject(mapString);
|