diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java index 45462a5bee..b5bcddcce1 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java @@ -101,7 +101,8 @@ default ProductSkuUpdateStockReqDTO convertNegative(List list) default PayOrderCreateReqDTO convert(TradeOrderDO order, List orderItems, TradeOrderProperties orderProperties) { PayOrderCreateReqDTO createReqDTO = new PayOrderCreateReqDTO() - .setAppKey(orderProperties.getPayAppKey()).setUserIp(order.getUserIp()); + .setAppKey(orderProperties.getPayAppKey()).setUserIp(order.getUserIp()) + .setUserId(order.getUserId()); // 商户相关字段 createReqDTO.setMerchantOrderId(String.valueOf(order.getId())); String subject = orderItems.get(0).getSpuName(); diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java index 3a7b181be3..38de4df8aa 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java @@ -28,6 +28,10 @@ public class PayOrderCreateReqDTO implements Serializable { @NotEmpty(message = "用户 IP 不能为空") private String userIp; + + @NotNull(message = "用户编号不能为空") + private Long userId; + // ========== 商户相关字段 ========== /** diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java index 8cb5b80fec..deee1beed2 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java @@ -1,9 +1,10 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; + import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; -import jakarta.validation.constraints.NotNull; import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -21,6 +22,10 @@ public class PayOrderBaseVO { @NotNull(message = "应用编号不能为空") private Long appId; + @Schema(description = "用户编号", example = "1024") + @NotNull(message = "用户编号不能为空") + private Long userId; + @Schema(description = "渠道编号", example = "2048") private Long channelId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java index 9e4d20b918..966195084c 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java @@ -15,6 +15,9 @@ public class PayOrderExportReqVO { @Schema(description = "应用编号", example = "1024") private Long appId; + @Schema(description = "用户编号", example = "1024") + private Long userId; + @Schema(description = "渠道编码", example = "wx_app") private String channelCode; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java index f7ff801cb3..1c2e5d378e 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java @@ -20,6 +20,9 @@ public class PayOrderPageReqVO extends PageParam { @Schema(description = "应用编号", example = "1024") private Long appId; + @Schema(description = "用户编号", example = "1024") + private Long userId; + @Schema(description = "渠道编码", example = "wx_app") private String channelCode; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java index a51b875fd1..a68cc3ab7f 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java @@ -32,19 +32,19 @@ public class PayOrderDO extends BaseDO { private Long id; /** * 应用编号 - * + *

* 关联 {@link PayAppDO#getId()} */ private Long appId; /** * 渠道编号 - * + *

* 关联 {@link PayChannelDO#getId()} */ private Long channelId; /** * 渠道编码 - * + *

* 枚举 {@link PayChannelEnum} */ private String channelCode; @@ -53,7 +53,7 @@ public class PayOrderDO extends BaseDO { /** * 商户订单编号 - * + *

* 例如说,内部系统 A 的订单号,需要保证每个 PayAppDO 唯一 */ private String merchantOrderId; @@ -78,7 +78,7 @@ public class PayOrderDO extends BaseDO { private Integer price; /** * 渠道手续费,单位:百分比 - * + *

* 冗余 {@link PayChannelDO#getFeeRate()} */ private Double channelFeeRate; @@ -88,7 +88,7 @@ public class PayOrderDO extends BaseDO { private Integer channelFeePrice; /** * 支付状态 - * + *

* 枚举 {@link PayOrderStatusEnum} */ private Integer status; @@ -96,6 +96,10 @@ public class PayOrderDO extends BaseDO { * 用户 IP */ private String userIp; + /** + * 用户编号 + */ + private Long userId; /** * 订单失效时间 */ @@ -106,13 +110,13 @@ public class PayOrderDO extends BaseDO { private LocalDateTime successTime; /** * 支付成功的订单拓展单编号 - * + *

* 关联 {@link PayOrderExtensionDO#getId()} */ private Long extensionId; /** * 支付成功的外部订单号 - * + *

* 关联 {@link PayOrderExtensionDO#getNo()} */ private String no; @@ -126,7 +130,7 @@ public class PayOrderDO extends BaseDO { // ========== 渠道相关字段 ========== /** * 渠道用户编号 - * + *

* 例如说,微信 openid、支付宝账号 */ private String channelUserId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java index 95510d5f7e..c1d0f67c74 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java @@ -18,6 +18,7 @@ public interface PayOrderMapper extends BaseMapperX { default PageResult selectPage(PayOrderPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(PayOrderDO::getAppId, reqVO.getAppId()) + .eqIfPresent(PayOrderDO::getUserId, reqVO.getUserId()) .eqIfPresent(PayOrderDO::getChannelCode, reqVO.getChannelCode()) .likeIfPresent(PayOrderDO::getMerchantOrderId, reqVO.getMerchantOrderId()) .likeIfPresent(PayOrderDO::getChannelOrderNo, reqVO.getChannelOrderNo()) @@ -30,6 +31,7 @@ default PageResult selectPage(PayOrderPageReqVO reqVO) { default List selectList(PayOrderExportReqVO reqVO) { return selectList(new LambdaQueryWrapperX() .eqIfPresent(PayOrderDO::getAppId, reqVO.getAppId()) + .eqIfPresent(PayOrderDO::getUserId, reqVO.getUserId()) .eqIfPresent(PayOrderDO::getChannelCode, reqVO.getChannelCode()) .likeIfPresent(PayOrderDO::getMerchantOrderId, reqVO.getMerchantOrderId()) .likeIfPresent(PayOrderDO::getChannelOrderNo, reqVO.getChannelOrderNo()) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java index fce8a79847..02d105b342 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java @@ -90,6 +90,7 @@ public Long createDemoOrder(Long userId, PayDemoOrderCreateReqVO createReqVO) { // 2.1 创建支付单 Long payOrderId = payOrderApi.createOrder(new PayOrderCreateReqDTO() .setAppKey(PAY_APP_KEY).setUserIp(getClientIP()) // 支付应用 + .setUserId(userId) .setMerchantOrderId(demoOrder.getId().toString()) // 业务的订单编号 .setSubject(spuName).setBody("").setPrice(price) // 价格信息 .setExpireTime(addTime(Duration.ofHours(2L)))); // 支付的过期时间 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java index b332731faf..ae851e138e 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletRechargeServiceImpl.java @@ -94,6 +94,7 @@ public PayWalletRechargeDO createWalletRecharge(Long userId, Integer userType, S // 2.1 创建支付单 Long payOrderId = payOrderService.createOrder(new PayOrderCreateReqDTO() .setAppKey(payProperties.getWalletPayAppKey()).setUserIp(userIp) + .setUserId(userId) .setMerchantOrderId(recharge.getId().toString()) // 业务的订单编号 .setSubject(WALLET_RECHARGE_ORDER_SUBJECT).setBody("") .setPrice(recharge.getPayPrice()) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql index 3f9f764179..2a83df5687 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql @@ -1,10 +1,11 @@ -CREATE TABLE IF NOT EXISTS "pay_app" ( +CREATE TABLE IF NOT EXISTS "pay_app" +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, "app_key" varchar(64) NOT NULL, "name" varchar(64) NOT NULL, "status" tinyint NOT NULL, "remark" varchar(255) DEFAULT NULL, - `order_notify_url` varchar(1024) NOT NULL, + `order_notify_url` varchar(1024) NOT NULL, `refund_notify_url` varchar(1024) NOT NULL, "creator" varchar(64) DEFAULT '', "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -14,7 +15,8 @@ CREATE TABLE IF NOT EXISTS "pay_app" ( PRIMARY KEY ("id") ) COMMENT = '支付应用'; -CREATE TABLE IF NOT EXISTS "pay_channel" ( +CREATE TABLE IF NOT EXISTS "pay_channel" +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, "code" varchar(32) NOT NULL, "status" tinyint(4) NOT NULL, @@ -27,121 +29,127 @@ CREATE TABLE IF NOT EXISTS "pay_channel" ( "updater" varchar(64) NULL DEFAULT '', "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "deleted" bit(1) NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', + "tenant_id" bigint not null default '0', PRIMARY KEY ("id") ) COMMENT = '支付渠道'; -CREATE TABLE IF NOT EXISTS `pay_order` ( +CREATE TABLE IF NOT EXISTS `pay_order` +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `app_id` bigint(20) NOT NULL, - `channel_id` bigint(20) DEFAULT NULL, - `channel_code` varchar(32) DEFAULT NULL, - `merchant_order_id` varchar(64) NOT NULL, - `subject` varchar(32) NOT NULL, - `body` varchar(128) NOT NULL, - `notify_url` varchar(1024) NOT NULL, - `price` bigint(20) NOT NULL, - `channel_fee_rate` double DEFAULT 0, - `channel_fee_price` bigint(20) DEFAULT 0, - `status` tinyint(4) NOT NULL, - `user_ip` varchar(50) NOT NULL, - `expire_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `success_time` datetime(0) DEFAULT CURRENT_TIMESTAMP, - `notify_time` datetime(0) DEFAULT CURRENT_TIMESTAMP, - `extension_id` bigint(20) DEFAULT NULL, - `no` varchar(64) NULL, - `refund_price` bigint(20) NOT NULL, - `channel_user_id` varchar(255) DEFAULT NULL, - `channel_order_no` varchar(64) DEFAULT NULL, - `creator` varchar(64) DEFAULT '', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) DEFAULT '', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT FALSE, + `app_id` bigint(20) NOT NULL, + `channel_id` bigint(20) DEFAULT NULL, + `channel_code` varchar(32) DEFAULT NULL, + `merchant_order_id` varchar(64) NOT NULL, + `subject` varchar(32) NOT NULL, + `body` varchar(128) NOT NULL, + `notify_url` varchar(1024) NOT NULL, + `price` bigint(20) NOT NULL, + `channel_fee_rate` double DEFAULT 0, + `channel_fee_price` bigint(20) DEFAULT 0, + `status` tinyint(4) NOT NULL, + `user_ip` varchar(50) NOT NULL, + `user_id` bigint(20) NOT NULL, + `expire_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `success_time` datetime(0) DEFAULT CURRENT_TIMESTAMP, + `notify_time` datetime(0) DEFAULT CURRENT_TIMESTAMP, + `extension_id` bigint(20) DEFAULT NULL, + `no` varchar(64) NULL, + `refund_price` bigint(20) NOT NULL, + `channel_user_id` varchar(255) DEFAULT NULL, + `channel_order_no` varchar(64) DEFAULT NULL, + `creator` varchar(64) DEFAULT '', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) DEFAULT '', + `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT = '支付订单'; -CREATE TABLE IF NOT EXISTS `pay_order_extension` ( +CREATE TABLE IF NOT EXISTS `pay_order_extension` +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `no` varchar(64) NOT NULL, - `order_id` bigint(20) NOT NULL, - `channel_id` bigint(20) NOT NULL, - `channel_code` varchar(32) NOT NULL, - `user_ip` varchar(50) NULL DEFAULT NULL, - `status` tinyint(4) NOT NULL, - `channel_extras` varchar(1024) NULL DEFAULT NULL, - `channel_error_code` varchar(64) NULL, - `channel_error_msg` varchar(64) NULL, - `channel_notify_data` varchar(1024) NULL, - `creator` varchar(64) NULL DEFAULT '', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) NULL DEFAULT '', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT FALSE, + `no` varchar(64) NOT NULL, + `order_id` bigint(20) NOT NULL, + `channel_id` bigint(20) NOT NULL, + `channel_code` varchar(32) NOT NULL, + `user_ip` varchar(50) NULL DEFAULT NULL, + `status` tinyint(4) NOT NULL, + `channel_extras` varchar(1024) NULL DEFAULT NULL, + `channel_error_code` varchar(64) NULL, + `channel_error_msg` varchar(64) NULL, + `channel_notify_data` varchar(1024) NULL, + `creator` varchar(64) NULL DEFAULT '', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) NULL DEFAULT '', + `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT = '支付订单拓展'; -CREATE TABLE IF NOT EXISTS `pay_refund` ( +CREATE TABLE IF NOT EXISTS `pay_refund` +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `no` varchar(64) NOT NULL, - `app_id` bigint(20) NOT NULL, - `channel_id` bigint(20) NOT NULL, - `channel_code` varchar(32) NOT NULL, - `order_id` bigint(20) NOT NULL, - `order_no` varchar(64) NOT NULL, - `merchant_order_id` varchar(64) NOT NULL, - `merchant_refund_id` varchar(64) NOT NULL, - `notify_url` varchar(1024) NOT NULL, - `status` tinyint(4) NOT NULL, - `pay_price` bigint(20) NOT NULL, - `refund_price` bigint(20) NOT NULL, - `reason` varchar(256) NOT NULL, - `user_ip` varchar(50) NULL DEFAULT NULL, - `channel_order_no` varchar(64) NOT NULL, - `channel_refund_no` varchar(64) NULL DEFAULT NULL, - `success_time` datetime(0) NULL DEFAULT NULL, - `channel_error_code` varchar(128) NULL DEFAULT NULL, - `channel_error_msg` varchar(256) NULL DEFAULT NULL, - `channel_notify_data` varchar(1024) NULL, - `creator` varchar(64) NULL DEFAULT '', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) NULL DEFAULT '', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT FALSE, + `no` varchar(64) NOT NULL, + `app_id` bigint(20) NOT NULL, + `channel_id` bigint(20) NOT NULL, + `channel_code` varchar(32) NOT NULL, + `order_id` bigint(20) NOT NULL, + `order_no` varchar(64) NOT NULL, + `merchant_order_id` varchar(64) NOT NULL, + `merchant_refund_id` varchar(64) NOT NULL, + `notify_url` varchar(1024) NOT NULL, + `status` tinyint(4) NOT NULL, + `pay_price` bigint(20) NOT NULL, + `refund_price` bigint(20) NOT NULL, + `reason` varchar(256) NOT NULL, + `user_ip` varchar(50) NULL DEFAULT NULL, + `channel_order_no` varchar(64) NOT NULL, + `channel_refund_no` varchar(64) NULL DEFAULT NULL, + `success_time` datetime(0) NULL DEFAULT NULL, + `channel_error_code` varchar(128) NULL DEFAULT NULL, + `channel_error_msg` varchar(256) NULL DEFAULT NULL, + `channel_notify_data` varchar(1024) NULL, + `creator` varchar(64) NULL DEFAULT '', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) NULL DEFAULT '', + `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT = '退款订单'; -CREATE TABLE IF NOT EXISTS `pay_notify_task` ( +CREATE TABLE IF NOT EXISTS `pay_notify_task` +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `app_id` bigint(20) NOT NULL, - `type` tinyint(4) NOT NULL, + `app_id` bigint(20) NOT NULL, + `type` tinyint(4) NOT NULL, `data_id` bigint(20) NOT NULL, - `merchant_order_id` varchar(64) NOT NULL, - `status` tinyint(4) NOT NULL, - `next_notify_time` datetime(0) NULL DEFAULT NULL, - `last_execute_time` datetime(0) NULL DEFAULT NULL, - `notify_times` int NOT NULL, - `max_notify_times` int NOT NULL, - `notify_url` varchar(1024) NOT NULL, - `creator` varchar(64) NULL DEFAULT '', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) NULL DEFAULT '', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT FALSE, - `tenant_id` bigint(20) NOT NULL DEFAULT 0, + `merchant_order_id` varchar(64) NOT NULL, + `status` tinyint(4) NOT NULL, + `next_notify_time` datetime(0) NULL DEFAULT NULL, + `last_execute_time` datetime(0) NULL DEFAULT NULL, + `notify_times` int NOT NULL, + `max_notify_times` int NOT NULL, + `notify_url` varchar(1024) NOT NULL, + `creator` varchar(64) NULL DEFAULT '', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) NULL DEFAULT '', + `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT FALSE, + `tenant_id` bigint(20) NOT NULL DEFAULT 0, PRIMARY KEY ("id") ) COMMENT = '支付通知任务'; -CREATE TABLE IF NOT EXISTS `pay_notify_log` ( +CREATE TABLE IF NOT EXISTS `pay_notify_log` +( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `task_id` bigint(20) NOT NULL, - `notify_times` int NOT NULL, - `response` varchar(1024) NOT NULL, - `status` tinyint(4) NOT NULL, - `creator` varchar(64) NULL DEFAULT '', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updater` varchar(64) NULL DEFAULT '', - `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `deleted` bit(1) NOT NULL DEFAULT FALSE, + `task_id` bigint(20) NOT NULL, + `notify_times` int NOT NULL, + `response` varchar(1024) NOT NULL, + `status` tinyint(4) NOT NULL, + `creator` varchar(64) NULL DEFAULT '', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updater` varchar(64) NULL DEFAULT '', + `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `deleted` bit(1) NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") ) COMMENT = '支付通知日志';