From 6c6c88b3cceab0f3dc1a34605ce0a387d8d24048 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Fri, 14 May 2021 18:07:56 +0800 Subject: [PATCH] modify --- src/test/java/com/xcong/excoin/XchTest.java | 14 ++++++++++++++ src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java | 16 ++++++++-------- src/main/resources/mapper/member/MemberDao.xml | 5 +++-- src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java | 2 +- src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java | 8 ++++---- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java b/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java index 7c104b9..9d84ccc 100644 --- a/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java +++ b/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java @@ -21,7 +21,7 @@ * 金额 */ @ApiModelProperty(value = "金额") - private BigDecimal amount; + private String amount; /** * 记录内容 */ diff --git a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java index b91eb96..6dd5b92 100644 --- a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java @@ -93,7 +93,7 @@ public Result getWalletCoin() { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); -// Long memberId = 446L; +// Long memberId = 444L; PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne(); BigDecimal cnyUsdt = cnyUsdtExchange.getValue(); @@ -107,10 +107,10 @@ for (MemberWalletCoinEntity memberWalletCoinEntity : memberWalletCoinlist) { if ("USDT".equals(memberWalletCoinEntity.getWalletCode()) || "XCH".equals(memberWalletCoinEntity.getWalletCode())) { MemberWalletCoinInfoVo memberWalletCoinInfoVo = new MemberWalletCoinInfoVo(); - memberWalletCoinInfoVo.setAvailableBalance(memberWalletCoinEntity.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN)); - memberWalletCoinInfoVo.setFrozenBalance(memberWalletCoinEntity.getFrozenBalance().setScale(4, BigDecimal.ROUND_DOWN)); + memberWalletCoinInfoVo.setAvailableBalance(memberWalletCoinEntity.getAvailableBalance().setScale(8, BigDecimal.ROUND_DOWN)); + memberWalletCoinInfoVo.setFrozenBalance(memberWalletCoinEntity.getFrozenBalance().setScale(8, BigDecimal.ROUND_DOWN)); memberWalletCoinInfoVo.setMemberId(memberWalletCoinEntity.getMemberId()); - memberWalletCoinInfoVo.setTotalBalance(memberWalletCoinEntity.getTotalBalance().setScale(4, BigDecimal.ROUND_DOWN)); + memberWalletCoinInfoVo.setTotalBalance(memberWalletCoinEntity.getTotalBalance().setScale(8, BigDecimal.ROUND_DOWN)); memberWalletCoinInfoVo.setWalletCode(memberWalletCoinEntity.getWalletCode()); memberWalletCoinInfoVolist.add(memberWalletCoinInfoVo); } @@ -1035,7 +1035,7 @@ for(MemberCoinChargeEntity memberCoinChargeEntitys : records) { CoinInListVo coinInListVo = new CoinInListVo(); coinInListVo.setSymbol(memberCoinChargeEntitys.getSymbol()); - coinInListVo.setAmount(memberCoinChargeEntitys.getAmount()); + coinInListVo.setAmount(memberCoinChargeEntitys.getAmount().toPlainString()); coinInListVo.setContent("充币"); coinInListVo.setStatus(memberCoinChargeEntitys.getStatus()); coinInListVo.setUpdateTime(memberCoinChargeEntitys.getUpdateTime()); @@ -1059,7 +1059,7 @@ for(MemberCoinWithdrawEntity memberCoinWithdrawEntitys : records) { CoinInListVo coinInListVo = new CoinInListVo(); coinInListVo.setSymbol(memberCoinWithdrawEntitys.getSymbol()); - coinInListVo.setAmount(memberCoinWithdrawEntitys.getAmount()); + coinInListVo.setAmount(memberCoinWithdrawEntitys.getAmount().toPlainString()); coinInListVo.setContent("提币"); int status = memberCoinWithdrawEntitys.getStatus(); int statusOut = 0; @@ -1095,7 +1095,7 @@ for(MemberAccountMoneyChange memberAccountMoneyChanges : records) { CoinInListVo coinInListVo = new CoinInListVo(); coinInListVo.setSymbol(memberAccountMoneyChanges.getSymbol()); - coinInListVo.setAmount(memberAccountMoneyChanges.getAmount()); + coinInListVo.setAmount(memberAccountMoneyChanges.getAmount().toPlainString()); coinInListVo.setContent(memberAccountMoneyChanges.getContent()); coinInListVo.setStatus(memberAccountMoneyChanges.getStatus()); coinInListVo.setUpdateTime(memberAccountMoneyChanges.getUpdateTime()); @@ -1119,7 +1119,7 @@ for(MemberAccountMoneyChange memberAccountMoneyChanges : records) { CoinInListVo coinInListVo = new CoinInListVo(); coinInListVo.setSymbol(memberAccountMoneyChanges.getSymbol()); - coinInListVo.setAmount(memberAccountMoneyChanges.getAmount()); + coinInListVo.setAmount(memberAccountMoneyChanges.getAmount().toPlainString()); coinInListVo.setContent(memberAccountMoneyChanges.getContent()); coinInListVo.setStatus(memberAccountMoneyChanges.getStatus()); coinInListVo.setUpdateTime(memberAccountMoneyChanges.getUpdateTime()); diff --git a/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java b/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java index 1796454..0becf5d 100644 --- a/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java @@ -234,9 +234,9 @@ if (CollUtil.isNotEmpty(orders)) { for (YdOrderEntity order : orders) { long between = DateUtil.between(order.getWorkTime(), currentDate, DateUnit.DAY); - if (between < 1) { - continue; - } +// if (between < 1) { +// continue; +// } MemberEntity memberEntity = memberDao.selectById(order.getMemberId()); List<String> inviteIds = StrUtil.split(memberEntity.getRefererIds(), ','); @@ -263,7 +263,7 @@ } } - remainProfit = remainProfit.subtract(orderProfit.subtract(orderProfit.multiply(order.getYdProductEntity().getManageExpense()))); + remainProfit = remainProfit.subtract(orderProfit.multiply(order.getYdProductEntity().getManageExpense())); String content = "XCH收益"; LogRecordUtils.insertMemberAccountMoneyChangeWithId(order.getMemberId(), content, remainProfit, "XCH", 1, 4, order.getId()); MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(order.getMemberId(), "XCH"); diff --git a/src/main/resources/mapper/member/MemberDao.xml b/src/main/resources/mapper/member/MemberDao.xml index 056f168..7c11538 100644 --- a/src/main/resources/mapper/member/MemberDao.xml +++ b/src/main/resources/mapper/member/MemberDao.xml @@ -56,13 +56,14 @@ <association property="ydBasicLevelSettingEntity" javaType="com.xcong.excoin.modules.yunding.entity.YdBasicLevelSettingEntity"> <result property="level" column="level"/> <result property="usdtRatio" column="usdt_ratio" /> + <result property="xchRatio" column="xch_ratio" /> </association> </resultMap> <select id="selectYdParentAgent" resultMap="memberAgentMap"> - select a.*, b.level, b.usdt_ratio from member a + select a.*, b.level, b.usdt_ratio, b.xch_ratio from member a inner join yd_basic_level_setting b on a.agent_level=b.id - where a.invite_id in + where a.invite_id!='rxadr3' and a.invite_id in <foreach collection = "list" item = "item" separator="," open = "(" close = ")" > #{item} </foreach > diff --git a/src/test/java/com/xcong/excoin/XchTest.java b/src/test/java/com/xcong/excoin/XchTest.java index 611af9d..f7497fa 100644 --- a/src/test/java/com/xcong/excoin/XchTest.java +++ b/src/test/java/com/xcong/excoin/XchTest.java @@ -3,6 +3,8 @@ import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; +import com.xcong.excoin.modules.coin.parameter.dto.CoinInListDto; +import com.xcong.excoin.modules.coin.service.CoinService; import com.xcong.excoin.modules.yunding.dao.YdOrderDao; import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; import com.xcong.excoin.modules.yunding.service.XchProfitService; @@ -65,4 +67,16 @@ public void xchProfitTest() { xchProfitService.xchProfitDistributor(BigDecimal.valueOf(1)); } + + @Autowired + private CoinService coinService; + + @Test + public void coinTest() { + CoinInListDto coin = new CoinInListDto(); + coin.setType(4); + coin.setPageNum(1); + coin.setPageSize(10); + coinService.coinInList(coin); + } } -- Gitblit v1.9.1