1. 支付渠道

This commit is contained in:
邱贞招 2024-09-06 16:10:45 +08:00
parent 99ef46526b
commit a6aebd38bb
15 changed files with 1003 additions and 434 deletions

View File

@ -0,0 +1,101 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.ChannelWithdraw;
import com.ruoyi.system.domain.ChannelWithdrawQuery;
import com.ruoyi.system.domain.ChannelWithdrawVO;
import com.ruoyi.system.service.ChannelWithdrawService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 提现渠道Controller
*
* @author ruoyi
* @date 2024-08-02
*/
@RestController
@RequestMapping("/ss/channelWithdraw")
public class ChannelWithdrawController extends BaseController
{
@Autowired
private ChannelWithdrawService channelWithdrawService;
/**
* 查询提现渠道列表
*/
@PreAuthorize("@ss.hasPermi('ss:channelWithdraw:list')")
@GetMapping("/list")
public TableDataInfo list(ChannelWithdrawQuery query)
{
startPage();
startOrderBy();
List<ChannelWithdrawVO> list = channelWithdrawService.selectChannelWithdrawList(query);
return getDataTable(list);
}
/**
* 导出提现渠道列表
*/
@PreAuthorize("@ss.hasPermi('ss:channelWithdraw:export')")
@Log(title = "提现渠道", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ChannelWithdrawQuery query)
{
List<ChannelWithdrawVO> list = channelWithdrawService.selectChannelWithdrawList(query);
ExcelUtil<ChannelWithdrawVO> util = new ExcelUtil<ChannelWithdrawVO>(ChannelWithdrawVO.class);
util.exportExcel(response, list, "提现渠道数据");
}
/**
* 获取提现渠道详细信息
*/
@PreAuthorize("@ss.hasPermi('ss:channelWithdraw:query')")
@GetMapping(value = "/{channelId}")
public AjaxResult getInfo(@PathVariable("channelId") Long channelId)
{
return success(channelWithdrawService.selectChannelWithdrawByChannelId(channelId));
}
/**
* 新增提现渠道
*/
@PreAuthorize("@ss.hasPermi('ss:channelWithdraw:add')")
@Log(title = "提现渠道", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ChannelWithdraw channelWithdraw)
{
return toAjax(channelWithdrawService.insertChannelWithdraw(channelWithdraw));
}
/**
* 修改提现渠道
*/
@PreAuthorize("@ss.hasPermi('ss:channelWithdraw:edit')")
@Log(title = "提现渠道", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ChannelWithdraw channelWithdraw)
{
return toAjax(channelWithdrawService.updateChannelWithdraw(channelWithdraw));
}
/**
* 删除提现渠道
*/
@PreAuthorize("@ss.hasPermi('ss:channelWithdraw:remove')")
@Log(title = "提现渠道", businessType = BusinessType.DELETE)
@DeleteMapping("/{channelIds}")
public AjaxResult remove(@PathVariable Long[] channelIds)
{
return toAjax(channelWithdrawService.deleteChannelWithdrawByChannelIds(channelIds));
}
}

View File

