DeliveryWarehouse.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using GalaSoft.MvvmLight;
  6. using Muchinfo.MTPClient.Data.Enums;
  7. using Muchinfo.MTPClient.Data.Helper;
  8. using System.Windows;
  9. namespace Muchinfo.MTPClient.Data.Model.Delivery
  10. {
  11. /// <summary>
  12. /// 交割仓单查询Model
  13. /// </summary>
  14. public class DeliveryWarehouse:ViewModelBase
  15. {
  16. #region SQL字段
  17. //<select id="SearchDeliveryWarehouseOrder" parameterType="java.util.Map"
  18. // resultType="HashMap">
  19. // select * from (SELECT
  20. // gs.DeliveryGoodsName,
  21. // wh.warehousename,
  22. // WarehouseAddress
  23. // wr.WRID,
  24. // wr.WRCODE,
  25. // wr.WRTYPE,
  26. // wr.WRACCOUNTID,
  27. // wr.DELIVERYGOODSID,
  28. // wr.BRAND,
  29. // wr.RANK,
  30. // wr.WAREHOUSEID,
  31. // wr.QTY,
  32. // wr.FREEZEQTY,
  33. // wr.PAYQTY,
  34. // wr.GOODSUNITID,
  35. // wr.STORECHARGE,
  36. // wr.WRSAVER,
  37. // wr.WAREHOUSEPERSON,
  38. // wr.CONTRACTNO,
  39. // wr.STOREPLACE,
  40. // wr.STORESTART,
  41. // wr.STOREEND,
  42. // wr.STOREGOODSCODE,
  43. // wr.STOREGOODSNAME,
  44. // wr.SPEC,
  45. // wr.NATURE,
  46. // wr.PACKAGE,
  47. // wr.PCS,
  48. // wr.MARK,
  49. // wr.STOREAMOUNT,
  50. // wr.HASPOLICY,
  51. // wr.POLICYPERIOD,
  52. // wr.INSURER,
  53. // wr.INSURANCEPOLICY,
  54. // wr.CREATETIME,
  55. // wr.CREATORID,
  56. // wr.MODIFYTIME,
  57. // wr.MODIFIERID,
  58. // wr.STATUS,
  59. // wr.PROCSTATUS,
  60. // wr.STOREINCODE,
  61. // wr.WRREGISTERCODE,
  62. // wr.TELPHONE,
  63. // wr.PERSONNAME,
  64. // wr.ADDRESS,
  65. /// TAKETYPE
  66. // os.RequestTime,
  67. // os.AuditTime,
  68. // os.AuditId,
  69. // os.AuditStatus,
  70. // os.Remark
  71. // from DeliveryGoods gs
  72. // left join WarehouseReciept wr on wr.DeliveryGoodsId=gs.DeliveryGoodsId
  73. // left join WareHouse wh on wh.warehouseid=wr.warehouseid
  74. // left join (select wrr.Remark Remark,wrd.WRID WRID,wrr.AuditId AuditId,wrr.RequestTime RequestTime,wrr.AuditTime AuditTime,wrr.AuditStatus AuditStatus from WRRegister wrr left join WRRegisterDetail wrd on wrr.WRRegisterID=wrd.WRRegisterID) os on os.WRID=wr.WRID
  75. // left join useraccount u on u.accountid=os.AuditId
  76. // where wr.WRAccountId =#{accountId}
  77. // <if test="startDate != null">
  78. // AND wr.CreateTime &gt;=to_date(#{startDate},'yyyy-MM-dd hh24:mi:ss')
  79. // </if>
  80. // <if test="endDate != null">
  81. // AND wr.CreateTime &lt;=to_date(#{endDate},'yyyy-MM-dd hh24:mi:ss')
  82. // </if>
  83. // order by wr.CreateTime desc)
  84. // </select>
  85. #endregion
  86. #region 交割商品表DeliveryGoods
  87. /// <summary>
  88. /// 交割商品名称
  89. /// </summary>
  90. [PropertyDisc("DeliveryGoodsName")]
  91. public string DeliveryGoodsName { get; set; }
  92. /// <summary>
  93. /// 交割商品代碼
  94. /// </summary>
  95. [PropertyDisc("deliverygoodscode")]
  96. public string DeliveryGoodsCode { get; set; }
  97. /// <summary>
  98. /// 交割商品名称
  99. /// </summary>
  100. public string DeliveryGoodsCodeNameDisplay
  101. {
  102. get
  103. {
  104. return string.Format("{0}/{1}", DeliveryGoodsCode, DeliveryGoodsName);
  105. }
  106. }
  107. #endregion
  108. #region 仓单表WarehouseReciept
  109. /// <summary>
  110. /// 仓单ID
  111. /// </summary>
  112. [PropertyDisc("WRID")]
  113. public long WRID { get; set; }
  114. /// <summary>
  115. /// 仓单号
  116. /// </summary>
  117. [PropertyDisc("WRCode")]
  118. public string WRCode { get; set; }
  119. /// <summary>
  120. /// 仓单类型
  121. /// </summary>
  122. [PropertyDisc("WRType")]
  123. public eWRType WRType { get; set; }
  124. /// <summary>
  125. /// 仓单类型-转换字符
  126. /// </summary>
  127. public string WRTypeDisplay
  128. {
  129. get
  130. {
  131. return WRType.Discription();
  132. }
  133. }
  134. private string _Brand="-";
  135. /// <summary>
  136. /// 品牌
  137. /// </summary>
  138. [PropertyDisc("Brand")]
  139. public string Brand
  140. {
  141. get { return _Brand; }
  142. set { _Brand = value; }
  143. }
  144. private string _Rank="-";
  145. /// <summary>
  146. /// 等级
  147. /// </summary>
  148. [PropertyDisc("Rank")]
  149. public string Rank
  150. {
  151. get { return _Rank; }
  152. set { _Rank = value; }
  153. }
  154. /// <summary>
  155. /// 单位
  156. /// </summary>
  157. [PropertyDisc("GoodsUnitId")]
  158. public long GoodsUnitId { get; set; }
  159. /// <summary>
  160. /// 单位名称
  161. /// </summary>
  162. [PropertyDisc("GoodsunitName")]
  163. public string GoodsunitName { get; set; }
  164. private string _Spec="-";
  165. /// <summary>
  166. /// 规格
  167. /// </summary>
  168. [PropertyDisc("Spec")]
  169. public string Spec
  170. {
  171. get { return _Spec; }
  172. set { _Spec = value; }
  173. }
  174. private string _Nature="-";
  175. /// <summary>
  176. /// 性质(损耗标准)
  177. /// </summary>
  178. [PropertyDisc("Nature")]
  179. public string Nature
  180. {
  181. get { return _Nature; }
  182. set { _Nature = value; }
  183. }
  184. private string _Package="-";
  185. /// <summary>
  186. /// 包装
  187. /// </summary>
  188. [PropertyDisc("PACKAGE")]
  189. public string Package
  190. {
  191. get { return _Package; }
  192. set { _Package = value; }
  193. }
  194. private string _Pcs="-";
  195. /// <summary>
  196. /// 件数
  197. /// </summary>
  198. [PropertyDisc("Pcs")]
  199. public string Pcs
  200. {
  201. get { return _Pcs; }
  202. set { _Pcs = value; }
  203. }
  204. private string _Mark="-";
  205. /// <summary>
  206. /// 标记
  207. /// </summary>
  208. [PropertyDisc("Mark")]
  209. public string Mark
  210. {
  211. get { return _Mark; }
  212. set { _Mark = value; }
  213. }
  214. /// <summary>
  215. /// 注册数量
  216. /// </summary>
  217. [PropertyDisc("Qty")]
  218. public decimal Qty { get; set; }
  219. public string QtyDisplay
  220. {
  221. get
  222. {
  223. if (Qty != decimal.Zero)
  224. {
  225. return Qty.ToString();
  226. }
  227. else
  228. {
  229. return "-";
  230. }
  231. }
  232. }
  233. /// <summary>
  234. /// 可用数量
  235. /// </summary>
  236. public decimal AvailQty
  237. {
  238. get
  239. {
  240. return Qty - FreezeQty;
  241. }
  242. }
  243. /// <summary>
  244. /// 冻结数量
  245. /// </summary>
  246. [PropertyDisc("FreezeQty")]
  247. public decimal FreezeQty { get; set; }
  248. public string FreezeQtyDisplay
  249. {
  250. get
  251. {
  252. if (FreezeQty != decimal.Zero)
  253. {
  254. return FreezeQty.ToString();
  255. }
  256. else
  257. {
  258. return "-";
  259. }
  260. }
  261. }
  262. /// <summary>
  263. /// 兑付数量
  264. /// </summary>
  265. [PropertyDisc("PayQty")]
  266. public decimal PayQty { get; set; }
  267. public string PayQtyDisplay
  268. {
  269. get
  270. {
  271. if (PayQty != decimal.Zero)
  272. {
  273. return PayQty.ToString();
  274. }
  275. else
  276. {
  277. return "-";
  278. }
  279. }
  280. }
  281. /// <summary>
  282. /// 存储仓库
  283. /// </summary>
  284. [PropertyDisc("WareHouseId")]
  285. public string WareHouseId { get; set; }
  286. private string _StorePlace="-";
  287. /// <summary>
  288. /// 库位
  289. /// </summary>
  290. [PropertyDisc("StorePlace")]
  291. public string StorePlace
  292. {
  293. get { return _StorePlace; }
  294. set { _StorePlace = value; }
  295. }
  296. /// <summary>
  297. /// 仓储起始时间
  298. /// </summary>
  299. [PropertyDisc("StoreStart")]
  300. public DateTime StoreStart { get; set; }
  301. public string StoreStartDisplay
  302. {
  303. get
  304. {
  305. if (StoreStart != DateTime.MinValue && StoreStart != DateTime.MaxValue)
  306. {
  307. return StoreStart.ToString("yyyy-MM-dd");
  308. }
  309. else
  310. {
  311. return "-";
  312. }
  313. }
  314. }
  315. /// <summary>
  316. /// 仓储结束时间
  317. /// </summary>
  318. [PropertyDisc("StoreEnd")]
  319. public DateTime StoreEnd { get; set; }
  320. public string StoreEndDisplay
  321. {
  322. get
  323. {
  324. if (StoreEnd != DateTime.MinValue && StoreEnd != DateTime.MaxValue)
  325. {
  326. return StoreEnd.ToString("yyyy-MM-dd");
  327. }
  328. else
  329. {
  330. return "-";
  331. }
  332. }
  333. }
  334. private string _StoreGoodsCode="-";
  335. /// <summary>
  336. /// 物料编号
  337. /// </summary>
  338. [PropertyDisc("StoreGoodsCode")]
  339. public string StoreGoodsCode
  340. {
  341. get { return _StoreGoodsCode; }
  342. set { _StoreGoodsCode = value; }
  343. }
  344. private string _StoreGoodsName="-";
  345. /// <summary>
  346. /// 仓储物名
  347. /// </summary>
  348. [PropertyDisc("StoreGoodsName")]
  349. public string StoreGoodsName
  350. {
  351. get { return _StoreGoodsName; }
  352. set { _StoreGoodsName = value; }
  353. }
  354. /// <summary>
  355. /// 货值金额
  356. /// </summary>
  357. [PropertyDisc("StoreAmount")]
  358. public decimal StoreAmount { get; set; }
  359. public string StoreAmountDisplay
  360. {
  361. get
  362. {
  363. if (StoreAmount != decimal.Zero)
  364. {
  365. return StoreAmount.ToString();
  366. }
  367. else
  368. {
  369. return "-";
  370. }
  371. }
  372. }
  373. /// <summary>
  374. /// 是否办理保险
  375. /// </summary>
  376. [PropertyDisc("HasPolicy")]
  377. public int HasPolicy { get; set; }
  378. public string HasPolicyDisplay
  379. {
  380. get
  381. {
  382. if (HasPolicy != 0)
  383. {
  384. return "是";
  385. }
  386. else
  387. {
  388. return "否";
  389. }
  390. }
  391. }
  392. /// <summary>
  393. /// 保险期限
  394. /// </summary>
  395. [PropertyDisc("PolicyPeriod")]
  396. public DateTime PolicyPeriod { get; set; }
  397. public string PolicyPeriodDisplay
  398. {
  399. get
  400. {
  401. if (PolicyPeriod != DateTime.MinValue && PolicyPeriod != DateTime.MaxValue)
  402. {
  403. return PolicyPeriod.ToString("yyyy-MM-dd");
  404. }
  405. else
  406. {
  407. return "-";
  408. }
  409. }
  410. }
  411. private string _Insurer="-";
  412. /// <summary>
  413. /// 保险人
  414. /// </summary>
  415. [PropertyDisc("Insurer")]
  416. public string Insurer
  417. {
  418. get { return _Insurer; }
  419. set { _Insurer = value; }
  420. }
  421. private string _InsurancePolicy="-";
  422. /// <summary>
  423. /// 关联保单
  424. /// </summary>
  425. [PropertyDisc("InsurancePolicy")]
  426. public string InsurancePolicy
  427. {
  428. get { return _InsurancePolicy; }
  429. set { _InsurancePolicy = value; }
  430. }
  431. /// <summary>
  432. /// 仓储费
  433. /// </summary>
  434. [PropertyDisc("StoreCharge")]
  435. public decimal StoreCharge { get; set; }
  436. public string StoreChargeDisplay
  437. {
  438. get
  439. {
  440. if (StoreCharge != decimal.Zero)
  441. {
  442. return StoreCharge.ToString();
  443. }
  444. else
  445. {
  446. return "-";
  447. }
  448. }
  449. }
  450. private string _WRSAVER="-";
  451. /// <summary>
  452. /// 存货人( 显示自己的仓单)
  453. /// </summary>
  454. [PropertyDisc("accountname")]
  455. public string WRSAVER
  456. {
  457. get { return _WRSAVER; }
  458. set { _WRSAVER = value; }
  459. }
  460. private string _WareHousePerson="-";
  461. /// <summary>
  462. /// 仓管人
  463. /// </summary>
  464. [PropertyDisc("WareHousePerson")]
  465. public string WareHousePerson
  466. {
  467. get { return _WareHousePerson; }
  468. set { _WareHousePerson = value; }
  469. }
  470. private string _ContractNo;
  471. /// <summary>
  472. /// 合同号
  473. /// </summary>
  474. [PropertyDisc("ContractNo")]
  475. public string ContractNo
  476. {
  477. get { return _ContractNo; }
  478. set { _ContractNo = value; }
  479. }
  480. /// <summary>
  481. /// 创建时间
  482. /// </summary>
  483. [PropertyDisc("CreateTime")]
  484. public DateTime CreateTime { get; set; }
  485. /// <summary>
  486. /// 创建人
  487. /// </summary>
  488. [PropertyDisc("CreatorId")]
  489. public int CreatorId { get; set; }
  490. /// <summary>
  491. /// 存货人Id
  492. /// </summary>
  493. [PropertyDisc("WRAccountId")]
  494. public long WRAccountId { get; set; }
  495. /// <summary>
  496. /// 状态
  497. /// </summary>
  498. [PropertyDisc("Status")]
  499. public eWRStatus Status { get; set; }
  500. /// <summary>
  501. /// 状态-转换显示
  502. /// </summary>
  503. public string StatusDisplay
  504. {
  505. get
  506. {
  507. return Status.Discription();
  508. }
  509. }
  510. /// <summary>
  511. /// 处理状态
  512. /// </summary>
  513. [PropertyDisc("ProcStatus")]
  514. public string ProcStatus { get; set; }
  515. /// <summary>
  516. /// 存入单号STOREINCODE
  517. /// </summary>
  518. [PropertyDisc("STOREINCODE")]
  519. public string STOREINCODE { get; set; }
  520. /// <summary>
  521. /// 注册单号
  522. /// </summary>
  523. [PropertyDisc("WRREGISTERCODE")]
  524. public string WRREGISTERCODE { get; set; }
  525. /// <summary>
  526. /// 合约单位
  527. /// </summary>
  528. public string GoodsUnitIdDisplay { get; set; }
  529. /// <summary>
  530. /// 联系人
  531. /// </summary>
  532. [PropertyDisc("personname")]
  533. public string personname { get; set; }
  534. /// <summary>
  535. /// 联系电话
  536. /// </summary>
  537. [PropertyDisc("telphone")]
  538. public string telphone { get; set; }
  539. /// <summary>
  540. /// 收货地址
  541. /// </summary>
  542. [PropertyDisc("address")]
  543. public string address { get; set; }
  544. /// <summary>
  545. /// 證件號
  546. /// </summary>
  547. [PropertyDisc("IdCardNum")]
  548. public string IdCardNum { get; set; }
  549. #endregion
  550. #region 出库单表OutStoreRequest
  551. /// <summary>
  552. /// 申请时间
  553. /// </summary>
  554. [PropertyDisc("RequestTime")]
  555. public DateTime RequestTime { get; set; }
  556. /// <summary>
  557. /// 审核时间
  558. /// </summary>
  559. [PropertyDisc("AuditTime")]
  560. public DateTime AuditTime { get; set; }
  561. /// <summary>
  562. /// 审核人
  563. /// </summary>
  564. [PropertyDisc("AuditId")]
  565. public long AuditId { get; set; }
  566. /// <summary>
  567. /// 审核状态
  568. /// </summary>
  569. [PropertyDisc("AuditStatus")]
  570. public eAuditStatus AuditStatus { get; set; }
  571. /// <summary>
  572. /// 备注
  573. /// </summary>
  574. [PropertyDisc("Remark")]
  575. public string Remark { get; set; }
  576. #endregion
  577. #region 仓库表WareHousegion
  578. private string _WareHouseName="-";
  579. /// <summary>
  580. /// 存储仓库名称
  581. /// </summary>
  582. [PropertyDisc("WareHouseName")]
  583. public string WareHouseName
  584. {
  585. get { return _WareHouseName; }
  586. set { _WareHouseName = value; }
  587. }
  588. /// <summary>
  589. /// 仓库地址
  590. /// </summary>
  591. [PropertyDisc("WarehouseAddress")]
  592. public string WarehouseAddress { get; set; }
  593. /// <summary>
  594. /// 仓库地区
  595. /// </summary>
  596. [PropertyDisc("AreaAddress")]
  597. public string AreaAddress { get; set; }
  598. /// <summary>
  599. /// 仓库具体地址
  600. /// </summary>
  601. [PropertyDisc("detailAddress")]
  602. public string DetailAddress { get; set; }
  603. /// <summary>
  604. /// 收货方式TakeGoodsWay
  605. /// </summary>
  606. [PropertyDisc("TAKETYPE")]
  607. public TakeGoodsWay TakeGoodsWay { get; set; }
  608. #endregion
  609. #region 是否可提货
  610. /// <summary>
  611. /// 是否可提货-自定义字段
  612. /// </summary>
  613. private Visibility _isVisibility = Visibility.Collapsed;
  614. /// <summary>
  615. /// 是否可提货-自定义字段
  616. /// </summary>
  617. public Visibility IsVisibility
  618. {
  619. get { return _isVisibility; }
  620. set { _isVisibility = value; }
  621. }
  622. private bool _isSelected;
  623. /// <summary>
  624. ///是否选择仓单
  625. /// </summary>
  626. public bool IsSelected
  627. {
  628. get { return _isSelected; }
  629. set { Set(() => IsSelected, ref _isSelected, value); }
  630. }
  631. #endregion
  632. }
  633. }