using System; using System.Collections.Generic; using System.Linq; using System.Text; //---------------------------------------------------------------- //Module Name: $safeprojectname$ //Purpose: //CopyRight: Muchinfo //History: //---------------------------------------------------------------- //DateTime 2016/8/5 10:08:22 //Author //Description Create //---------------------------------------------------------------- using Muchinfo.MTPClient.Data.Helper; using Muchinfo.MTPClient.Data.Enums; using System.ComponentModel; using System.Windows; using GalaSoft.MvvmLight; namespace Muchinfo.MTPClient.Data.Model.Delivery { /// /// 交割单查询 /// public class DryHoldDetail:ViewModelBase //: INotifyPropertyChanged { #region 重写方法 //public event PropertyChangedEventHandler PropertyChanged; //private void INotifyPropertyChanged(string name) //{ // if (PropertyChanged != null) // { // PropertyChanged(this, new PropertyChangedEventArgs(name)); // } //} #endregion #region SQL字段 // #endregion /// /// 交割单号 /// [PropertyDisc("DeliveryId")] public long DeliveryId { get; set; } /// /// 申报单号 /// [PropertyDisc("deliveryorderid")] public long DeliveryOrderID { get; set; } /// /// 账号ID /// [PropertyDisc("AccountID")] public ulong AccountID { get; set; } /// /// 账号ID /// [PropertyDisc("MatchAccountId")] public ulong MatchAccountId { get; set; } /// /// 交割商品Id /// [PropertyDisc("DeliveryGoodsId")] public long DeliveryGoodsId { get; set; } /// /// 交割时间 /// [PropertyDisc("DeliveryTime")] public DateTime DeliveryTime { get; set; } /// /// 交割时间-转换 /// public string DeliveryTimeDisplay { get { if (DeliveryTime != null && DeliveryTime != DateTime.MinValue) { return DeliveryTime.ToString("yyyy-MM-dd HH:mm:ss"); } else { return "-"; } } } /// /// 交割均价 /// [PropertyDisc("DeliveryPrice")] public decimal DeliveryPrice { get; set; } /// /// 交割数量/配对成功数量 /// [PropertyDisc("DeliveryQty")] public decimal DeliveryQty { get; set; } /// /// 交割总货款 /// [PropertyDisc("deliveryamount")] public decimal DeliveryTotalAmount { get; set; } /// /// 冻结货款 /// [PropertyDisc("FREEZEAMOUNT")] public decimal FreezeAmount { get; set; } /// /// 交割应付总货款 /// [PropertyDisc("remaintotalamount")] public decimal Deliverypaytotalamount { get; set; } /// /// 税款 /// [PropertyDisc("DELIVERYTAX")] public decimal DELIVERYTAX { get; set; } public string DeliveryTaxDisplay { get { if (DELIVERYTAX != decimal.Zero) { return DELIVERYTAX.ToString(); } else { return "-"; } } } /// /// 交割单状态 /// [PropertyDisc("DeliveryStatus")] public eDeliveryStatus DeliveryStatus { get; set; } /// /// 履约截止时间 /// [PropertyDisc("ContractTime")] public DateTime ContractTime { get; set; } [PropertyDisc("RelatedWRID")] public ulong RelatedWRID { get; set; } [PropertyDisc("brandid")] public ulong BrandID { get; set; } public string BrandName { get; set; } [PropertyDisc("qualityid")] public ulong QualityID { get; set; } public string QualityName { get; set; } [PropertyDisc("specid")] public ulong SpecID { get; set; } public string SpecName { get; set; } [PropertyDisc("warehouseid")] public ulong WarehouseID { get; set; } public string WarehouseName { get; set; } [PropertyDisc("deliverymonthid")] public ulong DeliveryMonthID { get; set; } public string DeliveryMonthName { get; set; } /// /// 确认状态 /// [PropertyDisc("confirmstatus")] public NeedComfrim NeedComfrim { get; set; } /// /// 是否为历史单据(0为当前,1历史) /// [PropertyDisc("IsHistory")] public int IsHistory { get; set; } /// /// 当前处理的计划ID,为0时没有不需确认 /// [PropertyDisc("PLANDETAILID")] public uint PlanDetailId { get; set; } // fp.confirmstatus, //fp.confirmdate, //fp.confirmremark, /// /// 确认时间 /// [PropertyDisc("confirmdate")] public DateTime ConfirmDate { get; set; } /// /// 确认内容 /// [PropertyDisc("confirmremark")] public string ConfirmRemark { get; set; } /// /// 履约截止时间-转换 /// public string ContractTimeDisplay { get { if (ContractTime != null && ContractTime != DateTime.MinValue) { return ContractTime.ToString("yyyy-MM-dd"); } else { return "-"; } } } /// /// 交割升贴水 /// [PropertyDisc("DeliveryPriceMoveAmount")] public decimal DeliveryPriceMoveAmount { get; set; } /// /// 差价款 /// [PropertyDisc("PriceMoveAmount")] public decimal PriceMoveAmount { get; set; } /// /// 商品名称 /// [PropertyDisc("DeliveryGoodsName")] public string DeliveryGoodsName { get; set; } /// /// 商品名称 /// [PropertyDisc("deliverygoodscode")] public string DeliveryGoodsCode { get; set; } /// /// N模式商品名称 /// [PropertyDisc("XGoodsName")] public string XGoodsName { get; set; } /// /// N模式商品代码 /// [PropertyDisc("XGoodsCode")] public string XGoodsCode { get; set; } /// /// 商品名称显示-判断取值 /// public string DeliveryGoodsNameDisplay { get { return string.Format("{0}/{1}", DeliveryGoodsCode, DeliveryGoodsName); //if (RelationMode != eDeliveryContractLink.None) //{ // return string.Format("{0}/{1}",DeliveryGoodsCode, DeliveryGoodsName); //} //else //{ // return "--"; //} } } /// /// 商品名称显示-判断取值 /// public string TradeGoodsNameDisplay { get { return string.Format("{0}/{1}", XGoodsCode, XGoodsName); } } /// /// 手续费 /// //[PropertyDisc("DeliveryCharge")] //public decimal DeliveryCharge { get; set; } /// /// 手续费 /// [PropertyDisc("DeliveryCharge")] public decimal DELIVERYFEE { get; set; } /// /// 关联仓单号 /// [PropertyDisc("WRCodeGroup")] public string WRCodeGroup { get; set; } /// /// 交割履约表-交割单号数量:1为确认货,2为确认票 /// [PropertyDisc("countNum")] public int countNum { get; set; } /// /// 确认货给付 /// [PropertyDisc("hValue")] public decimal hValue { get; set; } /// /// 交割履约表直接存储-确认货给付【防止盘中修改确认货比例,直接保存确认时的确认货给付比例】 /// [PropertyDisc("nhValue")] public decimal nhValue { get; set; } /// /// 确认票给付 /// [PropertyDisc("pValue")] public decimal pValue { get; set; } /// /// 计划id /// [PropertyDisc("PLANID")] public long PLANID { get; set; } /// /// 下期待支付 /// [PropertyDisc("NEXTPAYRADIO")] public decimal NEXTPAYRADIO { get; set; } /// /// 下期剩余天数 /// [PropertyDisc("NEXTPAYLEFTDAYS")] public int NEXTPAYLEFTDAYS { get; set; } /// /// 剩余待支付金额【 尾款=应付总货款—已付货款;】 /// [PropertyDisc("LEFTPAYAMOUNT")] public decimal LEFTPAYAMOUNT { get; set; } /// /// 已付金额=>sum[履约明细.支付金额]状态为已支付 /// [PropertyDisc("AlreadyPayAmount")] public decimal AlreadyPayAmount { get; set; } /// /// 尾款=应付总货款—已付货款; /// public string LeftPayAmountDisplay { get { if (Deliverypaytotalamount - AlreadyPayAmount != decimal.Zero) { return (Deliverypaytotalamount - AlreadyPayAmount).ToString("f2"); } else { return "-"; } } } /// /// 欠款金额 /// [PropertyDisc("DEBTAMOUNT")] public decimal DEBTAMOUNT { get; set; } private Visibility _isVisibility_DEBTAMOUNT = Visibility.Collapsed; /// /// 是否隐藏欠款金额 /// public Visibility IsVisibility_DEBTAMOUNT { get { return _isVisibility_DEBTAMOUNT; } set { Set(() => IsVisibility_DEBTAMOUNT, ref _isVisibility_DEBTAMOUNT, value); } } /// /// 支付审核状态 /// [PropertyDisc("PLANSTATUS")] public int PLANSTATUS { get; set; } /// /// 关联模式 /// [PropertyDisc("RelationMode")] public eDeliveryContractLink RelationMode { get; set; } /// /// 返回多个值-pValue确认票给付,hValue确认货给付,countNum交割单号数量 /// public string pValue_hValue_countNum { get { return pValue + "," + hValue + "," + countNum +"," +nhValue ; } } /// /// 交割单状态-显示文字 /// public string DeliveryStatusDisplay { get { return DeliveryStatus.Discription(); } } /// /// 交割结算盈亏=(最新价-持仓价)【交割算法:最新价-时才有此字段】 /// public string DeliveryBalancePL { get { return "-"; } } /// /// 是否选中货-自定义字段 /// private bool _isGoodsSelected; /// /// 是否选中货-自定义字段 /// public bool IsGoodsSelected { get { return _isGoodsSelected; } set { _isGoodsSelected = value; //INotifyPropertyChanged("IsGoodsSelected"); } } /// /// 是否选中票-自定义字段 /// private bool _isTicketSelected; /// /// 是否选中票-自定义字段 /// public bool IsTicketSelected { get { return _isTicketSelected; } set { _isTicketSelected = value; //INotifyPropertyChanged("IsTicketSelected"); } } /// /// 关联仓单号-字符 /// public string WRCodeGroupDisplay { get { if (WRCodeGroup != "" && WRCodeGroup != null) { return WRCodeGroup.ToString(); } else { return "-"; } } } } }