From 62f82f2224fc74aebb96ee0285cfe5a27185af04 Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Thu, 5 Dec 2024 09:53:53 +0800 Subject: [PATCH] feat: payment module add alipay and wechatpay framework --- .../payment/controller/AliPayController.java | 73 +++++ .../controller/CreditCardController.java | 2 +- .../payment/controller/PayPalController.java | 8 +- .../controller/WechatPayController.java | 73 +++++ .../java/org/wfc/payment/domain/AliPay.java | 256 ++++++++++++++++++ .../org/wfc/payment/domain/WechatPay.java | 256 ++++++++++++++++++ .../org/wfc/payment/domain/vo/MetaVo.java | 2 +- .../org/wfc/payment/mapper/AliPayMapper.java | 43 +++ .../wfc/payment/mapper/WechatPayMapper.java | 43 +++ .../wfc/payment/service/IAliPayService.java | 43 +++ .../payment/service/IWechatPayService.java | 43 +++ .../service/impl/AliPayServiceImpl.java | 63 +++++ .../service/impl/WechatPayServiceImpl.java | 63 +++++ .../resources/mapper/payment/AliPayMapper.xml | 103 +++++++ .../mapper/payment/WechatPayMapper.xml | 103 +++++++ 15 files changed, 1168 insertions(+), 6 deletions(-) create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/AliPayController.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/WechatPayController.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/AliPay.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/WechatPay.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/AliPayMapper.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/WechatPayMapper.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IAliPayService.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IWechatPayService.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/AliPayServiceImpl.java create mode 100644 wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/WechatPayServiceImpl.java create mode 100644 wfc-modules/wfc-payment/src/main/resources/mapper/payment/AliPayMapper.xml create mode 100644 wfc-modules/wfc-payment/src/main/resources/mapper/payment/WechatPayMapper.xml diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/AliPayController.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/AliPayController.java new file mode 100644 index 0000000..59b82f8 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/AliPayController.java @@ -0,0 +1,73 @@ +package org.wfc.payment.controller; + +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.wfc.common.core.web.controller.BaseController; +import org.wfc.common.core.web.domain.AjaxResult; +import org.wfc.common.log.annotation.Log; +import org.wfc.common.log.enums.BusinessType; +import org.wfc.common.security.annotation.RequiresPermissions; +import org.wfc.payment.domain.AliPay; +import org.wfc.payment.service.IAliPayService; + + +/** + * Paypal controller + * + * @author wfc + */ +@RestController +@RequestMapping("/alipay") +public class AliPayController extends BaseController +{ + @Autowired + private IAliPayService alipayService; + + /** + * AliPay + */ + @RequiresPermissions("payment:alipayInfo:query") + @Log(title = "alipay info management", businessType = BusinessType.OTHER) + @GetMapping("/{userId}") + public AjaxResult query(@PathVariable Long userId) { + return success(alipayService.selectAliPayInfoByUserId(userId)); + } + + /** + * AliPay + */ + @RequiresPermissions("payment:alipayInfo:add") + @Log(title = "alipay info management", businessType = BusinessType.INSERT) + @PostMapping("/{alipay}") + public AjaxResult add(@PathVariable AliPay alipay) + { + return toAjax(alipayService.insertAliPayInfo(alipay)); + } + + /** + * AliPay + */ + @RequiresPermissions("payment:alipayInfo:edit") + @Log(title = "alipay info management", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + public AjaxResult edit(@PathVariable Long id) { + return toAjax(alipayService.updateAliPayInfoById(id)); + } + + /** + * AliPay + */ + @RequiresPermissions("payment:alipayInfo:remove") + @Log(title = "alipay info management", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) { + alipayService.deleteAliPayInfoById(id); + return success(); + } +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/CreditCardController.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/CreditCardController.java index 0f893ea..1cea1c7 100644 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/CreditCardController.java +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/CreditCardController.java @@ -56,7 +56,7 @@ public class CreditCardController extends BaseController /** * 新增参数配置 */ - @RequiresPermissions("pay:creditCard:add") + @RequiresPermissions("payment:creditCard:add") @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody CreditCard creditCardInfo) diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/PayPalController.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/PayPalController.java index 999d5f3..71e7442 100644 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/PayPalController.java +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/PayPalController.java @@ -32,7 +32,7 @@ public class PayPalController extends BaseController /** * PayPal */ - @RequiresPermissions("pay:paypalInfo:query") + @RequiresPermissions("payment:paypalInfo:query") @Log(title = "paypal info management", businessType = BusinessType.OTHER) @GetMapping("/{userId}") public AjaxResult query(@PathVariable Long userId) { @@ -42,7 +42,7 @@ public class PayPalController extends BaseController /** * PayPal */ - @RequiresPermissions("pay:paypalInfo:add") + @RequiresPermissions("payment:paypalInfo:add") @Log(title = "paypal info management", businessType = BusinessType.INSERT) @PostMapping("/{paypal}") public AjaxResult add(@PathVariable PayPal paypal) @@ -53,7 +53,7 @@ public class PayPalController extends BaseController /** * PayPal */ - @RequiresPermissions("pay:paypalInfo:edit") + @RequiresPermissions("payment:paypalInfo:edit") @Log(title = "paypal info management", businessType = BusinessType.UPDATE) @PutMapping("/{id}") public AjaxResult edit(@PathVariable Long id) { @@ -63,7 +63,7 @@ public class PayPalController extends BaseController /** * PayPal */ - @RequiresPermissions("pay:paypalInfo:remove") + @RequiresPermissions("payment:paypalInfo:remove") @Log(title = "paypal info management", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") public AjaxResult remove(@PathVariable Long id) { diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/WechatPayController.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/WechatPayController.java new file mode 100644 index 0000000..2671919 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/controller/WechatPayController.java @@ -0,0 +1,73 @@ +package org.wfc.payment.controller; + +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.wfc.common.core.web.controller.BaseController; +import org.wfc.common.core.web.domain.AjaxResult; +import org.wfc.common.log.annotation.Log; +import org.wfc.common.log.enums.BusinessType; +import org.wfc.common.security.annotation.RequiresPermissions; +import org.wfc.payment.domain.WechatPay; +import org.wfc.payment.service.IWechatPayService; + + +/** + * Paypal controller + * + * @author wfc + */ +@RestController +@RequestMapping("/wechatpay") +public class WechatPayController extends BaseController +{ + @Autowired + private IWechatPayService wechatpayService; + + /** + * WechatPay + */ + @RequiresPermissions("payment:wechatpayInfo:query") + @Log(title = "wechatpay info management", businessType = BusinessType.OTHER) + @GetMapping("/{userId}") + public AjaxResult query(@PathVariable Long userId) { + return success(wechatpayService.selectWechatPayInfoByUserId(userId)); + } + + /** + * WechatPay + */ + @RequiresPermissions("payment:wechatpayInfo:add") + @Log(title = "wechatpay info management", businessType = BusinessType.INSERT) + @PostMapping("/{wechatpay}") + public AjaxResult add(@PathVariable WechatPay wechatpay) + { + return toAjax(wechatpayService.insertWechatPayInfo(wechatpay)); + } + + /** + * WechatPay + */ + @RequiresPermissions("payment:wechatpayInfo:edit") + @Log(title = "wechatpay info management", businessType = BusinessType.UPDATE) + @PutMapping("/{id}") + public AjaxResult edit(@PathVariable Long id) { + return toAjax(wechatpayService.updateWechatPayInfoById(id)); + } + + /** + * WechatPay + */ + @RequiresPermissions("payment:wechatpayInfo:remove") + @Log(title = "wechatpay info management", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) { + wechatpayService.deleteWechatPayInfoById(id); + return success(); + } +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/AliPay.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/AliPay.java new file mode 100644 index 0000000..e97b869 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/AliPay.java @@ -0,0 +1,256 @@ +package org.wfc.payment.domain; + +import org.wfc.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * 菜单权限表 sys_menu + * + * @author wfc + */ +public class AliPay extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 菜单ID */ + private Long menuId; + + /** 菜单名称 */ + private String menuName; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private Integer orderNum; + + /** 路由地址 */ + private String path; + + /** 组件路径 */ + private String component; + + /** 路由参数 */ + private String query; + + /** 是否为外链(0是 1否) */ + private String isFrame; + + /** 是否缓存(0缓存 1不缓存) */ + private String isCache; + + /** 类型(M目录 C菜单 F按钮) */ + private String menuType; + + /** 显示状态(0显示 1隐藏) */ + private String visible; + + /** 菜单状态(0正常 1停用) */ + private String status; + + /** 权限字符串 */ + private String perms; + + /** 菜单图标 */ + private String icon; + + /** 菜单key */ + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @NotBlank(message = "菜单名称不能为空") + @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") + public String getMenuName() + { + return menuName; + } + + public void setMenuName(String menuName) + { + this.menuName = menuName; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + + public String getIsFrame() + { + return isFrame; + } + + public void setIsFrame(String isFrame) + { + this.isFrame = isFrame; + } + + public String getIsCache() + { + return isCache; + } + + public void setIsCache(String isCache) + { + this.isCache = isCache; + } + + @NotBlank(message = "菜单类型不能为空") + public String getMenuType() + { + return menuType; + } + + public void setMenuType(String menuType) + { + this.menuType = menuType; + } + + public String getVisible() + { + return visible; + } + + public void setVisible(String visible) + { + this.visible = visible; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") + public String getPerms() + { + return perms; + } + + public void setPerms(String perms) + { + this.perms = perms; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("menuId", getMenuId()) + .append("menuName", getMenuName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("path", getPath()) + .append("component", getComponent()) + .append("isFrame", getIsFrame()) + .append("IsCache", getIsCache()) + .append("menuType", getMenuType()) + .append("visible", getVisible()) + .append("status ", getStatus()) + .append("perms", getPerms()) + .append("icon", getIcon()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("name", getName()) + .toString(); + } +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/WechatPay.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/WechatPay.java new file mode 100644 index 0000000..e0ab4d5 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/WechatPay.java @@ -0,0 +1,256 @@ +package org.wfc.payment.domain; + +import org.wfc.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * 菜单权限表 sys_menu + * + * @author wfc + */ +public class WechatPay extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 菜单ID */ + private Long menuId; + + /** 菜单名称 */ + private String menuName; + + /** 父菜单名称 */ + private String parentName; + + /** 父菜单ID */ + private Long parentId; + + /** 显示顺序 */ + private Integer orderNum; + + /** 路由地址 */ + private String path; + + /** 组件路径 */ + private String component; + + /** 路由参数 */ + private String query; + + /** 是否为外链(0是 1否) */ + private String isFrame; + + /** 是否缓存(0缓存 1不缓存) */ + private String isCache; + + /** 类型(M目录 C菜单 F按钮) */ + private String menuType; + + /** 显示状态(0显示 1隐藏) */ + private String visible; + + /** 菜单状态(0正常 1停用) */ + private String status; + + /** 权限字符串 */ + private String perms; + + /** 菜单图标 */ + private String icon; + + /** 菜单key */ + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getMenuId() + { + return menuId; + } + + public void setMenuId(Long menuId) + { + this.menuId = menuId; + } + + @NotBlank(message = "菜单名称不能为空") + @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符") + public String getMenuName() + { + return menuName; + } + + public void setMenuName(String menuName) + { + this.menuName = menuName; + } + + public String getParentName() + { + return parentName; + } + + public void setParentName(String parentName) + { + this.parentName = parentName; + } + + public Long getParentId() + { + return parentId; + } + + public void setParentId(Long parentId) + { + this.parentId = parentId; + } + + @NotNull(message = "显示顺序不能为空") + public Integer getOrderNum() + { + return orderNum; + } + + public void setOrderNum(Integer orderNum) + { + this.orderNum = orderNum; + } + + @Size(min = 0, max = 200, message = "路由地址不能超过200个字符") + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } + + @Size(min = 0, max = 200, message = "组件路径不能超过255个字符") + public String getComponent() + { + return component; + } + + public void setComponent(String component) + { + this.component = component; + } + + public String getQuery() + { + return query; + } + + public void setQuery(String query) + { + this.query = query; + } + + public String getIsFrame() + { + return isFrame; + } + + public void setIsFrame(String isFrame) + { + this.isFrame = isFrame; + } + + public String getIsCache() + { + return isCache; + } + + public void setIsCache(String isCache) + { + this.isCache = isCache; + } + + @NotBlank(message = "菜单类型不能为空") + public String getMenuType() + { + return menuType; + } + + public void setMenuType(String menuType) + { + this.menuType = menuType; + } + + public String getVisible() + { + return visible; + } + + public void setVisible(String visible) + { + this.visible = visible; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符") + public String getPerms() + { + return perms; + } + + public void setPerms(String perms) + { + this.perms = perms; + } + + public String getIcon() + { + return icon; + } + + public void setIcon(String icon) + { + this.icon = icon; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("menuId", getMenuId()) + .append("menuName", getMenuName()) + .append("parentId", getParentId()) + .append("orderNum", getOrderNum()) + .append("path", getPath()) + .append("component", getComponent()) + .append("isFrame", getIsFrame()) + .append("IsCache", getIsCache()) + .append("menuType", getMenuType()) + .append("visible", getVisible()) + .append("status ", getStatus()) + .append("perms", getPerms()) + .append("icon", getIcon()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("name", getName()) + .toString(); + } +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/vo/MetaVo.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/vo/MetaVo.java index 2b9c47b..e02993a 100644 --- a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/vo/MetaVo.java +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/domain/vo/MetaVo.java @@ -15,7 +15,7 @@ public class MetaVo private String title; /** - * 设置该路由的图标,对应路径src/assets/icons/svg + * 设置该路由的图标,对应路径src/assets/icons/sv */ private String icon; diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/AliPayMapper.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/AliPayMapper.java new file mode 100644 index 0000000..4c1ed29 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/AliPayMapper.java @@ -0,0 +1,43 @@ +package org.wfc.payment.mapper; + +import org.wfc.payment.domain.AliPay; + +/** + * Paypal mapper + * + * @author wfc + */ +public interface AliPayMapper +{ + /** + * select alipay info by user id + * + * @param userId user id + * @return alipay information + */ + public AliPay selectAliPayInfoByUserId(Long userId); + + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public int insertAliPayInfo(AliPay alipay); + + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public int updateAliPayInfoById(Long id); + + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public void deleteAliPayInfoById(Long id); +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/WechatPayMapper.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/WechatPayMapper.java new file mode 100644 index 0000000..435f706 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/mapper/WechatPayMapper.java @@ -0,0 +1,43 @@ +package org.wfc.payment.mapper; + +import org.wfc.payment.domain.WechatPay; + +/** + * Paypal mapper + * + * @author wfc + */ +public interface WechatPayMapper +{ + /** + * select wechatpay info by user id + * + * @param userId user id + * @return wechatpay information + */ + public WechatPay selectWechatPayInfoByUserId(Long userId); + + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public int insertWechatPayInfo(WechatPay wechatpay); + + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public int updateWechatPayInfoById(Long id); + + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public void deleteWechatPayInfoById(Long id); +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IAliPayService.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IAliPayService.java new file mode 100644 index 0000000..91ce6c3 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IAliPayService.java @@ -0,0 +1,43 @@ +package org.wfc.payment.service; + +import org.wfc.payment.domain.AliPay; + +/** + * Paypal pay service layer + * + * @author wfc + */ +public interface IAliPayService +{ + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public AliPay selectAliPayInfoByUserId(Long userId); + + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public int insertAliPayInfo(AliPay alipay); + + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public int updateAliPayInfoById(Long id); + + /** + * select AliPay pay information by user ID + * + * @param userId user ID + * @return AliPay pay information + */ + public void deleteAliPayInfoById(Long id); +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IWechatPayService.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IWechatPayService.java new file mode 100644 index 0000000..1e560d9 --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/IWechatPayService.java @@ -0,0 +1,43 @@ +package org.wfc.payment.service; + +import org.wfc.payment.domain.WechatPay; + +/** + * Paypal pay service layer + * + * @author wfc + */ +public interface IWechatPayService +{ + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public WechatPay selectWechatPayInfoByUserId(Long userId); + + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public int insertWechatPayInfo(WechatPay wechatpay); + + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public int updateWechatPayInfoById(Long id); + + /** + * select WechatPay pay information by user ID + * + * @param userId user ID + * @return WechatPay pay information + */ + public void deleteWechatPayInfoById(Long id); +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/AliPayServiceImpl.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/AliPayServiceImpl.java new file mode 100644 index 0000000..f84260b --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/AliPayServiceImpl.java @@ -0,0 +1,63 @@ +package org.wfc.payment.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.wfc.payment.mapper.AliPayMapper; +import org.wfc.payment.service.IAliPayService; +import org.wfc.payment.domain.AliPay; + +/** + * AliPay service implementation + * + * @author wfc + */ +@Service +public class AliPayServiceImpl implements IAliPayService +{ + @Autowired + private AliPayMapper alipayMapper; + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public AliPay selectAliPayInfoByUserId(Long userId) { + return alipayMapper.selectAliPayInfoByUserId(userId); + } + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public int insertAliPayInfo(AliPay alipay) { + return alipayMapper.insertAliPayInfo(alipay); + } + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public int updateAliPayInfoById(Long id) { + return alipayMapper.updateAliPayInfoById(id); + } + + /** + * update credit card + * + * @param creditCard User ID + * @return void + */ + @Override + public void deleteAliPayInfoById(Long id) { + alipayMapper.deleteAliPayInfoById(id); + } +} diff --git a/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/WechatPayServiceImpl.java b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/WechatPayServiceImpl.java new file mode 100644 index 0000000..2edca8c --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/java/org/wfc/payment/service/impl/WechatPayServiceImpl.java @@ -0,0 +1,63 @@ +package org.wfc.payment.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.wfc.payment.mapper.WechatPayMapper; +import org.wfc.payment.service.IWechatPayService; +import org.wfc.payment.domain.WechatPay; + +/** + * WechatPay service implementation + * + * @author wfc + */ +@Service +public class WechatPayServiceImpl implements IWechatPayService +{ + @Autowired + private WechatPayMapper wechatpayMapper; + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public WechatPay selectWechatPayInfoByUserId(Long userId) { + return wechatpayMapper.selectWechatPayInfoByUserId(userId); + } + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public int insertWechatPayInfo(WechatPay wechatpay) { + return wechatpayMapper.insertWechatPayInfo(wechatpay); + } + + /** + * Select Paypal information by user ID + * + * @param userId user ID + * @return 结果 + */ + @Override + public int updateWechatPayInfoById(Long id) { + return wechatpayMapper.updateWechatPayInfoById(id); + } + + /** + * update credit card + * + * @param creditCard User ID + * @return void + */ + @Override + public void deleteWechatPayInfoById(Long id) { + wechatpayMapper.deleteWechatPayInfoById(id); + } +} diff --git a/wfc-modules/wfc-payment/src/main/resources/mapper/payment/AliPayMapper.xml b/wfc-modules/wfc-payment/src/main/resources/mapper/payment/AliPayMapper.xml new file mode 100644 index 0000000..6542d0b --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/resources/mapper/payment/AliPayMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select d.dept_id, d.parent_id, d.ancestors, d.remark, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + from sys_dept d + + + + + + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + create_by, + remark, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where dept_id = #{id} + + + + update sys_dept set del_flag = '2' where dept_id = #{id} + + + \ No newline at end of file diff --git a/wfc-modules/wfc-payment/src/main/resources/mapper/payment/WechatPayMapper.xml b/wfc-modules/wfc-payment/src/main/resources/mapper/payment/WechatPayMapper.xml new file mode 100644 index 0000000..e8cadcd --- /dev/null +++ b/wfc-modules/wfc-payment/src/main/resources/mapper/payment/WechatPayMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select d.dept_id, d.parent_id, d.ancestors, d.remark, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + from sys_dept d + + + + + + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + create_by, + remark, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where dept_id = #{id} + + + + update sys_dept set del_flag = '2' where dept_id = #{id} + + + \ No newline at end of file