From e942a930f368e1431317f459032cd07a808af07e Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 11 Mar 2024 10:53:29 +0800
Subject: [PATCH] 抽奖

---
 src/test/java/cc/mrbird/febs/ProfitTest.java |   35 +++++++++++++++--------------------
 1 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/src/test/java/cc/mrbird/febs/ProfitTest.java b/src/test/java/cc/mrbird/febs/ProfitTest.java
index 77afc53..ced2bc2 100644
--- a/src/test/java/cc/mrbird/febs/ProfitTest.java
+++ b/src/test/java/cc/mrbird/febs/ProfitTest.java
@@ -5,10 +5,7 @@
 import cc.mrbird.febs.common.enumerates.ProductEnum;
 import cc.mrbird.febs.common.utils.MallUtils;
 import cc.mrbird.febs.mall.dto.TeamPerkDto;
-import cc.mrbird.febs.mall.entity.DataDictionaryCustom;
-import cc.mrbird.febs.mall.entity.MallMember;
-import cc.mrbird.febs.mall.entity.MallOrderItem;
-import cc.mrbird.febs.mall.entity.MallProductBuy;
+import cc.mrbird.febs.mall.entity.*;
 import cc.mrbird.febs.mall.mapper.*;
 import cc.mrbird.febs.mall.quartz.OrderSettlementJob;
 import cc.mrbird.febs.mall.service.*;
@@ -180,25 +177,23 @@
     private NBYHService nbyhService;
     @Autowired
     private IAdminMallMemberService mallMemberService;
+    @Autowired
+    private MallProductNftMapper mallProductNftMapper;
 
     @Test
     public void agentProfitTrade() {
-//        agentService.timeGetOrderBuy();
-//        agentService.BuyToSell();
-//        try {
-//            System.out.println(resourceLoader.getResource("classpath:lkl/api_private_key.pem").getInputStream());
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//        nbyhService.tradeSinge(306L);
-//        nbyhService.tradeSingeOuterTransfer(306L);
-//        nbyhService.accountInfoQuery(306L);
-//        nbyhService.transferResultInfoQuery(315L);
-//
-//        mallMemberService.chargeAgree(307L);
-//        mallMemberService.searchInfo(307L);
-
-//        agentService.perkAgent();
+        MallProductNft mallProductNft = mallProductNftMapper.selectById(4L);
+        BigDecimal profitPercent = mallProductNft.getProfit();
+        System.out.println(profitPercent);
+        MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(184L);
+        BigDecimal nftTotal = mallProductBuy.getNftTotal();
+        System.out.println(nftTotal);
+        BigDecimal totalPerk = mallProductBuy.getTotalPerk();
+        System.out.println(totalPerk);
+        BigDecimal profit = nftTotal.multiply(profitPercent.multiply(new BigDecimal(0.01))).setScale(2,BigDecimal.ROUND_DOWN);
+        System.out.println(profit);
+        BigDecimal bigDecimal = totalPerk.subtract(profit).setScale(2, BigDecimal.ROUND_DOWN);
+        System.out.println(bigDecimal);
     }
     @Test
     public void agentProfit() {

--
Gitblit v1.9.1