src/main/java/com/xcong/excoin/modules/member/entity/TdFinancialReord.java
New file @@ -0,0 +1,59 @@ package com.xcong.excoin.modules.member.entity; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.math.BigDecimal; import java.util.Date; @Data @TableName("td_financial_reord") public class TdFinancialReord { private static final long serialVersionUID = 1L; /** * 主键 */ private Long id; /** * 会员ID */ private Long memId; /** * 类型 */ private String symbol; /** * 标题 */ private String title; /** * 明细内容 */ private String content; /** * 金额 */ private BigDecimal amount; /** * 创建时间 */ private Date createTime; private String phone; } src/main/java/com/xcong/excoin/modules/member/mapper/MemberCoinAddressMapper.java
@@ -2,7 +2,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; public interface MemberCoinAddressMapper extends BaseMapper<MemberCoinAddressEntity> { MemberCoinAddressEntity selectSuanliWallet(String address); void updateSuanliWallet(@Param("id") Long id,@Param("availableBalance") BigDecimal availableBalance); } src/main/java/com/xcong/excoin/modules/member/mapper/MemberWalletCoinMapper.java
@@ -9,4 +9,5 @@ MemberWalletCoinEntity findWalletCoinByMemberIdAndWalletCode(@Param("memberId")Long memberId, @Param("walletCode")String walletCode); } src/main/java/com/xcong/excoin/modules/member/mapper/TdFinancialReordDao.java
New file @@ -0,0 +1,8 @@ package com.xcong.excoin.modules.member.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xcong.excoin.modules.member.entity.TdFinancialReord; public interface TdFinancialReordDao extends BaseMapper<TdFinancialReord> { } src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
@@ -13,24 +13,8 @@ import com.xcong.excoin.modules.Sms106Send; import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto; import com.xcong.excoin.modules.member.dto.MemberLimitDto; import com.xcong.excoin.modules.member.entity.AgentFriendRelationEntity; import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity; import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity; import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity; import com.xcong.excoin.modules.member.entity.MemberCoinChargeEntity; import com.xcong.excoin.modules.member.entity.MemberCoinWithdrawEntity; import com.xcong.excoin.modules.member.entity.MemberEntity; import com.xcong.excoin.modules.member.entity.MemberQuickBuySaleEntity; import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity; import com.xcong.excoin.modules.member.mapper.AgentFriendRelationMapper; import com.xcong.excoin.modules.member.mapper.MemberAccountMoneyChangeMapper; import com.xcong.excoin.modules.member.mapper.MemberAuthenticationMapper; import com.xcong.excoin.modules.member.mapper.MemberCoinAddressMapper; import com.xcong.excoin.modules.member.mapper.MemberCoinChargeMapper; import com.xcong.excoin.modules.member.mapper.MemberCoinWithdrawMapper; import com.xcong.excoin.modules.member.mapper.MemberMapper; import com.xcong.excoin.modules.member.mapper.MemberQuickBuySaleMapper; import com.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper; import com.xcong.excoin.modules.member.entity.*; import com.xcong.excoin.modules.member.mapper.*; import com.xcong.excoin.modules.member.service.EthService; import com.xcong.excoin.modules.member.service.IMemberService; import com.xcong.excoin.modules.member.service.RocService; @@ -89,6 +73,7 @@ private final AgentFriendRelationMapper agentFriendRelationMapper; private final RedisUtils redisUtils; private final TdFinancialReordDao tdFinancialReordDao; @Override public IPage<AgentFriendRelationEntity> findAgentInfoListInPage(AgentFriendRelationEntity agentFriendRelationEntity, @@ -441,6 +426,10 @@ String symbol = selectById.getSymbol(); String address = selectById.getAddress(); int status = selectById.getStatus(); BigDecimal feeAmount = selectById.getFeeAmount(); if(feeAmount==null){ feeAmount = BigDecimal.ZERO; } BigDecimal amount = selectById.getAmount(); if(status != 1) { return new FebsResponse().fail().message("只有等待审核的状态才能确认!"); @@ -534,7 +523,24 @@ // usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf(".")); // } // String s = ethService.tokenSend(address, usdtStr, null); } // 判断是不是到交易所的 MemberCoinAddressEntity coinAddressEntity = memberCoinAddressMapper.selectSuanliWallet(address); if(coinAddressEntity!=null){ // 是的 Long walletId = coinAddressEntity.getId(); // 插入充值记录 TdFinancialReord financialReord = new TdFinancialReord(); financialReord.setAmount(amount); financialReord.setTitle("USDT链上充值"); financialReord.setContent("USDT链上充值"); financialReord.setSymbol(symbol); financialReord.setCreateTime(new Date()); financialReord.setMemId(coinAddressEntity.getMemberId()); tdFinancialReordDao.insert(financialReord); // 更新钱包 memberCoinAddressMapper.updateSuanliWallet(walletId,amount); } } /** //短信提醒 src/main/resources/application-test.yml
@@ -15,20 +15,20 @@ datasource: # 数据源-1,名称为 base base: username: ct_test username: shop_user password: 123456 driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://120.27.238.55:3306/kss_framework?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8 url: jdbc:mysql://47.96.73.250:3306/db_roc?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8 redis: # Redis数据库索引(默认为 0) database: 0 database: 1 # Redis服务器地址 host: 127.0.0.1 host: 47.96.73.250 # Redis服务器连接端口 port: 6379 # Redis 密码 password: password: qwer12345678 lettuce: pool: # 连接池中的最小空闲连接 src/main/resources/application.yml
@@ -5,7 +5,7 @@ spring: profiles: active: prod active: test thymeleaf: cache: false src/main/resources/mapper/modules/MemberCoinAddressMapper.xml
@@ -17,4 +17,11 @@ order by s.create_time desc </select> <select id="selectSuanliWallet" parameterType="map" resultType="com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity"> select mem_id memberId,id from td_coin_wallet where address = #{address} </select> <update id="updateSuanliWallet" parameterType="map" > update td_coin_wallet set available_balance = available_balance + #{availableBalance} where id = #{id} </update> </mapper> src/main/resources/mapper/modules/MemberCoinWithdrawMapper.xml
@@ -2,7 +2,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.mapper.MemberCoinWithdrawMapper"> <select id="findmemberWithdrawCoinListInPage" resultType="com.xcong.excoin.modules.member.vo.MemberCoinWithdrawVo"> SELECT <select id="findmemberWithdrawCoinListInPage" resultType="com.xcong.excoin.modules.member.vo.MemberCoinWithdrawVo"> SELECT s.id, s.create_time, m.email, @@ -14,7 +15,7 @@ s.fee_amount, s.symbol, s.status, s.is_inside, case when is_inside = 'N' and EXISTS (select * from td_coin_wallet where address = s.address) then 'J' else s.is_inside end isInside, concat(auth.first_name,auth.second_name) as realName, (select phone from member where id = (select member_id from member_coin_address where address =s.address and symbol =s.symbol and is_biyict=1)) insidePhone FROM src/main/resources/mapper/modules/TdFinancialRecordDao.xml
New file @@ -0,0 +1,7 @@ <?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.mapper.TdFinancialReordDao"> </mapper> src/main/resources/templates/febs/views/modules/member/withdrawCoin.html
@@ -68,11 +68,10 @@ <!-- <span class="layui-badge-dot febs-bg-orange"></span> 无权限--> <!-- </span>--> {{# if(d.status === 1) { }} <a lay-event="confirm" shiro:hasPermission="coin:check">确认</a> <a lay-event="cancel" shiro:hasPermission="coin:check">拒绝</a> <a lay-event="examine" >查看</a> <a lay-event="confirm" shiro:hasPermission="coin:check" >确认</a> <a lay-event="cancel" shiro:hasPermission="coin:check" >拒绝</a> {{# } else { }} <a lay-event="examine" >查看</a> {{# } }} </script> <!-- 表格操作栏 end --> @@ -168,7 +167,9 @@ templet: function (d) { if (d.isInside === 'Y') { return '<span style="color:red;">是</span>' } else { } else if(d.isInside === 'J') { return '<span style="color:red;">算力</span>' }else{ return '<span style="color:green;">否</span>' } },minWidth: 100,align:'center'},