697 lines
17 KiB
C#
697 lines
17 KiB
C#
using BaseOUDAL;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data;
|
|
using YLErp.Helpers;
|
|
|
|
namespace YLErp.Model
|
|
{
|
|
public class EntryExitGridSum
|
|
{
|
|
/// <summary>
|
|
/// 金额总数
|
|
/// </summary>
|
|
public double? MoneySum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 出入金额总数
|
|
/// </summary>
|
|
public double? MoneyInOutSum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 权利金金额总数
|
|
/// </summary>
|
|
public double? MoneyPriceSum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 平仓行权金额总数
|
|
/// </summary>
|
|
public double? MoneyUnwindExerSum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 票息总数
|
|
/// </summary>
|
|
public double? MoneyCouponSum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 互换总数
|
|
/// </summary>
|
|
public double? MoneySwapSum { get; set; }
|
|
|
|
/// <summary>
|
|
/// 其他金额总数
|
|
/// </summary>
|
|
public double? MoneyOtherSum { get; set; }
|
|
/// <summary>
|
|
/// 互换预付金总数
|
|
/// </summary>
|
|
public double? MoneySwapMarginSum { get; set; }
|
|
}
|
|
|
|
public class EntryExitReq : BaseSearchReq
|
|
{
|
|
[DisplayName("有效状态")]
|
|
public string ValidState { get; set; }
|
|
public string TradeAction { get; set; }
|
|
public string InTradeAction { get; set; }
|
|
public string OutTradeAction { get; set; }
|
|
|
|
/// <summary>
|
|
/// 方向类型
|
|
/// </summary>
|
|
public string DirectionTypes { get; set; }
|
|
|
|
public List<string> DirectionTypeList => DataConvert.SplitByComma(DirectionTypes).ToList();
|
|
|
|
public List<string> TradeActionList => DataConvert.SplitByComma(TradeAction).ToList();
|
|
|
|
public List<int> ClientIdsInt
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrWhiteSpace(ClientIds))
|
|
{
|
|
return new List<int>();
|
|
}
|
|
else
|
|
{
|
|
if (ClientIds.Substring(0, 1) == ",")
|
|
{
|
|
return new List<int>();
|
|
}
|
|
return ClientIds.Split(',').Select(c => Convert.ToInt32(c)).ToList();
|
|
}
|
|
}
|
|
}
|
|
|
|
public string ClientIds { get; set; }
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public int id { get; set; }
|
|
|
|
/// <summary>
|
|
/// 出入金方向
|
|
/// </summary>
|
|
public string Direction { get; set; }
|
|
|
|
public List<string> Directions
|
|
{
|
|
get
|
|
{
|
|
return (Direction ?? string.Empty).Split(',').ToList();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 交易ID
|
|
/// </summary>
|
|
public int Tradeid { get; set; }
|
|
|
|
/// <summary>
|
|
/// 交易编号
|
|
/// </summary>
|
|
public string TradeNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 出入金单号
|
|
/// </summary>
|
|
public string Number { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客户信息
|
|
/// </summary>
|
|
public int? ClientId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客户编号
|
|
/// </summary>
|
|
public string ClientNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客户名称
|
|
/// </summary>
|
|
public string ClientName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客户证件
|
|
/// </summary>
|
|
public int? ClientIdentityId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 证件编号
|
|
/// </summary>
|
|
public string ClientIdentityNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 出入金额
|
|
/// </summary>
|
|
public double? Money { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否排除掉资金为0的情况
|
|
/// </summary>
|
|
public bool IsMoneyNotEqualsZero { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// 出入金时间
|
|
/// </summary>
|
|
public DateTime? HappenDate { get; set; }
|
|
|
|
[NotMapped]
|
|
public DateTime HappenDateStart { get; set; }
|
|
|
|
[NotMapped]
|
|
public DateTime HappenDateEnd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 状态
|
|
/// </summary>
|
|
public string State { get; set; }
|
|
|
|
/// <summary>
|
|
/// 开户银行
|
|
/// </summary>
|
|
public int? OpenBankId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 银行卡号
|
|
/// </summary>
|
|
public string OpenBankCard { get; set; }
|
|
|
|
/// <summary>
|
|
/// 创建人_optid
|
|
/// </summary>
|
|
public int? OptId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 创建人_optname
|
|
/// </summary>
|
|
public string OptName { get; set; }
|
|
|
|
public string OptNames { get; set; }
|
|
|
|
public List<int> IdLists
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrWhiteSpace(OptNames))
|
|
{
|
|
return new List<int>();
|
|
}
|
|
return (OptNames + "").Split(',').Select(c => Convert.ToInt32(c)).ToList();
|
|
}
|
|
}
|
|
|
|
[NotMapped]
|
|
public DateTime OptDateStart { get; set; }
|
|
|
|
[NotMapped]
|
|
public DateTime OptDateEnd { get; set; }
|
|
|
|
public string SerialNumber { get; set; }
|
|
|
|
public string Ids { get; set; }
|
|
|
|
public List<int> IdList
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(Ids))
|
|
{
|
|
return new List<int>();
|
|
}
|
|
|
|
return (Ids + "").Split(',').Select(c => Convert.ToInt32(c)).ToList();
|
|
}
|
|
}
|
|
|
|
public string InOut { get; set; }
|
|
|
|
public int IsCompany { get; set; }
|
|
|
|
public int IsCompanyCash { get; set; }
|
|
|
|
public string ActionSource { get; set; }
|
|
|
|
public string Comments { get; set; }
|
|
/// <summary>
|
|
/// 客户名称列表
|
|
/// </summary>
|
|
public List<string> ClientNameList { get; set; }
|
|
/// <summary>
|
|
/// 客户代码列表
|
|
/// </summary>
|
|
public List<string> ClientNumberList { get; set; }
|
|
/// <summary>
|
|
/// 方向列表
|
|
/// </summary>
|
|
public List<string> DirectionList { get; set; }
|
|
/// <summary>
|
|
/// 类型列表
|
|
/// </summary>
|
|
public List<string> ActionList { get; set; }
|
|
/// <summary>
|
|
/// 金额范围开始
|
|
/// </summary>
|
|
public double? MoneyStart { get; set; }
|
|
/// <summary>
|
|
/// 金额范围结束
|
|
/// </summary>
|
|
public double? MoneyEnd { get; set; }
|
|
/// <summary>
|
|
/// 状态列表
|
|
/// </summary>
|
|
public List<string> StateList { get; set; }
|
|
/// <summary>
|
|
/// 相关订单号列表
|
|
/// </summary>
|
|
public List<string> TradeNumberList { get; set; }
|
|
/// <summary>
|
|
/// 是否查询子级标识
|
|
/// </summary>
|
|
public bool ParentFlag { get; set; }
|
|
|
|
public List<int> CurUserClientIds { get; set; }
|
|
|
|
public string Explain { get; set; }
|
|
}
|
|
|
|
public class ClientCashInCashOutExtend
|
|
{
|
|
[DisplayName("有效状态")]
|
|
public string ValidState { get; set; }
|
|
|
|
public string TradeValidState { get; set; }
|
|
public int? TradeId { get; set; }
|
|
|
|
[NotMapped]
|
|
public int? ParentTradeId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 交易编号
|
|
/// </summary>
|
|
[NotMapped]
|
|
public string TradeNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 交易类型
|
|
/// </summary>
|
|
[DisplayName("交易类型")]
|
|
public string TradeType { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的代码(多空组合互换子交易资金会希望看到这个字段)
|
|
/// </summary>
|
|
[NotMapped]
|
|
public string UnderlyingCode { get; set; }
|
|
|
|
[NotMapped]
|
|
public int? TradeCashId { get; set; }
|
|
|
|
[DisplayName("操作来源")]
|
|
public string Action { get; set; }
|
|
/// <summary>
|
|
/// 账户类型初保账户/追保账户
|
|
/// </summary>
|
|
[DisplayName("账户类型")]
|
|
public string cash_type { get; set; }
|
|
/// <summary>
|
|
/// 加密主键
|
|
/// </summary>
|
|
[NotMapped]
|
|
public string EncryptId
|
|
{
|
|
get
|
|
{
|
|
return DataProtectHelper.Encrypt(id);
|
|
}
|
|
}
|
|
|
|
[NotMapped]
|
|
public string EncryptTradeId
|
|
{
|
|
get
|
|
{
|
|
if (ParentTradeId > 0)
|
|
{
|
|
return DataProtectHelper.Encrypt(ParentTradeId.Value);
|
|
}
|
|
|
|
return TradeId.HasValue ? DataProtectHelper.Encrypt(TradeId.Value) : "";
|
|
}
|
|
}
|
|
|
|
[Key]
|
|
public int id
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 出入金方向
|
|
/// </summary>
|
|
[DisplayName("出入金方向")]
|
|
|
|
public string Direction
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 出入金单号
|
|
/// </summary>
|
|
[DisplayName("出入金单号")]
|
|
|
|
public string Number
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 客户信息
|
|
/// </summary>
|
|
[DisplayName("客户信息")]
|
|
|
|
public int? ClientId
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 客户编号
|
|
/// </summary>
|
|
[DisplayName("客户编号")]
|
|
|
|
public string ClientNumber
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 客户名称
|
|
/// </summary>
|
|
[DisplayName("客户名称")]
|
|
|
|
public string ClientName
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 客户证件
|
|
/// </summary>
|
|
[DisplayName("客户证件")]
|
|
|
|
public int? ClientIdentityId
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 证件编号
|
|
/// </summary>
|
|
[DisplayName("证件编号")]
|
|
|
|
public string ClientIdentityNumber
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 出入金额
|
|
/// </summary>
|
|
[DisplayName("出入金额")]
|
|
|
|
public double? Money
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 币种
|
|
/// </summary>
|
|
public string CurrencyCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 出入金时间
|
|
/// </summary>
|
|
[DisplayName("出入金时间")]
|
|
|
|
public DateTime? HappenDate
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
[NotMapped]
|
|
public string HappenDateString => HappenDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty;
|
|
|
|
/// <summary>
|
|
/// 方向类型
|
|
/// </summary>
|
|
[NotMapped]
|
|
public string DirectionType
|
|
{
|
|
get
|
|
{
|
|
if (Direction == "入金")
|
|
{
|
|
return "收入";
|
|
}
|
|
else if (Direction == "出金")
|
|
{
|
|
return "支出";
|
|
}
|
|
else if (Money < 0)
|
|
{
|
|
return "支出";
|
|
}
|
|
else
|
|
{
|
|
return "收入";
|
|
}
|
|
}
|
|
}
|
|
|
|
public double MoneyAbs
|
|
{
|
|
get { return Math.Abs(Money ?? 0); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 金额显示带正负号
|
|
/// </summary>
|
|
public double MoneyToShow => (Direction == "出金" ? -1 : 1) * (Money ?? 0);
|
|
|
|
/// <summary>
|
|
/// 出入金金额
|
|
/// </summary>
|
|
public double MoneyInOut => (Direction == "出金" ? -1 : (Direction == "入金" ? 1 : 0)) * (Money ?? 0);
|
|
|
|
/// <summary>
|
|
/// 出金
|
|
/// </summary>
|
|
public double MoneyIn => (Direction == "入金" ? 1 : 0) * (Money ?? 0);
|
|
|
|
/// <summary>
|
|
/// 入金
|
|
/// </summary>
|
|
public double MoneyOut => (Direction == "出金" ? -1 : 0) * (Money ?? 0);
|
|
|
|
/// <summary>
|
|
/// 其他金额
|
|
/// </summary>
|
|
public double MoneyOther => (Direction == "其他支出" || Direction == "其他收入" ? 1 : 0) * (Money ?? 0);
|
|
|
|
/// <summary>
|
|
/// 权利金
|
|
/// </summary>
|
|
public double MoneyPrice
|
|
{
|
|
get
|
|
{
|
|
return (MoneyType == "权利金" ? 1 : 0) * (Money ?? 0);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 平仓行权费
|
|
/// </summary>
|
|
public double MoneyUnwindExer
|
|
{
|
|
get
|
|
{
|
|
return (MoneyType == "平仓行权" ? 1 : 0) * (Money ?? 0);
|
|
}
|
|
set { }
|
|
}
|
|
|
|
public double MoneyCoupon
|
|
{
|
|
get
|
|
{
|
|
return (MoneyType == "票息" ? 1 : 0) * (Money ?? 0);
|
|
}
|
|
}
|
|
|
|
public double MoneySwap
|
|
{
|
|
get
|
|
{
|
|
return (MoneyType == "互换" ? 1 : 0) * (Money ?? 0);
|
|
}
|
|
}
|
|
public double MoneySwapMargin
|
|
{
|
|
get
|
|
{
|
|
return (MoneyType == "预付金" ? 1 : 0) * (Money ?? 0);
|
|
}
|
|
}
|
|
public string MoneyType
|
|
{
|
|
get
|
|
{
|
|
if (Direction == "出金" || Direction == "入金")
|
|
{
|
|
return "出入金";
|
|
}
|
|
if (Action == "系统操作-期权费" && !(TradeType == "收益互换" && PS.Config.IsGuoJun))
|
|
{
|
|
return "权利金";
|
|
}
|
|
if ((Action == "系统操作-平仓费" || Action == "系统操作-行权费") && !(TradeType == "收益互换" && PS.Config.IsGuoJun))
|
|
{
|
|
return "平仓行权";
|
|
}
|
|
if (Action == "系统操作-票息" && !(TradeType == "收益互换" && PS.Config.IsGuoJun))
|
|
{
|
|
return "票息";
|
|
}
|
|
if (Action == "系统操作-互换" || (TradeType == "收益互换" && PS.Config.IsGuoJun))
|
|
{
|
|
return "互换";
|
|
}
|
|
if (Action == ClientCashInCashOut.系统操作_应付预付金 || Action == ClientCashInCashOut.系统操作_预付金返息)
|
|
{
|
|
return "预付金";
|
|
}
|
|
if (Direction == "其他收入" || Direction == "其他支出")
|
|
{
|
|
return "其他";
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 状态
|
|
/// </summary>
|
|
[DisplayName("状态")]
|
|
public string State
|
|
{
|
|
get; set;
|
|
}
|
|
/// <summary>
|
|
/// 开户行
|
|
/// </summary>
|
|
[DisplayName("开户银行")]
|
|
public string OpenBank { get; set; }
|
|
|
|
/// <summary>
|
|
/// 开户银行
|
|
/// </summary>
|
|
[DisplayName("开户账号")]
|
|
public string OpenBankId
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 备注
|
|
/// </summary>
|
|
[DisplayName("备注")]
|
|
public string OpenBankComments { get; set; }
|
|
|
|
/// <summary>
|
|
/// 银行卡号
|
|
/// </summary>
|
|
[DisplayName("银行卡号")]
|
|
public string OpenBankCard
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建人_optid
|
|
/// </summary>
|
|
[DisplayName("创建人")]
|
|
public int? OptId
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建人_optname
|
|
/// </summary>
|
|
[DisplayName("创建人")]
|
|
public string OptName
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 操作时间_createdate
|
|
/// </summary>
|
|
[DisplayName("操作时间")]
|
|
public DateTime? OptDate
|
|
{
|
|
get; set;
|
|
}
|
|
|
|
[NotMapped]
|
|
public string OptDateString => OptDate?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty;
|
|
|
|
public string SerialNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 结算日
|
|
/// </summary>
|
|
[DisplayName("结算日")]
|
|
public DateTime SettleDate { get; set; }
|
|
|
|
public string Comments { get; set; }
|
|
|
|
public int IsCompanyCash { get; set; }
|
|
|
|
/// <summary>
|
|
/// 资金标识
|
|
/// </summary>
|
|
public int CashFlag { get; set; }
|
|
/// <summary>
|
|
/// 审批进程
|
|
/// </summary>
|
|
public int ApprovalProcess { get; set; }
|
|
|
|
/// <summary>
|
|
/// 创建人ID
|
|
/// </summary>
|
|
[DisplayName("创建人")]
|
|
public int? CreatorId { set; get; }
|
|
|
|
/// <summary>
|
|
/// 创建人名称
|
|
/// </summary>
|
|
[DisplayName("创建人")]
|
|
public string CreatorName { set; get; }
|
|
|
|
/// <summary>
|
|
/// 创建时间
|
|
/// </summary>
|
|
[DisplayName("创建时间")]
|
|
public DateTime? CreateDate { set; get; }
|
|
}
|
|
}
|