From dbe6f3c4989266c51ff18270d01c521f71316f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=85=B1=E5=AD=90?= <1638743013@qq.com> Date: Tue, 29 Mar 2022 11:24:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=94=AF=E4=BB=98=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 8 + .../main/java/com/ruoyi/RuoYiApplication.java | 11 +- .../src/main/resources/application-druid.yml | 2 +- ruoyi-admin/src/main/resources/banner.txt | 24 - ruoyi-framework/pom.xml | 6 + ruoyi-pay/pom.xml | 28 + .../pay/controller/SysPayController.java | 104 +++ .../java/com/ruoyi/pay/domain/SysPay.java | 84 +++ .../com/ruoyi/pay/mapper/SysPayMapper.java | 61 ++ .../com/ruoyi/pay/service/ISysPayService.java | 61 ++ .../pay/service/impl/SysPayServiceImpl.java | 96 +++ .../resources/mapper/pay/SysPayMapper.xml | 86 +++ ruoyi-ui/src/api/pay/wxPay.js | 44 ++ ruoyi-ui/src/views/pay/wxPay/index.vue | 304 ++++++++ ruoyi-ui/src/views/system/dict/index.vue | 692 +++++++++--------- 15 files changed, 1230 insertions(+), 381 deletions(-) delete mode 100644 ruoyi-admin/src/main/resources/banner.txt create mode 100644 ruoyi-pay/pom.xml create mode 100644 ruoyi-pay/src/main/java/com/ruoyi/pay/controller/SysPayController.java create mode 100644 ruoyi-pay/src/main/java/com/ruoyi/pay/domain/SysPay.java create mode 100644 ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/SysPayMapper.java create mode 100644 ruoyi-pay/src/main/java/com/ruoyi/pay/service/ISysPayService.java create mode 100644 ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/SysPayServiceImpl.java create mode 100644 ruoyi-pay/src/main/resources/mapper/pay/SysPayMapper.xml create mode 100644 ruoyi-ui/src/api/pay/wxPay.js create mode 100644 ruoyi-ui/src/views/pay/wxPay/index.vue diff --git a/pom.xml b/pom.xml index b4931dbc5..11a122c3a 100644 --- a/pom.xml +++ b/pom.xml @@ -199,6 +199,13 @@ ${ruoyi.version} + + + com.ruoyi + ruoyi-pay + ${ruoyi.version} + + @@ -209,6 +216,7 @@ ruoyi-quartz ruoyi-generator ruoyi-common + ruoyi-pay pom diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index e3c56ee54..d0f015af5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -16,15 +16,6 @@ public class RuoYiApplication { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ "); } } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 1f098e407..78ba56801 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: password + password: root # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt deleted file mode 100644 index 94662592f..000000000 --- a/ruoyi-admin/src/main/resources/banner.txt +++ /dev/null @@ -1,24 +0,0 @@ -Application Version: ${ruoyi.version} -Spring Boot Version: ${spring-boot.version} -//////////////////////////////////////////////////////////////////// -// _ooOoo_ // -// o8888888o // -// 88" . "88 // -// (| ^_^ |) // -// O\ = /O // -// ____/`---'\____ // -// .' \\| |// `. // -// / \\||| : |||// \ // -// / _||||| -:- |||||- \ // -// | | \\\ - /// | | // -// | \_| ''\---/'' | | // -// \ .-\__ `-` ___/-. / // -// ___`. .' /--.--\ `. . ___ // -// ."" '< `.___\_<|>_/___.' >'"". // -// | | : `- \`.;`\ _ /`;.`/ - ` : | | // -// \ \ `-. \_ __\ /__ _/ .-` / / // -// ========`-.____`-.___\_____/___.-`____.-'======== // -// `=---=' // -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // -// 佛祖保佑 永不宕机 永无BUG // -//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml index f1b68c7c5..290b751fb 100644 --- a/ruoyi-framework/pom.xml +++ b/ruoyi-framework/pom.xml @@ -59,6 +59,12 @@ ruoyi-system + + + com.ruoyi + ruoyi-pay + + \ No newline at end of file diff --git a/ruoyi-pay/pom.xml b/ruoyi-pay/pom.xml new file mode 100644 index 000000000..5ca5e6735 --- /dev/null +++ b/ruoyi-pay/pom.xml @@ -0,0 +1,28 @@ + + + + ruoyi + com.ruoyi + 3.8.1 + + 4.0.0 + + ruoyi-pay + + 支付模块 + + + + + + + com.ruoyi + ruoyi-common + + + + + + \ No newline at end of file diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/SysPayController.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/SysPayController.java new file mode 100644 index 000000000..4300ba4ee --- /dev/null +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/SysPayController.java @@ -0,0 +1,104 @@ +package com.ruoyi.pay.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.pay.domain.SysPay; +import com.ruoyi.pay.service.ISysPayService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 支付相关Controller + * + * @author ruoyi + * @date 2022-03-29 + */ +@RestController +@RequestMapping("/pay/wxPay") +public class SysPayController extends BaseController +{ + @Autowired + private ISysPayService sysPayService; + + /** + * 查询支付相关列表 + */ + @PreAuthorize("@ss.hasPermi('pay:wxPay:list')") + @GetMapping("/list") + public TableDataInfo list(SysPay sysPay) + { + startPage(); + List list = sysPayService.selectSysPayList(sysPay); + return getDataTable(list); + } + + /** + * 导出支付相关列表 + */ + @PreAuthorize("@ss.hasPermi('pay:wxPay:export')") + @Log(title = "支付相关", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SysPay sysPay) + { + List list = sysPayService.selectSysPayList(sysPay); + ExcelUtil util = new ExcelUtil(SysPay.class); + util.exportExcel(response, list, "支付相关数据"); + } + + /** + * 获取支付相关详细信息 + */ + @PreAuthorize("@ss.hasPermi('pay:wxPay:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(sysPayService.selectSysPayById(id)); + } + + /** + * 新增支付相关 + */ + @PreAuthorize("@ss.hasPermi('pay:wxPay:add')") + @Log(title = "支付相关", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SysPay sysPay) + { + return toAjax(sysPayService.insertSysPay(sysPay)); + } + + /** + * 修改支付相关 + */ + @PreAuthorize("@ss.hasPermi('pay:wxPay:edit')") + @Log(title = "支付相关", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SysPay sysPay) + { + return toAjax(sysPayService.updateSysPay(sysPay)); + } + + /** + * 删除支付相关 + */ + @PreAuthorize("@ss.hasPermi('pay:wxPay:remove')") + @Log(title = "支付相关", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(sysPayService.deleteSysPayByIds(ids)); + } +} diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/domain/SysPay.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/domain/SysPay.java new file mode 100644 index 000000000..401782585 --- /dev/null +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/domain/SysPay.java @@ -0,0 +1,84 @@ +package com.ruoyi.pay.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 支付相关对象 sys_pay + * + * @author ruoyi + * @date 2022-03-29 + */ +public class SysPay extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 支付id */ + private Long id; + + /** 支付名称 */ + @Excel(name = "支付名称") + private String name; + + /** 支付状态 */ + @Excel(name = "支付状态") + private String state; + + /** 金额 */ + @Excel(name = "金额") + private String figure; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setState(String state) + { + this.state = state; + } + + public String getState() + { + return state; + } + public void setFigure(String figure) + { + this.figure = figure; + } + + public String getFigure() + { + return figure; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("state", getState()) + .append("figure", getFigure()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/SysPayMapper.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/SysPayMapper.java new file mode 100644 index 000000000..aa43d4d06 --- /dev/null +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/SysPayMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.pay.mapper; + +import java.util.List; +import com.ruoyi.pay.domain.SysPay; + +/** + * 支付相关Mapper接口 + * + * @author ruoyi + * @date 2022-03-29 + */ +public interface SysPayMapper +{ + /** + * 查询支付相关 + * + * @param id 支付相关主键 + * @return 支付相关 + */ + public SysPay selectSysPayById(Long id); + + /** + * 查询支付相关列表 + * + * @param sysPay 支付相关 + * @return 支付相关集合 + */ + public List selectSysPayList(SysPay sysPay); + + /** + * 新增支付相关 + * + * @param sysPay 支付相关 + * @return 结果 + */ + public int insertSysPay(SysPay sysPay); + + /** + * 修改支付相关 + * + * @param sysPay 支付相关 + * @return 结果 + */ + public int updateSysPay(SysPay sysPay); + + /** + * 删除支付相关 + * + * @param id 支付相关主键 + * @return 结果 + */ + public int deleteSysPayById(Long id); + + /** + * 批量删除支付相关 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSysPayByIds(Long[] ids); +} diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/ISysPayService.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/ISysPayService.java new file mode 100644 index 000000000..f7966975a --- /dev/null +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/ISysPayService.java @@ -0,0 +1,61 @@ +package com.ruoyi.pay.service; + +import java.util.List; +import com.ruoyi.pay.domain.SysPay; + +/** + * 支付相关Service接口 + * + * @author ruoyi + * @date 2022-03-29 + */ +public interface ISysPayService +{ + /** + * 查询支付相关 + * + * @param id 支付相关主键 + * @return 支付相关 + */ + public SysPay selectSysPayById(Long id); + + /** + * 查询支付相关列表 + * + * @param sysPay 支付相关 + * @return 支付相关集合 + */ + public List selectSysPayList(SysPay sysPay); + + /** + * 新增支付相关 + * + * @param sysPay 支付相关 + * @return 结果 + */ + public int insertSysPay(SysPay sysPay); + + /** + * 修改支付相关 + * + * @param sysPay 支付相关 + * @return 结果 + */ + public int updateSysPay(SysPay sysPay); + + /** + * 批量删除支付相关 + * + * @param ids 需要删除的支付相关主键集合 + * @return 结果 + */ + public int deleteSysPayByIds(Long[] ids); + + /** + * 删除支付相关信息 + * + * @param id 支付相关主键 + * @return 结果 + */ + public int deleteSysPayById(Long id); +} diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/SysPayServiceImpl.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/SysPayServiceImpl.java new file mode 100644 index 000000000..a5df58500 --- /dev/null +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/SysPayServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.pay.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.pay.mapper.SysPayMapper; +import com.ruoyi.pay.domain.SysPay; +import com.ruoyi.pay.service.ISysPayService; + +/** + * 支付相关Service业务层处理 + * + * @author ruoyi + * @date 2022-03-29 + */ +@Service +public class SysPayServiceImpl implements ISysPayService +{ + @Autowired + private SysPayMapper sysPayMapper; + + /** + * 查询支付相关 + * + * @param id 支付相关主键 + * @return 支付相关 + */ + @Override + public SysPay selectSysPayById(Long id) + { + return sysPayMapper.selectSysPayById(id); + } + + /** + * 查询支付相关列表 + * + * @param sysPay 支付相关 + * @return 支付相关 + */ + @Override + public List selectSysPayList(SysPay sysPay) + { + return sysPayMapper.selectSysPayList(sysPay); + } + + /** + * 新增支付相关 + * + * @param sysPay 支付相关 + * @return 结果 + */ + @Override + public int insertSysPay(SysPay sysPay) + { + sysPay.setCreateTime(DateUtils.getNowDate()); + return sysPayMapper.insertSysPay(sysPay); + } + + /** + * 修改支付相关 + * + * @param sysPay 支付相关 + * @return 结果 + */ + @Override + public int updateSysPay(SysPay sysPay) + { + sysPay.setUpdateTime(DateUtils.getNowDate()); + return sysPayMapper.updateSysPay(sysPay); + } + + /** + * 批量删除支付相关 + * + * @param ids 需要删除的支付相关主键 + * @return 结果 + */ + @Override + public int deleteSysPayByIds(Long[] ids) + { + return sysPayMapper.deleteSysPayByIds(ids); + } + + /** + * 删除支付相关信息 + * + * @param id 支付相关主键 + * @return 结果 + */ + @Override + public int deleteSysPayById(Long id) + { + return sysPayMapper.deleteSysPayById(id); + } +} diff --git a/ruoyi-pay/src/main/resources/mapper/pay/SysPayMapper.xml b/ruoyi-pay/src/main/resources/mapper/pay/SysPayMapper.xml new file mode 100644 index 000000000..1175641d6 --- /dev/null +++ b/ruoyi-pay/src/main/resources/mapper/pay/SysPayMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + select id, name, state, figure, create_by, create_time, update_by, update_time, remark from sys_pay + + + + + + + + insert into sys_pay + + name, + state, + figure, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{name}, + #{state}, + #{figure}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update sys_pay + + name = #{name}, + state = #{state}, + figure = #{figure}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from sys_pay where id = #{id} + + + + delete from sys_pay where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/pay/wxPay.js b/ruoyi-ui/src/api/pay/wxPay.js new file mode 100644 index 000000000..7c82bac25 --- /dev/null +++ b/ruoyi-ui/src/api/pay/wxPay.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询支付相关列表 +export function listWxPay(query) { + return request({ + url: '/pay/wxPay/list', + method: 'get', + params: query + }) +} + +// 查询支付相关详细 +export function getWxPay(id) { + return request({ + url: '/pay/wxPay/' + id, + method: 'get' + }) +} + +// 新增支付相关 +export function addWxPay(data) { + return request({ + url: '/pay/wxPay', + method: 'post', + data: data + }) +} + +// 修改支付相关 +export function updateWxPay(data) { + return request({ + url: '/pay/wxPay', + method: 'put', + data: data + }) +} + +// 删除支付相关 +export function delWxPay(id) { + return request({ + url: '/pay/wxPay/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/pay/wxPay/index.vue b/ruoyi-ui/src/views/pay/wxPay/index.vue new file mode 100644 index 000000000..b9095008c --- /dev/null +++ b/ruoyi-ui/src/views/pay/wxPay/index.vue @@ -0,0 +1,304 @@ + + + diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue index d26d14066..49fecccf8 100644 --- a/ruoyi-ui/src/views/system/dict/index.vue +++ b/ruoyi-ui/src/views/system/dict/index.vue @@ -1,346 +1,346 @@ - - - \ No newline at end of file + + +