KKSU
2024-03-11 e942a930f368e1431317f459032cd07a808af07e
抽奖
2 files modified
37 ■■■■■ changed files
src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/ProfitTest.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java
@@ -899,7 +899,7 @@
                        continue;
                    }
                    BigDecimal nftTotal = mallProductBuy.getNftTotal();
                    BigDecimal profit = nftTotal.multiply(profitPercent.multiply(new BigDecimal(0.01)));
                    BigDecimal profit = nftTotal.multiply(profitPercent.multiply(new BigDecimal(0.01))).setScale(2,BigDecimal.ROUND_DOWN);
                    if(totalPerk.compareTo(profit) <= 0){
                        profit = totalPerk;
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() {