CeErpTrade.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. using Castle.ActiveRecord;
  2. using NHibernate.Criterion;
  3. using System;
  4. using System.Text;
  5. namespace BizCom
  6. {
  7. [ActiveRecord("CE_ErpTrade")]
  8. public class CeErpTrade : ComBase<CeErpTrade>, ICloneable
  9. {
  10. /// <summary>
  11. ///交易编号
  12. /// </summary>
  13. [PrimaryKey(PrimaryKeyType.Assigned)]
  14. public string tid { get; set; }
  15. private double _num = 0;
  16. /// <summary>
  17. ///商品购买数量
  18. /// </summary>
  19. [Property]
  20. public double num
  21. {
  22. get { return _num; }
  23. set { _num = value; }
  24. }
  25. private string _status = "";
  26. /// <summary>
  27. ///交易状态
  28. /// </summary>
  29. [Property]
  30. public string status
  31. {
  32. get { return _status; }
  33. set { _status = value; }
  34. }
  35. private string _type = "";
  36. /// <summary>
  37. ///交易类型列表
  38. /// </summary>
  39. [Property]
  40. public string type
  41. {
  42. get { return _type; }
  43. set { _type = value; }
  44. }
  45. private double _price = 0;
  46. /// <summary>
  47. ///
  48. /// </summary>
  49. [Property]
  50. public double price
  51. {
  52. get { return _price; }
  53. set { _price = value; }
  54. }
  55. private double _discount_fee = 0;
  56. /// <summary>
  57. ///优惠金额
  58. /// </summary>
  59. [Property]
  60. public double discount_fee
  61. {
  62. get { return _discount_fee; }
  63. set { _discount_fee = value; }
  64. }
  65. private double _total_fee = 0;
  66. /// <summary>
  67. ///商品金额
  68. /// </summary>
  69. [Property]
  70. public double total_fee
  71. {
  72. get { return _total_fee; }
  73. set { _total_fee = value; }
  74. }
  75. [Property]
  76. public DateTime? create_time { get; set; }
  77. /// <summary>
  78. ///交易创建时间
  79. /// </summary>
  80. [Property]
  81. public DateTime? created { get; set; }
  82. /// <summary>
  83. ///付款时间
  84. /// </summary>
  85. [Property]
  86. public DateTime? pay_time { get; set; }
  87. /// <summary>
  88. ///交易修改时间
  89. /// </summary>
  90. [Property]
  91. public DateTime? modified { get; set; }
  92. /// <summary>
  93. ///交易结束时间
  94. /// </summary>
  95. [Property]
  96. public DateTime? end_time { get; set; }
  97. private string _buyer_nick = "";
  98. /// <summary>
  99. ///买家昵称
  100. /// </summary>
  101. [Property]
  102. public string buyer_nick
  103. {
  104. get { return _buyer_nick; }
  105. set { _buyer_nick = value; }
  106. }
  107. private string _step_trade_status = "";
  108. /// <summary>
  109. ///分阶段付款的订单状态
  110. /// </summary>
  111. [Property]
  112. public string step_trade_status
  113. {
  114. get { return _step_trade_status; }
  115. set { _step_trade_status = value; }
  116. }
  117. private double _step_paid_fee = 0;
  118. /// <summary>
  119. ///分阶段付款的已付金额
  120. /// </summary>
  121. [Property]
  122. public double step_paid_fee
  123. {
  124. get { return _step_paid_fee; }
  125. set { _step_paid_fee = value; }
  126. }
  127. private string _shipping_type = "";
  128. /// <summary>
  129. ///创建交易时的物流方式
  130. /// </summary>
  131. [Property]
  132. public string shipping_type
  133. {
  134. get { return _shipping_type; }
  135. set { _shipping_type = value; }
  136. }
  137. private double _adjust_fee = 0;
  138. /// <summary>
  139. ///卖家手工调整金额
  140. /// </summary>
  141. [Property]
  142. public double adjust_fee
  143. {
  144. get { return _adjust_fee; }
  145. set { _adjust_fee = value; }
  146. }
  147. private string _trade_from = "";
  148. /// <summary>
  149. ///交易内部来源
  150. /// </summary>
  151. [Property]
  152. public string trade_from
  153. {
  154. get { return _trade_from; }
  155. set { _trade_from = value; }
  156. }
  157. private string _seller_flag = "";
  158. /// <summary>
  159. ///卖家备注旗帜
  160. /// </summary>
  161. [Property]
  162. public string seller_flag
  163. {
  164. get { return _seller_flag; }
  165. set { _seller_flag = value; }
  166. }
  167. private string _seller_nick = "";
  168. /// <summary>
  169. ///卖家昵称
  170. /// </summary>
  171. [Property]
  172. public string seller_nick
  173. {
  174. get { return _seller_nick; }
  175. set { _seller_nick = value; }
  176. }
  177. private double _payment = 0;
  178. /// <summary>
  179. ///实付金额
  180. /// </summary>
  181. [Property]
  182. public double payment
  183. {
  184. get { return _payment; }
  185. set { _payment = value; }
  186. }
  187. private bool _seller_rate = false;
  188. /// <summary>
  189. ///卖家是否已评价
  190. /// </summary>
  191. [Property]
  192. public bool seller_rate
  193. {
  194. get { return _seller_rate; }
  195. set { _seller_rate = value; }
  196. }
  197. private double _post_fee = 0;
  198. /// <summary>
  199. ///邮费
  200. /// </summary>
  201. [Property]
  202. public double post_fee
  203. {
  204. get { return _post_fee; }
  205. set { _post_fee = value; }
  206. }
  207. private string _receiver_name = "";
  208. /// <summary>
  209. ///收货人的姓名
  210. /// </summary>
  211. [Property]
  212. public string receiver_name
  213. {
  214. get { return _receiver_name; }
  215. set { _receiver_name = value; }
  216. }
  217. private string _receiver_country = "";
  218. /// <summary>
  219. ///收货人国籍
  220. /// </summary>
  221. [Property]
  222. public string receiver_country
  223. {
  224. get { return _receiver_country; }
  225. set { _receiver_country = value; }
  226. }
  227. private string _receiver_state = "";
  228. /// <summary>
  229. ///收货人的所在省份
  230. /// </summary>
  231. [Property]
  232. public string receiver_state
  233. {
  234. get { return _receiver_state; }
  235. set { _receiver_state = value; }
  236. }
  237. private string _receiver_city = "";
  238. /// <summary>
  239. ///收货人的所在城市
  240. /// </summary>
  241. [Property]
  242. public string receiver_city
  243. {
  244. get { return _receiver_city; }
  245. set { _receiver_city = value; }
  246. }
  247. private string _receiver_town = "";
  248. /// <summary>
  249. ///收货人街道地址
  250. /// </summary>
  251. [Property]
  252. public string receiver_town
  253. {
  254. get { return _receiver_town; }
  255. set { _receiver_town = value; }
  256. }
  257. private string _receiver_district = "";
  258. /// <summary>
  259. ///收货人的所在地区
  260. /// </summary>
  261. [Property]
  262. public string receiver_district
  263. {
  264. get { return _receiver_district; }
  265. set { _receiver_district = value; }
  266. }
  267. private string _receiver_address = "";
  268. /// <summary>
  269. ///收货人的详细地址
  270. /// </summary>
  271. [Property]
  272. public string receiver_address
  273. {
  274. get { return _receiver_address; }
  275. set { _receiver_address = value; }
  276. }
  277. private string _receiver_zip = "";
  278. /// <summary>
  279. ///收货人的邮编
  280. /// </summary>
  281. [Property]
  282. public string receiver_zip
  283. {
  284. get { return _receiver_zip; }
  285. set { _receiver_zip = value; }
  286. }
  287. private string _receiver_mobile = "";
  288. /// <summary>
  289. ///收货人的手机号码
  290. /// </summary>
  291. [Property]
  292. public string receiver_mobile
  293. {
  294. get { return _receiver_mobile; }
  295. set { _receiver_mobile = value; }
  296. }
  297. private string _receiver_phone = "";
  298. /// <summary>
  299. ///收货人的电话号码
  300. /// </summary>
  301. [Property]
  302. public string receiver_phone
  303. {
  304. get { return _receiver_phone; }
  305. set { _receiver_phone = value; }
  306. }
  307. /// <summary>
  308. ///卖家发货时间
  309. /// </summary>
  310. [Property]
  311. public DateTime? consign_time { get; set; }
  312. private double _received_payment = 0;
  313. /// <summary>
  314. ///卖家实际收到的支付宝打款金额
  315. /// </summary>
  316. [Property]
  317. public double received_payment
  318. {
  319. get { return _received_payment; }
  320. set { _received_payment = value; }
  321. }
  322. /// <summary>
  323. ///发货时间
  324. /// </summary>
  325. [Property]
  326. public DateTime? delivery_time { get; set; }
  327. /// <summary>
  328. ///揽收时间
  329. /// </summary>
  330. [Property]
  331. public DateTime? collect_time { get; set; }
  332. /// <summary>
  333. ///签收时间
  334. /// </summary>
  335. [Property]
  336. public DateTime? sign_time { get; set; }
  337. private string _buyer_message = "";
  338. /// <summary>
  339. ///
  340. /// </summary>
  341. [Property]
  342. public string buyer_message
  343. {
  344. get { return _buyer_message; }
  345. set { _buyer_message = value; }
  346. }
  347. private string _buyer_memo = "";
  348. /// <summary>
  349. ///
  350. /// </summary>
  351. [Property]
  352. public string buyer_memo
  353. {
  354. get { return _buyer_memo; }
  355. set { _buyer_memo = value; }
  356. }
  357. private string _seller_memo = "";
  358. /// <summary>
  359. ///
  360. /// </summary>
  361. [Property]
  362. public string seller_memo
  363. {
  364. get { return _seller_memo; }
  365. set { _seller_memo = value; }
  366. }
  367. private string _posCode = "";
  368. /// <summary>
  369. ///店铺编码
  370. /// </summary>
  371. [Property]
  372. public string posCode
  373. {
  374. get { return _posCode; }
  375. set { _posCode = value; }
  376. }
  377. private string _buyer_id = "";
  378. /// <summary>
  379. ///客户id
  380. /// </summary>
  381. [Property]
  382. public string buyer_id
  383. {
  384. get { return _buyer_id; }
  385. set { _buyer_id = value; }
  386. }
  387. private bool _isNew = false;
  388. [Property]
  389. public bool IsNew
  390. {
  391. get { return _isNew; }
  392. set { _isNew = value; }
  393. }
  394. private double _unrefundedAmount = 0;
  395. /// <summary>
  396. /// 未退款金额
  397. /// </summary>
  398. [Property]
  399. public double unrefundedAmount
  400. {
  401. get { return _unrefundedAmount; }
  402. set { _unrefundedAmount = value; }
  403. }
  404. private int _orderFrom = 10;
  405. /// <summary>
  406. /// 【订单来源】"10":第三方平台"15":私域电商"20":ERP "30":售前系统
  407. /// </summary>
  408. [Property]
  409. public int orderFrom
  410. {
  411. get { return _orderFrom; }
  412. set { _orderFrom = value; }
  413. }
  414. private int _orderType = 10;
  415. /// <summary>
  416. /// 【订单类型】"10":线上单"15":线下单"20":补差单"30":售后单
  417. /// </summary>
  418. [Property]
  419. public int orderType
  420. {
  421. get { return _orderType; }
  422. set { _orderType = value; }
  423. }
  424. /// <summary>
  425. ///确认时间
  426. /// </summary>
  427. [Property]
  428. public DateTime? confirmTime { get; set; }
  429. public object Clone()
  430. {
  431. return this.MemberwiseClone();
  432. }
  433. public static void Del(object id)
  434. {
  435. StringBuilder sql = new StringBuilder();
  436. sql.AppendFormat("delete from CE_ErpTrade where tid='" + id + "'");
  437. ExecuteNonQuery(sql.ToString());
  438. }
  439. public static CeErpTrade Get(string tid)
  440. {
  441. return FindFirst(Expression.Eq("tid", tid));
  442. }
  443. public static CeErpTrade GetByName(string name)
  444. {
  445. return FindFirst(Expression.Eq("buyer_nick", name));
  446. }
  447. }
  448. }