Helius
2022-03-02 643f0aff6828aa659b4f039c9c75302ac823c83b
Merge branch 'bea' of http://120.27.238.55:7000/r/exchange into bea
1 files added
6 files modified
168 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java 130 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinChargeDao.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinWithdrawDao.java 5 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/member/MemberAccountMoneyChangeDao.xml 8 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/member/MemberCoinChargeDao.xml 6 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/member/MemberCoinWithdrawDao.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java
@@ -35,4 +35,8 @@
            @Param("record")MemberAccountMoneyChange memberAccountMoneyChange);
    IPage<UsdtToGusdVo> selectByMemberIdInPage(Page<UsdtToGusdVo> page, @Param("record")MemberAccountMoneyChange memberAccountMoneyChange);
    IPage<MemberAccountMoneyChange> coinInList(Page<MemberAccountMoneyChange> page,
                                               @Param("record")MemberAccountMoneyChange memberAccountMoneyChange);
}
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
@@ -4,6 +4,7 @@
import java.text.SimpleDateFormat;
import java.util.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.date.DateUtil;
@@ -14,6 +15,8 @@
import com.xcong.excoin.modules.coin.parameter.dto.CoinInListDto;
import com.xcong.excoin.modules.coin.parameter.dto.ZhiyaRewardRecordsPageDto;
import com.xcong.excoin.modules.coin.parameter.vo.*;
import com.xcong.excoin.modules.member.dao.*;
import com.xcong.excoin.modules.member.entity.*;
import com.xcong.excoin.modules.platform.entity.PlatformCnyUsdtExchangeEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -29,12 +32,6 @@
import com.xcong.excoin.modules.coin.mapper.MemberAccountMoneyChangeMapper;
import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto;
import com.xcong.excoin.modules.coin.service.CoinService;
import com.xcong.excoin.modules.member.dao.MemberWalletAgentDao;
import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao;
import com.xcong.excoin.modules.member.dao.MemberWalletContractDao;
import com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity;
import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
import com.xcong.excoin.modules.platform.dao.PlatformCnyUsdtExchangeDao;
import com.xcong.excoin.utils.CoinTypeConvert;
import com.xcong.excoin.utils.MessageSourceUtils;
@@ -63,6 +60,10 @@
    ZhiYaRecordDao zhiYaRecordDao;
    @Resource
    ZhiyaRewardDao zhiyaRewardDao;
    @Resource
    MemberCoinChargeDao memberCoinChargeDao;
    @Resource
    MemberCoinWithdrawDao memberCoinWithdrawDao;
    @Resource
    ZhiYaDao zhiYaDao;
    @Resource