@ -1,88 +1,86 @@
//package com.ruoyi.web.controller.system; package com.ruoyi.web.controller.system;
//
//import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
//import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
//import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.core.domain.ValidGroup;
//import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
//import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
//import com.ruoyi.ss.channel.domain.Channel; import com.ruoyi.system.domain.Channel;
//import com.ruoyi.ss.channel.domain.ChannelQuery; import com.ruoyi.system.domain.ChannelQuery;
//import com.ruoyi.ss.channel.domain.ChannelVO; import com.ruoyi.system.domain.ChannelVO;
//import com.ruoyi.ss.channel.service.ChannelService; import com.ruoyi.system.service.ChannelService;
//import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
//import java.util.List; import java.util.List;
//
///** /**
// * 充值渠道Controller * 充值渠道Controller
// * *
// * @author ruoyi * @author ruoyi
// * @date 2024-04-15 * @date 2024-04-15
// */ */
//@RestController @RestController
//@RequestMapping("/system/channel") @RequestMapping("/system/channel")
//public class SmChannelController extends BaseController public class SmChannelController extends BaseController
//{ {
// @Autowired @Autowired
// private ChannelService smChannelService; private ChannelService smChannelService;
//
// /** /**
// * 查询充值渠道列表 * 查询充值渠道列表
// */ */
// @PreAuthorize("@ss.hasPermi('system:channel:list')") @PreAuthorize("@ss.hasPermi('system:channel:list')")
// @GetMapping("/list") @GetMapping("/list")
// public TableDataInfo list(ChannelQuery smChannel) public TableDataInfo list(ChannelQuery smChannel)
// { {
// startPage(); startPage();
// List<ChannelVO> list = smChannelService.selectSmChannelList(smChannel); List<ChannelVO> list = smChannelService.selectSmChannelList(smChannel);
// return getDataTable(list); return getDataTable(list);
// } }
//
// /** /**
// * 导出充值渠道列表 * 导出充值渠道列表
// */ */
// @PreAuthorize("@ss.hasPermi('system:channel:export')") @PreAuthorize("@ss.hasPermi('system:channel:export')")
// @Log(title = "充值渠道", businessType = BusinessType.EXPORT) @Log(title = "充值渠道", businessType = BusinessType.EXPORT)
// @PostMapping("/export") @PostMapping("/export")
// public void export(HttpServletResponse response, ChannelQuery smChannel) public void export(HttpServletResponse response, ChannelQuery smChannel)
// { {
// List<ChannelVO> list = smChannelService.selectSmChannelList(smChannel); List<ChannelVO> list = smChannelService.selectSmChannelList(smChannel);
// ExcelUtil<ChannelVO> util = new ExcelUtil<ChannelVO>(ChannelVO.class); ExcelUtil<ChannelVO> util = new ExcelUtil<ChannelVO>(ChannelVO.class);
// util.exportExcel(response, list, "充值渠道数据"); util.exportExcel(response, list, "充值渠道数据");
// } }
//
// /** /**
// * 获取充值渠道详细信息 * 获取充值渠道详细信息
// */ */
// @PreAuthorize("@ss.hasPermi('system:channel:query')") @PreAuthorize("@ss.hasPermi('system:channel:query')")
// @GetMapping(value = "/{channelId}") @GetMapping(value = "/{channelId}")
// public AjaxResult getInfo(@PathVariable("channelId") Long channelId) public AjaxResult getInfo(@PathVariable("channelId") Long channelId)
// { {
// return success(smChannelService.selectSmChannelByChannelId(channelId)); return success(smChannelService.selectSmChannelByChannelId(channelId));
// } }
//
// /** /**
// * 修改充值渠道 * 修改充值渠道
// */ */
// @PreAuthorize("@ss.hasPermi('system:channel:edit')") @PreAuthorize("@ss.hasPermi('system:channel:edit')")
// @Log(title = "充值渠道", businessType = BusinessType.UPDATE) @Log(title = "充值渠道", businessType = BusinessType.UPDATE)
// @PutMapping @PutMapping
// public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) Channel form) public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) Channel form)
// { {
// Channel channel = new Channel(); Channel channel = new Channel();
// channel.setChannelId(form.getChannelId()); channel.setChannelId(form.getChannelId());
// channel.setEnabled(form.getEnabled()); channel.setEnabled(form.getEnabled());
// channel.setServiceRate(form.getServiceRate()); channel.setCostRate(form.getCostRate());
// channel.setCostRate(form.getCostRate()); channel.setPicture(form.getPicture());
// channel.setServiceType(form.getServiceType()); return toAjax(smChannelService.updateSmChannel(channel));
// channel.setPicture(form.getPicture()); }
// return toAjax(smChannelService.updateSmChannel(channel));
// } }
//
//}

View File

@ -3,7 +3,7 @@ package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.JsonViewProfile; //import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.core.domain.ValidGroup;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -23,34 +23,34 @@ public class Channel extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /** 主键 */
@JsonView(JsonViewProfile.App.class) // @JsonView(JsonViewProfile.App.class)
private Long channelId; private Long channelId;
/** 渠道名称 */ /** 渠道名称 */
@Excel(name = "渠道名称") @Excel(name = "渠道名称")
@JsonView(JsonViewProfile.App.class) // @JsonView(JsonViewProfile.App.class)
private String name; private String name;
/** 是否启用 */ /** 是否启用 */
@Excel(name = "是否启用") @Excel(name = "是否启用")
private Boolean enabled; private Boolean enabled;
/** 服务费费率% */ // /** 服务费费率% */
@Excel(name = "服务费费率%") // @Excel(name = "服务费费率%")
@Min(value = 0, message = "服务费费率不允许低于0", groups = {ValidGroup.Update.class}) // @Min(value = 0, message = "服务费费率不允许低于0", groups = {ValidGroup.Update.class})
private BigDecimal serviceRate; // private BigDecimal serviceRate;
/** 成本率% */ /** 成本率% */
@Excel(name = "成本率%") @Excel(name = "成本率%")
@Min(value = 0, message = "成本率不允许低于0", groups = {ValidGroup.Update.class}) @Min(value = 0, message = "成本率不允许低于0", groups = {ValidGroup.Update.class})
private BigDecimal costRate; private BigDecimal costRate;
@Excel(name = "服务费类型") // @Excel(name = "服务费类型")
@ApiModelProperty("服务费类型") // @ApiModelProperty("服务费类型")
private String serviceType; // private String serviceType;
@ApiModelProperty("渠道图片") @ApiModelProperty("渠道图片")
@JsonView(JsonViewProfile.App.class) // @JsonView(JsonViewProfile.App.class)
private String picture; private String picture;
} }

View File

@ -0,0 +1,60 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import java.math.BigDecimal;
/**
* 提现渠道对象 ss_channel_withdraw
*
* @author ruoyi
* @date 2024-08-02
*/
@Data
public class ChannelWithdraw extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long channelId;
@Excel(name = "渠道名称")
@ApiModelProperty("渠道名称")
private String name;
@Excel(name = "对应账户类型")
@ApiModelProperty("对应账户类型")
private String accountType;
@Excel(name = "服务费收取类型")
@ApiModelProperty("服务费收取类型")
private String serviceType;
@Excel(name = "服务费")
@ApiModelProperty("服务费")
private BigDecimal serviceRate;
@Excel(name = "是否启用")
@ApiModelProperty("是否启用")
private Boolean enabled;
@Excel(name = "渠道成本率")
@ApiModelProperty("渠道成本率")
private BigDecimal costRate;
@Excel(name = "图片")
@ApiModelProperty("图片")
private String picture;
@ApiModelProperty("单笔最低提现金额")
@Min(value = 0, message = "单笔最低提现金额不能小于0")
private BigDecimal minAmount;
@ApiModelProperty("单笔最高提现金额")
@Min(value = 0, message = "单笔最高提现金额不能小于0")
private BigDecimal maxAmount;
}

View File

@ -0,0 +1,18 @@
package com.ruoyi.system.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author wjh
* 2024/8/2
*/
@Data
public class ChannelWithdrawQuery extends ChannelWithdraw{
@ApiModelProperty("账户类型列表")
private List<String> accountTypes;
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.system.domain;
import lombok.Data;
/**
* @author wjh
* 2024/8/2
*/
@Data
public class ChannelWithdrawVO extends ChannelWithdraw{
}

View File

@ -1,9 +1,9 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
//import com.ruoyi.ss.channel.domain.Channel; import com.ruoyi.system.domain.Channel;
//import com.ruoyi.ss.channel.domain.ChannelQuery; import com.ruoyi.system.domain.ChannelQuery;
//import com.ruoyi.ss.channel.domain.ChannelVO; import com.ruoyi.system.domain.ChannelVO;
//import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -15,51 +15,51 @@ import java.util.List;
*/ */
public interface ChannelMapper public interface ChannelMapper
{ {
// /** /**
// * 查询充值渠道 * 查询充值渠道
// * *
// * @param channelId 充值渠道主键 * @param channelId 充值渠道主键
// * @return 充值渠道 * @return 充值渠道
// */ */
// public ChannelVO selectSmChannelByChannelId(Long channelId); public ChannelVO selectSmChannelByChannelId(Long channelId);
//
// /** /**
// * 查询充值渠道列表 * 查询充值渠道列表
// * *
// * @param smChannel 充值渠道 * @param smChannel 充值渠道
// * @return 充值渠道集合 * @return 充值渠道集合
// */ */
// public List<ChannelVO> selectSmChannelList(@Param("query") ChannelQuery smChannel); public List<ChannelVO> selectSmChannelList(@Param("query") ChannelQuery smChannel);
//
// /** /**
// * 新增充值渠道 * 新增充值渠道
// * *
// * @param channel 充值渠道 * @param channel 充值渠道
// * @return 结果 * @return 结果
// */ */
// public int insertSmChannel(Channel channel); public int insertSmChannel(Channel channel);
//
// /** /**
// * 修改充值渠道 * 修改充值渠道
// * *
// * @param channel 充值渠道 * @param channel 充值渠道
// * @return 结果 * @return 结果
// */ */
// public int updateSmChannel(@Param("data") Channel channel); public int updateSmChannel(@Param("data") Channel channel);
//
// /** /**
// * 删除充值渠道 * 删除充值渠道
// * *
// * @param channelId 充值渠道主键 * @param channelId 充值渠道主键
// * @return 结果 * @return 结果
// */ */
// public int deleteSmChannelByChannelId(Long channelId); public int deleteSmChannelByChannelId(Long channelId);
//
// /** /**
// * 批量删除充值渠道 * 批量删除充值渠道
// * *
// * @param channelIds 需要删除的数据主键集合 * @param channelIds 需要删除的数据主键集合
// * @return 结果 * @return 结果
// */ */
// public int deleteSmChannelByChannelIds(Long[] channelIds); public int deleteSmChannelByChannelIds(Long[] channelIds);
} }

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.ChannelWithdraw;
import com.ruoyi.system.domain.ChannelWithdrawQuery;
import com.ruoyi.system.domain.ChannelWithdrawVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 提现渠道Mapper接口
*
* @author ruoyi
* @date 2024-08-02
*/
public interface ChannelWithdrawMapper
{
/**
* 查询提现渠道
*
* @param channelId 提现渠道主键
* @return 提现渠道
*/
public ChannelWithdrawVO selectChannelWithdrawByChannelId(Long channelId);
/**
* 查询提现渠道列表
*
* @param query 提现渠道
* @return 提现渠道集合
*/
public List<ChannelWithdrawVO> selectChannelWithdrawList(@Param("query") ChannelWithdrawQuery query);
/**
* 新增提现渠道
*
* @param channelWithdraw 提现渠道
* @return 结果
*/
public int insertChannelWithdraw(ChannelWithdraw channelWithdraw);
/**
* 修改提现渠道
*
* @param channelWithdraw 提现渠道
* @return 结果
*/
public int updateChannelWithdraw(@Param("data") ChannelWithdraw channelWithdraw);
/**
* 删除提现渠道
*
* @param channelId 提现渠道主键
* @return 结果
*/
public int deleteChannelWithdrawByChannelId(Long channelId);
/**
* 批量删除提现渠道
*
* @param channelIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteChannelWithdrawByChannelIds(Long[] channelIds);
}

View File

@ -0,0 +1,43 @@
package com.ruoyi.system.mapper.typehandler;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* 非空BigDecimal类型处理器为空时返回0
* @author wjh
* 2024/3/30
*/
public class NonNullDecimalTypeHandler extends BaseTypeHandler<BigDecimal> {
@Override
public void setNonNullParameter(PreparedStatement ps, int i, BigDecimal parameter, JdbcType jdbcType) throws SQLException {
ps.setBigDecimal(i, parameter);
}
@Override
public BigDecimal getNullableResult(ResultSet rs, String columnName)
throws SQLException {
BigDecimal data = rs.getBigDecimal(columnName);
return data == null ? BigDecimal.ZERO : data;
}
@Override
public BigDecimal getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
BigDecimal data = rs.getBigDecimal(columnIndex);
return data == null ? BigDecimal.ZERO : data;
}
@Override
public BigDecimal getNullableResult(CallableStatement cs, int columnIndex)
throws SQLException {
BigDecimal data = cs.getBigDecimal(columnIndex);
return data == null ? BigDecimal.ZERO : data;
}
}

View File

@ -1,82 +1,82 @@
//package com.ruoyi.system.service; package com.ruoyi.system.service;
//
//import com.ruoyi.ss.channel.domain.Channel; import com.ruoyi.system.domain.Channel;
//import com.ruoyi.ss.channel.domain.ChannelQuery; import com.ruoyi.system.domain.ChannelQuery;
//import com.ruoyi.ss.channel.domain.ChannelVO; import com.ruoyi.system.domain.ChannelVO;
//
//import java.util.List; import java.util.List;
//import java.util.Map; import java.util.Map;
//import java.util.function.Function; import java.util.function.Function;
//
///** /**
// * 充值渠道Service接口 * 充值渠道Service接口
// * *
// * @author ruoyi * @author ruoyi
// * @date 2024-04-15 * @date 2024-04-15
// */ */
//public interface ChannelService public interface ChannelService
//{ {
// /** /**
// * 查询充值渠道 * 查询充值渠道
// * *
// * @param channelId 充值渠道主键 * @param channelId 充值渠道主键
// * @return 充值渠道 * @return 充值渠道
// */ */
// public ChannelVO selectSmChannelByChannelId(Long channelId); public ChannelVO selectSmChannelByChannelId(Long channelId);
//
// /** /**
// * 查询充值渠道列表 * 查询充值渠道列表
// * *
// * @param smChannel 充值渠道 * @param smChannel 充值渠道
// * @return 充值渠道集合 * @return 充值渠道集合
// */ */
// public List<ChannelVO> selectSmChannelList(ChannelQuery smChannel); public List<ChannelVO> selectSmChannelList(ChannelQuery smChannel);
//
// /** /**
// * 新增充值渠道 * 新增充值渠道
// * *
// * @param channel 充值渠道 * @param channel 充值渠道
// * @return 结果 * @return 结果
// */ */
// public int insertSmChannel(Channel channel); public int insertSmChannel(Channel channel);
//
// /** /**
// * 修改充值渠道 * 修改充值渠道
// * *
// * @param channel 充值渠道 * @param channel 充值渠道
// * @return 结果 * @return 结果
// */ */
// public int updateSmChannel(Channel channel); public int updateSmChannel(Channel channel);
//
// /** /**
// * 批量删除充值渠道 * 批量删除充值渠道
// * *
// * @param channelIds 需要删除的充值渠道主键集合 * @param channelIds 需要删除的充值渠道主键集合
// * @return 结果 * @return 结果
// */ */
// public int deleteSmChannelByChannelIds(Long[] channelIds); public int deleteSmChannelByChannelIds(Long[] channelIds);
//
// /** /**
// * 删除充值渠道信息 * 删除充值渠道信息
// * *
// * @param channelId 充值渠道主键 * @param channelId 充值渠道主键
// * @return 结果 * @return 结果
// */ */
// public int deleteSmChannelByChannelId(Long channelId); public int deleteSmChannelByChannelId(Long channelId);
//
// /** /**
// * 查询启用的充值渠道列表 * 查询启用的充值渠道列表
// * *
// * @return * @return
// */ */
// List<ChannelVO> selectEnabledRechargeList(); List<ChannelVO> selectEnabledRechargeList();
//
// /** /**
// * 查询充值渠道映射表 * 查询充值渠道映射表
// * *
// * @param query 查询条件 * @param query 查询条件
// * @param keyMapper 映射函数 * @param keyMapper 映射函数
// */ */
// <K> Map<K, ChannelVO> selectMap(ChannelQuery query, Function<? super Channel, ? extends K> keyMapper); <K> Map<K, ChannelVO> selectMap(ChannelQuery query, Function<? super Channel, ? extends K> keyMapper);
//
//} }

View File

@ -0,0 +1,69 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.ChannelWithdraw;
import com.ruoyi.system.domain.ChannelWithdrawQuery;
import com.ruoyi.system.domain.ChannelWithdrawVO;
import java.util.List;
/**
* 提现渠道Service接口
*
* @author ruoyi
* @date 2024-08-02
*/
public interface ChannelWithdrawService
{
/**
* 查询提现渠道
*
* @param channelId 提现渠道主键
* @return 提现渠道
*/
public ChannelWithdrawVO selectChannelWithdrawByChannelId(Long channelId);
/**
* 查询提现渠道列表
*
* @param channelWithdraw 提现渠道
* @return 提现渠道集合
*/
public List<ChannelWithdrawVO> selectChannelWithdrawList(ChannelWithdrawQuery channelWithdraw);
/**
* 新增提现渠道
*
* @param channelWithdraw 提现渠道
* @return 结果
*/
public int insertChannelWithdraw(ChannelWithdraw channelWithdraw);
/**
* 修改提现渠道
*
* @param channelWithdraw 提现渠道
* @return 结果
*/
public int updateChannelWithdraw(ChannelWithdraw channelWithdraw);
/**
* 批量删除提现渠道
*
* @param channelIds 需要删除的提现渠道主键集合
* @return 结果
*/
public int deleteChannelWithdrawByChannelIds(Long[] channelIds);
/**
* 删除提现渠道信息
*
* @param channelId 提现渠道主键
* @return 结果
*/
public int deleteChannelWithdrawByChannelId(Long channelId);
/**
* 查询用户可用的提现渠道
*/
List<ChannelWithdrawVO> selectEnabledList(Long userId);
}

View File

@ -1,127 +1,122 @@
//package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
//
//import com.ruoyi.common.utils.collection.CollectionUtils; import com.ruoyi.system.domain.Channel;
//import com.ruoyi.ss.account.service.AccountService; import com.ruoyi.system.domain.ChannelQuery;
//import com.ruoyi.ss.channel.domain.Channel; import com.ruoyi.system.domain.ChannelVO;
//import com.ruoyi.ss.channel.domain.ChannelQuery; import com.ruoyi.system.mapper.ChannelMapper;
//import com.ruoyi.ss.channel.domain.ChannelVO; import com.ruoyi.system.service.ChannelService;
//import com.ruoyi.ss.channel.mapper.ChannelMapper; import org.springframework.beans.factory.annotation.Autowired;
//import com.ruoyi.ss.channel.service.ChannelService; import org.springframework.stereotype.Service;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service; import javax.annotation.Resource;
// import java.util.List;
//import java.util.Collections; import java.util.Map;
//import java.util.List; import java.util.function.Function;
//import java.util.Map; import java.util.stream.Collectors;
//import java.util.function.Function;
//import java.util.stream.Collectors; /**
// * 充值渠道Service业务层处理
///** *
// * 充值渠道Service业务层处理 * @author ruoyi
// * * @date 2024-04-15
// * @author ruoyi */
// * @date 2024-04-15 @Service
// */ public class ChannelServiceImpl implements ChannelService
//@Service {
//public class ChannelServiceImpl implements ChannelService @Resource
//{ private ChannelMapper channelMapper;
// @Autowired
// private ChannelMapper channelMapper; /**
// * 查询充值渠道
// @Autowired *
// private AccountService accountService; * @param channelId 充值渠道主键
// * @return 充值渠道
// /** */
// * 查询充值渠道 @Override
// * public ChannelVO selectSmChannelByChannelId(Long channelId)
// * @param channelId 充值渠道主键 {
// * @return 充值渠道 return channelMapper.selectSmChannelByChannelId(channelId);
// */ }
// @Override
// public ChannelVO selectSmChannelByChannelId(Long channelId) /**
// { * 查询充值渠道列表
// return channelMapper.selectSmChannelByChannelId(channelId); *
// } * @param smChannel 充值渠道
// * @return 充值渠道
// /** */
// * 查询充值渠道列表 @Override
// * public List<ChannelVO> selectSmChannelList(ChannelQuery smChannel)
// * @param smChannel 充值渠道 {
// * @return 充值渠道 return channelMapper.selectSmChannelList(smChannel);
// */ }
// @Override
// public List<ChannelVO> selectSmChannelList(ChannelQuery smChannel) /**
// { * 新增充值渠道
// return channelMapper.selectSmChannelList(smChannel); *
// } * @param channel 充值渠道
// * @return 结果
// /** */
// * 新增充值渠道 @Override
// * public int insertSmChannel(Channel channel)
// * @param channel 充值渠道 {
// * @return 结果 return channelMapper.insertSmChannel(channel);
// */ }
// @Override
// public int insertSmChannel(Channel channel) /**
// { * 修改充值渠道
// return channelMapper.insertSmChannel(channel); *
// } * @param channel 充值渠道
// * @return 结果
// /** */
// * 修改充值渠道 @Override
// * public int updateSmChannel(Channel channel)
// * @param channel 充值渠道 {
// * @return 结果 return channelMapper.updateSmChannel(channel);
// */ }
// @Override
// public int updateSmChannel(Channel channel) /**
// { * 批量删除充值渠道
// return channelMapper.updateSmChannel(channel); *
// } * @param channelIds 需要删除的充值渠道主键
// * @return 结果
// /** */
// * 批量删除充值渠道 @Override
// * public int deleteSmChannelByChannelIds(Long[] channelIds)
// * @param channelIds 需要删除的充值渠道主键 {
// * @return 结果 return channelMapper.deleteSmChannelByChannelIds(channelIds);
// */ }
// @Override
// public int deleteSmChannelByChannelIds(Long[] channelIds) /**
// { * 删除充值渠道信息
// return channelMapper.deleteSmChannelByChannelIds(channelIds); *
// } * @param channelId 充值渠道主键
// * @return 结果
// /** */
// * 删除充值渠道信息 @Override
// * public int deleteSmChannelByChannelId(Long channelId)
// * @param channelId 充值渠道主键 {
// * @return 结果 return channelMapper.deleteSmChannelByChannelId(channelId);
// */ }
// @Override
// public int deleteSmChannelByChannelId(Long channelId) @Override
// { public List<ChannelVO> selectEnabledRechargeList() {
// return channelMapper.deleteSmChannelByChannelId(channelId); ChannelQuery dto = new ChannelQuery();
// } dto.setEnabled(true);
// return this.selectSmChannelList(dto);
// @Override }
// public List<ChannelVO> selectEnabledRechargeList() {
// ChannelQuery dto = new ChannelQuery(); /**
// dto.setEnabled(true); * 查询充值渠道映射表
// return this.selectSmChannelList(dto); *
// } * @param query 查询条件
// * @param keyMapper 映射函数
// /** */
// * 查询充值渠道映射表 @Override
// * public <K> Map<K, ChannelVO> selectMap(ChannelQuery query, Function<? super Channel, ? extends K> keyMapper) {
// * @param query 查询条件 List<ChannelVO> list = this.selectSmChannelList(query);
// * @param keyMapper 映射函数
// */
// @Override
// public <K> Map<K, ChannelVO> selectMap(ChannelQuery query, Function<? super Channel, ? extends K> keyMapper) {
// List<ChannelVO> list = this.selectSmChannelList(query);
// if (CollectionUtils.isEmptyElement(list)) { // if (CollectionUtils.isEmptyElement(list)) {
// return Collections.emptyMap(); // return Collections.emptyMap();
// } // }
// return list.stream().collect(Collectors.toMap(keyMapper, item -> item)); return list.stream().collect(Collectors.toMap(keyMapper, item -> item));
// } }
//} }

View File

@ -0,0 +1,114 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.system.domain.ChannelWithdraw;
import com.ruoyi.system.domain.ChannelWithdrawQuery;
import com.ruoyi.system.domain.ChannelWithdrawVO;
import com.ruoyi.system.mapper.ChannelWithdrawMapper;
import com.ruoyi.system.service.ChannelWithdrawService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 提现渠道Service业务层处理
*
* @author ruoyi
* @date 2024-08-02
*/
@Service
public class ChannelWithdrawServiceImpl implements ChannelWithdrawService
{
@Resource
private ChannelWithdrawMapper channelWithdrawMapper;
// @Autowired
// private AccountService accountService;
/**
* 查询提现渠道
*
* @param channelId 提现渠道主键
* @return 提现渠道
*/
@Override
public ChannelWithdrawVO selectChannelWithdrawByChannelId(Long channelId)
{
return channelWithdrawMapper.selectChannelWithdrawByChannelId(channelId);
}
/**
* 查询提现渠道列表
*
* @param channelWithdraw 提现渠道
* @return 提现渠道
*/
@Override
public List<ChannelWithdrawVO> selectChannelWithdrawList(ChannelWithdrawQuery channelWithdraw)
{
return channelWithdrawMapper.selectChannelWithdrawList(channelWithdraw);
}
/**
* 新增提现渠道
*
* @param channelWithdraw 提现渠道
* @return 结果
*/
@Override
public int insertChannelWithdraw(ChannelWithdraw channelWithdraw)
{
return channelWithdrawMapper.insertChannelWithdraw(channelWithdraw);
}
/**
* 修改提现渠道
*
* @param channelWithdraw 提现渠道
* @return 结果
*/
@Override
public int updateChannelWithdraw(ChannelWithdraw channelWithdraw)
{
return channelWithdrawMapper.updateChannelWithdraw(channelWithdraw);
}
/**
* 批量删除提现渠道
*
* @param channelIds 需要删除的提现渠道主键
* @return 结果
*/
@Override
public int deleteChannelWithdrawByChannelIds(Long[] channelIds)
{
return channelWithdrawMapper.deleteChannelWithdrawByChannelIds(channelIds);
}
/**
* 删除提现渠道信息
*
* @param channelId 提现渠道主键
* @return 结果
*/
@Override
public int deleteChannelWithdrawByChannelId(Long channelId)
{
return channelWithdrawMapper.deleteChannelWithdrawByChannelId(channelId);
}
@Override
public List<ChannelWithdrawVO> selectEnabledList(Long userId) {
// 查询用户账户列表
// List<AccountVO> accountList = accountService.selectByUserId(userId);
// if (CollectionUtils.isEmptyElement(accountList)) {
// return Collections.emptyList();
// }
// 查询渠道列表
// ChannelWithdrawQuery query = new ChannelWithdrawQuery();
// query.setAccountTypes(CollectionUtils.map(accountList, AccountVO::getAccountType));
// query.setEnabled(true);
// return this.selectChannelWithdrawList(query);
return null;
}
}

View File

@ -4,90 +4,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.ChannelMapper"> <mapper namespace="com.ruoyi.system.mapper.ChannelMapper">
<!-- <resultMap type="ChannelVO" id="SmChannelResult" autoMapping="true">--> <resultMap type="ChannelVO" id="SmChannelResult" autoMapping="true">
<!-- <result property="serviceRate" column="service_rate" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler"/>--> <result property="costRate" column="cost_rate" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler"/>
<!-- <result property="costRate" column="cost_rate" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler"/>--> </resultMap>
<!-- </resultMap>-->
<!-- <sql id="selectSmChannelVo">--> <sql id="selectSmChannelVo">
<!-- select--> select
<!-- sc.channel_id,--> sc.channel_id,
<!-- sc.name,--> sc.name,
<!-- sc.enabled,--> sc.enabled,
<!-- sc.service_rate,--> sc.cost_rate,
<!-- sc.cost_rate,--> sc.picture
<!-- sc.service_type,--> from sm_channel sc
<!-- sc.picture--> </sql>
<!-- from sm_channel sc-->
<!-- </sql>-->
<!-- <sql id="searchCondition">--> <sql id="searchCondition">
<!-- <if test="query.name != null and query.name != ''"> and sc.name like concat('%', #{query.name}, '%')</if>--> <if test="query.name != null and query.name != ''"> and sc.name like concat('%', #{query.name}, '%')</if>
<!-- <if test="query.enabled != null "> and sc.enabled = #{query.enabled}</if>--> <if test="query.enabled != null "> and sc.enabled = #{query.enabled}</if>
<!-- <if test="query.serviceType != null and query.serviceType != ''"> and sc.service_type = #{query.serviceType}</if>--> <if test="query.channelIds != null and query.channelIds.size() > 0 ">
<!-- <if test="query.channelIds != null and query.channelIds.size() > 0 ">--> and sc.channel_id in
<!-- and sc.channel_id in--> <foreach item="item" collection="query.channelIds" open="(" separator="," close=")">
<!-- <foreach item="item" collection="query.channelIds" open="(" separator="," close=")">--> #{item}
<!-- #{item}--> </foreach>
<!-- </foreach>--> </if>
<!-- </if>--> </sql>
<!-- </sql>-->
<!-- <select id="selectSmChannelList" parameterType="ChannelQuery" resultMap="SmChannelResult">--> <select id="selectSmChannelList" parameterType="ChannelQuery" resultMap="SmChannelResult">
<!-- <include refid="selectSmChannelVo"/>--> <include refid="selectSmChannelVo"/>
<!-- <where>--> <where>
<!-- <include refid="searchCondition"/>--> <include refid="searchCondition"/>
<!-- </where>--> </where>
<!-- </select>--> </select>
<!-- <select id="selectSmChannelByChannelId" parameterType="Long" resultMap="SmChannelResult">--> <select id="selectSmChannelByChannelId" parameterType="Long" resultMap="SmChannelResult">
<!-- <include refid="selectSmChannelVo"/>--> <include refid="selectSmChannelVo"/>
<!-- where sc.channel_id = #{channelId}--> where sc.channel_id = #{channelId}
<!-- </select>--> </select>
<!-- <insert id="insertSmChannel" parameterType="Channel">--> <insert id="insertSmChannel" parameterType="Channel">
<!-- insert into sm_channel--> insert into sm_channel
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">--> <trim prefix="(" suffix=")" suffixOverrides=",">
<!-- <if test="channelId != null">channel_id,</if>--> <if test="channelId != null">channel_id,</if>
<!-- <if test="name != null">`name`,</if>--> <if test="name != null">`name`,</if>
<!-- <if test="enabled != null">enabled,</if>--> <if test="enabled != null">enabled,</if>
<!-- <if test="serviceRate != null">service_rate,</if>--> <if test="costRate != null">cost_rate,</if>
<!-- <if test="costRate != null">cost_rate,</if>--> <if test="picture != null">picture,</if>
<!-- <if test="serviceType != null">service_type,</if>--> </trim>
<!-- <if test="picture != null">picture,</if>--> <trim prefix="values (" suffix=")" suffixOverrides=",">
<!-- </trim>--> <if test="channelId != null">#{channelId},</if>
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">--> <if test="name != null">#{name},</if>
<!-- <if test="channelId != null">#{channelId},</if>--> <if test="enabled != null">#{enabled},</if>
<!-- <if test="name != null">#{name},</if>--> <if test="costRate != null">#{costRate},</if>
<!-- <if test="enabled != null">#{enabled},</if>--> <if test="picture != null">#{picture},</if>
<!-- <if test="serviceRate != null">#{serviceRate},</if>--> </trim>
<!-- <if test="costRate != null">#{costRate},</if>--> </insert>
<!-- <if test="serviceType != null">#{serviceType},</if>-->
<!-- <if test="picture != null">#{picture},</if>-->
<!-- </trim>-->
<!-- </insert>-->
<!-- <update id="updateSmChannel" parameterType="Channel">--> <update id="updateSmChannel" parameterType="Channel">
<!-- update sm_channel--> update sm_channel
<!-- <trim prefix="SET" suffixOverrides=",">--> <trim prefix="SET" suffixOverrides=",">
<!-- <if test="data.name != null">name = #{data.name},</if>--> <if test="data.name != null">name = #{data.name},</if>
<!-- <if test="data.enabled != null">enabled = #{data.enabled},</if>--> <if test="data.enabled != null">enabled = #{data.enabled},</if>
<!-- <if test="data.serviceRate != null">service_rate = #{data.serviceRate},</if>--> <if test="data.costRate != null">cost_rate = #{data.costRate},</if>
<!-- <if test="data.costRate != null">cost_rate = #{data.costRate},</if>--> <if test="data.picture != null">picture = #{data.picture},</if>
<!-- <if test="data.serviceType != null">service_type = #{data.serviceType},</if>--> </trim>
<!-- <if test="data.picture != null">picture = #{data.picture},</if>--> where channel_id = #{data.channelId}
<!-- </trim>--> </update>
<!-- where channel_id = #{data.channelId}-->
<!-- </update>-->
<!-- <delete id="deleteSmChannelByChannelId" parameterType="Long">--> <delete id="deleteSmChannelByChannelId" parameterType="Long">
<!-- delete from sm_channel where channel_id = #{channelId}--> delete from sm_channel where channel_id = #{channelId}
<!-- </delete>--> </delete>
<!-- <delete id="deleteSmChannelByChannelIds" parameterType="String">--> <delete id="deleteSmChannelByChannelIds" parameterType="String">
<!-- delete from sm_channel where channel_id in--> delete from sm_channel where channel_id in
<!-- <foreach item="channelId" collection="array" open="(" separator="," close=")">--> <foreach item="channelId" collection="array" open="(" separator="," close=")">
<!-- #{channelId}--> #{channelId}
<!-- </foreach>--> </foreach>
<!-- </delete>--> </delete>
</mapper> </mapper>

View File

@ -0,0 +1,105 @@
<?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.ruoyi.system.mapper.ChannelWithdrawMapper">
<resultMap type="ChannelWithdrawVO" id="ChannelWithdrawResult" autoMapping="true">
<result property="serviceRate" column="service_rate" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler"/>
<result property="costRate" column="cost_rate" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullDecimalTypeHandler"/>
</resultMap>
<sql id="selectChannelWithdrawVo">
select
scw.channel_id,
scw.name,
scw.account_type,
scw.service_type,
scw.service_rate,
scw.enabled,
scw.cost_rate,
scw.picture,
scw.min_amount,
scw.max_amount
from ss_channel_withdraw scw
</sql>
<sql id="searchCondition">
<if test="query.channelId != null "> and scw.channel_id = #{query.channelId}</if>
<if test="query.name != null and query.name != ''"> and scw.name like concat('%', #{query.name}, '%')</if>
<if test="query.accountType != null and query.accountType != ''"> and scw.account_type = #{query.accountType}</if>
<if test="query.serviceType != null and query.serviceType != ''"> and scw.service_type = #{query.serviceType}</if>
<if test="query.enabled != null "> and scw.enabled = #{query.enabled}</if>
<if test="query.accountTypes != null and query.accountTypes.size() > 0">
and scw.account_type in
<foreach item="item" collection="query.accountTypes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<select id="selectChannelWithdrawList" parameterType="ChannelWithdrawQuery" resultMap="ChannelWithdrawResult">
<include refid="selectChannelWithdrawVo"/>
<where>
<include refid="searchCondition"/>
</where>
</select>
<select id="selectChannelWithdrawByChannelId" parameterType="Long" resultMap="ChannelWithdrawResult">
<include refid="selectChannelWithdrawVo"/>
where channel_id = #{channelId}
</select>
<insert id="insertChannelWithdraw" parameterType="ChannelWithdraw" useGeneratedKeys="true" keyProperty="channelId">
insert into ss_channel_withdraw
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="accountType != null and accountType != ''">account_type,</if>
<if test="serviceType != null and serviceType != ''">service_type,</if>
<if test="serviceRate != null">service_rate,</if>
<if test="enabled != null">enabled,</if>
<if test="costRate != null">cost_rate,</if>
<if test="picture != null">picture,</if>
<if test="minAmount != null">min_amount,</if>
<if test="maxAmount != null">max_amount,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="accountType != null and accountType != ''">#{accountType},</if>
<if test="serviceType != null and serviceType != ''">#{serviceType},</if>
<if test="serviceRate != null">#{serviceRate},</if>
<if test="enabled != null">#{enabled},</if>
<if test="costRate != null">#{costRate},</if>
<if test="picture != null">#{picture},</if>
<if test="minAmount != null">#{minAmount},</if>
<if test="maxAmount != null">#{maxAmount},</if>
</trim>
</insert>
<update id="updateChannelWithdraw" parameterType="ChannelWithdraw">
update ss_channel_withdraw
<trim prefix="SET" suffixOverrides=",">
<if test="data.name != null and data.name != ''">name = #{data.name},</if>
<if test="data.accountType != null and data.accountType != ''">account_type = #{data.accountType},</if>
<if test="data.serviceType != null and data.serviceType != ''">service_type = #{data.serviceType},</if>
<if test="data.serviceRate != null">service_rate = #{data.serviceRate},</if>
<if test="data.enabled != null">enabled = #{data.enabled},</if>
<if test="data.costRate != null">cost_rate = #{data.costRate},</if>
<if test="data.picture != null">picture = #{data.picture},</if>
<if test="data.minAmount != null">min_amount = #{data.minAmount},</if>
<if test="data.maxAmount != null">max_amount = #{data.maxAmount},</if>
</trim>
where channel_id = #{data.channelId}
</update>
<delete id="deleteChannelWithdrawByChannelId" parameterType="Long">
delete from ss_channel_withdraw where channel_id = #{channelId}
</delete>
<delete id="deleteChannelWithdrawByChannelIds" parameterType="String">
delete from ss_channel_withdraw where channel_id in
<foreach item="channelId" collection="array" open="(" separator="," close=")">
#{channelId}
</foreach>
</delete>
</mapper>