diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SmChannelController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SmChannelController.java new file mode 100644 index 0000000..6b07c93 --- /dev/null +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SmChannelController.java @@ -0,0 +1,88 @@ +//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.domain.ValidGroup; +//import com.ruoyi.common.core.page.TableDataInfo; +//import com.ruoyi.common.enums.BusinessType; +//import com.ruoyi.common.utils.poi.ExcelUtil; +//import com.ruoyi.ss.channel.domain.Channel; +//import com.ruoyi.ss.channel.domain.ChannelQuery; +//import com.ruoyi.ss.channel.domain.ChannelVO; +//import com.ruoyi.ss.channel.service.ChannelService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.security.access.prepost.PreAuthorize; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +//import javax.servlet.http.HttpServletResponse; +//import java.util.List; +// +///** +// * 充值渠道Controller +// * +// * @author ruoyi +// * @date 2024-04-15 +// */ +//@RestController +//@RequestMapping("/system/channel") +//public class SmChannelController extends BaseController +//{ +// @Autowired +// private ChannelService smChannelService; +// +// /** +// * 查询充值渠道列表 +// */ +// @PreAuthorize("@ss.hasPermi('system:channel:list')") +// @GetMapping("/list") +// public TableDataInfo list(ChannelQuery smChannel) +// { +// startPage(); +// List list = smChannelService.selectSmChannelList(smChannel); +// return getDataTable(list); +// } +// +// /** +// * 导出充值渠道列表 +// */ +// @PreAuthorize("@ss.hasPermi('system:channel:export')") +// @Log(title = "充值渠道", businessType = BusinessType.EXPORT) +// @PostMapping("/export") +// public void export(HttpServletResponse response, ChannelQuery smChannel) +// { +// List list = smChannelService.selectSmChannelList(smChannel); +// ExcelUtil util = new ExcelUtil(ChannelVO.class); +// util.exportExcel(response, list, "充值渠道数据"); +// } +// +// /** +// * 获取充值渠道详细信息 +// */ +// @PreAuthorize("@ss.hasPermi('system:channel:query')") +// @GetMapping(value = "/{channelId}") +// public AjaxResult getInfo(@PathVariable("channelId") Long channelId) +// { +// return success(smChannelService.selectSmChannelByChannelId(channelId)); +// } +// +// /** +// * 修改充值渠道 +// */ +// @PreAuthorize("@ss.hasPermi('system:channel:edit')") +// @Log(title = "充值渠道", businessType = BusinessType.UPDATE) +// @PutMapping +// public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) Channel form) +// { +// Channel channel = new Channel(); +// channel.setChannelId(form.getChannelId()); +// channel.setEnabled(form.getEnabled()); +// channel.setServiceRate(form.getServiceRate()); +// channel.setCostRate(form.getCostRate()); +// channel.setServiceType(form.getServiceType()); +// channel.setPicture(form.getPicture()); +// return toAjax(smChannelService.updateSmChannel(channel)); +// } +// +//} diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java new file mode 100644 index 0000000..58826ee --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/ChannelMapper.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.mapper; + +//import com.ruoyi.ss.channel.domain.Channel; +//import com.ruoyi.ss.channel.domain.ChannelQuery; +//import com.ruoyi.ss.channel.domain.ChannelVO; +//import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 充值渠道Mapper接口 + * + * @author ruoyi + * @date 2024-04-15 + */ +public interface ChannelMapper +{ +// /** +// * 查询充值渠道 +// * +// * @param channelId 充值渠道主键 +// * @return 充值渠道 +// */ +// public ChannelVO selectSmChannelByChannelId(Long channelId); +// +// /** +// * 查询充值渠道列表 +// * +// * @param smChannel 充值渠道 +// * @return 充值渠道集合 +// */ +// public List selectSmChannelList(@Param("query") ChannelQuery smChannel); +// +// /** +// * 新增充值渠道 +// * +// * @param channel 充值渠道 +// * @return 结果 +// */ +// public int insertSmChannel(Channel channel); +// +// /** +// * 修改充值渠道 +// * +// * @param channel 充值渠道 +// * @return 结果 +// */ +// public int updateSmChannel(@Param("data") Channel channel); +// +// /** +// * 删除充值渠道 +// * +// * @param channelId 充值渠道主键 +// * @return 结果 +// */ +// public int deleteSmChannelByChannelId(Long channelId); +// +// /** +// * 批量删除充值渠道 +// * +// * @param channelIds 需要删除的数据主键集合 +// * @return 结果 +// */ +// public int deleteSmChannelByChannelIds(Long[] channelIds); +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/ChannelService.java b/electripper-system/src/main/java/com/ruoyi/system/service/ChannelService.java new file mode 100644 index 0000000..817a1fe --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/service/ChannelService.java @@ -0,0 +1,82 @@ +//package com.ruoyi.system.service; +// +//import com.ruoyi.ss.channel.domain.Channel; +//import com.ruoyi.ss.channel.domain.ChannelQuery; +//import com.ruoyi.ss.channel.domain.ChannelVO; +// +//import java.util.List; +//import java.util.Map; +//import java.util.function.Function; +// +///** +// * 充值渠道Service接口 +// * +// * @author ruoyi +// * @date 2024-04-15 +// */ +//public interface ChannelService +//{ +// /** +// * 查询充值渠道 +// * +// * @param channelId 充值渠道主键 +// * @return 充值渠道 +// */ +// public ChannelVO selectSmChannelByChannelId(Long channelId); +// +// /** +// * 查询充值渠道列表 +// * +// * @param smChannel 充值渠道 +// * @return 充值渠道集合 +// */ +// public List selectSmChannelList(ChannelQuery smChannel); +// +// /** +// * 新增充值渠道 +// * +// * @param channel 充值渠道 +// * @return 结果 +// */ +// public int insertSmChannel(Channel channel); +// +// /** +// * 修改充值渠道 +// * +// * @param channel 充值渠道 +// * @return 结果 +// */ +// public int updateSmChannel(Channel channel); +// +// /** +// * 批量删除充值渠道 +// * +// * @param channelIds 需要删除的充值渠道主键集合 +// * @return 结果 +// */ +// public int deleteSmChannelByChannelIds(Long[] channelIds); +// +// /** +// * 删除充值渠道信息 +// * +// * @param channelId 充值渠道主键 +// * @return 结果 +// */ +// public int deleteSmChannelByChannelId(Long channelId); +// +// /** +// * 查询启用的充值渠道列表 +// * +// * @return +// */ +// List selectEnabledRechargeList(); +// +// /** +// * 查询充值渠道映射表 +// * +// * @param query 查询条件 +// * @param keyMapper 映射函数 +// */ +// Map selectMap(ChannelQuery query, Function keyMapper); +// +//} diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java new file mode 100644 index 0000000..f6d2cb1 --- /dev/null +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/ChannelServiceImpl.java @@ -0,0 +1,127 @@ +//package com.ruoyi.system.service.impl; +// +//import com.ruoyi.common.utils.collection.CollectionUtils; +//import com.ruoyi.ss.account.service.AccountService; +//import com.ruoyi.ss.channel.domain.Channel; +//import com.ruoyi.ss.channel.domain.ChannelQuery; +//import com.ruoyi.ss.channel.domain.ChannelVO; +//import com.ruoyi.ss.channel.mapper.ChannelMapper; +//import com.ruoyi.ss.channel.service.ChannelService; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.function.Function; +//import java.util.stream.Collectors; +// +///** +// * 充值渠道Service业务层处理 +// * +// * @author ruoyi +// * @date 2024-04-15 +// */ +//@Service +//public class ChannelServiceImpl implements ChannelService +//{ +// @Autowired +// private ChannelMapper channelMapper; +// +// @Autowired +// private AccountService accountService; +// +// /** +// * 查询充值渠道 +// * +// * @param channelId 充值渠道主键 +// * @return 充值渠道 +// */ +// @Override +// public ChannelVO selectSmChannelByChannelId(Long channelId) +// { +// return channelMapper.selectSmChannelByChannelId(channelId); +// } +// +// /** +// * 查询充值渠道列表 +// * +// * @param smChannel 充值渠道 +// * @return 充值渠道 +// */ +// @Override +// public List selectSmChannelList(ChannelQuery smChannel) +// { +// return channelMapper.selectSmChannelList(smChannel); +// } +// +// /** +// * 新增充值渠道 +// * +// * @param channel 充值渠道 +// * @return 结果 +// */ +// @Override +// public int insertSmChannel(Channel channel) +// { +// return channelMapper.insertSmChannel(channel); +// } +// +// /** +// * 修改充值渠道 +// * +// * @param channel 充值渠道 +// * @return 结果 +// */ +// @Override +// public int updateSmChannel(Channel channel) +// { +// return channelMapper.updateSmChannel(channel); +// } +// +// /** +// * 批量删除充值渠道 +// * +// * @param channelIds 需要删除的充值渠道主键 +// * @return 结果 +// */ +// @Override +// public int deleteSmChannelByChannelIds(Long[] channelIds) +// { +// return channelMapper.deleteSmChannelByChannelIds(channelIds); +// } +// +// /** +// * 删除充值渠道信息 +// * +// * @param channelId 充值渠道主键 +// * @return 结果 +// */ +// @Override +// public int deleteSmChannelByChannelId(Long channelId) +// { +// return channelMapper.deleteSmChannelByChannelId(channelId); +// } +// +// @Override +// public List selectEnabledRechargeList() { +// ChannelQuery dto = new ChannelQuery(); +// dto.setEnabled(true); +// return this.selectSmChannelList(dto); +// } +// +// /** +// * 查询充值渠道映射表 +// * +// * @param query 查询条件 +// * @param keyMapper 映射函数 +// */ +// @Override +// public Map selectMap(ChannelQuery query, Function keyMapper) { +// List list = this.selectSmChannelList(query); +// if (CollectionUtils.isEmptyElement(list)) { +// return Collections.emptyMap(); +// } +// return list.stream().collect(Collectors.toMap(keyMapper, item -> item)); +// } +//} diff --git a/electripper-system/src/main/resources/mapper/system/ChannelMapper.xml b/electripper-system/src/main/resources/mapper/system/ChannelMapper.xml new file mode 100644 index 0000000..56f9b6a --- /dev/null +++ b/electripper-system/src/main/resources/mapper/system/ChannelMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +