Helius
2020-07-14 1b0e20f11a920ba8c0c38e4c8fef58e8fa1fe0d2
src/main/java/com/xcong/excoin/modules/coin/service/impl/BlockCoinServiceImpl.java
@@ -18,7 +18,9 @@
import com.xcong.excoin.modules.member.entity.MemberEntity;
import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
import com.xcong.excoin.utils.LogRecordUtils;
import com.xcong.excoin.utils.mail.SmsSend;
import com.xcong.excoin.utils.ThreadPoolUtils;
import com.xcong.excoin.utils.dingtalk.DingTalkUtils;
import com.xcong.excoin.utils.mail.Sms106Send;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -85,12 +87,12 @@
                        String orderNo = insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.USDT.name(), "ERC20", balance);
                        // 插入财务记录
                        LogRecordUtils.insertMemberAccountMoneyChange(memberId, "转入", newBalance, CoinTypeEnum.USDT.name(), 1, 1);
                        // TODO 钉钉发送, 短信提醒
                        ThreadPoolUtils.sendDingTalk(5);
                        MemberEntity member = memberDao.selectById(memberId);
                        if (StrUtil.isNotBlank(member.getPhone())) {
                            String amount = newBalance.toPlainString() + "USDT-ERC20";
                            SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo);
                            Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo);
                        }
                    }
                }
@@ -134,12 +136,12 @@
                        // 插入财务记录
                        LogRecordUtils.insertMemberAccountMoneyChange(memberId, "转入", newBalance, CoinTypeEnum.ETH.name(), 1, 1);
                        // TODO 钉钉消息, 短信提醒
                        ThreadPoolUtils.sendDingTalk(5);
                        MemberEntity member = memberDao.selectById(memberId);
                        if (StrUtil.isNotBlank(member.getPhone())) {
                            String amount = newBalance.toPlainString() + "ETH";
                            SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo);
                            Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo);
                        }
                    }
                }
@@ -180,11 +182,11 @@
                        memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), newBalance, balance, 0);
                        String orderNo = insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.USDT.name(), "OMNI", balance);
                        // TODO 钉钉消息, 短信提醒
                        ThreadPoolUtils.sendDingTalk(5);
                        MemberEntity member = memberDao.selectById(memberId);
                        if (StrUtil.isNotBlank(member.getPhone())) {
                            String amount = newBalance.toPlainString() + "USDT-OMNI";
                            SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo);
                            Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo);
                        }
                    }
                }
@@ -227,11 +229,11 @@
                        String orderNo = insertCoinCharge(address, memberId, newBalance, CoinTypeEnum.BTC.name(), null, balance);
                        LogRecordUtils.insertMemberAccountMoneyChange(memberId, "转入", newBalance, CoinTypeEnum.BTC.name(), 1, 1);
                        // TODO 钉钉提醒, 短信提醒
                        ThreadPoolUtils.sendDingTalk(5);
                        MemberEntity member = memberDao.selectById(memberId);
                        if (StrUtil.isNotBlank(member.getPhone())) {
                            String amount = newBalance.toPlainString() + "BTC";
                            SmsSend.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), amount, orderNo);
                            Sms106Send.sendRechargeMsg(member.getPhone(), DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MINUTE_PATTERN), orderNo);
                        }
                    }
                }