Pārlūkot izejas kodu

Merge branch 'master' of http://git.izouma.com/xiongzhu/raex_back into dev-meta

sunkean 3 gadi atpakaļ
vecāks
revīzija
228f576d12

+ 1 - 1
src/main/java/com/izouma/nineth/domain/Asset.java

@@ -346,7 +346,7 @@ public class Asset extends CollectionBaseEntity {
                 .minter(user.getNickname())
                 .minterId(user.getId())
                 .minterAvatar(user.getAvatar())
-                .name("元域名:" + domainOrder.getDomainName())
+                .name("RID元宇宙域名 " + domainOrder.getDomainName())
                 .pic(domainOrder.getPic())
                 .model3d(null)
                 .category("元域名")

+ 6 - 0
src/main/java/com/izouma/nineth/domain/TradeAuctionOrder.java

@@ -112,4 +112,10 @@ public class TradeAuctionOrder extends BaseEntity {
     private TradeAuctionStatus tradeAuctionStatus;
 
     private Long invitor;
+
+    private String invitorPhone;
+
+    private String invitorParentPhone;
+
+    private Long parentInvitor;
 }

+ 5 - 1
src/main/java/com/izouma/nineth/repo/DomainOrderRepo.java

@@ -4,6 +4,8 @@ import com.izouma.nineth.domain.DomainOrder;
 import com.izouma.nineth.enums.CollectionStatus;
 import com.izouma.nineth.enums.OrderStatus;
 import com.izouma.nineth.service.LikeService;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
@@ -21,10 +23,12 @@ public interface DomainOrderRepo extends JpaRepository<DomainOrder, Long>, JpaSp
 
     List<DomainOrder> findAllByUserIdAndOrderStatus(Long userId, OrderStatus status);
 
+    List<DomainOrder> findAllByPicNameInAndOrderStatus(List<String> strings, OrderStatus status);
+
     Integer countAllByDomainNameEqualsAndOrderStatusNot(String name, OrderStatus status);
 
     @Query(value = "select c from DomainOrder c where c.picName like ?1 and c.orderStatus <> ?2")
-    List<DomainOrder> searchUsedDomain(String name, OrderStatus status);
+    Page<DomainOrder> searchUsedDomain(String name, OrderStatus status, Pageable pageable);
 
     List<DomainOrder> findByOrderStatusAndCreatedAtBeforeAndDelFalse(OrderStatus orderStatus, LocalDateTime createdAt);
 }

+ 1 - 1
src/main/java/com/izouma/nineth/service/AssetService.java

@@ -264,7 +264,7 @@ public class AssetService {
         asset.setNumber(number);
         asset.setOrderId(orderId);
         asset.setPrice(price);
-        asset.setPrefixName("元域名");
+        asset.setPrefixName("RID");
         asset.setTags(new HashSet<>());
         User fakeUser = null;
         if (safeFlag) {

+ 96 - 26
src/main/java/com/izouma/nineth/service/DomainOrderService.java

@@ -20,6 +20,9 @@ import lombok.AllArgsConstructor;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.springframework.data.annotation.Transient;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Service;
 
 import javax.imageio.ImageIO;
@@ -69,28 +72,42 @@ public class DomainOrderService {
     public DomainOrder create(Long userId, String domain, BigDecimal price, Long year) {
         List<DomainOrder> notPaidOrders = domainOrderRepo.findAllByUserIdAndOrderStatus(userId, OrderStatus.NOT_PAID);
         Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
+        if (notPaidOrders.size() > 0) {
+            throw new BusinessException("已存在未支付订单,不可继续下单");
+        }
+        if (domain.contains(".uni")) {
+            throw new BusinessException("域名后缀不符合规定.");
+        }
         if (!superUserId.equals(SecurityUtils.getAuthenticatedUser().getId())) {
             if (isContainChinese(domain)) {
                 throw new BusinessException("禁止注册中文域名");
             }
-            if (notPaidOrders.size() > 0) {
-                throw new BusinessException("已存在未支付订单,不可继续下单");
-            }
             if (domain.length() < 9) {
                 throw new BusinessException("四位及以下域名只能官方创建。");
             }
         }
-        Map<String, Object> checkResult = check(domain);
+        String realName;
+        int dotIndex = domain.indexOf(".");
+        realName = domain.substring(0, dotIndex);
+        Map<String, Object> checkResult = check(realName);
         if (!(Boolean) checkResult.get("result")) {
             throw new BusinessException(checkResult.get("reason").toString());
         }
+        BigDecimal singlePrice = sysConfigService.getBigDecimal("domain_price");
+        if (singlePrice.multiply(BigDecimal.valueOf(year)).compareTo(price) != 0) {
+            throw new BusinessException("价格不符");
+        }
+//        LocalDateTime startTime = LocalDateTime.of(2023, 2, 10, 17, 0, 0);
+//        if (LocalDateTime.now().isBefore(startTime)) {
+//            throw new BusinessException("时间不符");
+//        }
 //        if (price.compareTo(BigDecimal.valueOf(40L)) != 0) {
 //            throw new BusinessException("订单价格与配置不符,请重新下单.");
 //        }
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("未找到用户"));
         if (domain.contains(".")) {
-            int dotIndex = domain.indexOf(".");
-            domain = domain.substring(0, dotIndex);
+            int dotIndex1 = domain.indexOf(".");
+            domain = domain.substring(0, dotIndex1);
         }
 
         DomainOrder domainOrder = new DomainOrder();
@@ -108,11 +125,18 @@ public class DomainOrderService {
     }
 
     public Map<String, Object> check(String domain) {
+        Map<String, Object> result = new HashMap<>();
         Long superUserId = Long.valueOf(sysConfigService.getString("domain_superUserId"));
-        String visibleDomain = domain + ".nft";
+        String visibleDomain = domain;
+        if (domain.contains(".uni")) {
+            result.put("result", false);
+            result.put("reason", "禁止使用.uni");
+            return result;
+        }
+        if (!domain.contains(".nft")) {
+            visibleDomain = domain + ".nft";
+        }
         List<String> keywords = Arrays.asList(sysConfigService.getString("domain_keyword").split(","));
-
-        Map<String, Object> result = new HashMap<>();
         if (!superUserId.equals(SecurityUtils.getAuthenticatedUser().getId())) {
             if (keywords.stream().anyMatch(keyword -> org.apache.commons.lang.StringUtils.equals(keyword, domain))) {
                 result.put("result", false);
@@ -147,7 +171,8 @@ public class DomainOrderService {
             int dotIndex = domain.indexOf(".");
             domain = domain.substring(0, dotIndex);
         }
-        List<DomainOrder> used = domainOrderRepo.searchUsedDomain("%" + domain + "%", OrderStatus.CANCELLED);
+        Pageable pageable = PageRequest.of(0, 10, Sort.by("createdAt").descending());
+        List<DomainOrder> used = domainOrderRepo.searchUsedDomain("%" + domain + "%", OrderStatus.CANCELLED,pageable).getContent();
 
         String n = domain.substring(domain.length() - 1);
         List<Map<String, Object>> recommend = new ArrayList<>();
@@ -171,9 +196,14 @@ public class DomainOrderService {
 
         used.forEach(domainOrder -> {
             Map<String, Object> sold = new HashMap<>();
-            sold.put("domain", domainOrder.getDomainName().toLowerCase());
-            sold.put("sold", true);
-            result.add(sold);
+            if (!domainOrder.getDomainName().contains(".uni")) {
+                sold.put("domain", domainOrder.getDomainName().toLowerCase());
+                sold.put("sold", true);
+                result.add(sold);
+            }
+            if (result.size() > 9) {
+
+            }
         });
         return result;
     }
@@ -220,12 +250,12 @@ public class DomainOrderService {
         String domainName;
         if (domain.contains(".")) {
             int dotIndex = domain.indexOf(".");
-            domainName = domain.substring(0, dotIndex);
+            domainName = domain.substring(0, dotIndex).toUpperCase();
         } else {
-            domainName = domain;
+            domainName = domain.toUpperCase();
         }
         InputStream is1 = this.getClass()
-                .getResourceAsStream("/font/Akronim Regular_mianfeiziti1.ttf");
+                .getResourceAsStream("/font/VonwaonBitmap_16pxLite.ttf");
         Font font1 = Font.createFont(Font.TRUETYPE_FONT, is1);
         is1.close();
         InputStream is2 = this.getClass()
@@ -262,17 +292,57 @@ public class DomainOrderService {
 //                ImageUtils.Fit.COVER), 40);
 //        g.drawImage(avatarImg, 334, 136, null);
 
-        g.setColor(new Color(255, 255, 255));
-        Font topFont = font1.deriveFont(Font.PLAIN, 240f);
 
-        Font downFont = font2.deriveFont(Font.BOLD, 36f);
-        ImageUtils.drawCenteredString(g, domainName, new Rectangle(0, 243, shareImg
-                .getWidth(), 86), topFont);
-        ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 462, shareImg
-                .getWidth(), 86), topFont);
-        g.setColor(new Color(255, 255, 255));
-        ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 612, shareImg
-                .getWidth(), 12), downFont);
+        int domainLength = domainName.length();
+        if (domainLength > 10) {
+            g.setColor(new Color(255, 255, 255));
+            Font topFont = font1.deriveFont(Font.PLAIN, 130f);
+            Font downFont = font2.deriveFont(Font.BOLD, 36f);
+            int subIndex = domainLength / 3;
+            String str1 = domainName.substring(0, subIndex);
+            String str2 = domainName.substring(subIndex, subIndex + subIndex);
+            String str3 = domainName.substring(subIndex + subIndex, domainLength);
+            ImageUtils.drawCenteredString(g, str1, new Rectangle(0, 180, shareImg
+                    .getWidth(), 86), topFont);
+            ImageUtils.drawCenteredString(g, str2, new Rectangle(0, 300, shareImg
+                    .getWidth(), 86), topFont);
+            ImageUtils.drawCenteredString(g, str3, new Rectangle(0, 420, shareImg
+                    .getWidth(), 86), topFont);
+            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 540, shareImg
+                    .getWidth(), 86), topFont);
+            g.setColor(new Color(255, 255, 255));
+            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 650, shareImg
+                    .getWidth(), 12), downFont);
+        }
+        if (domainLength > 5 & domainLength <= 10) {
+            g.setColor(new Color(255, 255, 255));
+            Font topFont = font1.deriveFont(Font.PLAIN, 190f);
+            Font downFont = font2.deriveFont(Font.BOLD, 36f);
+            int subIndex = domainLength / 2;
+            String str1 = domainName.substring(0, subIndex);
+            String str2 = domainName.substring(subIndex, domainLength);
+            ImageUtils.drawCenteredString(g, str1, new Rectangle(0, 180, shareImg
+                    .getWidth(), 86), topFont);
+            ImageUtils.drawCenteredString(g, str2, new Rectangle(0, 350, shareImg
+                    .getWidth(), 86), topFont);
+            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(0, 520, shareImg
+                    .getWidth(), 86), topFont);
+            g.setColor(new Color(255, 255, 255));
+            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 650, shareImg
+                    .getWidth(), 12), downFont);
+        }
+        if (domainLength <= 5) {
+            g.setColor(new Color(255, 255, 255));
+            Font topFont = font1.deriveFont(Font.PLAIN, 240f);
+            Font downFont = font2.deriveFont(Font.BOLD, 36f);
+            ImageUtils.drawCenteredString(g, domainName, new Rectangle(17, 220, shareImg
+                    .getWidth(), 86), topFont);
+            ImageUtils.drawCenteredString(g, ".NFT", new Rectangle(-10, 420, shareImg
+                    .getWidth(), 86), topFont);
+            g.setColor(new Color(255, 255, 255));
+            ImageUtils.drawCenteredString(g, domain, new Rectangle(0, 620, shareImg
+                    .getWidth(), 12), downFont);
+        }
 
         //二维码
 //        QRCodeWriter qrCodeWriter = new QRCodeWriter();

