mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-10 06:19:06 +00:00
feat 支付订单和退款订单页面添加实时金额汇总展示
This commit is contained in:
12
README.md
12
README.md
@@ -36,10 +36,10 @@
|
|||||||
|
|
||||||
## 📃 文档和源码地址
|
## 📃 文档和源码地址
|
||||||
### 文档地址
|
### 文档地址
|
||||||
在 [Bootx开源文档站](https://bootx.gitee.io/) 下的支付网关(DaxPay)模块下可以进行查阅相关文档,具体链接地址如下:
|
在 [Bootx开源文档站](https://doc.bootx.cn/) 下的支付网关(DaxPay)模块下可以进行查阅相关文档,具体链接地址如下:
|
||||||
[快速指南](https://bootx.gitee.io/daxpay/guides/overview/项目介绍.html)、
|
[快速指南](https://doc.bootx.cn/daxpay/guides/overview/项目介绍.html)、
|
||||||
[支付对接](https://bootx.gitee.io/daxpay/gateway/overview/接口清单.html)、
|
[支付对接](https://doc.bootx.cn/daxpay/gateway/overview/接口清单.html)、
|
||||||
[操作手册](https://bootx.gitee.io/daxpay/admin/config/平台配置.html)
|
[操作手册](https://doc.bootx.cn/daxpay/admin/config/平台配置.html)
|
||||||
|
|
||||||
### 项目地址
|
### 项目地址
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
不会对原业务系统的架构产生影响。如果是Java项目,可以使用SDK简化接入流程, 其他语言可以参照中的说明使用HTTP接口方式接入。
|
不会对原业务系统的架构产生影响。如果是Java项目,可以使用SDK简化接入流程, 其他语言可以参照中的说明使用HTTP接口方式接入。
|
||||||
|
|
||||||
### Java客户端SDK
|
### Java客户端SDK
|
||||||
> SDK版本号与支付网关的版本保持一致,如果需要使用,请在pom.xml中添加如下依赖。SDK使用方式参考[SDK使用说明](https://bootx.gitee.io/daxpay/gateway/overview/SDK使用说明.html)。
|
> SDK版本号与支付网关的版本保持一致,如果需要使用,请在pom.xml中添加如下依赖。SDK使用方式参考[SDK使用说明](https://doc.bootx.cn/daxpay/gateway/overview/SDK使用说明.html)。
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<!-- 支付SDK -->
|
<!-- 支付SDK -->
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
### SDK调用示例
|
### SDK调用示例
|
||||||
> 此处以简单支付接口为例,演示业务系统如何调用支付网关进行支付,其他接口的调用方式类似,具体请参考[支付对接](https://bootx.gitee.io/daxpay/gateway/overview/接口清单.html)。
|
> 此处以简单支付接口为例,演示业务系统如何调用支付网关进行支付,其他接口的调用方式类似,具体请参考[支付对接](https://doc.bootx.cn/daxpay/gateway/overview/接口清单.html)。
|
||||||
|
|
||||||
```java
|
```java
|
||||||
/**
|
/**
|
||||||
|
@@ -12,17 +12,16 @@
|
|||||||
- [x] 订单修复
|
- [x] 订单修复
|
||||||
- [x] 支付和退款回调
|
- [x] 支付和退款回调
|
||||||
- [x] 去除现金支付和储值卡支付方式
|
- [x] 去除现金支付和储值卡支付方式
|
||||||
- [x] 三方支付外部订单号规则优化: 支付P、退款R、分账A,根据环境加前缀:DEV_、DEMO_、PRE_
|
- [x] 三方支付通道订单号规则优化: 支付P、退款R、分账A,根据环境加前缀:DEV_、DEMO_、PRE_
|
||||||
- [x] 金额显示统一使用元
|
- [x] 金额显示统一使用元
|
||||||
- [x] 使用切面统一处理API调用异常, 做统一包装返回
|
- [x] 使用切面统一处理API调用异常, 做统一包装返回
|
||||||
- [x] 支付接口优化
|
- [x] 支付接口优化
|
||||||
- [x] 前端查询条件适配
|
- [x] 前端查询条件适配
|
||||||
- [x] paymentId替换
|
- [x] paymentId替换
|
||||||
- [ ] 支付订单和退款订单页面添加实时金额汇总展示
|
- [x] 对账单改造
|
||||||
- [ ] 对账单改造
|
|
||||||
- [x] 去除对账单明细按钮
|
- [x] 去除对账单明细按钮
|
||||||
- [x] 增加对账结果计算和显示
|
- [x] 增加对账结果计算和显示
|
||||||
- [ ] 增加下载原始对账单功能(保证将明细文件进行储存)
|
- [x] 增加下载原始对账单功能(保证将明细文件进行储存)
|
||||||
- [x] 保存原始的文件
|
- [x] 保存原始的文件
|
||||||
- [x] 微信
|
- [x] 微信
|
||||||
- [x] 支付宝
|
- [x] 支付宝
|
||||||
@@ -30,6 +29,7 @@
|
|||||||
- [x] 解析原有文件, 可以转换为指定格式进行下载
|
- [x] 解析原有文件, 可以转换为指定格式进行下载
|
||||||
- [x] 增加下载系统对账单功能
|
- [x] 增加下载系统对账单功能
|
||||||
- [x] 增加对单差异数据查看功能和查看功能
|
- [x] 增加对单差异数据查看功能和查看功能
|
||||||
|
- [x] 支付订单和退款订单页面添加实时金额汇总展示
|
||||||
- [ ] 自动分账改造
|
- [ ] 自动分账改造
|
||||||
- [ ] SDK新增对账接收放添加接口
|
- [ ] SDK新增对账接收放添加接口
|
||||||
- [ ] 创建定时任务, 自动对待分账订单进行分账
|
- [ ] 创建定时任务, 自动对待分账订单进行分账
|
||||||
|
@@ -103,4 +103,10 @@ public class PayOrderController {
|
|||||||
allocationService.allocation(param);
|
allocationService.allocation(param);
|
||||||
return Res.ok();
|
return Res.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询金额汇总")
|
||||||
|
@GetMapping("/getTotalAmount")
|
||||||
|
public ResResult<Integer> getTotalAmount(PayOrderQuery param){
|
||||||
|
return Res.ok(queryService.getTotalAmount(param));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,7 @@ import cn.bootx.platform.daxpay.service.core.payment.sync.service.RefundSyncServ
|
|||||||
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderDetailDto;
|
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderDetailDto;
|
||||||
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderDto;
|
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderDto;
|
||||||
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderExtraDto;
|
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderExtraDto;
|
||||||
|
import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery;
|
||||||
import cn.bootx.platform.daxpay.service.param.order.PayOrderRefundParam;
|
import cn.bootx.platform.daxpay.service.param.order.PayOrderRefundParam;
|
||||||
import cn.bootx.platform.daxpay.service.param.order.RefundOrderQuery;
|
import cn.bootx.platform.daxpay.service.param.order.RefundOrderQuery;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@@ -30,36 +31,36 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RefundOrderController {
|
public class RefundOrderController {
|
||||||
private final RefundOrderService refundOrderService;
|
private final RefundOrderService refundOrderService;
|
||||||
private final RefundOrderQueryService refundOrderQueryService;
|
private final RefundOrderQueryService queryService;
|
||||||
private final RefundSyncService refundSyncService;
|
private final RefundSyncService refundSyncService;
|
||||||
|
|
||||||
@Operation(summary = "分页查询")
|
@Operation(summary = "分页查询")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ResResult<PageResult<RefundOrderDto>> page(PageParam pageParam, RefundOrderQuery query){
|
public ResResult<PageResult<RefundOrderDto>> page(PageParam pageParam, RefundOrderQuery query){
|
||||||
return Res.ok(refundOrderQueryService.page(pageParam, query));
|
return Res.ok(queryService.page(pageParam, query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "查询退款订单详情")
|
@Operation(summary = "查询退款订单详情")
|
||||||
@GetMapping("/findByOrderNo")
|
@GetMapping("/findByOrderNo")
|
||||||
public ResResult<RefundOrderDetailDto> findByRefundNo(String refundNo){
|
public ResResult<RefundOrderDetailDto> findByRefundNo(String refundNo){
|
||||||
RefundOrderDto order = refundOrderQueryService.findByRefundNo(refundNo);
|
RefundOrderDto order = queryService.findByRefundNo(refundNo);
|
||||||
RefundOrderDetailDto detailDto = new RefundOrderDetailDto();
|
RefundOrderDetailDto detailDto = new RefundOrderDetailDto();
|
||||||
detailDto.setRefundOrder(order);
|
detailDto.setRefundOrder(order);
|
||||||
detailDto.setRefundOrderExtra(refundOrderQueryService.findExtraById(order.getId()));
|
detailDto.setRefundOrderExtra(queryService.findExtraById(order.getId()));
|
||||||
return Res.ok(detailDto);
|
return Res.ok(detailDto);
|
||||||
}
|
}
|
||||||
@Operation(summary = "查询单条")
|
@Operation(summary = "查询单条")
|
||||||
@GetMapping("/findById")
|
@GetMapping("/findById")
|
||||||
public ResResult<RefundOrderDto> findById(Long id){
|
public ResResult<RefundOrderDto> findById(Long id){
|
||||||
return Res.ok(refundOrderQueryService.findById(id));
|
return Res.ok(queryService.findById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "查询扩展信息")
|
@Operation(summary = "查询扩展信息")
|
||||||
@GetMapping("/findExtraById")
|
@GetMapping("/findExtraById")
|
||||||
public ResResult<RefundOrderExtraDto> findExtraById(Long id){
|
public ResResult<RefundOrderExtraDto> findExtraById(Long id){
|
||||||
return Res.ok(refundOrderQueryService.findExtraById(id));
|
return Res.ok(queryService.findExtraById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "手动发起退款")
|
@Operation(summary = "手动发起退款")
|
||||||
@@ -83,4 +84,10 @@ public class RefundOrderController {
|
|||||||
refundSyncParam.setRefundNo(refundNo);
|
refundSyncParam.setRefundNo(refundNo);
|
||||||
return Res.ok(refundSyncService.sync(refundSyncParam));
|
return Res.ok(refundSyncService.sync(refundSyncParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "查询金额汇总")
|
||||||
|
@GetMapping("/getTotalAmount")
|
||||||
|
public ResResult<Integer> getTotalAmount(PayOrderQuery param){
|
||||||
|
return Res.ok(queryService.getTotalAmount(param));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,7 @@ public interface AliPayCode {
|
|||||||
/** 对交易或商品的描述(在没有公用回传参数的时候, 这个作为公用回传参数) */
|
/** 对交易或商品的描述(在没有公用回传参数的时候, 这个作为公用回传参数) */
|
||||||
String BODY = "body";
|
String BODY = "body";
|
||||||
|
|
||||||
/** 外部支付订单号 - 商户订单号 */
|
/** 通道支付订单号 - 商户订单号 */
|
||||||
String OUT_TRADE_NO = "out_trade_no";
|
String OUT_TRADE_NO = "out_trade_no";
|
||||||
|
|
||||||
/** 支付流水号 */
|
/** 支付流水号 */
|
||||||
|
@@ -44,9 +44,9 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction<
|
|||||||
private String bizAllocationNo;
|
private String bizAllocationNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部分账号
|
* 通道分账号
|
||||||
*/
|
*/
|
||||||
@DbColumn(comment = "外部分账号")
|
@DbColumn(comment = "通道分账号")
|
||||||
private String outAllocationNo;
|
private String outAllocationNo;
|
||||||
|
|
||||||
/** 支付订单ID */
|
/** 支付订单ID */
|
||||||
@@ -66,9 +66,9 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction<
|
|||||||
private String bizOrderNo;
|
private String bizOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部系统支付订单号
|
* 通道系统支付订单号
|
||||||
*/
|
*/
|
||||||
@DbColumn(comment = "外部支付订单号")
|
@DbColumn(comment = "通道支付订单号")
|
||||||
private String outOrderNo;
|
private String outOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -68,4 +68,13 @@ public class PayOrderManager extends BaseManager<PayOrderMapper, PayOrder> {
|
|||||||
.list();
|
.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询汇总金额
|
||||||
|
*/
|
||||||
|
public Integer getTalAmount(PayOrderQuery query){
|
||||||
|
QueryWrapper<PayOrder> generator = QueryGenerator.generator(query);
|
||||||
|
generator.eq(MpUtil.getColumnName(PayOrder::getStatus), PayStatusEnum.SUCCESS.getCode());
|
||||||
|
return baseMapper.getTalAmount(generator);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,12 @@
|
|||||||
package cn.bootx.platform.daxpay.service.core.order.pay.dao;
|
package cn.bootx.platform.daxpay.service.core.order.pay.dao;
|
||||||
|
|
||||||
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
|
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -16,4 +19,7 @@ import java.util.List;
|
|||||||
public interface PayOrderMapper extends BaseMapper<PayOrder> {
|
public interface PayOrderMapper extends BaseMapper<PayOrder> {
|
||||||
|
|
||||||
int insertList(@Param("list")List<PayOrder> list);
|
int insertList(@Param("list")List<PayOrder> list);
|
||||||
|
|
||||||
|
@Select("select sum(amount) from pay_order ${ew.customSqlSegment}")
|
||||||
|
Integer getTalAmount(@Param(Constants.WRAPPER) QueryWrapper<PayOrder> param);
|
||||||
}
|
}
|
||||||
|
@@ -41,9 +41,9 @@ public class PayOrder extends MpBaseEntity implements EntityBaseFunction<PayOrde
|
|||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部系统交易号
|
* 通道系统交易号
|
||||||
*/
|
*/
|
||||||
@DbColumn(comment = "外部支付订单号")
|
@DbColumn(comment = "通道支付订单号")
|
||||||
private String outOrderNo;
|
private String outOrderNo;
|
||||||
|
|
||||||
/** 标题 */
|
/** 标题 */
|
||||||
|
@@ -11,7 +11,6 @@ import cn.bootx.platform.daxpay.result.order.PayOrderResult;
|
|||||||
import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderExtraManager;
|
import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderExtraManager;
|
||||||
import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderManager;
|
import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderManager;
|
||||||
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
|
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder;
|
||||||
import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra;
|
|
||||||
import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderDto;
|
import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderDto;
|
||||||
import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery;
|
import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
@@ -21,8 +20,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@@ -80,8 +77,6 @@ public class PayOrderQueryService {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询支付记录
|
* 查询支付记录
|
||||||
*/
|
*/
|
||||||
@@ -94,10 +89,17 @@ public class PayOrderQueryService {
|
|||||||
PayOrder payOrder = this.findByBizOrOrderNo(param.getBizOrderNoeNo(), param.getOrderNo())
|
PayOrder payOrder = this.findByBizOrOrderNo(param.getBizOrderNoeNo(), param.getOrderNo())
|
||||||
.orElseThrow(() -> new DataNotExistException("未查询到支付订单"));
|
.orElseThrow(() -> new DataNotExistException("未查询到支付订单"));
|
||||||
// 查询扩展数据
|
// 查询扩展数据
|
||||||
PayOrderExtra payOrderExtra = payOrderExtraManager.findById(payOrder.getId())
|
payOrderExtraManager.findById(payOrder.getId())
|
||||||
.orElseThrow(() -> new PayFailureException("支付订单不完整"));
|
.orElseThrow(() -> new PayFailureException("支付订单不完整"));
|
||||||
PayOrderResult payOrderResult = new PayOrderResult();
|
PayOrderResult payOrderResult = new PayOrderResult();
|
||||||
BeanUtil.copyProperties(payOrder, payOrderResult);
|
BeanUtil.copyProperties(payOrder, payOrderResult);
|
||||||
return payOrderResult;
|
return payOrderResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付总金额
|
||||||
|
*/
|
||||||
|
public Integer getTotalAmount(PayOrderQuery param) {
|
||||||
|
return payOrderManager.getTalAmount(param);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,8 +55,8 @@ public class ReconcileDiff extends MpBaseEntity implements EntityBaseFunction<Re
|
|||||||
@DbColumn(comment = "本地交易号")
|
@DbColumn(comment = "本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@DbColumn(comment = "外部交易号")
|
@DbColumn(comment = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 交易时间 */
|
/** 交易时间 */
|
||||||
@@ -79,8 +79,8 @@ public class ReconcileDiff extends MpBaseEntity implements EntityBaseFunction<Re
|
|||||||
private Integer amount;
|
private Integer amount;
|
||||||
|
|
||||||
|
|
||||||
/** 外部交易金额 */
|
/** 通道交易金额 */
|
||||||
@DbColumn(comment = "外部交易金额")
|
@DbColumn(comment = "通道交易金额")
|
||||||
private Integer outAmount;
|
private Integer outAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -49,8 +49,8 @@ public class ReconcileTradeDetail extends MpCreateEntity implements EntityBaseFu
|
|||||||
@DbColumn(comment = "本地交易号")
|
@DbColumn(comment = "本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 - 支付宝/微信的订单号 */
|
/** 通道交易号 - 支付宝/微信的订单号 */
|
||||||
@DbColumn(comment = "外部交易号")
|
@DbColumn(comment = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 交易时间 */
|
/** 交易时间 */
|
||||||
|
@@ -4,8 +4,10 @@ import cn.bootx.platform.common.core.rest.param.PageParam;
|
|||||||
import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
|
import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
|
||||||
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
|
import cn.bootx.platform.common.mybatisplus.util.MpUtil;
|
||||||
import cn.bootx.platform.common.query.generator.QueryGenerator;
|
import cn.bootx.platform.common.query.generator.QueryGenerator;
|
||||||
|
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||||
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
import cn.bootx.platform.daxpay.code.RefundStatusEnum;
|
||||||
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrder;
|
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrder;
|
||||||
|
import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery;
|
||||||
import cn.bootx.platform.daxpay.service.param.order.RefundOrderQuery;
|
import cn.bootx.platform.daxpay.service.param.order.RefundOrderQuery;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -85,4 +87,13 @@ public class RefundOrderManager extends BaseManager<RefundOrderMapper, RefundOrd
|
|||||||
.in(RefundOrder::getStatus, status)
|
.in(RefundOrder::getStatus, status)
|
||||||
.list();
|
.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询汇总金额
|
||||||
|
*/
|
||||||
|
public Integer getTalAmount(PayOrderQuery query){
|
||||||
|
QueryWrapper<RefundOrder> generator = QueryGenerator.generator(query);
|
||||||
|
generator.eq(MpUtil.getColumnName(RefundOrder::getStatus), PayStatusEnum.SUCCESS.getCode());
|
||||||
|
return baseMapper.getTalAmount(generator);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,12 @@
|
|||||||
package cn.bootx.platform.daxpay.service.core.order.refund.dao;
|
package cn.bootx.platform.daxpay.service.core.order.refund.dao;
|
||||||
|
|
||||||
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrder;
|
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrder;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xxm
|
* @author xxm
|
||||||
@@ -11,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface RefundOrderMapper extends BaseMapper<RefundOrder> {
|
public interface RefundOrderMapper extends BaseMapper<RefundOrder> {
|
||||||
|
|
||||||
|
@Select("select sum(amount) from pay_refund_order ${ew.customSqlSegment}")
|
||||||
|
Integer getTalAmount(@Param(Constants.WRAPPER) QueryWrapper<RefundOrder> generator);
|
||||||
}
|
}
|
||||||
|
@@ -39,7 +39,7 @@ public class RefundOrder extends MpBaseEntity implements EntityBaseFunction<Refu
|
|||||||
@DbColumn(comment = "商户支付订单号")
|
@DbColumn(comment = "商户支付订单号")
|
||||||
private String bizOrderNo;
|
private String bizOrderNo;
|
||||||
|
|
||||||
/** 外部支付订单号 */
|
/** 通道支付订单号 */
|
||||||
@DbColumn(comment = "商户支付订单号")
|
@DbColumn(comment = "商户支付订单号")
|
||||||
private String outOrderNo;
|
private String outOrderNo;
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrder;
|
|||||||
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrderExtra;
|
import cn.bootx.platform.daxpay.service.core.order.refund.entity.RefundOrderExtra;
|
||||||
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderDto;
|
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderDto;
|
||||||
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderExtraDto;
|
import cn.bootx.platform.daxpay.service.dto.order.refund.RefundOrderExtraDto;
|
||||||
|
import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery;
|
||||||
import cn.bootx.platform.daxpay.service.param.order.RefundOrderQuery;
|
import cn.bootx.platform.daxpay.service.param.order.RefundOrderQuery;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -104,4 +105,11 @@ public class RefundOrderQueryService {
|
|||||||
return RefundOrderConvert.CONVERT.convertResult(refundOrder);
|
return RefundOrderConvert.CONVERT.convertResult(refundOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付总金额
|
||||||
|
*/
|
||||||
|
public Integer getTotalAmount(PayOrderQuery param) {
|
||||||
|
return refundOrderManager.getTalAmount(param);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,9 @@ import java.util.Optional;
|
|||||||
public class RefundOrderService {
|
public class RefundOrderService {
|
||||||
|
|
||||||
private final RefundService refundService;
|
private final RefundService refundService;
|
||||||
|
|
||||||
private final PayApiConfigService apiConfigService;
|
private final PayApiConfigService apiConfigService;
|
||||||
|
|
||||||
private final PaymentAssistService paymentAssistService;
|
private final PaymentAssistService paymentAssistService;
|
||||||
|
|
||||||
private final RefundOrderExtraManager refundOrderExtraManager;
|
private final RefundOrderExtraManager refundOrderExtraManager;
|
||||||
|
@@ -36,8 +36,8 @@ public class GeneralTradeInfo {
|
|||||||
@ExcelProperty("本地交易号")
|
@ExcelProperty("本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@ExcelProperty("外部交易号")
|
@ExcelProperty("通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 网关完成时间 */
|
/** 网关完成时间 */
|
||||||
|
@@ -91,7 +91,7 @@ public class RefundSyncService {
|
|||||||
this.saveRecord(refundOrder, syncResult, false, null, syncResult.getErrorMsg());
|
this.saveRecord(refundOrder, syncResult, false, null, syncResult.getErrorMsg());
|
||||||
throw new PayFailureException(syncResult.getErrorMsg());
|
throw new PayFailureException(syncResult.getErrorMsg());
|
||||||
}
|
}
|
||||||
// 订单的外部交易号是否一致, 不一致进行更新
|
// 订单的通道交易号是否一致, 不一致进行更新
|
||||||
if (Objects.nonNull(syncResult.getOutRefundNo()) && !Objects.equals(syncResult.getOutRefundNo(), refundOrder.getOutRefundNo())){
|
if (Objects.nonNull(syncResult.getOutRefundNo()) && !Objects.equals(syncResult.getOutRefundNo(), refundOrder.getOutRefundNo())){
|
||||||
refundOrder.setOutRefundNo(syncResult.getOutRefundNo());
|
refundOrder.setOutRefundNo(syncResult.getOutRefundNo());
|
||||||
refundOrderManager.updateById(refundOrder);
|
refundOrderManager.updateById(refundOrder);
|
||||||
|
@@ -33,8 +33,8 @@ public class PayCallbackRecord extends MpCreateEntity implements EntityBaseFunct
|
|||||||
@DbColumn(comment = "本地交易号")
|
@DbColumn(comment = "本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@DbColumn(comment = "外部交易号")
|
@DbColumn(comment = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -37,8 +37,8 @@ public class PaySyncRecord extends MpCreateEntity implements EntityBaseFunction<
|
|||||||
@DbColumn(comment = "商户交易号")
|
@DbColumn(comment = "商户交易号")
|
||||||
private String bizTradeNo;
|
private String bizTradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@DbColumn(comment = "外部交易号")
|
@DbColumn(comment = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -44,9 +44,9 @@ public class AllocationOrderDto extends BaseDto {
|
|||||||
private String bizOrderNo;
|
private String bizOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部订单号
|
* 通道订单号
|
||||||
*/
|
*/
|
||||||
@Schema(description = "外部订单号")
|
@Schema(description = "通道订单号")
|
||||||
private String outOrderNo;
|
private String outOrderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,9 +56,9 @@ public class AllocationOrderDto extends BaseDto {
|
|||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部分账单号
|
* 通道分账单号
|
||||||
*/
|
*/
|
||||||
@Schema(description = "外部分账单号")
|
@Schema(description = "通道分账单号")
|
||||||
private String outAllocationNo;
|
private String outAllocationNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -29,9 +29,9 @@ public class PayOrderDto extends BaseDto {
|
|||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部系统交易号
|
* 通道系统交易号
|
||||||
*/
|
*/
|
||||||
@Schema(description = "外部支付订单号")
|
@Schema(description = "通道支付订单号")
|
||||||
private String outOrderNo;
|
private String outOrderNo;
|
||||||
|
|
||||||
/** 标题 */
|
/** 标题 */
|
||||||
|
@@ -48,8 +48,8 @@ public class ReconcileDiffDto extends BaseDto {
|
|||||||
@Schema(description = "本地交易号")
|
@Schema(description = "本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 交易时间 */
|
/** 交易时间 */
|
||||||
@@ -71,8 +71,8 @@ public class ReconcileDiffDto extends BaseDto {
|
|||||||
@Schema(description = "交易金额")
|
@Schema(description = "交易金额")
|
||||||
private Integer amount;
|
private Integer amount;
|
||||||
|
|
||||||
/** 外部交易金额 */
|
/** 通道交易金额 */
|
||||||
@DbColumn(comment = "外部交易金额")
|
@DbColumn(comment = "通道交易金额")
|
||||||
private Integer outAmount;
|
private Integer outAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -51,9 +51,9 @@ public class ReconcileDiffExcel {
|
|||||||
@ExcelProperty("本地交易号")
|
@ExcelProperty("本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
@ExcelProperty("外部交易号")
|
@ExcelProperty("通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 交易时间 */
|
/** 交易时间 */
|
||||||
@@ -79,9 +79,9 @@ public class ReconcileDiffExcel {
|
|||||||
@ExcelProperty(value = "交易金额(元)", converter = AmountConverter.class)
|
@ExcelProperty(value = "交易金额(元)", converter = AmountConverter.class)
|
||||||
private Integer amount;
|
private Integer amount;
|
||||||
|
|
||||||
/** 外部交易金额 */
|
/** 通道交易金额 */
|
||||||
@DbColumn(comment = "外部交易金额")
|
@DbColumn(comment = "通道交易金额")
|
||||||
@ExcelProperty(value = "外部交易金额(元)", converter = AmountConverter.class)
|
@ExcelProperty(value = "通道交易金额(元)", converter = AmountConverter.class)
|
||||||
private Integer outAmount;
|
private Integer outAmount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -54,9 +54,9 @@ public class ReconcileTradeDetailDto extends BaseDto {
|
|||||||
@ExcelProperty("本地交易号")
|
@ExcelProperty("本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 - 支付宝/微信的订单号 */
|
/** 通道交易号 - 支付宝/微信的订单号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
@ExcelProperty("外部交易号")
|
@ExcelProperty("通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 交易时间 */
|
/** 交易时间 */
|
||||||
|
@@ -43,9 +43,9 @@ public class ReconcileTradeDetailExcel {
|
|||||||
@ExcelProperty("本地交易号")
|
@ExcelProperty("本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 - 支付宝/微信的订单号 */
|
/** 通道交易号 - 支付宝/微信的订单号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
@ExcelProperty("外部交易号")
|
@ExcelProperty("通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 交易时间 */
|
/** 交易时间 */
|
||||||
|
@@ -23,7 +23,7 @@ public class PayCallbackRecordDto extends BaseDto {
|
|||||||
@Schema(description = "交易号")
|
@Schema(description = "交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
/**
|
/**
|
||||||
* 支付通道
|
* 支付通道
|
||||||
|
@@ -32,8 +32,8 @@ public class PaySyncRecordDto extends BaseDto {
|
|||||||
@Schema(description = "商户交易号")
|
@Schema(description = "商户交易号")
|
||||||
private String bizTradeNo;
|
private String bizTradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -31,9 +31,9 @@ public class PayOrderQuery extends QueryOrder {
|
|||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部系统交易号
|
* 通道系统交易号
|
||||||
*/
|
*/
|
||||||
@Schema(description = "外部支付订单号")
|
@Schema(description = "通道支付订单号")
|
||||||
private String outOrderNo;
|
private String outOrderNo;
|
||||||
|
|
||||||
/** 标题 */
|
/** 标题 */
|
||||||
|
@@ -29,8 +29,8 @@ public class ReconcileDiffQuery extends QueryOrder {
|
|||||||
@Schema(description = "本地交易号")
|
@Schema(description = "本地交易号")
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/** 订单标题 */
|
/** 订单标题 */
|
||||||
|
@@ -30,8 +30,8 @@ public class PaySyncRecordQuery {
|
|||||||
@Schema(description = "商户交易号")
|
@Schema(description = "商户交易号")
|
||||||
private String bizTradeNo;
|
private String bizTradeNo;
|
||||||
|
|
||||||
/** 外部交易号 */
|
/** 通道交易号 */
|
||||||
@Schema(description = "外部交易号")
|
@Schema(description = "通道交易号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -11,5 +11,4 @@
|
|||||||
#{item.deleted,jdbcType=BIT})
|
#{item.deleted,jdbcType=BIT})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Reference in New Issue
Block a user