From 9250fa21608d5830507263ae5799833d695eda5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com>
Date: Tue, 30 Jul 2024 14:23:53 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B8=A0=E9=81=93=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/constants/ChannelConstants.java | 4 ++++
.../ss/account/domain/enums/AccountType.java | 2 +-
.../com/ruoyi/ss/channel/domain/Channel.java | 5 +++-
.../ruoyi/ss/channel/mapper/ChannelMapper.xml | 24 +++++++++++--------
.../ss/channel/service/ChannelService.java | 6 +++++
.../service/impl/ChannelServiceImpl.java | 7 ++++++
.../controller/app/AppChannelController.java | 11 +++++++++
.../controller/ss/SmChannelController.java | 1 +
8 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/smart-switch-service/src/main/java/com/ruoyi/common/constants/ChannelConstants.java b/smart-switch-service/src/main/java/com/ruoyi/common/constants/ChannelConstants.java
index be7507d7..746f9b2a 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/common/constants/ChannelConstants.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/common/constants/ChannelConstants.java
@@ -18,4 +18,8 @@ public class ChannelConstants {
// 余额
public static final Long BALANCE_ID = 4L;
+
+ // 收款码
+ public static final Long QR_CODE_ID = 5L;
+
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java
index 94572874..fde57c4f 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/account/domain/enums/AccountType.java
@@ -19,7 +19,7 @@ public enum AccountType {
BANK_CARD("1", "个人银行卡", ChannelConstants.BANK_CARD_ID),
WECHAT("2", "微信", ChannelConstants.WECHAT_ID),
ALIPAY("3", "支付宝", ChannelConstants.ALIPAY_ID),
- OFFLINE_IMAGE("4", "线下图片", null);
+ OFFLINE_IMAGE("4", "线下图片", ChannelConstants.QR_CODE_ID);
private final String type;
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/domain/Channel.java b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/domain/Channel.java
index 6a9d1ba4..060229d5 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/domain/Channel.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/domain/Channel.java
@@ -38,7 +38,6 @@ public class Channel extends BaseEntity
/** 服务费费率% */
@Excel(name = "服务费费率%")
@Min(value = 0, message = "服务费费率不允许低于0", groups = {ValidGroup.Update.class})
- @JsonView(JsonViewProfile.App.class)
private BigDecimal serviceRate;
/** 成本率% */
@@ -66,4 +65,8 @@ public class Channel extends BaseEntity
@ApiModelProperty("提现成本率%")
private BigDecimal withdrawCostRate;
+ @ApiModelProperty("渠道图片")
+ @JsonView(JsonViewProfile.App.class)
+ private String picture;
+
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/mapper/ChannelMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/mapper/ChannelMapper.xml
index cb2c7afc..007359c9 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/mapper/ChannelMapper.xml
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/mapper/ChannelMapper.xml
@@ -13,16 +13,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select
- channel_id,
- name,
- enabled,
- service_rate,
- cost_rate,
- service_type,
- withdraw_enabled,
- withdraw_service_type,
- withdraw_service_rate,
- withdraw_cost_rate
+ sc.channel_id,
+ sc.name,
+ sc.enabled,
+ sc.service_rate,
+ sc.cost_rate,
+ sc.service_type,
+ sc.withdraw_enabled,
+ sc.withdraw_service_type,
+ sc.withdraw_service_rate,
+ sc.withdraw_cost_rate,
+ sc.picture
from sm_channel sc
@@ -65,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
withdraw_service_type,
withdraw_service_rate,
withdraw_cost_rate,
+ picture,
#{channelId},
@@ -77,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{withdrawServiceType},
#{withdrawServiceRate},
#{withdrawCostRate},
+ #{picture},
@@ -92,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
withdraw_service_type = #{data.withdrawServiceType},
withdraw_service_rate = #{data.withdrawServiceRate},
withdraw_cost_rate = #{data.withdrawCostRate},
+ picture = #{data.picture},
where channel_id = #{data.channelId}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelService.java
index 3d7a2440..fb7628c5 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelService.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/ChannelService.java
@@ -78,4 +78,10 @@ public interface ChannelService
* @param keyMapper 映射函数
*/
Map selectMap(ChannelQuery query, Function super Channel, ? extends K> keyMapper);
+
+ /**
+ * 查询启用的提现渠道列表
+ */
+ List selectEnabledWithdrawList();
+
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/impl/ChannelServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/impl/ChannelServiceImpl.java
index 7dc691e9..509a756e 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/impl/ChannelServiceImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/channel/service/impl/ChannelServiceImpl.java
@@ -106,6 +106,13 @@ public class ChannelServiceImpl implements ChannelService
return this.selectSmChannelList(dto);
}
+ @Override
+ public List selectEnabledWithdrawList() {
+ ChannelQuery dto = new ChannelQuery();
+ dto.setWithdrawEnabled(true);
+ return this.selectSmChannelList(dto);
+ }
+
/**
* 查询充值渠道映射表
*
diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppChannelController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppChannelController.java
index 748e6026..36bb9617 100644
--- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppChannelController.java
+++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppChannelController.java
@@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.ss.channel.service.ChannelService;
+import com.ruoyi.ss.transactionBill.service.TransactionBillService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -22,6 +23,9 @@ public class AppChannelController extends BaseController {
@Autowired
private ChannelService channelService;
+ @Autowired
+ private TransactionBillService transactionBillService;
+
@ApiOperation("获取充值渠道列表")
@JsonView(JsonViewProfile.App.class)
@GetMapping("/recharge/enabledList")
@@ -29,4 +33,11 @@ public class AppChannelController extends BaseController {
return success(channelService.selectEnabledRechargeList());
}
+ @ApiOperation("获取提现渠道列表")
+ @JsonView(JsonViewProfile.App.class)
+ @GetMapping("/recharge/enabledWithdrawList")
+ public AjaxResult getWithdrawEnabledList() {
+ return success(channelService.selectEnabledWithdrawList());
+ }
+
}
diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmChannelController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmChannelController.java
index 0564cbde..1a4b7804 100644
--- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmChannelController.java
+++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmChannelController.java
@@ -91,6 +91,7 @@ public class SmChannelController extends BaseController
channel.setWithdrawServiceType(form.getWithdrawServiceType());
channel.setWithdrawServiceRate(form.getWithdrawServiceRate());
channel.setWithdrawCostRate(form.getWithdrawCostRate());
+ channel.setPicture(form.getPicture());
return toAjax(smChannelService.updateSmChannel(channel));
}