+ 5 - 5
src/main/java/com/izouma/nineth/service/OrderPayService.java

@@ -745,7 +745,7 @@ public class OrderPayService {
         }
         BalanceRecord record = userBalanceService
                 .balancePay(order.getUserId(), amount, orderId, "拍卖");
-        tradeAuctionOrderService.commission(order, amount);
+        tradeAuctionOrderService.commission(order, order.getPrice());
         tradeAuctionOrderService.notify(orderId, record.getId().toString(), PayMethod.BALANCE);
     }
 
@@ -880,7 +880,7 @@ public class OrderPayService {
                 return hmPayService.requestAlipay(orderId + "", order.getPrice(),
                         "域名:" + order.getPicName(), HMPayService.getTimeout(order.getCreatedAt(), 180),
                         Constants.OrderNotifyType.DOMAIN, generalProperties
-                                .resolveFrontUrl(getCompanyId(), "/orderDetail?id=" + orderId));
+                                .resolveFrontUrl(getCompanyId(), "/domainname"));
         }
         throw new BusinessException("绿洲宇宙冷却系统已启动,请稍后支付");
     }
@@ -903,7 +903,7 @@ public class OrderPayService {
                     + "&orderId=" + orderId + "&type=domain&returnUrl="
                     + URLEncoder
                     .encode(generalProperties
-                            .resolveFrontUrl(getCompanyId(), "/orderDetail?id=" + orderId), StandardCharsets.UTF_8);
+                            .resolveFrontUrl(getCompanyId(), "/domainname"), StandardCharsets.UTF_8);
         } else {
             return Constants.ALIPAY_URL_SCHEME + qrCode;
         }
@@ -920,7 +920,7 @@ public class OrderPayService {
                 .orElseThrow(new BusinessException("请先完成实名认证"));
         return sandPayService.payQuick(orderId + "", "域名:" + order.getPicName(),
                 order.getPrice(), order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.DOMAIN,
-                generalProperties.resolveFrontUrl(getCompanyId(), "/orderDetail?id=" + orderId));
+                generalProperties.resolveFrontUrl(getCompanyId(), "/domainname"));
     }
 
     @Cacheable(value = "payOrder", key = "'domain#'+#orderId")
@@ -934,7 +934,7 @@ public class OrderPayService {
                 .orElseThrow(new BusinessException("请先完成实名认证"));
         return sandPayService.payQuickBind(orderId + "", "域名:" + order.getPicName(),
                 order.getPrice(), order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.DOMAIN,
-                generalProperties.resolveFrontUrl(getCompanyId(), "/orderDetail?id=" + orderId),
+                generalProperties.resolveFrontUrl(getCompanyId(), "/domainname"),
                 order.getUserId(), identityAuth.getRealName(), identityAuth.getIdNo());
     }
 

+ 62 - 24
src/main/java/com/izouma/nineth/service/TradeAuctionOrderService.java

@@ -113,7 +113,15 @@ public class TradeAuctionOrderService {
 
         if (user.getInviteType() != null) {
             if (user.getInviteType().equals(InviteType.AUCTION)) {
-                tradeAuctionOrder.setInvitor(Long.valueOf(user.getInviteCode()));
+                tradeAuctionOrder.setInvitorPhone(user.getInvitorPhone());
+            }
+            User parentUser = userRepo.findByPhoneAndDelFalse(user.getInvitorPhone()).orElse(null);
+            if (parentUser != null) {
+                if (parentUser.getInviteType() != null) {
+                    if (parentUser.getInviteType().equals(InviteType.AUCTION)) {
+                        tradeAuctionOrder.setInvitorParentPhone(parentUser.getInvitorPhone());
+                    }
+                }
             }
         }
         tradeAuctionOrder = tradeAuctionOrderRepo.save(tradeAuctionOrder);
@@ -344,30 +352,60 @@ public class TradeAuctionOrderService {
     }
 
     public void commission(TradeAuctionOrder order, BigDecimal price) {
-        if (order.getInvitor() != null) {
-            userRepo.findById(order.getInvitor()).ifPresent(user -> {
-                BigDecimal shareRatio = sysConfigService.getBigDecimal("auction_commission_rate");
-                if (StringUtils.isNotBlank(user.getSettleAccountId()) &&
-                        shareRatio != null && shareRatio.compareTo(BigDecimal.ZERO) > 0) {
-                    commissionRecordRepo.save(CommissionRecord.builder()
-                            .orderId(order.getId())
-                            .collectionId(order.getTradeAuctionId())
-                            .name(order.getName())
-                            .totalPrice(price)
-                            .nickname(user.getNickname())
-                            .userId(user.getId())
-                            .shareRatio(user.getShareRatio())
-                            .phone(user.getPhone())
-                            .shareAmount(price.multiply(shareRatio)
-                                    .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP))
-                            .type(InviteType.AUCTION)
-                            .build());
+        List<String> officialPhones = Arrays.asList(sysConfigService.getString("ta_phone").split(","));
+        if (order.getInvitorPhone() != null) {
+            if (officialPhones.contains(order.getInvitorPhone())) {
+                userRepo.findByPhoneAndDelFalse(order.getInvitorPhone()).ifPresent(user -> {
+                    BigDecimal shareRatio = sysConfigService.getBigDecimal("auction_commission_rate");
+                    if (StringUtils.isNotBlank(user.getSettleAccountId()) &&
+                            shareRatio != null && shareRatio.compareTo(BigDecimal.ZERO) > 0) {
+                        commissionRecordRepo.save(CommissionRecord.builder()
+                                .orderId(order.getId())
+                                .collectionId(order.getTradeAuctionId())
+                                .name(order.getName())
+                                .totalPrice(price)
+                                .nickname(user.getNickname())
+                                .userId(user.getId())
+                                .shareRatio(user.getShareRatio())
+                                .phone(user.getPhone())
+                                .shareAmount(price.multiply(shareRatio)
+                                        .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP))
+                                .type(InviteType.AUCTION)
+                                .build());
 
-                    userBalanceService.addBalance(user.getId(), price.multiply(shareRatio)
-                            .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP), order
-                            .getId(), BalanceType.COMMISSION);
-                }
-            });
+                        userBalanceService.addBalance(user.getId(), price.multiply(shareRatio)
+                                .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP), order
+                                .getId(), BalanceType.COMMISSION);
+                    }
+                });
+            }
+        }
+        if (order.getInvitorParentPhone() != null) {
+            if (officialPhones.contains(order.getInvitorParentPhone())) {
+                userRepo.findByPhoneAndDelFalse(order.getInvitorParentPhone()).ifPresent(user -> {
+                    BigDecimal shareRatio = sysConfigService.getBigDecimal("auction_commission_step");
+                    if (StringUtils.isNotBlank(user.getSettleAccountId()) &&
+                            shareRatio != null && shareRatio.compareTo(BigDecimal.ZERO) > 0) {
+                        commissionRecordRepo.save(CommissionRecord.builder()
+                                .orderId(order.getId())
+                                .collectionId(order.getTradeAuctionId())
+                                .name(order.getName())
+                                .totalPrice(price)
+                                .nickname(user.getNickname())
+                                .userId(user.getId())
+                                .shareRatio(user.getShareRatio())
+                                .phone(user.getPhone())
+                                .shareAmount(price.multiply(shareRatio)
+                                        .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP))
+                                .type(InviteType.AUCTION)
+                                .build());
+
+                        userBalanceService.addBalance(user.getId(), price.multiply(shareRatio)
+                                .divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP), order
+                                .getId(), BalanceType.COMMISSION);
+                    }
+                });
+            }
         }
     }
 

