You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

353 lines
10 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using NPoco;
using POSV.Entity;
using POSV.Utils;
namespace POSV.ShoppingCart
{
/// <summary>
/// 订单支付明细
/// </summary>
[Serializable]
[JsonObject(MemberSerialization.OptIn)]
[TableName("pos_order_pay")]
[PrimaryKey(new string[] { "id" } , AutoIncrement = false)]
public class PayItem : BaseEntity
{
public PayItem()
{
}
/// <summary>
/// 租户ID
/// </summary>
[JsonProperty(PropertyName = "tenantId")]
[Column("tenantId")]
public string TenantId { get; set; }
/// <summary>
/// 随机单号
/// </summary>
[JsonProperty(PropertyName = "orderId")]
[Column("orderId")]
public string OrderId { get; set;}
/// <summary>
/// 序号
/// </summary>
[JsonProperty(PropertyName = "order")]
[Column("order")]
public int Order { get; set; }
/// <summary>
/// 单据编号
/// </summary>
[JsonProperty(PropertyName = "tradeNo")]
[Column("tradeNo")]
public string TradeNo { get; set; }
/// <summary>
/// 单据编号
/// </summary>
[JsonProperty(PropertyName = "outTradeNo")]
[Column("outTradeNo")]
public string OutTradeNo { get; set; }
/// <summary>
/// 支付单编号
/// </summary>
[JsonProperty(PropertyName = "payNo")]
[Column("payNo")]
public string PayNo { get; set; }
/// <summary>
/// 原单号,退款单使用
/// </summary>
[JsonProperty(PropertyName = "orgPayId")]
[Ignore]
public string OrgPayId { get; set; } = string.Empty;
/// <summary>
/// 班次编号
/// </summary>
[JsonProperty(PropertyName = "shiftNo")]
[Column("shiftNo")]
public string ShiftNo { get; set; }
/// <summary>
/// 班次名称
/// </summary>
[JsonProperty(PropertyName = "shiftName")]
[Column("shiftName")]
public string ShiftName { get; set; }
/// <summary>
/// 交易参考号(凭证号)
/// </summary>
[JsonProperty(PropertyName = "voucherNo")]
[Column("tradeVoucherNo")]
public string TradeVoucherNo { get; set; }
/// <summary>
/// 会员卡预支付编码
/// </summary>
[JsonProperty(PropertyName = "prePayNo")]
[Column("prePayNo")]
public string PrePayNo { get; set; }
/// <summary>
/// 付款方式名称
/// </summary>
[JsonProperty(PropertyName = "payType")]
[Column("name")]
public string Name { get; set; }
/// <summary>
/// 付款方式编号
/// </summary>
[JsonProperty(PropertyName = "payTypeNo")]
[Column("no")]
public string No { get; set; }
/// <summary>
/// 支付渠道 区分各种聚合支付、原生支付
/// </summary>
[JsonProperty(PropertyName = "payChannel")]
[Column("payChannel")]
public PayChannelEnum PayChannel { get; set; } = PayChannelEnum.;
/// <summary>
/// 是否参与积分(0否1是)
/// </summary>
[JsonProperty(PropertyName = "pointFlag")]
[Column("pointFlag")]
public int PointFlag { get; set; }
/// <summary>
/// 已收金额 = 实收 - 找零
/// </summary>
[JsonProperty(PropertyName = "money")]
[Column("amount")]
public decimal Amount { get; set; }
/// <summary>
/// 实收金额
/// </summary>
[JsonProperty(PropertyName = "paid")]
[Column("paidAmount")]
public decimal PaidAmount { get; set; }
/// <summary>
/// 退款金额
/// </summary>
[JsonProperty(PropertyName = "ramount")]
[Column("ramount")]
public decimal RefundAmount { get; set; }
/// <summary>
/// 溢出金额
/// </summary>
[JsonProperty(PropertyName = "overAmount")]
[Column("overAmount")]
public decimal OverAmount { get; set; }
/// <summary>
/// 找零金额
/// </summary>
[JsonProperty(PropertyName = "rchange")]
[Column("changeAmount")]
public decimal ChangeAmount { get; set; }
/// <summary>
/// 付款卡号
/// </summary>
[JsonProperty(PropertyName = "cardno")]
[Column("cardNo")]
public string CardNo { get; set; }
/// <summary>
/// 卡面号
/// </summary>
[JsonProperty(PropertyName = "cardFaceNo")]
[Column("cardFaceNo")]
public string CardFaceNo { get; set; }
/// <summary>
/// 手机号
/// </summary>
[JsonProperty(PropertyName = "memberMobileNo")]
[Column("memberMobileNo")]
public string MemberMobileNo { get; set; }
/// <summary>
/// 卡支付前余额
/// </summary>
[JsonProperty(PropertyName = "cardYe")]
[Column("balance")]
public decimal CardBeforeBalance { get; set; }
/// <summary>
/// 刷卡后金额
/// </summary>
[JsonProperty(PropertyName = "cardAftAmount")]
[Column("cardAftAmount")]
public decimal CardAftAmount { get; set; }
/// <summary>
/// 卡支付前积分
/// </summary>
[JsonProperty(PropertyName = "cardJf")]
[Column("point")]
public decimal CardBeforePoint { get; set; }
/// <summary>
/// 用户是否确认输入密码
/// </summary>
[JsonProperty(PropertyName = "useConfirmed")]
[Column("useConfirmed")]
public bool UseConfirmed { get; set; }
/// <summary>
/// 会员卡密码加密
/// </summary>
[JsonIgnore]
[Ignore]
public string Passwd { get; set; }
/// <summary>
/// 备注说明
/// </summary>
[JsonProperty(PropertyName = "memo")]
[Column("memo")]
public string Memo { get; set; }
/// <summary>
/// 支付状态
/// </summary>
[JsonProperty(PropertyName = "status")]
[Column("status")]
public int Status { get; set; }
/// <summary>
/// 是否订阅微信公众号
/// </summary>
public string Subscribe { get; set; }
/// <summary>
/// 支付状态描述
/// </summary>
[JsonProperty(PropertyName = "statusDesc")]
[Column("statusDesc")]
public string StatusDesc { get; set; }
/// <summary>
/// 支付时间(格式:yyyy-MM-dd HH:mm:ss)
/// </summary>
[JsonProperty(PropertyName = "payTime")]
[Column("payTime")]
public string PayTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
/// <summary>
/// 订单完成时间(格式:yyyy-MM-dd HH:mm:ss)
/// </summary>
[JsonProperty(PropertyName = "finishDate")]
[Column("finishDate")]
public string FinishDate { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
/// <summary>
/// 是否实收(0-否;1-是;)
/// </summary>
[JsonProperty(PropertyName = "incomeFlag")]
[Column("incomeFlag")]
public int IncomeFlag { get; set; }
/// <summary>
/// 第三方扣费类型
/// </summary>
[JsonProperty(PropertyName = "otherRateType")]
[Column("otherRateType")]
public int OtherRateType { get; set; }
/// <summary>
/// 第三方扣费值
/// </summary>
[JsonProperty(PropertyName = "otherRateValue")]
[Column("otherRateValue")]
public decimal OtherRateValue { get; set; }
private decimal _otherRate = 0;
/// <summary>
/// 第三方扣费
/// </summary>
[JsonProperty(PropertyName = "otherRate")]
[Column("otherRate")]
public decimal OtherRate
{
get
{
//金额合计不包含套餐明细
if (this.OtherRateType == 0)
{
this._otherRate = 0;
}
else if (this.OtherRateType == 1)
{
this._otherRate = this.OtherRateValue;
}
else if (this.OtherRateType == 2)
{
//add by yangaming 除100
this._otherRate = this.Amount* this.OtherRateValue / 100M;
}
else {
this._otherRate = 0;
}
return OrderUtils.ToRound(this._otherRate);
}
set
{
this._otherRate = value;
}
}
/// <summary>
/// 扩展字段1- zhangy Add 2020-02-18启用支付方式扣率
/// </summary>
[JsonProperty(PropertyName = "ext1")]
[Column("ext1")]
public string Ext1 { get; set; }
/// <summary>
/// 扩展字段2- zhangy Add 2020-02-18启用支付方式扣率计算的扣款
/// </summary>
[JsonProperty(PropertyName = "ext2")]
[Column("ext2")]
public string Ext2 { get; set; }
/// <summary>
/// 扩展字段3
/// </summary>
[JsonProperty(PropertyName = "ext3")]
[Column("ext3")]
public string Ext3 { get; set; }
public override string ToString()
{
return string.Format("[{0},{1}]",this.Name,string.IsNullOrEmpty(this.CardNo) ? "" : this.CardNo);
}
#region subin 20230916 新增,用于本地小程序订单退款。
/// <summary>
/// 小程序付款的PayuserId
/// </summary>
public string OpenId { get; set; }
#endregion
}
}