mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-03 11:06:46 +00:00
perf 支付订单增加关闭时间属性
This commit is contained in:
@@ -78,6 +78,10 @@ public class PayOrder extends MpBaseEntity implements EntityBaseFunction<PayOrde
|
||||
@DbColumn(comment = "支付时间")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/** 关闭时间 */
|
||||
@DbColumn(comment = "支付时间")
|
||||
private LocalDateTime closeTime;
|
||||
|
||||
/** 过期时间 */
|
||||
@DbColumn(comment = "过期时间")
|
||||
private LocalDateTime expiredTime;
|
||||
|
@@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -130,7 +131,8 @@ public class PayCloseService {
|
||||
*/
|
||||
private void successHandler(PayOrder payOrder){
|
||||
// 取消订单
|
||||
payOrder.setStatus(PayStatusEnum.CLOSE.getCode());
|
||||
payOrder.setStatus(PayStatusEnum.CLOSE.getCode())
|
||||
.setCloseTime(LocalDateTime.now());
|
||||
payOrderService.updateById(payOrder);
|
||||
this.saveRecord(payOrder,true,null);
|
||||
}
|
||||
|
@@ -2,6 +2,8 @@ package cn.bootx.platform.daxpay.service.core.payment.notice.result;
|
||||
|
||||
import cn.bootx.platform.daxpay.code.PayChannelEnum;
|
||||
import cn.bootx.platform.daxpay.code.PayStatusEnum;
|
||||
import cn.bootx.platform.daxpay.serializer.LocalDateTimeToTimestampSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -46,11 +48,17 @@ public class PayNoticeResult {
|
||||
@Schema(description = "支付状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "支付创建时间")
|
||||
@JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "支付成功时间")
|
||||
@JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
|
||||
private LocalDateTime payTime;
|
||||
|
||||
@Schema(description = "支付创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@Schema(description = "支付关闭时间")
|
||||
@JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
|
||||
private LocalDateTime closeTime;
|
||||
|
||||
@Schema(description = "商户扩展参数,回调时会原样返回")
|
||||
private String attach;
|
||||
|
@@ -152,6 +152,7 @@ public class ClientNoticeService {
|
||||
.setBusinessNo(order.getBusinessNo())
|
||||
.setAmount(order.getAmount())
|
||||
.setPayTime(order.getPayTime())
|
||||
.setCloseTime(order.getCloseTime())
|
||||
.setCreateTime(order.getCreateTime())
|
||||
.setStatus(order.getStatus())
|
||||
.setAttach(orderExtra.getAttach())
|
||||
|
@@ -140,7 +140,9 @@ public class PayRepairService {
|
||||
private void closeLocal(PayOrder order, List<AbsPayRepairStrategy> absPayStrategies) {
|
||||
// 执行策略的关闭方法
|
||||
absPayStrategies.forEach(AbsPayRepairStrategy::doCloseLocalHandler);
|
||||
order.setStatus(PayStatusEnum.CLOSE.getCode());
|
||||
order.setStatus(PayStatusEnum.CLOSE.getCode())
|
||||
// TODO 尝试是否可以使用网关返回的
|
||||
.setCloseTime(LocalDateTime.now());
|
||||
payOrderService.updateById(order);
|
||||
}
|
||||
/**
|
||||
@@ -150,7 +152,9 @@ public class PayRepairService {
|
||||
private void closeGateway(PayOrder payOrder, List<AbsPayRepairStrategy> absPayStrategies) {
|
||||
// 执行策略的关闭方法
|
||||
absPayStrategies.forEach(AbsPayRepairStrategy::doCloseGatewayHandler);
|
||||
payOrder.setStatus(PayStatusEnum.CLOSE.getCode());
|
||||
payOrder.setStatus(PayStatusEnum.CLOSE.getCode())
|
||||
// TODO 尝试是否可以使用网关返回的
|
||||
.setCloseTime(LocalDateTime.now());
|
||||
payOrderService.updateById(payOrder);
|
||||
}
|
||||
|
||||
|
@@ -68,6 +68,10 @@ public class PayOrderDto extends BaseDto {
|
||||
@Schema(description = "支付时间")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/** 关闭时间 */
|
||||
@Schema(description = "关闭时间")
|
||||
private LocalDateTime closeTime;
|
||||
|
||||
/** 过期时间 */
|
||||
@Schema(description = "过期时间")
|
||||
private LocalDateTime expiredTime;
|
||||
|
Reference in New Issue
Block a user