DryHoldDetail.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. //----------------------------------------------------------------
  6. //Module Name: $safeprojectname$
  7. //Purpose:
  8. //CopyRight: Muchinfo
  9. //History:
  10. //----------------------------------------------------------------
  11. //DateTime 2016/8/5 10:08:22
  12. //Author
  13. //Description Create
  14. //----------------------------------------------------------------
  15. using Muchinfo.MTPClient.Data.Helper;
  16. using Muchinfo.MTPClient.Data.Enums;
  17. using System.ComponentModel;
  18. using System.Windows;
  19. using GalaSoft.MvvmLight;
  20. namespace Muchinfo.MTPClient.Data.Model.Delivery
  21. {
  22. /// <summary>
  23. /// 交割单查询
  24. /// </summary>
  25. public class DryHoldDetail:ViewModelBase //: INotifyPropertyChanged
  26. {
  27. #region 重写方法
  28. //public event PropertyChangedEventHandler PropertyChanged;
  29. //private void INotifyPropertyChanged(string name)
  30. //{
  31. // if (PropertyChanged != null)
  32. // {
  33. // PropertyChanged(this, new PropertyChangedEventArgs(name));
  34. // }
  35. //}
  36. #endregion
  37. #region SQL字段
  38. // <select id="QueryDeliveryHolder" parameterType="java.util.Map"
  39. // resultType="java.util.Map">
  40. // SELECT
  41. // dd.DeliveryId,
  42. // dd.BuyOrderId,
  43. // dd.SellOrderId,
  44. // dd.BuyAccountID,
  45. // dd.sellaccountid,
  46. // dd.DeliveryGoodsId,
  47. // dd.DeliveryTime,
  48. // dd.Price as DeliveryPrice,
  49. // dd.DeliveryQty,
  50. // dd.DeliveryAmount,
  51. // dd.DELIVERYPRICEMORE as DeliveryPriceMoveAmount,
  52. // dd.DeliveryTotalAmount,
  53. // dd.DeliveryStatus,
  54. // dd.tax as DELIVERYTAX,
  55. // dp.enddate as ContractTime,
  56. // dg.DeliveryGoodsName,
  57. // dg.deliverygoodscode,
  58. // dp.payStatus as PLANSTATUS
  59. // FROM
  60. // DELIVERYDETAIL dd,
  61. // DeliveryPerformance dp,
  62. // DELIVERYGOODS dg
  63. // WHERE
  64. // dd.DeliveryId = dp.DELIVERYID
  65. // AND dd.DELIVERYGOODSID = dg.DELIVERYGOODSID
  66. // AND dd.BuyAccountID = #{accountid,jdbcType=BIGINT}
  67. //</select>
  68. #endregion
  69. /// <summary>
  70. /// 交割单号
  71. /// </summary>
  72. [PropertyDisc("DeliveryId")]
  73. public long DeliveryId { get; set; }
  74. /// <summary>
  75. /// 申报单号
  76. /// </summary>
  77. [PropertyDisc("deliveryorderid")]
  78. public long DeliveryOrderID { get; set; }
  79. /// <summary>
  80. /// 账号ID
  81. /// </summary>
  82. [PropertyDisc("AccountID")]
  83. public ulong AccountID { get; set; }
  84. /// <summary>
  85. /// 账号ID
  86. /// </summary>
  87. [PropertyDisc("MatchAccountId")]
  88. public ulong MatchAccountId { get; set; }
  89. /// <summary>
  90. /// 交割商品Id
  91. /// </summary>
  92. [PropertyDisc("DeliveryGoodsId")]
  93. public long DeliveryGoodsId { get; set; }
  94. /// <summary>
  95. /// 交割时间
  96. /// </summary>
  97. [PropertyDisc("DeliveryTime")]
  98. public DateTime DeliveryTime { get; set; }
  99. /// <summary>
  100. /// 交割时间-转换
  101. /// </summary>
  102. public string DeliveryTimeDisplay
  103. {
  104. get
  105. {
  106. if (DeliveryTime != null && DeliveryTime != DateTime.MinValue)
  107. {
  108. return DeliveryTime.ToString("yyyy-MM-dd HH:mm:ss");
  109. }
  110. else
  111. {
  112. return "-";
  113. }
  114. }
  115. }
  116. /// <summary>
  117. /// 交割均价
  118. /// </summary>
  119. [PropertyDisc("DeliveryPrice")]
  120. public decimal DeliveryPrice { get; set; }
  121. /// <summary>
  122. /// 交割数量/配对成功数量
  123. /// </summary>
  124. [PropertyDisc("DeliveryQty")]
  125. public decimal DeliveryQty { get; set; }
  126. /// <summary>
  127. /// 交割总货款
  128. /// </summary>
  129. [PropertyDisc("deliveryamount")]
  130. public decimal DeliveryTotalAmount { get; set; }
  131. /// <summary>
  132. /// 冻结货款
  133. /// </summary>
  134. [PropertyDisc("FREEZEAMOUNT")]
  135. public decimal FreezeAmount { get; set; }
  136. /// <summary>
  137. /// 交割应付总货款
  138. /// </summary>
  139. [PropertyDisc("remaintotalamount")]
  140. public decimal Deliverypaytotalamount { get; set; }
  141. /// <summary>
  142. /// 税款
  143. /// </summary>
  144. [PropertyDisc("DELIVERYTAX")]
  145. public decimal DELIVERYTAX { get; set; }
  146. public string DeliveryTaxDisplay
  147. {
  148. get
  149. {
  150. if (DELIVERYTAX != decimal.Zero)
  151. {
  152. return DELIVERYTAX.ToString();
  153. }
  154. else
  155. {
  156. return "-";
  157. }
  158. }
  159. }
  160. /// <summary>
  161. /// 交割单状态
  162. /// </summary>
  163. [PropertyDisc("DeliveryStatus")]
  164. public eDeliveryStatus DeliveryStatus { get; set; }
  165. /// <summary>
  166. /// 履约截止时间
  167. /// </summary>
  168. [PropertyDisc("ContractTime")]
  169. public DateTime ContractTime { get; set; }
  170. [PropertyDisc("RelatedWRID")]
  171. public ulong RelatedWRID { get; set; }
  172. [PropertyDisc("brandid")]
  173. public ulong BrandID { get; set; }
  174. public string BrandName { get; set; }
  175. [PropertyDisc("qualityid")]
  176. public ulong QualityID { get; set; }
  177. public string QualityName { get; set; }
  178. [PropertyDisc("specid")]
  179. public ulong SpecID { get; set; }
  180. public string SpecName { get; set; }
  181. [PropertyDisc("warehouseid")]
  182. public ulong WarehouseID { get; set; }
  183. public string WarehouseName { get; set; }
  184. [PropertyDisc("deliverymonthid")]
  185. public ulong DeliveryMonthID { get; set; }
  186. public string DeliveryMonthName { get; set; }
  187. /// <summary>
  188. /// 确认状态
  189. /// </summary>
  190. [PropertyDisc("confirmstatus")]
  191. public NeedComfrim NeedComfrim { get; set; }
  192. /// <summary>
  193. /// 是否为历史单据(0为当前,1历史)
  194. /// </summary>
  195. [PropertyDisc("IsHistory")]
  196. public int IsHistory { get; set; }
  197. /// <summary>
  198. /// 当前处理的计划ID,为0时没有不需确认
  199. /// </summary>
  200. [PropertyDisc("PLANDETAILID")]
  201. public uint PlanDetailId { get; set; }
  202. // fp.confirmstatus,
  203. //fp.confirmdate,
  204. //fp.confirmremark,
  205. /// <summary>
  206. /// 确认时间
  207. /// </summary>
  208. [PropertyDisc("confirmdate")]
  209. public DateTime ConfirmDate { get; set; }
  210. /// <summary>
  211. /// 确认内容
  212. /// </summary>
  213. [PropertyDisc("confirmremark")]
  214. public string ConfirmRemark { get; set; }
  215. /// <summary>
  216. /// 履约截止时间-转换
  217. /// </summary>
  218. public string ContractTimeDisplay
  219. {
  220. get
  221. {
  222. if (ContractTime != null && ContractTime != DateTime.MinValue)
  223. {
  224. return ContractTime.ToString("yyyy-MM-dd");
  225. }
  226. else
  227. {
  228. return "-";
  229. }
  230. }
  231. }
  232. /// <summary>
  233. /// 交割升贴水
  234. /// </summary>
  235. [PropertyDisc("DeliveryPriceMoveAmount")]
  236. public decimal DeliveryPriceMoveAmount { get; set; }
  237. /// <summary>
  238. /// 差价款
  239. /// </summary>
  240. [PropertyDisc("PriceMoveAmount")]
  241. public decimal PriceMoveAmount { get; set; }
  242. /// <summary>
  243. /// 商品名称
  244. /// </summary>
  245. [PropertyDisc("DeliveryGoodsName")]
  246. public string DeliveryGoodsName { get; set; }
  247. /// <summary>
  248. /// 商品名称
  249. /// </summary>
  250. [PropertyDisc("deliverygoodscode")]
  251. public string DeliveryGoodsCode { get; set; }
  252. /// <summary>
  253. /// N模式商品名称
  254. /// </summary>
  255. [PropertyDisc("XGoodsName")]
  256. public string XGoodsName { get; set; }
  257. /// <summary>
  258. /// N模式商品代码
  259. /// </summary>
  260. [PropertyDisc("XGoodsCode")]
  261. public string XGoodsCode { get; set; }
  262. /// <summary>
  263. /// 商品名称显示-判断取值
  264. /// </summary>
  265. public string DeliveryGoodsNameDisplay
  266. {
  267. get
  268. {
  269. return string.Format("{0}/{1}", DeliveryGoodsCode, DeliveryGoodsName);
  270. //if (RelationMode != eDeliveryContractLink.None)
  271. //{
  272. // return string.Format("{0}/{1}",DeliveryGoodsCode, DeliveryGoodsName);
  273. //}
  274. //else
  275. //{
  276. // return "--";
  277. //}
  278. }
  279. }
  280. /// <summary>
  281. /// 商品名称显示-判断取值
  282. /// </summary>
  283. public string TradeGoodsNameDisplay
  284. {
  285. get
  286. {
  287. return string.Format("{0}/{1}", XGoodsCode, XGoodsName);
  288. }
  289. }
  290. /// <summary>
  291. /// 手续费
  292. /// </summary>
  293. //[PropertyDisc("DeliveryCharge")]
  294. //public decimal DeliveryCharge { get; set; }
  295. /// <summary>
  296. /// 手续费
  297. /// </summary>
  298. [PropertyDisc("DeliveryCharge")]
  299. public decimal DELIVERYFEE { get; set; }
  300. /// <summary>
  301. /// 关联仓单号
  302. /// </summary>
  303. [PropertyDisc("WRCodeGroup")]
  304. public string WRCodeGroup { get; set; }
  305. /// <summary>
  306. /// 交割履约表-交割单号数量:1为确认货,2为确认票
  307. /// </summary>
  308. [PropertyDisc("countNum")]
  309. public int countNum { get; set; }
  310. /// <summary>
  311. /// 确认货给付
  312. /// </summary>
  313. [PropertyDisc("hValue")]
  314. public decimal hValue { get; set; }
  315. /// <summary>
  316. /// 交割履约表直接存储-确认货给付【防止盘中修改确认货比例,直接保存确认时的确认货给付比例】
  317. /// </summary>
  318. [PropertyDisc("nhValue")]
  319. public decimal nhValue { get; set; }
  320. /// <summary>
  321. /// 确认票给付
  322. /// </summary>
  323. [PropertyDisc("pValue")]
  324. public decimal pValue { get; set; }
  325. /// <summary>
  326. /// 计划id
  327. /// </summary>
  328. [PropertyDisc("PLANID")]
  329. public long PLANID { get; set; }
  330. /// <summary>
  331. /// 下期待支付
  332. /// </summary>
  333. [PropertyDisc("NEXTPAYRADIO")]
  334. public decimal NEXTPAYRADIO { get; set; }
  335. /// <summary>
  336. /// 下期剩余天数
  337. /// </summary>
  338. [PropertyDisc("NEXTPAYLEFTDAYS")]
  339. public int NEXTPAYLEFTDAYS { get; set; }
  340. /// <summary>
  341. /// 剩余待支付金额【 尾款=应付总货款—已付货款;】
  342. /// </summary>
  343. [PropertyDisc("LEFTPAYAMOUNT")]
  344. public decimal LEFTPAYAMOUNT { get; set; }
  345. /// <summary>
  346. /// 已付金额=>sum[履约明细.支付金额]状态为已支付
  347. /// </summary>
  348. [PropertyDisc("AlreadyPayAmount")]
  349. public decimal AlreadyPayAmount { get; set; }
  350. /// <summary>
  351. /// 尾款=应付总货款—已付货款;
  352. /// </summary>
  353. public string LeftPayAmountDisplay
  354. {
  355. get
  356. {
  357. if (Deliverypaytotalamount - AlreadyPayAmount != decimal.Zero)
  358. {
  359. return (Deliverypaytotalamount - AlreadyPayAmount).ToString("f2");
  360. }
  361. else
  362. {
  363. return "-";
  364. }
  365. }
  366. }
  367. /// <summary>
  368. /// 欠款金额
  369. /// </summary>
  370. [PropertyDisc("DEBTAMOUNT")]
  371. public decimal DEBTAMOUNT { get; set; }
  372. private Visibility _isVisibility_DEBTAMOUNT = Visibility.Collapsed;
  373. /// <summary>
  374. /// 是否隐藏欠款金额
  375. /// </summary>
  376. public Visibility IsVisibility_DEBTAMOUNT
  377. {
  378. get
  379. {
  380. return _isVisibility_DEBTAMOUNT;
  381. }
  382. set
  383. {
  384. Set(() => IsVisibility_DEBTAMOUNT, ref _isVisibility_DEBTAMOUNT, value);
  385. }
  386. }
  387. /// <summary>
  388. /// 支付审核状态
  389. /// </summary>
  390. [PropertyDisc("PLANSTATUS")]
  391. public int PLANSTATUS { get; set; }
  392. /// <summary>
  393. /// 关联模式
  394. /// </summary>
  395. [PropertyDisc("RelationMode")]
  396. public eDeliveryContractLink RelationMode { get; set; }
  397. /// <summary>
  398. /// 返回多个值-pValue确认票给付,hValue确认货给付,countNum交割单号数量
  399. /// </summary>
  400. public string pValue_hValue_countNum
  401. {
  402. get
  403. {
  404. return pValue + "," + hValue + "," + countNum +"," +nhValue ;
  405. }
  406. }
  407. /// <summary>
  408. /// 交割单状态-显示文字
  409. /// </summary>
  410. public string DeliveryStatusDisplay
  411. {
  412. get
  413. {
  414. return DeliveryStatus.Discription();
  415. }
  416. }
  417. /// <summary>
  418. /// 交割结算盈亏=(最新价-持仓价)【交割算法:最新价-时才有此字段】
  419. /// </summary>
  420. public string DeliveryBalancePL
  421. {
  422. get
  423. {
  424. return "-";
  425. }
  426. }
  427. /// <summary>
  428. /// 是否选中货-自定义字段
  429. /// </summary>
  430. private bool _isGoodsSelected;
  431. /// <summary>
  432. /// 是否选中货-自定义字段
  433. /// </summary>
  434. public bool IsGoodsSelected
  435. {
  436. get { return _isGoodsSelected; }
  437. set
  438. {
  439. _isGoodsSelected = value;
  440. //INotifyPropertyChanged("IsGoodsSelected");
  441. }
  442. }
  443. /// <summary>
  444. /// 是否选中票-自定义字段
  445. /// </summary>
  446. private bool _isTicketSelected;
  447. /// <summary>
  448. /// 是否选中票-自定义字段
  449. /// </summary>
  450. public bool IsTicketSelected
  451. {
  452. get { return _isTicketSelected; }
  453. set
  454. {
  455. _isTicketSelected = value;
  456. //INotifyPropertyChanged("IsTicketSelected");
  457. }
  458. }
  459. /// <summary>
  460. /// 关联仓单号-字符
  461. /// </summary>
  462. public string WRCodeGroupDisplay
  463. {
  464. get
  465. {
  466. if (WRCodeGroup != "" && WRCodeGroup != null)
  467. {
  468. return WRCodeGroup.ToString();
  469. }
  470. else
  471. {
  472. return "-";
  473. }
  474. }
  475. }
  476. }
  477. }