158 lines
4.0 KiB
C#
158 lines
4.0 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace YLErp.DBModels
|
|
{
|
|
[Table("exchange_account")]
|
|
public class ExchangeAccount : DBModelBase, IDataEntity, IDataTraceV2, IClonable<ExchangeAccount>
|
|
{
|
|
public static string LogClass = "exchange_account";
|
|
|
|
[NotMapped]
|
|
public List<int> TraderIntIds
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(TraderIds))
|
|
{
|
|
return new List<int>();
|
|
}
|
|
|
|
return TraderIds.Split(","[0]).Select(t => Convert.ToInt32(t)).ToList();
|
|
}
|
|
}
|
|
|
|
[DisplayName("账户名称")]
|
|
public string AccountName { set; get; }
|
|
/// <summary>
|
|
/// 账户
|
|
/// </summary>
|
|
[DisplayName("账户")]
|
|
public string AccountCode { set; get; }
|
|
|
|
/// <summary>
|
|
/// 目前账户类型只有 Stock CommodityFutures
|
|
/// 如果加了其他类型,需要对应的修改AccountTypeName展示逻辑
|
|
/// </summary>
|
|
[DisplayName("账户类型 ")]
|
|
public string AccountType { set; get; }
|
|
|
|
/// <summary>
|
|
/// 目前只有股票 商品期货
|
|
/// </summary>
|
|
[DisplayName("账户类型")]
|
|
public string AccountTypeName
|
|
{
|
|
get
|
|
{
|
|
return AccountType == "Stock" ? "股票" : (AccountType == "CommodityFutures" ? "商品期货" : "其他");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 交易员id
|
|
/// </summary>
|
|
[DisplayName("交易员名称")]
|
|
public string TraderIds { set; get; }
|
|
|
|
/// <summary>
|
|
/// 交易员名称
|
|
/// </summary>
|
|
[DisplayName("交易员名称")]
|
|
public string TraderNames { set; get; }
|
|
/// <summary>
|
|
/// 状态
|
|
/// </summary>
|
|
[DisplayName("状态")]
|
|
public int? Status { set; get; }
|
|
|
|
[DisplayName("状态")]
|
|
[NotMapped]
|
|
public string StatusCN
|
|
{
|
|
get
|
|
{
|
|
if (Status == 1)
|
|
{
|
|
return "正常";
|
|
}
|
|
else
|
|
{
|
|
return "停用";
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始成本
|
|
/// </summary>
|
|
[DisplayName("初始成本")]
|
|
public double? InitialCost { get; set; }
|
|
|
|
/// <summary>
|
|
/// 总资金
|
|
/// </summary>
|
|
[DisplayName("总资金")]
|
|
public double Total { set; get; }
|
|
|
|
/// <summary>
|
|
/// 可用资金
|
|
/// </summary>
|
|
[DisplayName("可用资金")]
|
|
public double Available { set; get; }
|
|
|
|
/// <summary>
|
|
/// 动态权益
|
|
/// </summary>
|
|
[DisplayName("动态权益")]
|
|
public double CurrFund { set; get; }
|
|
|
|
/// <summary>
|
|
/// 当前预付金
|
|
/// </summary>
|
|
[DisplayName("当前预付金")]
|
|
public double CurrMargin { set; get; }
|
|
|
|
/// <summary>
|
|
/// 描述
|
|
/// </summary>
|
|
[DisplayName("描述")]
|
|
public string Description { set; get; }
|
|
|
|
/// <summary>
|
|
/// 默认簿记账户Id
|
|
/// </summary>
|
|
[DisplayName("默认簿记账户")]
|
|
public int? DefaultBookId { set; get; }
|
|
|
|
/// <summary>
|
|
/// 品种
|
|
/// </summary>
|
|
[DisplayName("品种")]
|
|
public string VarietyIds { get; set; }
|
|
|
|
[NotMapped]
|
|
[DisplayName("品种")]
|
|
public string VarietyNames { get; set; }
|
|
|
|
public ExchangeAccount Clone()
|
|
{
|
|
return (ExchangeAccount)MemberwiseClone();
|
|
}
|
|
|
|
public string GetDataTraceKeyId()
|
|
{
|
|
return id.ToString();
|
|
}
|
|
|
|
public string GetDataTraceKeyInfo()
|
|
{
|
|
return "对冲账户:" + AccountName;
|
|
}
|
|
}
|
|
|
|
[NotMapped]
|
|
public class ExchangeAccountDto : ExchangeAccount
|
|
{
|
|
public string AssetBookName { get; set; }
|
|
}
|
|
}
|