diff --git a/ruoyi-pay/pom.xml b/ruoyi-pay/pom.xml index 6182e47..1e1ac0d 100644 --- a/ruoyi-pay/pom.xml +++ b/ruoyi-pay/pom.xml @@ -27,6 +27,13 @@ ${ruoyi.version} + + + com.ruoyi + ruoyi-pay-common + ${ruoyi.version} + + com.ruoyi @@ -61,6 +68,7 @@ ruoyi-pay-sqb ruoyi-pay-alipay ruoyi-pay-wx + ruoyi-pay-common ruoyi-pay-start pom diff --git a/ruoyi-pay/ruoyi-pay-common/pom.xml b/ruoyi-pay/ruoyi-pay-common/pom.xml new file mode 100644 index 0000000..5220ad0 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/pom.xml @@ -0,0 +1,28 @@ + + + + ruoyi-pay + com.ruoyi + 3.8.7.3.1 + + 4.0.0 + + ruoyi-pay-common + + + 支付基础模块 + + + + + + + com.ruoyi + ruoyi-common + + + + + \ No newline at end of file diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/controller/PayInvoiceController.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/controller/PayInvoiceController.java new file mode 100644 index 0000000..429c821 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/controller/PayInvoiceController.java @@ -0,0 +1,113 @@ +package com.ruoyi.pay.controller; + +import java.util.List; +import jakarta.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.PayInvoice; +import com.ruoyi.pay.service.IPayInvoiceService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; + +/** + * 发票Controller + * + * @author ruoyi + * @date 2024-02-15 + */ +@RestController +@RequestMapping("/pay/invoice") +@Tag(name = "【发票】管理") +public class PayInvoiceController extends BaseController +{ + @Autowired + private IPayInvoiceService payInvoiceService; + + /** + * 查询发票列表 + */ + @Operation(summary = "查询发票列表") + @PreAuthorize("@ss.hasPermi('pay:invoice:list')") + @GetMapping("/list") + public TableDataInfo list(PayInvoice payInvoice) + { + startPage(); + List list = payInvoiceService.selectPayInvoiceList(payInvoice); + return getDataTable(list); + } + + /** + * 导出发票列表 + */ + @Operation(summary = "导出发票列表") + @PreAuthorize("@ss.hasPermi('pay:invoice:export')") + @Log(title = "发票", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, PayInvoice payInvoice) + { + List list = payInvoiceService.selectPayInvoiceList(payInvoice); + ExcelUtil util = new ExcelUtil(PayInvoice.class); + util.exportExcel(response, list, "发票数据"); + } + + /** + * 获取发票详细信息 + */ + @Operation(summary = "获取发票详细信息") + @PreAuthorize("@ss.hasPermi('pay:invoice:query')") + @GetMapping(value = "/{invoiceId}") + public AjaxResult getInfo(@PathVariable("invoiceId") Long invoiceId) + { + return success(payInvoiceService.selectPayInvoiceByInvoiceId(invoiceId)); + } + + /** + * 新增发票 + */ + @Operation(summary = "新增发票") + @PreAuthorize("@ss.hasPermi('pay:invoice:add')") + @Log(title = "发票", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PayInvoice payInvoice) + { + return toAjax(payInvoiceService.insertPayInvoice(payInvoice)); + } + + /** + * 修改发票 + */ + @Operation(summary = "修改发票") + @PreAuthorize("@ss.hasPermi('pay:invoice:edit')") + @Log(title = "发票", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PayInvoice payInvoice) + { + return toAjax(payInvoiceService.updatePayInvoice(payInvoice)); + } + + /** + * 删除发票 + */ + @Operation(summary = "删除发票") + @PreAuthorize("@ss.hasPermi('pay:invoice:remove')") + @Log(title = "发票", businessType = BusinessType.DELETE) + @DeleteMapping("/{invoiceIds}") + public AjaxResult remove(@PathVariable( name = "invoiceIds" ) Long[] invoiceIds) + { + return toAjax(payInvoiceService.deletePayInvoiceByInvoiceIds(invoiceIds)); + } +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/controller/PayOrderController.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/controller/PayOrderController.java new file mode 100644 index 0000000..16e0ef0 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/controller/PayOrderController.java @@ -0,0 +1,113 @@ +package com.ruoyi.pay.controller; + +import java.util.List; +import jakarta.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.PayOrder; +import com.ruoyi.pay.service.IPayOrderService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; + +/** + * 订单Controller + * + * @author ruoyi + * @date 2024-02-15 + */ +@RestController +@RequestMapping("/pay/order") +@Tag(name = "【订单】管理") +public class PayOrderController extends BaseController +{ + @Autowired + private IPayOrderService payOrderService; + + /** + * 查询订单列表 + */ + @Operation(summary = "查询订单列表") + @PreAuthorize("@ss.hasPermi('pay:order:list')") + @GetMapping("/list") + public TableDataInfo list(PayOrder payOrder) + { + startPage(); + List list = payOrderService.selectPayOrderList(payOrder); + return getDataTable(list); + } + + /** + * 导出订单列表 + */ + @Operation(summary = "导出订单列表") + @PreAuthorize("@ss.hasPermi('pay:order:export')") + @Log(title = "订单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, PayOrder payOrder) + { + List list = payOrderService.selectPayOrderList(payOrder); + ExcelUtil util = new ExcelUtil(PayOrder.class); + util.exportExcel(response, list, "订单数据"); + } + + /** + * 获取订单详细信息 + */ + @Operation(summary = "获取订单详细信息") + @PreAuthorize("@ss.hasPermi('pay:order:query')") + @GetMapping(value = "/{orderId}") + public AjaxResult getInfo(@PathVariable("orderId") Long orderId) + { + return success(payOrderService.selectPayOrderByOrderId(orderId)); + } + + /** + * 新增订单 + */ + @Operation(summary = "新增订单") + @PreAuthorize("@ss.hasPermi('pay:order:add')") + @Log(title = "订单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PayOrder payOrder) + { + return toAjax(payOrderService.insertPayOrder(payOrder)); + } + + /** + * 修改订单 + */ + @Operation(summary = "修改订单") + @PreAuthorize("@ss.hasPermi('pay:order:edit')") + @Log(title = "订单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PayOrder payOrder) + { + return toAjax(payOrderService.updatePayOrder(payOrder)); + } + + /** + * 删除订单 + */ + @Operation(summary = "删除订单") + @PreAuthorize("@ss.hasPermi('pay:order:remove')") + @Log(title = "订单", businessType = BusinessType.DELETE) + @DeleteMapping("/{orderIds}") + public AjaxResult remove(@PathVariable( name = "orderIds" ) Long[] orderIds) + { + return toAjax(payOrderService.deletePayOrderByOrderIds(orderIds)); + } +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java new file mode 100644 index 0000000..9758c8f --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayInvoice.java @@ -0,0 +1,187 @@ +package com.ruoyi.pay.domain; + +import io.swagger.v3.oas.annotations.media.Schema; +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; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 发票对象 pay_invoice + * + * @author ruoyi + * @date 2024-02-15 + */ +@Schema(description = "发票对象") +public class PayInvoice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 发票id */ + @Schema(defaultValue = "发票id") + private Long invoiceId; + + + + + /** 订单号 */ + @Schema(defaultValue = "订单号") + @Excel(name = "订单号") + private String orderNumber; + + + + + /** 发票类型 */ + @Schema(defaultValue = "发票类型") + @Excel(name = "发票类型") + private String invoiceType; + + + + + /** 发票抬头 */ + @Schema(defaultValue = "发票抬头") + @Excel(name = "发票抬头") + private String invoiceHeader; + + + + + /** 纳税人识别号 */ + @Schema(defaultValue = "纳税人识别号") + @Excel(name = "纳税人识别号") + private String invoiceNumber; + + + + + /** 收票人手机号 */ + @Schema(defaultValue = "收票人手机号") + @Excel(name = "收票人手机号") + private String invoicePhone; + + + + + /** 收票人邮箱 */ + @Schema(defaultValue = "收票人邮箱") + @Excel(name = "收票人邮箱") + private String invoiceEmail; + + + + + /** 发票备注 */ + @Schema(defaultValue = "发票备注") + @Excel(name = "发票备注") + private String invoiceRemark; + + + + public void setInvoiceId(Long invoiceId) + { + this.invoiceId = invoiceId; + } + + public Long getInvoiceId() + { + return invoiceId; + } + + + public void setOrderNumber(String orderNumber) + { + this.orderNumber = orderNumber; + } + + public String getOrderNumber() + { + return orderNumber; + } + + + public void setInvoiceType(String invoiceType) + { + this.invoiceType = invoiceType; + } + + public String getInvoiceType() + { + return invoiceType; + } + + + public void setInvoiceHeader(String invoiceHeader) + { + this.invoiceHeader = invoiceHeader; + } + + public String getInvoiceHeader() + { + return invoiceHeader; + } + + + public void setInvoiceNumber(String invoiceNumber) + { + this.invoiceNumber = invoiceNumber; + } + + public String getInvoiceNumber() + { + return invoiceNumber; + } + + + public void setInvoicePhone(String invoicePhone) + { + this.invoicePhone = invoicePhone; + } + + public String getInvoicePhone() + { + return invoicePhone; + } + + + public void setInvoiceEmail(String invoiceEmail) + { + this.invoiceEmail = invoiceEmail; + } + + public String getInvoiceEmail() + { + return invoiceEmail; + } + + + public void setInvoiceRemark(String invoiceRemark) + { + this.invoiceRemark = invoiceRemark; + } + + public String getInvoiceRemark() + { + return invoiceRemark; + } + + + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("invoiceId", getInvoiceId()) + .append("orderNumber", getOrderNumber()) + .append("invoiceType", getInvoiceType()) + .append("invoiceHeader", getInvoiceHeader()) + .append("invoiceNumber", getInvoiceNumber()) + .append("invoicePhone", getInvoicePhone()) + .append("invoiceEmail", getInvoiceEmail()) + .append("invoiceRemark", getInvoiceRemark()) + .toString(); + } +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java new file mode 100644 index 0000000..3634bf4 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/domain/PayOrder.java @@ -0,0 +1,187 @@ +package com.ruoyi.pay.domain; + +import io.swagger.v3.oas.annotations.media.Schema; +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; + +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * 订单对象 pay_order + * + * @author ruoyi + * @date 2024-02-15 + */ +@Schema(description = "订单对象") +public class PayOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** 订单ID */ + @Schema(defaultValue = "订单ID") + private Long orderId; + + + + + /** 用户id */ + @Schema(defaultValue = "用户id") + @Excel(name = "用户id") + private Long userId; + + + + + /** 订单号 */ + @Schema(defaultValue = "订单号") + @Excel(name = "订单号") + private String orderNumber; + + + + + /** 订单状态 */ + @Schema(defaultValue = "订单状态") + @Excel(name = "订单状态") + private String orderStatus; + + + + + /** 订单总金额 */ + @Schema(defaultValue = "订单总金额") + @Excel(name = "订单总金额") + private String totalAmount; + + + + + /** 订单内容 */ + @Schema(defaultValue = "订单内容") + @Excel(name = "订单内容") + private String orderContent; + + + + + /** 订单备注 */ + @Schema(defaultValue = "订单备注") + @Excel(name = "订单备注") + private String orderRemark; + + + + + /** 负载信息 */ + @Schema(defaultValue = "负载信息") + @Excel(name = "负载信息") + private String orderMessage; + + + + public void setOrderId(Long orderId) + { + this.orderId = orderId; + } + + public Long getOrderId() + { + return orderId; + } + + + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + + + public void setOrderNumber(String orderNumber) + { + this.orderNumber = orderNumber; + } + + public String getOrderNumber() + { + return orderNumber; + } + + + public void setOrderStatus(String orderStatus) + { + this.orderStatus = orderStatus; + } + + public String getOrderStatus() + { + return orderStatus; + } + + + public void setTotalAmount(String totalAmount) + { + this.totalAmount = totalAmount; + } + + public String getTotalAmount() + { + return totalAmount; + } + + + public void setOrderContent(String orderContent) + { + this.orderContent = orderContent; + } + + public String getOrderContent() + { + return orderContent; + } + + + public void setOrderRemark(String orderRemark) + { + this.orderRemark = orderRemark; + } + + public String getOrderRemark() + { + return orderRemark; + } + + + public void setOrderMessage(String orderMessage) + { + this.orderMessage = orderMessage; + } + + public String getOrderMessage() + { + return orderMessage; + } + + + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("orderId", getOrderId()) + .append("userId", getUserId()) + .append("orderNumber", getOrderNumber()) + .append("orderStatus", getOrderStatus()) + .append("totalAmount", getTotalAmount()) + .append("orderContent", getOrderContent()) + .append("orderRemark", getOrderRemark()) + .append("orderMessage", getOrderMessage()) + .toString(); + } +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/mapper/PayInvoiceMapper.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/mapper/PayInvoiceMapper.java new file mode 100644 index 0000000..668c208 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/mapper/PayInvoiceMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.pay.mapper; + +import java.util.List; +import com.ruoyi.pay.domain.PayInvoice; + +/** + * 发票Mapper接口 + * + * @author ruoyi + * @date 2024-02-15 + */ +public interface PayInvoiceMapper +{ + /** + * 查询发票 + * + * @param invoiceId 发票主键 + * @return 发票 + */ + public PayInvoice selectPayInvoiceByInvoiceId(Long invoiceId); + + /** + * 查询发票列表 + * + * @param payInvoice 发票 + * @return 发票集合 + */ + public List selectPayInvoiceList(PayInvoice payInvoice); + + /** + * 新增发票 + * + * @param payInvoice 发票 + * @return 结果 + */ + public int insertPayInvoice(PayInvoice payInvoice); + + /** + * 修改发票 + * + * @param payInvoice 发票 + * @return 结果 + */ + public int updatePayInvoice(PayInvoice payInvoice); + + /** + * 删除发票 + * + * @param invoiceId 发票主键 + * @return 结果 + */ + public int deletePayInvoiceByInvoiceId(Long invoiceId); + + /** + * 批量删除发票 + * + * @param invoiceIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePayInvoiceByInvoiceIds(Long[] invoiceIds); +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/mapper/PayOrderMapper.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/mapper/PayOrderMapper.java new file mode 100644 index 0000000..fc74207 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/mapper/PayOrderMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.pay.mapper; + +import java.util.List; +import com.ruoyi.pay.domain.PayOrder; + +/** + * 订单Mapper接口 + * + * @author ruoyi + * @date 2024-02-15 + */ +public interface PayOrderMapper +{ + /** + * 查询订单 + * + * @param orderId 订单主键 + * @return 订单 + */ + public PayOrder selectPayOrderByOrderId(Long orderId); + + /** + * 查询订单列表 + * + * @param payOrder 订单 + * @return 订单集合 + */ + public List selectPayOrderList(PayOrder payOrder); + + /** + * 新增订单 + * + * @param payOrder 订单 + * @return 结果 + */ + public int insertPayOrder(PayOrder payOrder); + + /** + * 修改订单 + * + * @param payOrder 订单 + * @return 结果 + */ + public int updatePayOrder(PayOrder payOrder); + + /** + * 删除订单 + * + * @param orderId 订单主键 + * @return 结果 + */ + public int deletePayOrderByOrderId(Long orderId); + + /** + * 批量删除订单 + * + * @param orderIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePayOrderByOrderIds(Long[] orderIds); +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/IPayInvoiceService.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/IPayInvoiceService.java new file mode 100644 index 0000000..80cba55 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/IPayInvoiceService.java @@ -0,0 +1,61 @@ +package com.ruoyi.pay.service; + +import java.util.List; +import com.ruoyi.pay.domain.PayInvoice; + +/** + * 发票Service接口 + * + * @author ruoyi + * @date 2024-02-15 + */ +public interface IPayInvoiceService +{ + /** + * 查询发票 + * + * @param invoiceId 发票主键 + * @return 发票 + */ + public PayInvoice selectPayInvoiceByInvoiceId(Long invoiceId); + + /** + * 查询发票列表 + * + * @param payInvoice 发票 + * @return 发票集合 + */ + public List selectPayInvoiceList(PayInvoice payInvoice); + + /** + * 新增发票 + * + * @param payInvoice 发票 + * @return 结果 + */ + public int insertPayInvoice(PayInvoice payInvoice); + + /** + * 修改发票 + * + * @param payInvoice 发票 + * @return 结果 + */ + public int updatePayInvoice(PayInvoice payInvoice); + + /** + * 批量删除发票 + * + * @param invoiceIds 需要删除的发票主键集合 + * @return 结果 + */ + public int deletePayInvoiceByInvoiceIds(Long[] invoiceIds); + + /** + * 删除发票信息 + * + * @param invoiceId 发票主键 + * @return 结果 + */ + public int deletePayInvoiceByInvoiceId(Long invoiceId); +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/IPayOrderService.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/IPayOrderService.java new file mode 100644 index 0000000..fb4d424 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/IPayOrderService.java @@ -0,0 +1,61 @@ +package com.ruoyi.pay.service; + +import java.util.List; +import com.ruoyi.pay.domain.PayOrder; + +/** + * 订单Service接口 + * + * @author ruoyi + * @date 2024-02-15 + */ +public interface IPayOrderService +{ + /** + * 查询订单 + * + * @param orderId 订单主键 + * @return 订单 + */ + public PayOrder selectPayOrderByOrderId(Long orderId); + + /** + * 查询订单列表 + * + * @param payOrder 订单 + * @return 订单集合 + */ + public List selectPayOrderList(PayOrder payOrder); + + /** + * 新增订单 + * + * @param payOrder 订单 + * @return 结果 + */ + public int insertPayOrder(PayOrder payOrder); + + /** + * 修改订单 + * + * @param payOrder 订单 + * @return 结果 + */ + public int updatePayOrder(PayOrder payOrder); + + /** + * 批量删除订单 + * + * @param orderIds 需要删除的订单主键集合 + * @return 结果 + */ + public int deletePayOrderByOrderIds(Long[] orderIds); + + /** + * 删除订单信息 + * + * @param orderId 订单主键 + * @return 结果 + */ + public int deletePayOrderByOrderId(Long orderId); +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/impl/PayInvoiceServiceImpl.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/impl/PayInvoiceServiceImpl.java new file mode 100644 index 0000000..25bd936 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/impl/PayInvoiceServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.pay.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.pay.mapper.PayInvoiceMapper; +import com.ruoyi.pay.domain.PayInvoice; +import com.ruoyi.pay.service.IPayInvoiceService; + +/** + * 发票Service业务层处理 + * + * @author ruoyi + * @date 2024-02-15 + */ +@Service +public class PayInvoiceServiceImpl implements IPayInvoiceService +{ + @Autowired + private PayInvoiceMapper payInvoiceMapper; + + /** + * 查询发票 + * + * @param invoiceId 发票主键 + * @return 发票 + */ + @Override + public PayInvoice selectPayInvoiceByInvoiceId(Long invoiceId) + { + return payInvoiceMapper.selectPayInvoiceByInvoiceId(invoiceId); + } + + /** + * 查询发票列表 + * + * @param payInvoice 发票 + * @return 发票 + */ + @Override + public List selectPayInvoiceList(PayInvoice payInvoice) + { + return payInvoiceMapper.selectPayInvoiceList(payInvoice); + } + + /** + * 新增发票 + * + * @param payInvoice 发票 + * @return 结果 + */ + @Override + public int insertPayInvoice(PayInvoice payInvoice) + { + return payInvoiceMapper.insertPayInvoice(payInvoice); + } + + /** + * 修改发票 + * + * @param payInvoice 发票 + * @return 结果 + */ + @Override + public int updatePayInvoice(PayInvoice payInvoice) + { + return payInvoiceMapper.updatePayInvoice(payInvoice); + } + + /** + * 批量删除发票 + * + * @param invoiceIds 需要删除的发票主键 + * @return 结果 + */ + @Override + public int deletePayInvoiceByInvoiceIds(Long[] invoiceIds) + { + return payInvoiceMapper.deletePayInvoiceByInvoiceIds(invoiceIds); + } + + /** + * 删除发票信息 + * + * @param invoiceId 发票主键 + * @return 结果 + */ + @Override + public int deletePayInvoiceByInvoiceId(Long invoiceId) + { + return payInvoiceMapper.deletePayInvoiceByInvoiceId(invoiceId); + } +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/impl/PayOrderServiceImpl.java b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/impl/PayOrderServiceImpl.java new file mode 100644 index 0000000..3c271ce --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/java/com/ruoyi/pay/service/impl/PayOrderServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.pay.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.pay.mapper.PayOrderMapper; +import com.ruoyi.pay.domain.PayOrder; +import com.ruoyi.pay.service.IPayOrderService; + +/** + * 订单Service业务层处理 + * + * @author ruoyi + * @date 2024-02-15 + */ +@Service +public class PayOrderServiceImpl implements IPayOrderService +{ + @Autowired + private PayOrderMapper payOrderMapper; + + /** + * 查询订单 + * + * @param orderId 订单主键 + * @return 订单 + */ + @Override + public PayOrder selectPayOrderByOrderId(Long orderId) + { + return payOrderMapper.selectPayOrderByOrderId(orderId); + } + + /** + * 查询订单列表 + * + * @param payOrder 订单 + * @return 订单 + */ + @Override + public List selectPayOrderList(PayOrder payOrder) + { + return payOrderMapper.selectPayOrderList(payOrder); + } + + /** + * 新增订单 + * + * @param payOrder 订单 + * @return 结果 + */ + @Override + public int insertPayOrder(PayOrder payOrder) + { + return payOrderMapper.insertPayOrder(payOrder); + } + + /** + * 修改订单 + * + * @param payOrder 订单 + * @return 结果 + */ + @Override + public int updatePayOrder(PayOrder payOrder) + { + return payOrderMapper.updatePayOrder(payOrder); + } + + /** + * 批量删除订单 + * + * @param orderIds 需要删除的订单主键 + * @return 结果 + */ + @Override + public int deletePayOrderByOrderIds(Long[] orderIds) + { + return payOrderMapper.deletePayOrderByOrderIds(orderIds); + } + + /** + * 删除订单信息 + * + * @param orderId 订单主键 + * @return 结果 + */ + @Override + public int deletePayOrderByOrderId(Long orderId) + { + return payOrderMapper.deletePayOrderByOrderId(orderId); + } +} diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/resources/mapper/pay/PayInvoiceMapper.xml b/ruoyi-pay/ruoyi-pay-common/src/main/resources/mapper/pay/PayInvoiceMapper.xml new file mode 100644 index 0000000..c9325bf --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/resources/mapper/pay/PayInvoiceMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + select invoice_id, order_number, invoice_type, invoice_header, invoice_number, invoice_phone, invoice_email, invoice_remark from pay_invoice + + + + + + + + insert into pay_invoice + + invoice_id, + order_number, + invoice_type, + invoice_header, + invoice_number, + invoice_phone, + invoice_email, + invoice_remark, + + + #{invoiceId}, + #{orderNumber}, + #{invoiceType}, + #{invoiceHeader}, + #{invoiceNumber}, + #{invoicePhone}, + #{invoiceEmail}, + #{invoiceRemark}, + + + + + update pay_invoice + + order_number = #{orderNumber}, + invoice_type = #{invoiceType}, + invoice_header = #{invoiceHeader}, + invoice_number = #{invoiceNumber}, + invoice_phone = #{invoicePhone}, + invoice_email = #{invoiceEmail}, + invoice_remark = #{invoiceRemark}, + + where pay_invoice.invoice_id = #{invoiceId} + + + + delete from pay_invoice where invoice_id = #{invoiceId} + + + + delete from pay_invoice where invoice_id in + + #{invoiceId} + + + \ No newline at end of file diff --git a/ruoyi-pay/ruoyi-pay-common/src/main/resources/mapper/pay/PayOrderMapper.xml b/ruoyi-pay/ruoyi-pay-common/src/main/resources/mapper/pay/PayOrderMapper.xml new file mode 100644 index 0000000..74f4400 --- /dev/null +++ b/ruoyi-pay/ruoyi-pay-common/src/main/resources/mapper/pay/PayOrderMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + select order_id, user_id, order_number, order_status, total_amount, order_content, order_remark, order_message from pay_order + + + + + + + + insert into pay_order + + order_id, + user_id, + order_number, + order_status, + total_amount, + order_content, + order_remark, + order_message, + + + #{orderId}, + #{userId}, + #{orderNumber}, + #{orderStatus}, + #{totalAmount}, + #{orderContent}, + #{orderRemark}, + #{orderMessage}, + + + + + update pay_order + + user_id = #{userId}, + order_number = #{orderNumber}, + order_status = #{orderStatus}, + total_amount = #{totalAmount}, + order_content = #{orderContent}, + order_remark = #{orderRemark}, + order_message = #{orderMessage}, + + where pay_order.order_id = #{orderId} + + + + delete from pay_order where order_id = #{orderId} + + + + delete from pay_order where order_id in + + #{orderId} + + + \ No newline at end of file diff --git a/ruoyi-pay/ruoyi-pay-start/pom.xml b/ruoyi-pay/ruoyi-pay-start/pom.xml index 3675e56..ca08737 100644 --- a/ruoyi-pay/ruoyi-pay-start/pom.xml +++ b/ruoyi-pay/ruoyi-pay-start/pom.xml @@ -23,6 +23,13 @@ ruoyi-common + + + + com.ruoyi + ruoyi-pay-common + + com.ruoyi @@ -41,6 +48,7 @@ ruoyi-pay-wx + \ No newline at end of file diff --git a/sql/oauth.sql b/sql/oauth.sql index 59e2126..2480a1a 100644 --- a/sql/oauth.sql +++ b/sql/oauth.sql @@ -19,7 +19,7 @@ CREATE TABLE oauth_user ( code VARCHAR(255) COMMENT '用户的授权code,部分平台可能没有', oauth_token VARCHAR(255) COMMENT 'Twitter平台用户的附带属性,部分平台可能没有', oauth_token_secret VARCHAR(255) COMMENT 'Twitter平台用户的附带属性,部分平台可能没有' -); +) ENGINE = InnoDB COMMENT = '第三方登录'; -- 菜单 SQL insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) diff --git a/sql/online.sql b/sql/online.sql index d87d22a..913a19b 100644 --- a/sql/online.sql +++ b/sql/online.sql @@ -12,7 +12,7 @@ CREATE TABLE `online_mb` ( `resultType` varchar(255) NULL COMMENT '响应类型', `actuator` varchar(255) NULL COMMENT '执行器', PRIMARY KEY (`mb_id`) -); +) ENGINE = InnoDB COMMENT = '在线接口'; -- 菜单 SQL insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) diff --git a/sql/pay.sql b/sql/pay.sql new file mode 100644 index 0000000..bf0e7af --- /dev/null +++ b/sql/pay.sql @@ -0,0 +1,80 @@ +-- ---------------------------- +-- 订单表 +-- ---------------------------- +DROP TABLE IF EXISTS `pay_order`; +CREATE TABLE `pay_order` ( + `order_id` bigint NOT NULL COMMENT '订单ID', + `user_id` bigint NULL DEFAULT NULL COMMENT '用户id', + `order_number` varchar(255) NULL DEFAULT NULL COMMENT '订单号', + `order_status` varchar(255) NULL DEFAULT NULL COMMENT '订单状态', + `total_amount` varchar(255) NULL DEFAULT NULL COMMENT '订单总金额', + `order_content` varchar(255) NULL DEFAULT NULL COMMENT '订单内容', + `order_remark` varchar(255) NULL DEFAULT NULL COMMENT '订单备注', + `order_message` varchar(255) NULL DEFAULT NULL COMMENT '负载信息', + PRIMARY KEY (`order_id`) +) ENGINE = InnoDB COMMENT = '订单'; + +-- ---------------------------- +-- 发票表 +-- ---------------------------- +DROP TABLE IF EXISTS `pay_invoice`; +CREATE TABLE `pay_invoice` ( + `invoice_id` bigint NOT NULL COMMENT '发票id', + `order_number` varchar(255) NULL DEFAULT NULL COMMENT '订单号', + `invoice_type` varchar(255) NULL DEFAULT NULL COMMENT '发票类型', + `invoice_header` varchar(255) NULL DEFAULT NULL COMMENT '发票抬头', + `invoice_number` varchar(255) NULL DEFAULT NULL COMMENT '纳税人识别号', + `invoice_phone` varchar(255) NULL DEFAULT NULL COMMENT '收票人手机号', + `invoice_email` varchar(255) NULL DEFAULT NULL COMMENT '收票人邮箱', + `invoice_remark` varchar(255) NULL DEFAULT NULL COMMENT '发票备注', + PRIMARY KEY (`invoice_id`) +) ENGINE = InnoDB COMMENT = '发票'; + +INSERT INTO sys_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2024, '支付管理', 0, 4, '/pay', NULL, NULL, 1, 0, 'M', '0', '0', NULL, 'money', 'admin', '2024-02-15 22:40:23', '', NULL, ''); + +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单', '2024', '1', 'order', 'pay/order/index', 1, 0, 'C', '0', '0', 'pay:order:list', '#', 'admin', sysdate(), '', null, '订单菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pay:order:query', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pay:order:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pay:order:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pay:order:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('订单导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pay:order:export', '#', 'admin', sysdate(), '', null, ''); + + +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('发票', '2024', '1', 'invoice', 'pay/invoice/index', 1, 0, 'C', '0', '0', 'pay:invoice:list', '#', 'admin', sysdate(), '', null, '发票菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('发票查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pay:invoice:query', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('发票新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pay:invoice:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('发票修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pay:invoice:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('发票删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pay:invoice:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('发票导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pay:invoice:export', '#', 'admin', sysdate(), '', null, ''); \ No newline at end of file