+ 36 - 0
src/main/java/com/izouma/nineth/service/UserService.java

@@ -1225,4 +1225,40 @@ public class UserService {
             cacheService.clearUser(user.getId());
         }
     }
+
+    public void bindAuctionInvitor(Long userId, Long invitor) {
+        Invite invite = null;
+        InviteType type = InviteType.AUCTION;
+        User inviteUser = userRepo.findById(invitor).orElseThrow(new BusinessException("暂无用户"));
+        invite = inviteRepo.findFirstByCode(String.valueOf(invitor)).orElse(null);
+        if (invite == null) {
+            Invite newOne = new Invite();
+            newOne.setInviteNum(0);
+            newOne.setPhone(inviteUser.getPhone());
+            newOne.setCode(String.valueOf(invitor));
+            newOne.setName(inviteUser.getNickname());
+            newOne.setInviteType(InviteType.AUCTION);
+            invite = inviteRepo.save(newOne);
+        }
+        User user = userRepo.findById(userId).orElseThrow(new BusinessException("无此用户"));
+        user.setInvitorPhone(Optional.of(invite).map(Invite::getPhone).orElse(null));
+        user.setInvitorName(Optional.of(invite).map(Invite::getName).orElse(null));
+        user.setInviteCode(Optional.of(invite).map(Invite::getCode).orElse(null));
+        user.setCollectionInvitor(invitor);
+//            user.setCollectionId(collectionId)
+        user.setInviteType(type);
+        User orig = userRepo.findById(user.getId()).orElseThrow(new BusinessException("无记录"));
+        ObjUtils.merge(orig, user);
+        orig = save(orig);
+        userRepo.updateAssetMinter(orig.getId());
+        userRepo.updateAssetOwner(orig.getId());
+        userRepo.updateCollectionMinter(orig.getId());
+        userRepo.updateCollectionOwner(orig.getId());
+        userRepo.updateOrderMinter(orig.getId());
+        userRepo.updateHistoryFromUser(orig.getId());
+        userRepo.updateHistoryToUser(orig.getId());
+        userRepo.updateShowroomToUser(orig.getId());
+        cacheService.clearCollection();
+
+    }
 }

+ 23 - 6
src/main/java/com/izouma/nineth/web/AuthenticationController.java

@@ -13,10 +13,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -66,8 +63,18 @@ public class AuthenticationController {
 
     @PostMapping("/phoneLogin")
     @ApiOperation(value = "手机号验证码登录")
-    public String phoneLogin(String phone, String code) {
+    public String phoneLogin(String phone, String code, @RequestParam(required = false) Long invitor) {
         User user = userService.loginByPhone(phone, code);
+        InviteType userInviteType = user.getInviteType();
+        if (invitor != null) {
+            if (userInviteType != null) {
+                if (!userInviteType.equals(InviteType.AUCTION)) {
+                    userService.bindAuctionInvitor(user.getId(), invitor);
+                }
+            } else {
+                userService.bindAuctionInvitor(user.getId(), invitor);
+            }
+        }
         return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
     }
 
@@ -81,8 +88,18 @@ public class AuthenticationController {
 
     @PostMapping("/phonePwdLogin")
     @ApiOperation(value = "手机号密码登录")
-    public String phonePwdLogin(String phone, String password) {
+    public String phonePwdLogin(String phone, String password, @RequestParam(required = false) Long invitor) {
         User user = userService.loginByPhonePwd(phone, password);
+        InviteType userInviteType = user.getInviteType();
+        if (invitor != null) {
+            if (userInviteType != null) {
+                if (!userInviteType.equals(InviteType.AUCTION)) {
+                    userService.bindAuctionInvitor(user.getId(), invitor);
+                }
+            } else {
+                userService.bindAuctionInvitor(user.getId(), invitor);
+            }
+        }
         return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
     }
 

BIN
src/main/resources/font/VonwaonBitmap_16pxLite.ttf


+ 178 - 162
src/main/vue/src/views/DomainOrderList.vue

@@ -1,22 +1,24 @@
 <template>
-    <div  class="list-view">
+    <div class="list-view">
         <page-title>
-            <el-button @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading" class="filter-item">
-                新增
-            </el-button>
-            <el-button @click="download" icon="el-icon-upload2" :loading="downloading" :disabled="fetchingData" class="filter-item">
-                导出
-            </el-button>
+            <!--            <el-button @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading"-->
+            <!--                       class="filter-item">-->
+            <!--                新增-->
+            <!--            </el-button>-->
+            <!--            <el-button @click="download" icon="el-icon-upload2" :loading="downloading" :disabled="fetchingData"-->
+            <!--                       class="filter-item">-->
+            <!--                导出-->
+            <!--            </el-button>-->
         </page-title>
         <div class="filters-container">
             <el-input
-                    placeholder="搜索..."
-                    v-model="search"
-                    clearable
-                    class="filter-item search"
-                    @keyup.enter.native="getData"
+                placeholder="搜索..."
+                v-model="search"
+                clearable
+                class="filter-item search"
+                @keyup.enter.native="getData"
             >
-                <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
+                <el-button @click="getData" slot="append" icon="el-icon-search"></el-button>
             </el-input>
         </div>
         <el-table :data="tableData" row-key="id" ref="table"
@@ -29,46 +31,45 @@
             </el-table-column>
             <el-table-column prop="id" label="ID" width="100">
             </el-table-column>
-                                <el-table-column prop="userId" label="用户id"
->
-                    </el-table-column>
-                    <el-table-column prop="userName" label="用户名"
->
-                    </el-table-column>
-                    <el-table-column prop="userAvatar" label="用户头像"
->
-                    </el-table-column>
-                    <el-table-column prop="picName" label="图片名称"
->
-                    </el-table-column>
-                    <el-table-column prop="domainName" label="图片名称"
->
-                    </el-table-column>
-                    <el-table-column prop="status" label="状态"
-                            :formatter="statusFormatter"
-                        >
-                    </el-table-column>
-                    <el-table-column prop="auditResult" label="审核结果"
->
-                    </el-table-column>
-                    <el-table-column prop="orderStatus" label="orderStatus"
-                            :formatter="orderStatusFormatter"
-                        >
-                    </el-table-column>
-                    <el-table-column prop="payMethod" label="payMethod"
-                            :formatter="payMethodFormatter"
-                        >
-                    </el-table-column>
-            <el-table-column
-                    label="操作"
-                    align="center"
-                    fixed="right"
-                    width="150">
-                <template slot-scope="{row}">
-                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
-                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
-                </template>
+            <el-table-column prop="userId" label="用户id"
+            >
+            </el-table-column>
+            <el-table-column prop="userName" label="用户名"
+            >
+            </el-table-column>
+            <!--            <el-table-column prop="userAvatar" label="用户头像"-->
+            <!--            >-->
+            <!--            </el-table-column>-->
+            <el-table-column prop="picName" label="域名名称"
+            >
+            </el-table-column>
+            <el-table-column prop="domainName" label="域名(包含后缀)"
+            >
+            </el-table-column>
+            <el-table-column prop="transactionId" label="交易流水号"
+            >
             </el-table-column>
+            <el-table-column prop="auditResult" label="审核结果"
+            >
+            </el-table-column>
+            <el-table-column prop="orderStatus" label="订单状态"
+                             :formatter="orderStatusFormatter"
+            >
+            </el-table-column>
+            <el-table-column prop="payMethod" label="支付方式"
+                             :formatter="payMethodFormatter"
+            >
+            </el-table-column>
+            <!--            <el-table-column-->
+            <!--                    label="操作"-->
+            <!--                    align="center"-->
+            <!--                    fixed="right"-->
+            <!--                    width="150">-->
+            <!--                <template slot-scope="{row}">-->
+            <!--                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>-->
+            <!--                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>-->
+            <!--                </template>-->
+            <!--            </el-table-column>-->
         </el-table>
         <div class="pagination-wrapper">
             <!-- <div class="multiple-mode-wrapper">
@@ -90,125 +91,140 @@
     </div>
 </template>
 <script>
-    import { mapState } from "vuex";
-    import pageableTable from "@/mixins/pageableTable";
+import {mapState} from "vuex";
+import pageableTable from "@/mixins/pageableTable";
 
-    export default {
-        name: 'DomainOrderList',
-        mixins: [pageableTable],
-        data() {
-            return {
-                multipleMode: false,
-                search: "",
-                url: "/domainOrder/all",
-                downloading: false,
-                        statusOptions:[{"label":"审核中","value":"PENDING"},{"label":"通过","value":"SUCCESS"},{"label":"失败","value":"FAIL"}],
-                        orderStatusOptions:[{"label":"未支付","value":"NOT_PAID"},{"label":"已支付,处理中","value":"PROCESSING"},{"label":"已完成","value":"FINISH"},{"label":"已取消","value":"CANCELLED"}],
-                        payMethodOptions:[{"label":"微信","value":"WEIXIN"},{"label":"支付宝","value":"ALIPAY"},{"label":"无GAS费","value":"FREE"},{"label":"衫德支付","value":"SANDPAY"},{"label":"河马支付","value":"HMPAY"},{"label":"首信易","value":"PAYEASE"},{"label":"余额支付","value":"BALANCE"},{"label":"销毁藏品","value":"DESTROY"}],
+export default {
+    name: 'DomainOrderList',
+    mixins: [pageableTable],
+    data() {
+        return {
+            multipleMode: false,
+            search: "",
+            url: "/domainOrder/all",
+            downloading: false,
+            statusOptions: [{"label": "审核中", "value": "PENDING"}, {"label": "通过", "value": "SUCCESS"}, {
+                "label": "失败",
+                "value": "FAIL"
+            }],
+            orderStatusOptions: [{"label": "未支付", "value": "NOT_PAID"}, {
+                "label": "已支付,处理中",
+                "value": "PROCESSING"
+            }, {"label": "已完成", "value": "FINISH"}, {"label": "已取消", "value": "CANCELLED"}],
+            payMethodOptions: [{"label": "微信", "value": "WEIXIN"}, {
+                "label": "支付宝",
+                "value": "ALIPAY"
+            }, {"label": "无GAS费", "value": "FREE"}, {"label": "衫德支付", "value": "SANDPAY"}, {
+                "label": "河马支付",
+                "value": "HMPAY"
+            }, {"label": "首信易", "value": "PAYEASE"}, {"label": "余额支付", "value": "BALANCE"}, {
+                "label": "销毁藏品",
+                "value": "DESTROY"
+            }],
+        }
+    },
+    computed: {
+        selection() {
+            return this.$refs.table.selection.map(i => i.id);
+        }
+    },
+    methods: {
+        statusFormatter(row, column, cellValue, index) {
+            let selectedOption = this.statusOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
+        orderStatusFormatter(row, column, cellValue, index) {
+            let selectedOption = this.orderStatusOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
             }
+            return '';
         },
-        computed: {
-            selection() {
-                return this.$refs.table.selection.map(i => i.id);
+        payMethodFormatter(row, column, cellValue, index) {
+            let selectedOption = this.payMethodOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
             }
+            return '';
+        },
+        beforeGetData() {
+            return {search: this.search, query: {orderStatus: 'FINISH', del: false}};
         },
-        methods: {
-                    statusFormatter(row, column, cellValue, index) {
-                        let selectedOption = this.statusOptions.find(i => i.value === cellValue);
-                        if (selectedOption) {
-                            return selectedOption.label;
-                        }
-                        return '';
-                    },
-                    orderStatusFormatter(row, column, cellValue, index) {
-                        let selectedOption = this.orderStatusOptions.find(i => i.value === cellValue);
-                        if (selectedOption) {
-                            return selectedOption.label;
-                        }
-                        return '';
-                    },
-                    payMethodFormatter(row, column, cellValue, index) {
-                        let selectedOption = this.payMethodOptions.find(i => i.value === cellValue);
-                        if (selectedOption) {
-                            return selectedOption.label;
-                        }
-                        return '';
-                    },
-            beforeGetData() {
-                return { search: this.search, query: { del: false } };
-            },
-            toggleMultipleMode(multipleMode) {
-                this.multipleMode = multipleMode;
-                if (!multipleMode) {
-                    this.$refs.table.clearSelection();
+        toggleMultipleMode(multipleMode) {
+            this.multipleMode = multipleMode;
+            if (!multipleMode) {
+                this.$refs.table.clearSelection();
+            }
+        },
+        addRow() {
+            this.$router.push({
+                path: "/domainOrderEdit",
+                query: {
+                    ...this.$route.query
                 }
-            },
-            addRow() {
-                this.$router.push({
-                    path: "/domainOrderEdit",
-                    query: {
-                        ...this.$route.query
-                    }
-                });
-            },
-            editRow(row) {
-                this.$router.push({
-                    path: "/domainOrderEdit",
-                    query: {
+            });
+        },
+        editRow(row) {
+            this.$router.push({
+                path: "/domainOrderEdit",
+                query: {
                     id: row.id
-                    }
-                });
-            },
-            download() {
-                this.downloading = true;
-                this.$axios
-                    .get("/domainOrder/excel", { 
-                        responseType: "blob",
-                        params: { size: 10000 }
-                    })
-                    .then(res => {
-                        console.log(res);
-                        this.downloading = false;
-                        const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
-                        const link = document.createElement("a");
-                        link.href = downloadUrl;
-                        link.setAttribute(
-                            "download",
-                            res.headers["content-disposition"].split("filename=")[1]
-                        );
-                        document.body.appendChild(link);
-                        link.click();
-                        link.remove();
-                    })
-                    .catch(e => {
-                        console.log(e);
-                        this.downloading = false;
-                        this.$message.error(e.error);
-                    });
-            },
-            operation1() {
-                this.$notify({
-                    title: '提示',
-                    message: this.selection
-                });
-            },
-            operation2() {
-                this.$message('操作2');
-            },
-            deleteRow(row) {
-                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
-                    return this.$http.post(`/domainOrder/del/${row.id}`)
-                }).then(() => {
-                    this.$message.success('删除成功');
-                    this.getData();
-                }).catch(e => {
-                    if (e !== 'cancel') {
-                        this.$message.error(e.error);
-                    }
+                }
+            });
+        },
+        download() {
+            this.downloading = true;
+            this.$axios
+                .get("/domainOrder/excel", {
+                    responseType: "blob",
+                    params: {size: 10000}
                 })
-            },
-        }
+                .then(res => {
+                    console.log(res);
+                    this.downloading = false;
+                    const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+                    const link = document.createElement("a");
+                    link.href = downloadUrl;
+                    link.setAttribute(
+                        "download",
+                        res.headers["content-disposition"].split("filename=")[1]
+                    );
+                    document.body.appendChild(link);
+                    link.click();
+                    link.remove();
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.downloading = false;
+                    this.$message.error(e.error);
+                });
+        },
+        operation1() {
+            this.$notify({
+                title: '提示',
+                message: this.selection
+            });
+        },
+        operation2() {
+            this.$message('操作2');
+        },
+        deleteRow(row) {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                return this.$http.post(`/domainOrder/del/${row.id}`)
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.getData();
+            }).catch(e => {
+                if (e !== 'cancel') {
+                    this.$message.error(e.error);
+                }
+            })
+        },
     }
+}
 </script>
 <style lang="less" scoped>
 </style>

+ 15 - 1
src/test/java/com/izouma/nineth/service/UserServiceTest.java

@@ -2,6 +2,7 @@ package com.izouma.nineth.service;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.api.AlipayApiException;
+import com.google.zxing.WriterException;
 import com.huifu.adapay.core.exception.BaseAdaPayException;
 import com.izouma.nineth.ApplicationTests;
 import com.izouma.nineth.config.Constants;
@@ -29,6 +30,9 @@ import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -40,6 +44,8 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
 
+import javax.imageio.ImageIO;
+
 @Slf4j
 @ExtendWith(SpringExtension.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@@ -61,6 +67,8 @@ public class UserServiceTest extends ApplicationTests {
     private TeamService           teamService;
     @Autowired
     private NeteaseMessageService neteaseMessageService;
+    @Autowired
+    private DomainOrderService    domainOrderService;
 
     @Test
     public void findByUsernameAndDelFalse1() {
@@ -260,6 +268,12 @@ public class UserServiceTest extends ApplicationTests {
 
     @Test
     public void tTe() {
-        teamService.getUnreadCount("9850","7807550605");
+        teamService.getUnreadCount("9850", "7807550605");
+    }
+
+    @Test
+    public void shareImg() throws IOException, FontFormatException, WriterException {
+        BufferedImage img = domainOrderService.domainImg("thomeboydontkill.nft");
+        ImageIO.write(img, "jpg", new File("1.jpg"));
     }
 }