OrderVo.java 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. package com.kmall.api.entity;
  2. import com.fasterxml.jackson.annotation.JsonFormat;
  3. import com.kmall.api.dto.GeometryMarker;
  4. import org.apache.commons.lang.StringUtils;
  5. import java.io.Serializable;
  6. import java.math.BigDecimal;
  7. import java.util.*;
  8. /**
  9. * @author Scott
  10. * @email
  11. * @date 2017-08-15 08:03:40
  12. */
  13. public class OrderVo implements Serializable {
  14. private static final long serialVersionUID = 1L;
  15. //主键
  16. private Long id;
  17. //订单序列号:商户(拼音首字母)+业务类型+编号
  18. private String order_sn;
  19. //会员Id
  20. private Long user_id;
  21. /*
  22. 订单状态
  23. 1xx 表示订单取消和删除等状态 0订单创建成功等待付款, 101订单已取消, 102订单已删除
  24. 2xx 表示订单支付状态 201订单已付款,等待发货
  25. 3xx 表示订单物流相关状态 300订单已发货, 301用户确认收货
  26. 4xx 表示订单退换货相关的状态 401 没有发货,退款 402 已收货,退款退货
  27. */
  28. private Integer order_status;
  29. //发货状态 商品配送情况;0未配送,1已配送,2已收货,4退货
  30. private Integer shipping_status;
  31. //付款状态 支付状态;0未付款;1付款中;2已付款;4退款
  32. private Integer pay_status;
  33. //评价状态 1已评价 0未评价
  34. private Integer comment_count = 0;
  35. //收货人
  36. private String consignee;
  37. //国家
  38. private String country;
  39. //省
  40. private String province;
  41. //地市
  42. private String city;
  43. //区县
  44. private String district;
  45. //收货地址
  46. private String address;
  47. //联系电话
  48. private String mobile;
  49. //补充说明
  50. private String postscript;
  51. // 配送员Id
  52. private Long shipping_id;
  53. // 配送员名称
  54. private String shipping_name;
  55. // 配送员手机
  56. private String shipping_mobile;
  57. // 配送员手机
  58. private String shipping_code;
  59. // 配送费用
  60. private BigDecimal shipping_fee;
  61. // 配送单号,rider_order表id
  62. private String shipping_no;
  63. //付款
  64. private String pay_id;
  65. // 付款人
  66. private String pay_name;
  67. //实际需要支付的金额
  68. private BigDecimal actual_price;
  69. // 积分
  70. private Integer integral;
  71. // 积分抵扣金额
  72. private BigDecimal integral_money;
  73. //订单总价
  74. private BigDecimal order_price;
  75. //商品总价
  76. private BigDecimal goods_price;
  77. //新增时间
  78. private Date add_time;
  79. //确认时间
  80. private Date confirm_time;
  81. //付款时间
  82. private Date pay_time;
  83. //重商品额外费用
  84. private Integer freight_price;
  85. //使用的优惠券id
  86. private Integer coupon_id;
  87. //优惠券名称
  88. private String coupon_name;
  89. //
  90. private Integer parent_id;
  91. //优惠价格
  92. private BigDecimal coupon_price;
  93. //订单的商品
  94. private Integer goodsCount;
  95. //订单状态的处理
  96. private String order_status_text;
  97. //可操作的选项
  98. private Map handleOption;
  99. //订单满减
  100. private BigDecimal full_cut_price;
  101. // 订单类型 1:普通订单 2:团购订单
  102. private String order_type;
  103. // 活动id
  104. private Long activity_id;
  105. // 门店Id
  106. private Long store_id;
  107. // 送达时间
  108. @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  109. private Date delivery_date;
  110. // 送到说明
  111. private String delivery_remark;
  112. // 预计送达时间
  113. @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
  114. private Date predict_time;
  115. // 地址Id
  116. private Long address_id;
  117. //纬度
  118. private BigDecimal latitude;
  119. //经度
  120. private BigDecimal longitude;
  121. // 订单详情
  122. private List<OrderGoodsVo> goodsList;
  123. // 过期付款时间(下单时间,10分钟)
  124. private Long end_time;
  125. // 配送中的骑手位置
  126. private List<GeometryMarker> markers;
  127. private String payTransactionId;
  128. private String payMobile;
  129. private String merchSn;
  130. private String sku;
  131. private String orderBizType;
  132. private String buyerPayCheck;
  133. private String payFlag;
  134. private String createrSn;
  135. private Date createTime;
  136. private String moderSn;
  137. private Date modTime;
  138. private Date tstm;
  139. public String getSku() {
  140. return sku;
  141. }
  142. public void setSku(String sku) {
  143. this.sku = sku;
  144. }
  145. public String getPayTransactionId() {
  146. return payTransactionId;
  147. }
  148. public void setPayTransactionId(String payTransactionId) {
  149. this.payTransactionId = payTransactionId;
  150. }
  151. public String getPayMobile() {
  152. return payMobile;
  153. }
  154. public void setPayMobile(String payMobile) {
  155. this.payMobile = payMobile;
  156. }
  157. public String getMerchSn() {
  158. return merchSn;
  159. }
  160. public void setMerchSn(String merchSn) {
  161. this.merchSn = merchSn;
  162. }
  163. public String getOrderBizType() {
  164. return orderBizType;
  165. }
  166. public void setOrderBizType(String orderBizType) {
  167. this.orderBizType = orderBizType;
  168. }
  169. public String getBuyerPayCheck() {
  170. return buyerPayCheck;
  171. }
  172. public void setBuyerPayCheck(String buyerPayCheck) {
  173. this.buyerPayCheck = buyerPayCheck;
  174. }
  175. public String getPayFlag() {
  176. return payFlag;
  177. }
  178. public void setPayFlag(String payFlag) {
  179. this.payFlag = payFlag;
  180. }
  181. public String getCreaterSn() {
  182. return createrSn;
  183. }
  184. public void setCreaterSn(String createrSn) {
  185. this.createrSn = createrSn;
  186. }
  187. public Date getCreateTime() {
  188. return createTime;
  189. }
  190. public void setCreateTime(Date createTime) {
  191. this.createTime = createTime;
  192. }
  193. public String getModerSn() {
  194. return moderSn;
  195. }
  196. public void setModerSn(String moderSn) {
  197. this.moderSn = moderSn;
  198. }
  199. public Date getModTime() {
  200. return modTime;
  201. }
  202. public void setModTime(Date modTime) {
  203. this.modTime = modTime;
  204. }
  205. public Date getTstm() {
  206. return tstm;
  207. }
  208. public void setTstm(Date tstm) {
  209. this.tstm = tstm;
  210. }
  211. public Long getId() {
  212. return id;
  213. }
  214. public void setId(Long id) {
  215. this.id = id;
  216. }
  217. public String getOrder_sn() {
  218. return order_sn;
  219. }
  220. public void setOrder_sn(String order_sn) {
  221. this.order_sn = order_sn;
  222. }
  223. public Long getUser_id() {
  224. return user_id;
  225. }
  226. public void setUser_id(Long user_id) {
  227. this.user_id = user_id;
  228. }
  229. public Integer getOrder_status() {
  230. return order_status;
  231. }
  232. public void setOrder_status(Integer order_status) {
  233. this.order_status = order_status;
  234. }
  235. public Integer getShipping_status() {
  236. return shipping_status;
  237. }
  238. public void setShipping_status(Integer shipping_status) {
  239. this.shipping_status = shipping_status;
  240. }
  241. public Integer getPay_status() {
  242. return pay_status;
  243. }
  244. public void setPay_status(Integer pay_status) {
  245. this.pay_status = pay_status;
  246. }
  247. public String getConsignee() {
  248. return consignee;
  249. }
  250. public void setConsignee(String consignee) {
  251. this.consignee = consignee;
  252. }
  253. public String getCountry() {
  254. return country;
  255. }
  256. public void setCountry(String country) {
  257. this.country = country;
  258. }
  259. public String getProvince() {
  260. return province;
  261. }
  262. public void setProvince(String province) {
  263. this.province = province;
  264. }
  265. public String getCity() {
  266. return city;
  267. }
  268. public void setCity(String city) {
  269. this.city = city;
  270. }
  271. public String getDistrict() {
  272. return district;
  273. }
  274. public void setDistrict(String district) {
  275. this.district = district;
  276. }
  277. public String getAddress() {
  278. return address;
  279. }
  280. public void setAddress(String address) {
  281. this.address = address;
  282. }
  283. public String getMobile() {
  284. return mobile;
  285. }
  286. public void setMobile(String mobile) {
  287. this.mobile = mobile;
  288. }
  289. public String getPostscript() {
  290. return postscript;
  291. }
  292. public void setPostscript(String postscript) {
  293. this.postscript = postscript;
  294. }
  295. public Long getShipping_id() {
  296. return shipping_id;
  297. }
  298. public void setShipping_id(Long shipping_id) {
  299. this.shipping_id = shipping_id;
  300. }
  301. public String getShipping_name() {
  302. return shipping_name;
  303. }
  304. public void setShipping_name(String shipping_name) {
  305. this.shipping_name = shipping_name;
  306. }
  307. public String getPay_id() {
  308. return pay_id;
  309. }
  310. public void setPay_id(String pay_id) {
  311. this.pay_id = pay_id;
  312. }
  313. public String getPay_name() {
  314. return pay_name;
  315. }
  316. public void setPay_name(String pay_name) {
  317. this.pay_name = pay_name;
  318. }
  319. public BigDecimal getShipping_fee() {
  320. return shipping_fee;
  321. }
  322. public void setShipping_fee(BigDecimal shipping_fee) {
  323. this.shipping_fee = shipping_fee;
  324. }
  325. public BigDecimal getActual_price() {
  326. return actual_price;
  327. }
  328. public void setActual_price(BigDecimal actual_price) {
  329. this.actual_price = actual_price;
  330. }
  331. public Integer getIntegral() {
  332. return integral;
  333. }
  334. public void setIntegral(Integer integral) {
  335. this.integral = integral;
  336. }
  337. public BigDecimal getIntegral_money() {
  338. return integral_money;
  339. }
  340. public void setIntegral_money(BigDecimal integral_money) {
  341. this.integral_money = integral_money;
  342. }
  343. public BigDecimal getOrder_price() {
  344. return order_price;
  345. }
  346. public void setOrder_price(BigDecimal order_price) {
  347. this.order_price = order_price;
  348. }
  349. public BigDecimal getGoods_price() {
  350. return goods_price;
  351. }
  352. public void setGoods_price(BigDecimal goods_price) {
  353. this.goods_price = goods_price;
  354. }
  355. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  356. public Date getAdd_time() {
  357. return add_time;
  358. }
  359. public void setAdd_time(Date add_time) {
  360. this.add_time = add_time;
  361. }
  362. @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
  363. public Date getConfirm_time() {
  364. return confirm_time;
  365. }
  366. public void setConfirm_time(Date confirm_time) {
  367. this.confirm_time = confirm_time;
  368. }
  369. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  370. public Date getPay_time() {
  371. return pay_time;
  372. }
  373. public void setPay_time(Date pay_time) {
  374. this.pay_time = pay_time;
  375. }
  376. public Integer getFreight_price() {
  377. return freight_price;
  378. }
  379. public void setFreight_price(Integer freight_price) {
  380. this.freight_price = freight_price;
  381. }
  382. public Integer getCoupon_id() {
  383. return coupon_id;
  384. }
  385. public void setCoupon_id(Integer coupon_id) {
  386. this.coupon_id = coupon_id;
  387. }
  388. public Integer getParent_id() {
  389. return parent_id;
  390. }
  391. public void setParent_id(Integer parent_id) {
  392. this.parent_id = parent_id;
  393. }
  394. public BigDecimal getCoupon_price() {
  395. return coupon_price;
  396. }
  397. public void setCoupon_price(BigDecimal coupon_price) {
  398. this.coupon_price = coupon_price;
  399. }
  400. public Integer getGoodsCount() {
  401. return goodsCount;
  402. }
  403. public void setGoodsCount(Integer goodsCount) {
  404. this.goodsCount = goodsCount;
  405. }
  406. public String getOrder_status_text() {
  407. if (null != order_status && StringUtils.isEmpty(order_status_text)) {
  408. order_status_text = "未付款";
  409. switch (order_status) {
  410. case 0:
  411. order_status_text = "未付款";
  412. break;
  413. case 201:
  414. order_status_text = "等待发货";
  415. break;
  416. case 300:
  417. order_status_text = "待收货";
  418. break;
  419. case 301:
  420. order_status_text = "已完成";
  421. break;
  422. case 200:
  423. order_status_text = "已付款";
  424. break;
  425. case 101:
  426. order_status_text = "已取消";
  427. break;
  428. case 401:
  429. order_status_text = "已取消";
  430. break;
  431. case 402:
  432. order_status_text = "已退货";
  433. break;
  434. }
  435. }
  436. return order_status_text;
  437. }
  438. public void setOrder_status_text(String order_status_text) {
  439. this.order_status_text = order_status_text;
  440. }
  441. //
  442. public Map getHandleOption() {
  443. handleOption = new HashMap();
  444. handleOption.put("cancel", false);//取消操作
  445. handleOption.put("delete", false);//删除操作
  446. handleOption.put("pay", false);//支付操作
  447. handleOption.put("comment", false);//评论操作
  448. handleOption.put("delivery", false);//确认收货操作
  449. handleOption.put("confirm", false);//完成订单操作
  450. handleOption.put("return", false); //退换货操作
  451. handleOption.put("buy", false); //再次购买
  452. //订单流程: 下单成功-》支付订单-》发货-》收货-》评论
  453. //订单相关状态字段设计,采用单个字段表示全部的订单状态
  454. //1xx 表示订单取消和删除等状态 0订单创建成功等待付款, 101订单已取消, 102订单已删除
  455. //2xx 表示订单支付状态 201订单已付款,等待发货
  456. //3xx 表示订单物流相关状态 300订单已发货, 301用户确认收货
  457. //4xx 表示订单退换货相关的状态 401 没有发货,退款 402 已收货,退款退货
  458. //如果订单已经取消或是已完成,则可删除和再次购买
  459. if (order_status == 101) {
  460. // handleOption.put("delete", true);
  461. handleOption.put("buy", true);
  462. }
  463. //如果订单没有被取消,且没有支付,则可支付,可取消
  464. if (order_status == 0) {
  465. handleOption.put("cancel", true);
  466. handleOption.put("pay", true);
  467. }
  468. //如果订单已付款,没有发货,则可退款操作
  469. if (order_status == 201) {
  470. handleOption.put("cancel", true);
  471. }
  472. //如果订单已经发货,没有收货,则可收货操作和退款、退货操作
  473. if (order_status == 300) {
  474. // handleOption.put("cancel", true);
  475. handleOption.put("confirm", true);
  476. // handleOption.put("return", true);
  477. }
  478. //如果订单已经支付,且已经收货,则可完成交易、评论和再次购买
  479. if (order_status == 301) {
  480. handleOption.put("comment", true);
  481. handleOption.put("buy", true);
  482. }
  483. if (comment_count > 0) {
  484. handleOption.put("comment", false);
  485. }
  486. return handleOption;
  487. }
  488. public void setHandleOption(Map handleOption) {
  489. this.handleOption = handleOption;
  490. }
  491. public BigDecimal getFull_cut_price() {
  492. return full_cut_price;
  493. }
  494. public void setFull_cut_price(BigDecimal full_cut_price) {
  495. this.full_cut_price = full_cut_price;
  496. }
  497. public String getShipping_no() {
  498. return shipping_no;
  499. }
  500. public void setShipping_no(String shipping_no) {
  501. this.shipping_no = shipping_no;
  502. }
  503. public String getOrder_type() {
  504. return order_type;
  505. }
  506. public void setOrder_type(String order_type) {
  507. this.order_type = order_type;
  508. }
  509. public Long getActivity_id() {
  510. return activity_id;
  511. }
  512. public void setActivity_id(Long activity_id) {
  513. this.activity_id = activity_id;
  514. }
  515. public Long getStore_id() {
  516. return store_id;
  517. }
  518. public void setStore_id(Long store_id) {
  519. this.store_id = store_id;
  520. }
  521. public Date getDelivery_date() {
  522. return delivery_date;
  523. }
  524. public void setDelivery_date(Date delivery_date) {
  525. this.delivery_date = delivery_date;
  526. }
  527. public String getDelivery_remark() {
  528. return delivery_remark;
  529. }
  530. public void setDelivery_remark(String delivery_remark) {
  531. this.delivery_remark = delivery_remark;
  532. }
  533. public String getShipping_mobile() {
  534. return shipping_mobile;
  535. }
  536. public void setShipping_mobile(String shipping_mobile) {
  537. this.shipping_mobile = shipping_mobile;
  538. }
  539. public String getShipping_code() {
  540. return shipping_code;
  541. }
  542. public void setShipping_code(String shipping_code) {
  543. this.shipping_code = shipping_code;
  544. }
  545. public Date getPredict_time() {
  546. return predict_time;
  547. }
  548. public void setPredict_time(Date predict_time) {
  549. this.predict_time = predict_time;
  550. }
  551. public Long getAddress_id() {
  552. return address_id;
  553. }
  554. public void setAddress_id(Long address_id) {
  555. this.address_id = address_id;
  556. }
  557. public BigDecimal getLatitude() {
  558. return latitude;
  559. }
  560. public void setLatitude(BigDecimal latitude) {
  561. this.latitude = latitude;
  562. }
  563. public BigDecimal getLongitude() {
  564. return longitude;
  565. }
  566. public void setLongitude(BigDecimal longitude) {
  567. this.longitude = longitude;
  568. }
  569. public List<OrderGoodsVo> getGoodsList() {
  570. return goodsList;
  571. }
  572. public void setGoodsList(List<OrderGoodsVo> goodsList) {
  573. this.goodsList = goodsList;
  574. }
  575. public String getCoupon_name() {
  576. return coupon_name;
  577. }
  578. public void setCoupon_name(String coupon_name) {
  579. this.coupon_name = coupon_name;
  580. }
  581. public Long getEnd_time() {
  582. if (getOrder_status() == 0) {
  583. end_time = getAdd_time().getTime() + 60 * 10 * 1000;
  584. }
  585. return end_time;
  586. }
  587. public void setEnd_time(Long end_time) {
  588. this.end_time = end_time;
  589. }
  590. public List<GeometryMarker> getMarkers() {
  591. return markers;
  592. }
  593. public void pushMarkers(GeometryMarker marker) {
  594. if (null == this.markers) {
  595. this.markers = new ArrayList();
  596. }
  597. this.markers.add(marker);
  598. }
  599. public Integer getComment_count() {
  600. return comment_count;
  601. }
  602. public void setComment_count(Integer comment_count) {
  603. this.comment_count = comment_count;
  604. }
  605. }