| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537 |
- 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
- {
- /// <summary>
- /// 交割单查询
- /// </summary>
- 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字段
- // <select id="QueryDeliveryHolder" parameterType="java.util.Map"
- // resultType="java.util.Map">
- // SELECT
- // dd.DeliveryId,
- // dd.BuyOrderId,
- // dd.SellOrderId,
- // dd.BuyAccountID,
- // dd.sellaccountid,
- // dd.DeliveryGoodsId,
- // dd.DeliveryTime,
- // dd.Price as DeliveryPrice,
- // dd.DeliveryQty,
- // dd.DeliveryAmount,
- // dd.DELIVERYPRICEMORE as DeliveryPriceMoveAmount,
- // dd.DeliveryTotalAmount,
- // dd.DeliveryStatus,
- // dd.tax as DELIVERYTAX,
- // dp.enddate as ContractTime,
- // dg.DeliveryGoodsName,
- // dg.deliverygoodscode,
- // dp.payStatus as PLANSTATUS
- // FROM
- // DELIVERYDETAIL dd,
- // DeliveryPerformance dp,
- // DELIVERYGOODS dg
- // WHERE
- // dd.DeliveryId = dp.DELIVERYID
- // AND dd.DELIVERYGOODSID = dg.DELIVERYGOODSID
- // AND dd.BuyAccountID = #{accountid,jdbcType=BIGINT}
- //</select>
- #endregion
- /// <summary>
- /// 交割单号
- /// </summary>
- [PropertyDisc("DeliveryId")]
- public long DeliveryId { get; set; }
- /// <summary>
- /// 申报单号
- /// </summary>
- [PropertyDisc("deliveryorderid")]
- public long DeliveryOrderID { get; set; }
- /// <summary>
- /// 账号ID
- /// </summary>
- [PropertyDisc("AccountID")]
- public ulong AccountID { get; set; }
- /// <summary>
- /// 账号ID
- /// </summary>
- [PropertyDisc("MatchAccountId")]
- public ulong MatchAccountId { get; set; }
-
- /// <summary>
- /// 交割商品Id
- /// </summary>
- [PropertyDisc("DeliveryGoodsId")]
- public long DeliveryGoodsId { get; set; }
- /// <summary>
- /// 交割时间
- /// </summary>
- [PropertyDisc("DeliveryTime")]
- public DateTime DeliveryTime { get; set; }
- /// <summary>
- /// 交割时间-转换
- /// </summary>
- public string DeliveryTimeDisplay
- {
- get
- {
- if (DeliveryTime != null && DeliveryTime != DateTime.MinValue)
- {
- return DeliveryTime.ToString("yyyy-MM-dd HH:mm:ss");
- }
- else
- {
- return "-";
- }
- }
- }
-
- /// <summary>
- /// 交割均价
- /// </summary>
- [PropertyDisc("DeliveryPrice")]
- public decimal DeliveryPrice { get; set; }
- /// <summary>
- /// 交割数量/配对成功数量
- /// </summary>
- [PropertyDisc("DeliveryQty")]
- public decimal DeliveryQty { get; set; }
- /// <summary>
- /// 交割总货款
- /// </summary>
- [PropertyDisc("deliveryamount")]
- public decimal DeliveryTotalAmount { get; set; }
- /// <summary>
- /// 冻结货款
- /// </summary>
- [PropertyDisc("FREEZEAMOUNT")]
- public decimal FreezeAmount { get; set; }
- /// <summary>
- /// 交割应付总货款
- /// </summary>
- [PropertyDisc("remaintotalamount")]
- public decimal Deliverypaytotalamount { get; set; }
- /// <summary>
- /// 税款
- /// </summary>
- [PropertyDisc("DELIVERYTAX")]
- public decimal DELIVERYTAX { get; set; }
- public string DeliveryTaxDisplay
- {
- get
- {
- if (DELIVERYTAX != decimal.Zero)
- {
- return DELIVERYTAX.ToString();
- }
- else
- {
- return "-";
- }
- }
- }
- /// <summary>
- /// 交割单状态
- /// </summary>
- [PropertyDisc("DeliveryStatus")]
- public eDeliveryStatus DeliveryStatus { get; set; }
- /// <summary>
- /// 履约截止时间
- /// </summary>
- [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; }
-
- /// <summary>
- /// 确认状态
- /// </summary>
- [PropertyDisc("confirmstatus")]
- public NeedComfrim NeedComfrim { get; set; }
- /// <summary>
- /// 是否为历史单据(0为当前,1历史)
- /// </summary>
- [PropertyDisc("IsHistory")]
- public int IsHistory { get; set; }
- /// <summary>
- /// 当前处理的计划ID,为0时没有不需确认
- /// </summary>
- [PropertyDisc("PLANDETAILID")]
- public uint PlanDetailId { get; set; }
- // fp.confirmstatus,
- //fp.confirmdate,
- //fp.confirmremark,
- /// <summary>
- /// 确认时间
- /// </summary>
- [PropertyDisc("confirmdate")]
- public DateTime ConfirmDate { get; set; }
- /// <summary>
- /// 确认内容
- /// </summary>
- [PropertyDisc("confirmremark")]
- public string ConfirmRemark { get; set; }
- /// <summary>
- /// 履约截止时间-转换
- /// </summary>
- public string ContractTimeDisplay
- {
- get
- {
- if (ContractTime != null && ContractTime != DateTime.MinValue)
- {
- return ContractTime.ToString("yyyy-MM-dd");
- }
- else
- {
- return "-";
- }
- }
- }
- /// <summary>
- /// 交割升贴水
- /// </summary>
- [PropertyDisc("DeliveryPriceMoveAmount")]
- public decimal DeliveryPriceMoveAmount { get; set; }
- /// <summary>
- /// 差价款
- /// </summary>
- [PropertyDisc("PriceMoveAmount")]
- public decimal PriceMoveAmount { get; set; }
- /// <summary>
- /// 商品名称
- /// </summary>
- [PropertyDisc("DeliveryGoodsName")]
- public string DeliveryGoodsName { get; set; }
- /// <summary>
- /// 商品名称
- /// </summary>
- [PropertyDisc("deliverygoodscode")]
- public string DeliveryGoodsCode { get; set; }
- /// <summary>
- /// N模式商品名称
- /// </summary>
- [PropertyDisc("XGoodsName")]
- public string XGoodsName { get; set; }
- /// <summary>
- /// N模式商品代码
- /// </summary>
- [PropertyDisc("XGoodsCode")]
- public string XGoodsCode { get; set; }
- /// <summary>
- /// 商品名称显示-判断取值
- /// </summary>
- public string DeliveryGoodsNameDisplay
- {
- get
- {
- return string.Format("{0}/{1}", DeliveryGoodsCode, DeliveryGoodsName);
- //if (RelationMode != eDeliveryContractLink.None)
- //{
- // return string.Format("{0}/{1}",DeliveryGoodsCode, DeliveryGoodsName);
- //}
- //else
- //{
- // return "--";
- //}
- }
- }
- /// <summary>
- /// 商品名称显示-判断取值
- /// </summary>
- public string TradeGoodsNameDisplay
- {
- get
- {
- return string.Format("{0}/{1}", XGoodsCode, XGoodsName);
-
- }
- }
- /// <summary>
- /// 手续费
- /// </summary>
- //[PropertyDisc("DeliveryCharge")]
- //public decimal DeliveryCharge { get; set; }
- /// <summary>
- /// 手续费
- /// </summary>
- [PropertyDisc("DeliveryCharge")]
- public decimal DELIVERYFEE { get; set; }
- /// <summary>
- /// 关联仓单号
- /// </summary>
- [PropertyDisc("WRCodeGroup")]
- public string WRCodeGroup { get; set; }
- /// <summary>
- /// 交割履约表-交割单号数量:1为确认货,2为确认票
- /// </summary>
- [PropertyDisc("countNum")]
- public int countNum { get; set; }
- /// <summary>
- /// 确认货给付
- /// </summary>
- [PropertyDisc("hValue")]
- public decimal hValue { get; set; }
- /// <summary>
- /// 交割履约表直接存储-确认货给付【防止盘中修改确认货比例,直接保存确认时的确认货给付比例】
- /// </summary>
- [PropertyDisc("nhValue")]
- public decimal nhValue { get; set; }
- /// <summary>
- /// 确认票给付
- /// </summary>
- [PropertyDisc("pValue")]
- public decimal pValue { get; set; }
- /// <summary>
- /// 计划id
- /// </summary>
- [PropertyDisc("PLANID")]
- public long PLANID { get; set; }
- /// <summary>
- /// 下期待支付
- /// </summary>
- [PropertyDisc("NEXTPAYRADIO")]
- public decimal NEXTPAYRADIO { get; set; }
- /// <summary>
- /// 下期剩余天数
- /// </summary>
- [PropertyDisc("NEXTPAYLEFTDAYS")]
- public int NEXTPAYLEFTDAYS { get; set; }
- /// <summary>
- /// 剩余待支付金额【 尾款=应付总货款—已付货款;】
- /// </summary>
- [PropertyDisc("LEFTPAYAMOUNT")]
- public decimal LEFTPAYAMOUNT { get; set; }
- /// <summary>
- /// 已付金额=>sum[履约明细.支付金额]状态为已支付
- /// </summary>
- [PropertyDisc("AlreadyPayAmount")]
- public decimal AlreadyPayAmount { get; set; }
- /// <summary>
- /// 尾款=应付总货款—已付货款;
- /// </summary>
- public string LeftPayAmountDisplay
- {
- get
- {
- if (Deliverypaytotalamount - AlreadyPayAmount != decimal.Zero)
- {
- return (Deliverypaytotalamount - AlreadyPayAmount).ToString("f2");
- }
- else
- {
- return "-";
- }
- }
- }
- /// <summary>
- /// 欠款金额
- /// </summary>
- [PropertyDisc("DEBTAMOUNT")]
- public decimal DEBTAMOUNT { get; set; }
- private Visibility _isVisibility_DEBTAMOUNT = Visibility.Collapsed;
- /// <summary>
- /// 是否隐藏欠款金额
- /// </summary>
- public Visibility IsVisibility_DEBTAMOUNT
- {
- get
- {
- return _isVisibility_DEBTAMOUNT;
- }
- set
- {
- Set(() => IsVisibility_DEBTAMOUNT, ref _isVisibility_DEBTAMOUNT, value);
- }
- }
- /// <summary>
- /// 支付审核状态
- /// </summary>
- [PropertyDisc("PLANSTATUS")]
- public int PLANSTATUS { get; set; }
- /// <summary>
- /// 关联模式
- /// </summary>
- [PropertyDisc("RelationMode")]
- public eDeliveryContractLink RelationMode { get; set; }
- /// <summary>
- /// 返回多个值-pValue确认票给付,hValue确认货给付,countNum交割单号数量
- /// </summary>
- public string pValue_hValue_countNum
- {
- get
- {
- return pValue + "," + hValue + "," + countNum +"," +nhValue ;
- }
- }
- /// <summary>
- /// 交割单状态-显示文字
- /// </summary>
- public string DeliveryStatusDisplay
- {
- get
- {
- return DeliveryStatus.Discription();
- }
- }
- /// <summary>
- /// 交割结算盈亏=(最新价-持仓价)【交割算法:最新价-时才有此字段】
- /// </summary>
- public string DeliveryBalancePL
- {
- get
- {
- return "-";
- }
- }
- /// <summary>
- /// 是否选中货-自定义字段
- /// </summary>
- private bool _isGoodsSelected;
- /// <summary>
- /// 是否选中货-自定义字段
- /// </summary>
- public bool IsGoodsSelected
- {
- get { return _isGoodsSelected; }
- set
- {
- _isGoodsSelected = value;
- //INotifyPropertyChanged("IsGoodsSelected");
- }
- }
- /// <summary>
- /// 是否选中票-自定义字段
- /// </summary>
- private bool _isTicketSelected;
- /// <summary>
- /// 是否选中票-自定义字段
- /// </summary>
- public bool IsTicketSelected
- {
- get { return _isTicketSelected; }
- set
- {
- _isTicketSelected = value;
- //INotifyPropertyChanged("IsTicketSelected");
- }
- }
- /// <summary>
- /// 关联仓单号-字符
- /// </summary>
- public string WRCodeGroupDisplay
- {
- get
- {
- if (WRCodeGroup != "" && WRCodeGroup != null)
- {
- return WRCodeGroup.ToString();
- }
- else
- {
- return "-";
- }
- }
- }
- }
- }
|