mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-15 10:41:54 +08:00
trade: 分销业务 - 提现申请
This commit is contained in:
@@ -2,14 +2,18 @@ package cn.iocoder.yudao.module.trade.service.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.withdraw.BrokerageWithdrawPageReqVO;
|
||||
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageWithdrawDO;
|
||||
import cn.iocoder.yudao.module.trade.dal.mysql.brokerage.BrokerageWithdrawMapper;
|
||||
import cn.iocoder.yudao.module.trade.service.config.TradeConfigService;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
|
||||
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
|
||||
@@ -32,6 +36,19 @@ public class BrokerageWithdrawServiceImplTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private BrokerageWithdrawMapper brokerageWithdrawMapper;
|
||||
|
||||
@MockBean
|
||||
private BrokerageRecordService brokerageRecordService;
|
||||
@MockBean
|
||||
private BrokerageUserService brokerageUserService;
|
||||
@MockBean
|
||||
private TradeConfigService tradeConfigService;
|
||||
|
||||
@MockBean
|
||||
private NotifyMessageSendApi notifyMessageSendApi;
|
||||
|
||||
@Resource
|
||||
private Validator validator;
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetBrokerageWithdrawPage() {
|
||||
@@ -84,4 +101,17 @@ public class BrokerageWithdrawServiceImplTest extends BaseDbUnitTest {
|
||||
assertPojoEquals(dbBrokerageWithdraw, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCalculateFeePrice() {
|
||||
Integer withdrawPrice = 100;
|
||||
// 测试手续费比例未设置
|
||||
Integer percent = null;
|
||||
assertEquals(brokerageWithdrawService.calculateFeePrice(withdrawPrice, percent), 0);
|
||||
// 测试手续费给为0
|
||||
percent = 0;
|
||||
assertEquals(brokerageWithdrawService.calculateFeePrice(withdrawPrice, percent), 0);
|
||||
// 测试手续费
|
||||
percent = 1;
|
||||
assertEquals(brokerageWithdrawService.calculateFeePrice(withdrawPrice, percent), 1);
|
||||
}
|
||||
}
|
||||
|
@@ -186,6 +186,6 @@ CREATE TABLE IF NOT EXISTS "trade_brokerage_withdraw"
|
||||
"updater" varchar DEFAULT '',
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint not null default '0',目
|
||||
"tenant_id" bigint not null default '0',
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '佣金提现';
|
Reference in New Issue
Block a user