Helius
2021-05-14 6c6c88b3cceab0f3dc1a34605ce0a387d8d24048
modify
5 files modified
45 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java 16 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/member/MemberDao.xml 5 ●●●●● patch | view | raw | blame | history
src/test/java/com/xcong/excoin/XchTest.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/CoinInListVo.java
@@ -21,7 +21,7 @@
     * 金额
     */
    @ApiModelProperty(value = "金额")
    private BigDecimal amount;
    private String amount;
    /**
     * 记录内容
     */
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());
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");
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 >
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);
    }
}