From 3b50641fea610c2150bbd7371af4e31298a6d97e Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 01 Jun 2021 17:32:01 +0800
Subject: [PATCH] modify
---
src/test/java/com/xcong/excoin/OtcTest.java | 74 +++++++++++++++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
diff --git a/src/test/java/com/xcong/excoin/OtcTest.java b/src/test/java/com/xcong/excoin/OtcTest.java
index 3fb1d06..b288801 100644
--- a/src/test/java/com/xcong/excoin/OtcTest.java
+++ b/src/test/java/com/xcong/excoin/OtcTest.java
@@ -1,11 +1,22 @@
package com.xcong.excoin;
+import cn.hutool.crypto.SecureUtil;
+import com.xcong.excoin.common.system.dto.RegisterDto;
+import com.xcong.excoin.modules.member.dao.MemberDao;
+import com.xcong.excoin.modules.member.dao.MemberPaymentMethodDao;
+import com.xcong.excoin.modules.member.entity.MemberEntity;
+import com.xcong.excoin.modules.member.entity.MemberPaymentMethodEntity;
+import com.xcong.excoin.modules.otc.dao.OtcMarketBussinessDao;
+import com.xcong.excoin.modules.otc.entity.OtcMarketBussiness;
+import com.xcong.excoin.quartz.job.OtcOrderJob;
import com.xcong.excoin.rabbit.producer.OtcProducter;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.transaction.annotation.Transactional;
+import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;
@Slf4j
@@ -28,4 +39,67 @@
}
}
+
+ @Autowired
+// private OtcOrderJob otcOrderJob;
+
+ @Test
+ public void jobTest() {
+// otcOrderJob.marketBussinessJob();
+ }
+
+ @Test
+ public void mbProducterTest() {
+// otcProducter.sendMarketBussinessMsg(11L, 3);
+ }
+
+ @Autowired
+ private MemberDao memberDao;
+
+ @Autowired
+ private OtcMarketBussinessDao otcMarketBussinessDao;
+
+ @Autowired
+ private MemberPaymentMethodDao memberPaymentMethodDao;
+
+ @Test
+// @Transactional(rollbackFor = Exception.class)
+ public void mbInsertTest() {
+ for(int i = 0; i < 50; i++) {
+ String phonePrefix = "199999999";
+ if (i < 10) {
+ phonePrefix = phonePrefix + "0" + i;
+ } else {
+ phonePrefix = phonePrefix + i;
+ }
+
+ MemberEntity member = memberDao.selectMemberInfoByAccount(phonePrefix);
+
+ OtcMarketBussiness otcMb = new OtcMarketBussiness();
+ otcMb.setMemberId(member.getId());
+ otcMb.setAvgCoinTime(0);
+ otcMb.setAvgPayTime(0);
+ otcMb.setTotalOrderCnt(0);
+ otcMb.setBuyCnt(0);
+ otcMb.setFinishRatio(BigDecimal.ZERO);
+ otcMb.setStatus(OtcMarketBussiness.CHECK_PASS);
+
+ member.setIsTrader(1);
+ member.setCertifyStatus(2);
+ member.setTradePassword(SecureUtil.md5("123456"));
+
+ memberDao.updateById(member);
+ otcMarketBussinessDao.insert(otcMb);
+
+ MemberPaymentMethodEntity memberPaymentMethodEntity = new MemberPaymentMethodEntity();
+ memberPaymentMethodEntity.setMemberId(member.getId());
+ memberPaymentMethodEntity.setAccount("123456789");
+ memberPaymentMethodEntity.setBank("中国银行");
+ memberPaymentMethodEntity.setName("无名");
+ memberPaymentMethodEntity.setPaymentType(MemberPaymentMethodEntity.PAYMENTTYPE_CARD.toString());
+ memberPaymentMethodEntity.setSubBank("中国银行");
+ memberPaymentMethodEntity.setIsDefualt("1");
+ memberPaymentMethodDao.insert(memberPaymentMethodEntity);
+ }
+ }
}
--
Gitblit v1.9.1