@@ -912,8 +913,121 @@
    }
    @Override
    public Result coinInList(CoinInListDto coinInListDto) {
        return null;
    public Result coinInList(@Valid CoinInListDto coinInListDto) {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        int type = coinInListDto.getType();
        //充币记录
        if(type == 1) {
            Page<MemberCoinChargeEntity> page = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            MemberCoinChargeEntity memberCoinChargeEntity = new MemberCoinChargeEntity();
            memberCoinChargeEntity.setMemberId(memberId);
            IPage<MemberCoinChargeEntity> memberCoinCharge = memberCoinChargeDao.findMemberCoinChargeInPage(page, memberCoinChargeEntity);
            List<MemberCoinChargeEntity> records = memberCoinCharge.getRecords();
            Page<CoinInListVo> responsePage = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            if(CollUtil.isNotEmpty(records)) {
                ArrayList<CoinInListVo> arrayList = new ArrayList<>();
                for(MemberCoinChargeEntity memberCoinChargeEntitys : records) {
                    CoinInListVo coinInListVo = new CoinInListVo();
                    coinInListVo.setSymbol(memberCoinChargeEntitys.getSymbol());
                    coinInListVo.setAmount(memberCoinChargeEntitys.getAmount().toPlainString());
                    coinInListVo.setContent("充币");
                    coinInListVo.setStatus(memberCoinChargeEntitys.getStatus());
                    coinInListVo.setUpdateTime(memberCoinChargeEntitys.getUpdateTime());
                    arrayList.add(coinInListVo);
                }
                responsePage.setRecords(arrayList);
            }
            return Result.ok(responsePage);
        }
        //提币记录
        if(type == 2) {
            Page<MemberCoinWithdrawEntity> page = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            MemberCoinWithdrawEntity memberCoinWithdrawEntity = new MemberCoinWithdrawEntity();
            memberCoinWithdrawEntity.setMemberId(memberId);
            IPage<MemberCoinWithdrawEntity> memberCoinWithdraw = memberCoinWithdrawDao.findMemberCoinWithdrawInPage(page, memberCoinWithdrawEntity);
            List<MemberCoinWithdrawEntity> records = memberCoinWithdraw.getRecords();
            Page<CoinInListVo> responsePage = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            if(CollUtil.isNotEmpty(records)) {
                ArrayList<CoinInListVo> arrayList = new ArrayList<>();
                for(MemberCoinWithdrawEntity memberCoinWithdrawEntitys : records) {
                    CoinInListVo coinInListVo = new CoinInListVo();
                    coinInListVo.setSymbol(memberCoinWithdrawEntitys.getSymbol());
                    coinInListVo.setAmount(memberCoinWithdrawEntitys.getAmount().toPlainString());
                    coinInListVo.setContent("提币");
                    int status = memberCoinWithdrawEntitys.getStatus();
                    int statusOut = 0;
                    if(status == 1) {
                        statusOut = 0;
                    }
                    if(status == 2) {
                        statusOut = 1;
                    }
                    if(status == 3) {
                        statusOut = 2;
                    }
                    coinInListVo.setStatus(statusOut);
                    coinInListVo.setUpdateTime(memberCoinWithdrawEntitys.getUpdateTime());
                    coinInListVo.setIsInside(memberCoinWithdrawEntitys.getIsInside());
                    arrayList.add(coinInListVo);
                }
                responsePage.setRecords(arrayList);
            }
            return Result.ok(responsePage);
        }
        //划转记录
        if(type == 3) {
            Page<MemberAccountMoneyChange> page = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            MemberAccountMoneyChange memberAccountMoneyChange = new MemberAccountMoneyChange();
            memberAccountMoneyChange.setMemberId(memberId);
            IPage<MemberAccountMoneyChange> list = memberAccountMoneyChangeDao.coinInList(page, memberAccountMoneyChange);
            List<MemberAccountMoneyChange> records = list.getRecords();
            Page<CoinInListVo> responsePage = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            if(CollUtil.isNotEmpty(records)) {
                ArrayList<CoinInListVo> arrayList = new ArrayList<>();
                for(MemberAccountMoneyChange memberAccountMoneyChanges : records) {
                    CoinInListVo coinInListVo = new CoinInListVo();
                    coinInListVo.setSymbol(memberAccountMoneyChanges.getSymbol());
                    coinInListVo.setAmount(memberAccountMoneyChanges.getAmount().toPlainString());
                    coinInListVo.setContent(memberAccountMoneyChanges.getContent());
                    coinInListVo.setStatus(memberAccountMoneyChanges.getStatus());
                    coinInListVo.setUpdateTime(memberAccountMoneyChanges.getUpdateTime());
                    arrayList.add(coinInListVo);
                }
                responsePage.setRecords(arrayList);
            }
            return Result.ok(responsePage);
        }
        //其他记录
        if(type == 4) {
            Page<OrderCoinsDealEntity> page = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            MemberAccountMoneyChange memberAccountMoneyChange = new MemberAccountMoneyChange();
            memberAccountMoneyChange.setMemberId(memberId);
            IPage<MemberAccountMoneyChange> list = memberAccountMoneyChangeDao.selectWalletAgentIntoRecordsByMemIdTypeSymbol(page, memberAccountMoneyChange);
            List<MemberAccountMoneyChange> records = list.getRecords();
            Page<CoinInListVo> responsePage = new Page<>(coinInListDto.getPageNum(), coinInListDto.getPageSize());
            if(CollUtil.isNotEmpty(records)) {
                ArrayList<CoinInListVo> arrayList = new ArrayList<>();
                for(MemberAccountMoneyChange memberAccountMoneyChanges : records) {
                    CoinInListVo coinInListVo = new CoinInListVo();
                    coinInListVo.setSymbol(memberAccountMoneyChanges.getSymbol());
                    coinInListVo.setAmount(memberAccountMoneyChanges.getAmount().toPlainString());
                    coinInListVo.setContent(memberAccountMoneyChanges.getContent());
                    coinInListVo.setStatus(memberAccountMoneyChanges.getStatus());
                    coinInListVo.setUpdateTime(memberAccountMoneyChanges.getUpdateTime());
                    arrayList.add(coinInListVo);
                }
                responsePage.setRecords(arrayList);
            }
            return Result.ok(responsePage);
        }
        return Result.fail(MessageSourceUtils.getString("member_controller_0005"));
    }
    public String generateSimpleSerialno(String userId) {
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinChargeDao.java
@@ -1,6 +1,8 @@
package com.xcong.excoin.modules.member.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xcong.excoin.modules.member.entity.MemberCoinChargeEntity;
import org.apache.ibatis.annotations.Param;
@@ -12,4 +14,6 @@
    List<MemberCoinChargeEntity> selectAllBySymbolAndTag(@Param("symbol") String symbol, @Param("tag") String tag, @Param("status") Integer status);
    public IPage<MemberCoinChargeEntity> findMemberCoinChargeInPage(Page<MemberCoinChargeEntity> page,
                                                                    @Param("record")MemberCoinChargeEntity memberCoinChargeEntity);
}
src/main/java/com/xcong/excoin/modules/member/dao/MemberCoinWithdrawDao.java
@@ -1,8 +1,13 @@
package com.xcong.excoin.modules.member.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xcong.excoin.modules.member.entity.MemberCoinWithdrawEntity;
import org.apache.ibatis.annotations.Param;
public interface MemberCoinWithdrawDao  extends BaseMapper<MemberCoinWithdrawEntity> {
    IPage<MemberCoinWithdrawEntity> findMemberCoinWithdrawInPage(Page<MemberCoinWithdrawEntity> page,
                                                                 @Param("record")MemberCoinWithdrawEntity memberCoinWithdrawEntity);
}
src/main/resources/mapper/member/MemberAccountMoneyChangeDao.xml
@@ -77,4 +77,12 @@
        order by id desc
    </select>
    <select id="coinInList" resultType="com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange">
        select * from member_account_money_change
        where member_id = #{record.memberId}
          and (content like '%转%' or content like '%收款%')
        order by create_time desc
    </select>
</mapper>
src/main/resources/mapper/member/MemberCoinChargeDao.xml
@@ -23,4 +23,10 @@
        </if>
    </select>
    <select id="findMemberCoinChargeInPage" resultType="com.xcong.excoin.modules.member.entity.MemberCoinChargeEntity">
        select * from member_coin_charge
        where member_id=#{record.memberId}
        order by create_time desc
    </select>
</mapper>
src/main/resources/mapper/member/MemberCoinWithdrawDao.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xcong.excoin.modules.member.dao.MemberCoinWithdrawDao">
    <select id="findMemberCoinWithdrawInPage" resultType="com.xcong.excoin.modules.member.entity.MemberCoinWithdrawEntity">
        select * from member_coin_withdraw
        where member_id = #{record.memberId}
        order by create_time desc
    </select>
</mapper>