RelationPAndXGoodsInfoModel.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Data.Helper;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. namespace Muchinfo.MTPClient.Data.Model.Delivery
  8. {
  9. /// <summary>
  10. /// P+X交割商品信息
  11. /// </summary>
  12. public class RelationPAndXGoodsInfoModel
  13. {
  14. #region SQL字段
  15. // <select id="SearchRelationPAndXGoodsInfo" parameterType="java.util.Map"
  16. // resultType="HashMap">
  17. // SELECT
  18. // dr.GOODSID,
  19. // dr.AUTOID RelationId,
  20. // dr.deliverygoodsid,
  21. // dr.RelationMode,
  22. // dr.RelationGoodsId,
  23. // dr.Conversion,
  24. // dr.DELIVERYPRICEMOVE,
  25. // dr.goodsscale,
  26. // dg.deliverygoodsname,
  27. // dg.deliverygoodscode,
  28. // dg.GoodsUnitId,
  29. // dg.Sponsor,
  30. // dg.deliverygoodsstatus,
  31. // gs.name as goodsUnitName,
  32. //rg.goodsname RelationGoodsname,
  33. //to_char(minDate.Parametervalue, 'yyyy-MM-dd hh24:mi:ss') minDateDeliveryDate,
  34. //to_char(maxDate.Parametervalue, 'yyyy-MM-dd hh24:mi:ss') maxDateDeliveryDate,
  35. // rg.goodscode RelationGoodscode,
  36. //(select listagg(to_char(wr.brand),'/') within group (order by wr.brand) as GroupBrand from (select distinct wh.brand as brand,wh.deliverygoodsid from warehousereciept wh ) wr where wr.brand is not null and wr.deliverygoodsid =dr.deliverygoodsid group by wr.deliverygoodsid) BrandList,
  37. //(select listagg(to_char(wc.ranks),'/') within group (order by wc.ranks) as GroupRanks from (select distinct wh.rank as ranks,wh.deliverygoodsid from warehousereciept wh ) wc where wc.ranks is not null and wc.deliverygoodsid =dr.deliverygoodsid group by wc.deliverygoodsid) RankList,
  38. //(select listagg(to_char(wl.warehousename),'/') within group (order by wl.warehousename) as GroupWarehouse from (select distinct wa.warehousename as warehousename,wh.deliverygoodsid from warehousereciept wh left join warehouse wa on wh.warehouseid=wa.warehouseid ) wl where wl.warehousename is not null and wl.deliverygoodsid =dr.deliverygoodsid group by wl.deliverygoodsid) WarehouseList
  39. // from GoodsDeliveryRelation dr
  40. //left join goods rg on rg.goodsid= dr.RelationGoodsId
  41. //left join DeliveryGoods dg on dg.DeliveryGoodsId=dr.DeliveryGoodsId
  42. //left join goodsunit gs on gs.goodsunitid =dg.goodsunitid
  43. //left join DeliveryRule minDate on minDate.Deliverygoodsid=dr.goodsid and minDate.ruleid= 3001
  44. //left join DeliveryRule maxDate on maxDate.DeliveryGoodsId=dr.goodsid and minDate.ruleid= 3002
  45. // </select>
  46. #endregion
  47. /// <summary>
  48. /// 交易商品Id
  49. /// </summary>
  50. [PropertyDisc("GoodsId")]
  51. public long GoodsId { get; set; }
  52. /// <summary>
  53. /// 交割关系id
  54. /// </summary>
  55. [PropertyDisc("RelationId")]
  56. public long RelationId { get; set; }
  57. /// <summary>
  58. /// 关联模式
  59. /// </summary>
  60. [PropertyDisc("RelationMode")]
  61. public eDeliveryContractLink RelationMode { get; set; }
  62. /// <summary>
  63. /// 关联交易商品Id
  64. /// </summary>
  65. [PropertyDisc("RelationGoodsId")]
  66. public long RelationGoodsId { get; set; }
  67. /// <summary>
  68. /// 交割商品Id
  69. /// </summary>
  70. [PropertyDisc("DeliveryGoodsId")]
  71. public long DeliveryGoodsId { get; set; }
  72. /// <summary>
  73. /// 兑换系数
  74. /// </summary>
  75. [PropertyDisc("Conversion")]
  76. public decimal Conversion { get; set; }
  77. /// <summary>
  78. /// 交割商品合约单位-数据库表中,此字段删除
  79. /// </summary>
  80. //[PropertyDisc("AgreeUnit")]
  81. //public decimal AgreeUnit { get; set; }
  82. /// <summary>
  83. /// 发起方式'1买方限定,2卖方限定,3双方自由';
  84. /// </summary>
  85. [PropertyDisc("Sponsor")]
  86. public eSponsorType Sponsor { get; set; }
  87. /// <summary>
  88. /// 商品单位
  89. /// </summary>
  90. [PropertyDisc("GoodsUnitId")]
  91. public long GoodsUnitId { get; set; }
  92. /// <summary>
  93. /// 商品单位名称
  94. /// </summary>
  95. [PropertyDisc("goodsUnitName")]
  96. public string goodsUnitName { get; set; }
  97. /// <summary>
  98. /// 差价升贴水
  99. /// </summary>
  100. [PropertyDisc("DeliveryPriceMove")]
  101. public decimal DeliveryPriceMove { get; set; }
  102. /// <summary>
  103. /// 交割商品名称
  104. /// </summary>
  105. [PropertyDisc("deliverygoodsname")]
  106. public string deliverygoodsname { get; set; }
  107. /// <summary>
  108. /// 交割商品代码
  109. /// </summary>
  110. [PropertyDisc("deliverygoodscode")]
  111. public string deliverygoodscode { get; set; }
  112. /// <summary>
  113. /// 关联交易商品-商品名称
  114. /// </summary>
  115. [PropertyDisc("RelationGoodsname")]
  116. public string RelationGoodsname { get; set; }
  117. /// <summary>
  118. /// 关联交易商品-商品代码
  119. /// </summary>
  120. [PropertyDisc("RelationGoodscode")]
  121. public string RelationGoodscode { get; set; }
  122. public string RelationGoodsNameCodeDisplay
  123. {
  124. get
  125. {
  126. if (RelationGoodsname != null && RelationGoodsname != "" && RelationGoodsname.Length > 8)
  127. {
  128. return RelationGoodsname.Substring(0, 8) + "..." + " " + RelationGoodscode;
  129. }
  130. else
  131. {
  132. return RelationGoodsname + " " + RelationGoodscode;
  133. }
  134. }
  135. }
  136. private string _WarehouseList = "-";
  137. /// <summary>
  138. /// 交割商品属性-仓库
  139. /// </summary>
  140. [PropertyDisc("WarehouseList")]
  141. public string WarehouseList
  142. {
  143. get { return _WarehouseList; }
  144. set { _WarehouseList = value; }
  145. }
  146. private string _BrandList ="-";
  147. /// <summary>
  148. /// 交割商品属性-品牌
  149. /// </summary>
  150. [PropertyDisc("BrandList")]
  151. public string BrandList
  152. {
  153. get { return _BrandList; }
  154. set { _BrandList = value; }
  155. }
  156. private string _RankList = "-";
  157. /// <summary>
  158. /// 交割商品属性-等级
  159. /// </summary>
  160. [PropertyDisc("RankList")]
  161. public string RankList
  162. {
  163. get { return _RankList; }
  164. set { _RankList = value; }
  165. }
  166. private DateTime _minDateDeliveryDate = DateTime.MinValue;
  167. /// <summary>
  168. /// 交割开始日期
  169. /// </summary>
  170. [PropertyDisc("minDateDeliveryDate")]
  171. public DateTime MinDateDeliveryDate
  172. {
  173. get { return _minDateDeliveryDate; }
  174. set { _minDateDeliveryDate = value; }
  175. }
  176. private DateTime _maxDateDeliveryDate = DateTime.MinValue;
  177. /// <summary>
  178. /// 交割结束日期
  179. /// </summary>
  180. [PropertyDisc("maxDateDeliveryDate")]
  181. public DateTime MaxDateDeliveryDate
  182. {
  183. get { return _maxDateDeliveryDate; }
  184. set { _maxDateDeliveryDate = value; }
  185. }
  186. /// <summary>
  187. /// 商品配比
  188. /// </summary>
  189. [PropertyDisc("goodsscale")]
  190. public decimal GoodsScale { get; set; }
  191. }
  192. }