|
@@ -53,7 +53,7 @@ public class DomainOrderService {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public DomainOrder create(Long userId, String domain, BigDecimal price) {
|
|
|
|
|
|
|
+ public DomainOrder create(Long userId, String domain, BigDecimal price, Long year) {
|
|
|
List<DomainOrder> notPaidOrders = domainOrderRepo.findAllByUserIdAndOrderStatus(userId, OrderStatus.NOT_PAID);
|
|
List<DomainOrder> notPaidOrders = domainOrderRepo.findAllByUserIdAndOrderStatus(userId, OrderStatus.NOT_PAID);
|
|
|
Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
|
|
Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
|
|
|
if (!superUserId.equals(SecurityUtils.getAuthenticatedUser().getId())) {
|
|
if (!superUserId.equals(SecurityUtils.getAuthenticatedUser().getId())) {
|
|
@@ -71,9 +71,9 @@ public class DomainOrderService {
|
|
|
if (!(Boolean) checkResult.get("result")) {
|
|
if (!(Boolean) checkResult.get("result")) {
|
|
|
throw new BusinessException(checkResult.get("reason").toString());
|
|
throw new BusinessException(checkResult.get("reason").toString());
|
|
|
}
|
|
}
|
|
|
- if (price.compareTo(BigDecimal.valueOf(40L)) != 0) {
|
|
|
|
|
- throw new BusinessException("订单价格与配置不符,请重新下单.");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (price.compareTo(BigDecimal.valueOf(40L)) != 0) {
|
|
|
|
|
+// throw new BusinessException("订单价格与配置不符,请重新下单.");
|
|
|
|
|
+// }
|
|
|
User user = userRepo.findById(userId).orElseThrow(new BusinessException("未找到用户"));
|
|
User user = userRepo.findById(userId).orElseThrow(new BusinessException("未找到用户"));
|
|
|
if (domain.contains(".")) {
|
|
if (domain.contains(".")) {
|
|
|
int dotIndex = domain.indexOf(".");
|
|
int dotIndex = domain.indexOf(".");
|
|
@@ -88,6 +88,7 @@ public class DomainOrderService {
|
|
|
domainOrder.setPicName(domain);
|
|
domainOrder.setPicName(domain);
|
|
|
domainOrder.setPrice(price);
|
|
domainOrder.setPrice(price);
|
|
|
domainOrder.setDomainName(domain + ".nft");
|
|
domainOrder.setDomainName(domain + ".nft");
|
|
|
|
|
+ domainOrder.setYears(year);
|
|
|
domainOrder.setStatus(CollectionStatus.PENDING);
|
|
domainOrder.setStatus(CollectionStatus.PENDING);
|
|
|
domainOrder.setOrderStatus(OrderStatus.NOT_PAID);
|
|
domainOrder.setOrderStatus(OrderStatus.NOT_PAID);
|
|
|
domainOrder.setUserId(user.getId());
|
|
domainOrder.setUserId(user.getId());
|