9 changed files with 8603 additions and 1 deletions
-
2src/Shentun.WebPeis.DbMigrator/appsettings.json
-
87src/Shentun.WebPeis.Domain/Models/WeChatOrder.cs
-
98src/Shentun.WebPeis.Domain/Models/WeChatOrderRefund.cs
-
30src/Shentun.WebPeis.EntityFrameworkCore/Configures/WeChatOrderConfigure.cs
-
30src/Shentun.WebPeis.EntityFrameworkCore/Configures/WeChatOrderRefundConfigure.cs
-
4src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs
-
8090src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.Designer.cs
-
89src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.cs
-
174src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs
@ -0,0 +1,87 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
namespace Shentun.WebPeis.Models |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 微信订单表
|
||||
|
/// </summary>
|
||||
|
public partial class WeChatOrder : AuditedEntity, IHasConcurrencyStamp |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
public Guid WeChatOrderId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 预约id
|
||||
|
/// </summary>
|
||||
|
public Guid AppointPatientRegisterId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// openid
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string Openid { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单号
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string OutTradeNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 商户号
|
||||
|
/// </summary>
|
||||
|
[StringLength(20)] |
||||
|
public string Mchid { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// appid
|
||||
|
/// </summary>
|
||||
|
[StringLength(20)] |
||||
|
public string Appid { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单金额
|
||||
|
/// </summary>
|
||||
|
public int OrderMoney { get; set; } |
||||
|
|
||||
|
//
|
||||
|
/// <summary>
|
||||
|
/// 微信系统生成的订单号
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string TransactionId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// 交易状态,枚举值:
|
||||
|
/// SUCCESS:支付成功
|
||||
|
/// REFUND:转入退款
|
||||
|
/// NOTPAY:未支付
|
||||
|
/// CLOSED:已关闭
|
||||
|
/// REVOKED:已撤销(付款码支付)
|
||||
|
/// USERPAYING:用户支付中(付款码支付)
|
||||
|
/// PAYERROR:支付失败(其他原因,如银行返回失败)
|
||||
|
/// </summary>
|
||||
|
[StringLength(20)] |
||||
|
public string Status { get; set; } |
||||
|
|
||||
|
public string ConcurrencyStamp { get; set; } |
||||
|
|
||||
|
|
||||
|
public override object?[] GetKeys() |
||||
|
{ |
||||
|
return [WeChatOrderId]; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,98 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
|
||||
|
namespace Shentun.WebPeis.Models |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 微信订单表
|
||||
|
/// </summary>
|
||||
|
public partial class WeChatOrderRefund : AuditedEntity, IHasConcurrencyStamp |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 主键
|
||||
|
/// </summary>
|
||||
|
public Guid WeChatOrderRefundId { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 微信订单表Id
|
||||
|
/// </summary>
|
||||
|
public Guid WeChatOrderId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 退款申请单号
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string OutRefundNo { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 退款金额
|
||||
|
/// </summary>
|
||||
|
public int RefundrMoney { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 微信系统生成的退款号
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string RefundId { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 退款渠道
|
||||
|
/// ORIGINAL: 原路退款
|
||||
|
/// BALANCE: 退回到余额
|
||||
|
/// OTHER_BALANCE: 原账户异常退到其他余额账户
|
||||
|
/// OTHER_BANKCARD: 原银行卡异常退到其他银行卡
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string Channel { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 退款入账账户 取当前退款单的退款入账方,有以下几种情况:
|
||||
|
/// 1)退回银行卡:{银行名称}{卡类型}{卡尾号}
|
||||
|
/// 2)退回支付用户零钱:支付用户零钱
|
||||
|
/// 3)退还商户:商户基本账户商户结算银行账户
|
||||
|
/// 4)退回支付用户零钱通:支付用户零钱通
|
||||
|
/// 5)退回支付用户银行电子账户:支付用户银行电子账户
|
||||
|
/// 6)退回支付用户零花钱:支付用户零花钱
|
||||
|
/// 7)退回用户经营账户:用户经营账户
|
||||
|
/// 8)退回支付用户来华零钱包:支付用户来华零钱包
|
||||
|
/// 9)退回企业支付商户:企业支付商户
|
||||
|
/// </summary>
|
||||
|
[StringLength(100)] |
||||
|
public string UserReceivedAccount { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 退款状态
|
||||
|
/// SUCCESS: 退款成功
|
||||
|
/// CLOSED: 退款关闭
|
||||
|
/// PROCESSING: 退款处理中
|
||||
|
/// ABNORMAL: 退款异常
|
||||
|
/// </summary>
|
||||
|
[StringLength(50)] |
||||
|
public string Status { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 完成时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? SuccessTime { get; set; } |
||||
|
|
||||
|
public string ConcurrencyStamp { get; set; } |
||||
|
|
||||
|
public override object?[] GetKeys() |
||||
|
{ |
||||
|
return [WeChatOrderRefundId]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Shentun.WebPeis.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Shentun.WebPeis.Configures |
||||
|
{ |
||||
|
internal class WeChatOrderConfigure : IEntityTypeConfiguration<WeChatOrder> |
||||
|
{ |
||||
|
public void Configure(EntityTypeBuilder<WeChatOrder> entity) |
||||
|
{ |
||||
|
entity.ToTable("wechat_order"); |
||||
|
|
||||
|
entity.HasIndex(e => e.OutTradeNo, "ix_wechat_order_out_trade_no").IsUnique(); |
||||
|
|
||||
|
entity.Property(e => e.AppointPatientRegisterId).HasComment("预约id"); |
||||
|
entity.Property(e => e.Openid).HasComment("Openid"); |
||||
|
entity.Property(e => e.OutTradeNo).HasComment("订单号"); |
||||
|
entity.Property(e => e.Mchid).HasComment("商户号"); |
||||
|
entity.Property(e => e.Appid).HasComment("appid"); |
||||
|
entity.Property(e => e.OrderMoney).HasComment("订单金额"); |
||||
|
entity.Property(e => e.TransactionId).HasComment("微信系统生成的订单号").IsRequired(false); |
||||
|
entity.Property(e => e.Status).HasComment("交易状态"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Shentun.WebPeis.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Shentun.WebPeis.Configures |
||||
|
{ |
||||
|
internal class WeChatOrderRefundConfigure : IEntityTypeConfiguration<WeChatOrderRefund> |
||||
|
{ |
||||
|
public void Configure(EntityTypeBuilder<WeChatOrderRefund> entity) |
||||
|
{ |
||||
|
entity.ToTable("wechat_order_refund"); |
||||
|
|
||||
|
entity.HasIndex(e => e.OutRefundNo, "ix_wechat_order_refund_out_refund_no").IsUnique(); |
||||
|
|
||||
|
entity.Property(e => e.WeChatOrderId).HasComment("微信订单表Id"); |
||||
|
entity.Property(e => e.OutRefundNo).HasComment("退款申请单号"); |
||||
|
entity.Property(e => e.RefundrMoney).HasComment("退款金额(分)"); |
||||
|
entity.Property(e => e.RefundId).HasComment("微信系统生成的退款号").IsRequired(false); |
||||
|
entity.Property(e => e.Channel).HasComment("退款渠道"); |
||||
|
entity.Property(e => e.UserReceivedAccount).HasComment("退款入账账户"); |
||||
|
entity.Property(e => e.SuccessTime).HasComment("完成时间").IsRequired(false); |
||||
|
entity.Property(e => e.Status).HasComment("交易状态"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
8090
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,89 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Shentun.WebPeis.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class add_wechat_order : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "wechat_order", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
we_chat_order_id = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
appoint_patient_register_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "预约id"), |
||||
|
openid = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "Openid"), |
||||
|
out_trade_no = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "订单号"), |
||||
|
mchid = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, comment: "商户号"), |
||||
|
appid = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, comment: "appid"), |
||||
|
order_money = table.Column<int>(type: "integer", nullable: false, comment: "订单金额"), |
||||
|
transaction_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true, comment: "微信系统生成的订单号"), |
||||
|
status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, comment: "交易状态"), |
||||
|
concurrency_stamp = table.Column<string>(type: "text", nullable: false), |
||||
|
creation_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
||||
|
creator_id = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
last_modification_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
||||
|
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("pk_wechat_order", x => x.we_chat_order_id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "wechat_order_refund", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
we_chat_order_refund_id = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
we_chat_order_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "微信订单表Id"), |
||||
|
out_refund_no = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "退款申请单号"), |
||||
|
refundr_money = table.Column<int>(type: "integer", nullable: false, comment: "退款金额(分)"), |
||||
|
refund_id = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true, comment: "微信系统生成的退款号"), |
||||
|
channel = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "退款渠道"), |
||||
|
user_received_account = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false, comment: "退款入账账户"), |
||||
|
status = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "交易状态"), |
||||
|
success_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "完成时间"), |
||||
|
concurrency_stamp = table.Column<string>(type: "text", nullable: false), |
||||
|
creation_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
||||
|
creator_id = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
last_modification_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
||||
|
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("pk_wechat_order_refund", x => x.we_chat_order_refund_id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "ix_wechat_order_out_trade_no", |
||||
|
table: "wechat_order", |
||||
|
column: "out_trade_no", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "ix_wechat_order_refund_out_refund_no", |
||||
|
table: "wechat_order_refund", |
||||
|
column: "out_refund_no", |
||||
|
unique: true); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "wechat_order"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "wechat_order_refund"); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue