Browse Source

微信订单表

master
wxd 12 months ago
parent
commit
44877f066e
  1. 2
      src/Shentun.WebPeis.DbMigrator/appsettings.json
  2. 87
      src/Shentun.WebPeis.Domain/Models/WeChatOrder.cs
  3. 98
      src/Shentun.WebPeis.Domain/Models/WeChatOrderRefund.cs
  4. 30
      src/Shentun.WebPeis.EntityFrameworkCore/Configures/WeChatOrderConfigure.cs
  5. 30
      src/Shentun.WebPeis.EntityFrameworkCore/Configures/WeChatOrderRefundConfigure.cs
  6. 4
      src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs
  7. 8090
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.Designer.cs
  8. 89
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.cs
  9. 174
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs

2
src/Shentun.WebPeis.DbMigrator/appsettings.json

@ -1,7 +1,7 @@
{ {
"AdminId": "3a12a8a6-beb9-fc29-b4e7-4acfb00d8370", "AdminId": "3a12a8a6-beb9-fc29-b4e7-4acfb00d8370",
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Host=62.156.10.86;Port=5432;Database=WebPeis0520;User ID=postgres;Password=st123"
"Default": "Host=140.143.162.39;Port=5432;Database=WebPeis;User ID=postgres;Password=shentun123"
}, },
"Redis": { "Redis": {
"Configuration": "127.0.0.1" "Configuration": "127.0.0.1"

87
src/Shentun.WebPeis.Domain/Models/WeChatOrder.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];
}
}
}

98
src/Shentun.WebPeis.Domain/Models/WeChatOrderRefund.cs

@ -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];
}
}
}

30
src/Shentun.WebPeis.EntityFrameworkCore/Configures/WeChatOrderConfigure.cs

@ -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("交易状态");
}
}
}

30
src/Shentun.WebPeis.EntityFrameworkCore/Configures/WeChatOrderRefundConfigure.cs

@ -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("交易状态");
}
}
}

4
src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs

@ -242,6 +242,10 @@ public partial class WebPeisDbContext : AbpDbContext<WebPeisDbContext>,
public virtual DbSet<PrimarykeyBuilder> PrimarykeyBuilders { get; set; } public virtual DbSet<PrimarykeyBuilder> PrimarykeyBuilders { get; set; }
public virtual DbSet<ThirdInterface> ThirdInterfaces { get; set; } public virtual DbSet<ThirdInterface> ThirdInterfaces { get; set; }
public virtual DbSet<WeChatOrder> WeChatOrders { get; set; }
public virtual DbSet<WeChatOrderRefund> WeChatOrderRefunds { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
base.OnConfiguring(optionsBuilder); base.OnConfiguring(optionsBuilder);

8090
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.Designer.cs
File diff suppressed because it is too large
View File

89
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241115093850_add_wechat_order.cs

@ -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");
}
}
}

174
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs

@ -5070,6 +5070,180 @@ namespace Shentun.WebPeis.Migrations
}); });
}); });
modelBuilder.Entity("Shentun.WebPeis.Models.WeChatOrder", b =>
{
b.Property<Guid>("WeChatOrderId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("we_chat_order_id");
b.Property<string>("Appid")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasColumnName("appid")
.HasComment("appid");
b.Property<Guid>("AppointPatientRegisterId")
.HasColumnType("uuid")
.HasColumnName("appoint_patient_register_id")
.HasComment("预约id");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnType("text")
.HasColumnName("concurrency_stamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("creation_time");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("creator_id");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("last_modification_time");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<string>("Mchid")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasColumnName("mchid")
.HasComment("商户号");
b.Property<string>("Openid")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("openid")
.HasComment("Openid");
b.Property<int>("OrderMoney")
.HasColumnType("integer")
.HasColumnName("order_money")
.HasComment("订单金额");
b.Property<string>("OutTradeNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("out_trade_no")
.HasComment("订单号");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasColumnName("status")
.HasComment("交易状态");
b.Property<string>("TransactionId")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("transaction_id")
.HasComment("微信系统生成的订单号");
b.HasKey("WeChatOrderId")
.HasName("pk_wechat_order");
b.HasIndex(new[] { "OutTradeNo" }, "ix_wechat_order_out_trade_no")
.IsUnique();
b.ToTable("wechat_order", (string)null);
});
modelBuilder.Entity("Shentun.WebPeis.Models.WeChatOrderRefund", b =>
{
b.Property<Guid>("WeChatOrderRefundId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("we_chat_order_refund_id");
b.Property<string>("Channel")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("channel")
.HasComment("退款渠道");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnType("text")
.HasColumnName("concurrency_stamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("creation_time");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("creator_id");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("last_modification_time");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.Property<string>("OutRefundNo")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("out_refund_no")
.HasComment("退款申请单号");
b.Property<string>("RefundId")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("refund_id")
.HasComment("微信系统生成的退款号");
b.Property<int>("RefundrMoney")
.HasColumnType("integer")
.HasColumnName("refundr_money")
.HasComment("退款金额(分)");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("status")
.HasComment("交易状态");
b.Property<DateTime?>("SuccessTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("success_time")
.HasComment("完成时间");
b.Property<string>("UserReceivedAccount")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasColumnName("user_received_account")
.HasComment("退款入账账户");
b.Property<Guid>("WeChatOrderId")
.HasColumnType("uuid")
.HasColumnName("we_chat_order_id")
.HasComment("微信订单表Id");
b.HasKey("WeChatOrderRefundId")
.HasName("pk_wechat_order_refund");
b.HasIndex(new[] { "OutRefundNo" }, "ix_wechat_order_refund_out_refund_no")
.IsUnique();
b.ToTable("wechat_order_refund", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")

Loading…
Cancel
Save