OrderVo.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  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. private String merchOrderSn;
  140. private String isScan;
  141. private String storeName;
  142. private Boolean isRefundStatus;
  143. private String refundStatus;
  144. public void setRefundStatus(String refundStatus) {
  145. this.refundStatus = refundStatus;
  146. }
  147. public String getRefundStatus() {
  148. return refundStatus;
  149. }
  150. public Boolean getIsRefundStatus() {
  151. return isRefundStatus;
  152. }
  153. public void setIsRefundStatus(Boolean refundStatus) {
  154. isRefundStatus = refundStatus;
  155. }
  156. public String getStoreName() {
  157. return storeName;
  158. }
  159. public void setStoreName(String storeName) {
  160. this.storeName = storeName;
  161. }
  162. public String getIsScan() {
  163. return isScan;
  164. }
  165. public void setIsScan(String isScan) {
  166. this.isScan = isScan;
  167. }
  168. public String getMerchOrderSn() {
  169. return merchOrderSn;
  170. }
  171. public void setMerchOrderSn(String merchOrderSn) {
  172. this.merchOrderSn = merchOrderSn;
  173. }
  174. public String getSku() {
  175. return sku;
  176. }
  177. public void setSku(String sku) {
  178. this.sku = sku;
  179. }
  180. public String getPayTransactionId() {
  181. return payTransactionId;
  182. }
  183. public void setPayTransactionId(String payTransactionId) {
  184. this.payTransactionId = payTransactionId;
  185. }
  186. public String getPayMobile() {
  187. return payMobile;
  188. }
  189. public void setPayMobile(String payMobile) {
  190. this.payMobile = payMobile;
  191. }
  192. public String getMerchSn() {
  193. return merchSn;
  194. }
  195. public void setMerchSn(String merchSn) {
  196. this.merchSn = merchSn;
  197. }
  198. public String getOrderBizType() {
  199. return orderBizType;
  200. }
  201. public void setOrderBizType(String orderBizType) {
  202. this.orderBizType = orderBizType;
  203. }
  204. public String getBuyerPayCheck() {
  205. return buyerPayCheck;
  206. }
  207. public void setBuyerPayCheck(String buyerPayCheck) {
  208. this.buyerPayCheck = buyerPayCheck;
  209. }
  210. public String getPayFlag() {
  211. return payFlag;
  212. }
  213. public void setPayFlag(String payFlag) {
  214. this.payFlag = payFlag;
  215. }
  216. public String getCreaterSn() {
  217. return createrSn;
  218. }
  219. public void setCreaterSn(String createrSn) {
  220. this.createrSn = createrSn;
  221. }
  222. public Date getCreateTime() {
  223. return createTime;
  224. }
  225. public void setCreateTime(Date createTime) {
  226. this.createTime = createTime;
  227. }
  228. public String getModerSn() {
  229. return moderSn;
  230. }
  231. public void setModerSn(String moderSn) {
  232. this.moderSn = moderSn;
  233. }
  234. public Date getModTime() {
  235. return modTime;
  236. }
  237. public void setModTime(Date modTime) {
  238. this.modTime = modTime;
  239. }
  240. public Date getTstm() {
  241. return tstm;
  242. }
  243. public void setTstm(Date tstm) {
  244. this.tstm = tstm;
  245. }
  246. public Long getId() {
  247. return id;
  248. }
  249. public void setId(Long id) {
  250. this.id = id;
  251. }
  252. public String getOrder_sn() {
  253. return order_sn;
  254. }
  255. public void setOrder_sn(String order_sn) {
  256. this.order_sn = order_sn;
  257. }
  258. public Long getUser_id() {
  259. return user_id;
  260. }
  261. public void setUser_id(Long user_id) {
  262. this.user_id = user_id;
  263. }
  264. public Integer getOrder_status() {
  265. return order_status;
  266. }
  267. public void setOrder_status(Integer order_status) {
  268. this.order_status = order_status;
  269. }
  270. public Integer getShipping_status() {
  271. return shipping_status;
  272. }
  273. public void setShipping_status(Integer shipping_status) {
  274. this.shipping_status = shipping_status;
  275. }
  276. public Integer getPay_status() {
  277. return pay_status;
  278. }
  279. public void setPay_status(Integer pay_status) {
  280. this.pay_status = pay_status;
  281. }
  282. public String getConsignee() {
  283. return consignee;
  284. }
  285. public void setConsignee(String consignee) {
  286. this.consignee = consignee;
  287. }
  288. public String getCountry() {
  289. return country;
  290. }
  291. public void setCountry(String country) {
  292. this.country = country;
  293. }
  294. public String getProvince() {
  295. return province;
  296. }
  297. public void setProvince(String province) {
  298. this.province = province;
  299. }
  300. public String getCity() {
  301. return city;
  302. }
  303. public void setCity(String city) {
  304. this.city = city;
  305. }
  306. public String getDistrict() {
  307. return district;
  308. }
  309. public void setDistrict(String district) {
  310. this.district = district;
  311. }
  312. public String getAddress() {
  313. return address;
  314. }
  315. public void setAddress(String address) {
  316. this.address = address;
  317. }
  318. public String getMobile() {
  319. return mobile;
  320. }
  321. public void setMobile(String mobile) {
  322. this.mobile = mobile;
  323. }
  324. public String getPostscript() {
  325. return postscript;
  326. }
  327. public void setPostscript(String postscript) {
  328. this.postscript = postscript;
  329. }
  330. public Long getShipping_id() {
  331. return shipping_id;
  332. }
  333. public void setShipping_id(Long shipping_id) {
  334. this.shipping_id = shipping_id;
  335. }
  336. public String getShipping_name() {
  337. return shipping_name;
  338. }
  339. public void setShipping_name(String shipping_name) {
  340. this.shipping_name = shipping_name;
  341. }
  342. public String getPay_id() {
  343. return pay_id;
  344. }
  345. public void setPay_id(String pay_id) {
  346. this.pay_id = pay_id;
  347. }
  348. public String getPay_name() {
  349. return pay_name;
  350. }
  351. public void setPay_name(String pay_name) {
  352. this.pay_name = pay_name;
  353. }
  354. public BigDecimal getShipping_fee() {
  355. return shipping_fee;
  356. }
  357. public void setShipping_fee(BigDecimal shipping_fee) {
  358. this.shipping_fee = shipping_fee;
  359. }
  360. public BigDecimal getActual_price() {
  361. return actual_price;
  362. }
  363. public void setActual_price(BigDecimal actual_price) {
  364. this.actual_price = actual_price;
  365. }
  366. public Integer getIntegral() {
  367. return integral;
  368. }
  369. public void setIntegral(Integer integral) {
  370. this.integral = integral;
  371. }
  372. public BigDecimal getIntegral_money() {
  373. return integral_money;
  374. }
  375. public void setIntegral_money(BigDecimal integral_money) {
  376. this.integral_money = integral_money;
  377. }
  378. public BigDecimal getOrder_price() {
  379. return order_price;
  380. }
  381. public void setOrder_price(BigDecimal order_price) {
  382. this.order_price = order_price;
  383. }
  384. public BigDecimal getGoods_price() {
  385. return goods_price;
  386. }
  387. public void setGoods_price(BigDecimal goods_price) {
  388. this.goods_price = goods_price;
  389. }
  390. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  391. public Date getAdd_time() {
  392. return add_time;
  393. }
  394. public void setAdd_time(Date add_time) {
  395. this.add_time = add_time;
  396. }
  397. @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
  398. public Date getConfirm_time() {
  399. return confirm_time;
  400. }
  401. public void setConfirm_time(Date confirm_time) {
  402. this.confirm_time = confirm_time;
  403. }
  404. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  405. public Date getPay_time() {
  406. return pay_time;
  407. }
  408. public void setPay_time(Date pay_time) {
  409. this.pay_time = pay_time;
  410. }
  411. public Integer getFreight_price() {
  412. return freight_price;
  413. }
  414. public void setFreight_price(Integer freight_price) {
  415. this.freight_price = freight_price;
  416. }
  417. public Integer getCoupon_id() {
  418. return coupon_id;
  419. }
  420. public void setCoupon_id(Integer coupon_id) {
  421. this.coupon_id = coupon_id;
  422. }
  423. public Integer getParent_id() {
  424. return parent_id;
  425. }
  426. public void setParent_id(Integer parent_id) {
  427. this.parent_id = parent_id;
  428. }
  429. public BigDecimal getCoupon_price() {
  430. return coupon_price;
  431. }
  432. public void setCoupon_price(BigDecimal coupon_price) {
  433. this.coupon_price = coupon_price;
  434. }
  435. public Integer getGoodsCount() {
  436. return goodsCount;
  437. }
  438. public void setGoodsCount(Integer goodsCount) {
  439. this.goodsCount = goodsCount;
  440. }
  441. public String getOrder_status_text() {
  442. if (null != order_status && StringUtils.isEmpty(order_status_text)) {
  443. order_status_text = "未付款";
  444. switch (order_status) {
  445. case 0:
  446. order_status_text = "未付款";
  447. break;
  448. case 201:
  449. order_status_text = "等待发货";
  450. break;
  451. case 300:
  452. order_status_text = "待收货";
  453. break;
  454. case 301:
  455. order_status_text = "已完成";
  456. break;
  457. case 200:
  458. order_status_text = "已付款";
  459. break;
  460. case 101:
  461. order_status_text = "已取消";
  462. break;
  463. case 401:
  464. order_status_text = "已退款";
  465. break;
  466. case 402:
  467. order_status_text = "已退货";
  468. break;
  469. }
  470. }
  471. return order_status_text;
  472. }
  473. public void setOrder_status_text(String order_status_text) {
  474. this.order_status_text = order_status_text;
  475. }
  476. //
  477. public Map getHandleOption() {
  478. handleOption = new HashMap();
  479. handleOption.put("cancel", false);//取消操作
  480. handleOption.put("delete", false);//删除操作
  481. handleOption.put("pay", false);//支付操作
  482. handleOption.put("comment", false);//评论操作
  483. handleOption.put("delivery", false);//确认收货操作
  484. handleOption.put("confirm", false);//完成订单操作
  485. handleOption.put("return", false); //退换货操作
  486. handleOption.put("buy", false); //再次购买
  487. //订单流程: 下单成功-》支付订单-》发货-》收货-》评论
  488. //订单相关状态字段设计,采用单个字段表示全部的订单状态
  489. //1xx 表示订单取消和删除等状态 0订单创建成功等待付款, 101订单已取消, 102订单已删除
  490. //2xx 表示订单支付状态 201订单已付款,等待发货
  491. //3xx 表示订单物流相关状态 300订单已发货, 301用户确认收货
  492. //4xx 表示订单退换货相关的状态 401 没有发货,退款 402 已收货,退款退货
  493. //如果订单已经取消或是已完成,则可删除和再次购买
  494. if (order_status == 101) {
  495. // handleOption.put("delete", true);
  496. handleOption.put("buy", true);
  497. }
  498. //如果订单没有被取消,且没有支付,则可支付,可取消
  499. if (order_status == 0) {
  500. handleOption.put("cancel", true);
  501. handleOption.put("pay", true);
  502. }
  503. //如果订单已付款,没有发货,则可退款操作
  504. if (order_status == 201) {
  505. handleOption.put("cancel", true);
  506. }
  507. //如果订单已经发货,没有收货,则可收货操作和退款、退货操作
  508. if (order_status == 300) {
  509. // handleOption.put("cancel", true);
  510. handleOption.put("confirm", true);
  511. // handleOption.put("return", true);
  512. }
  513. //如果订单已经支付,且已经收货,则可完成交易、评论和再次购买
  514. if (order_status == 301) {
  515. handleOption.put("comment", true);
  516. handleOption.put("buy", true);
  517. }
  518. if (comment_count > 0) {
  519. handleOption.put("comment", false);
  520. }
  521. return handleOption;
  522. }
  523. public void setHandleOption(Map handleOption) {
  524. this.handleOption = handleOption;
  525. }
  526. public BigDecimal getFull_cut_price() {
  527. return full_cut_price;
  528. }
  529. public void setFull_cut_price(BigDecimal full_cut_price) {
  530. this.full_cut_price = full_cut_price;
  531. }
  532. public String getShipping_no() {
  533. return shipping_no;
  534. }
  535. public void setShipping_no(String shipping_no) {
  536. this.shipping_no = shipping_no;
  537. }
  538. public String getOrder_type() {
  539. return order_type;
  540. }
  541. public void setOrder_type(String order_type) {
  542. this.order_type = order_type;
  543. }
  544. public Long getActivity_id() {
  545. return activity_id;
  546. }
  547. public void setActivity_id(Long activity_id) {
  548. this.activity_id = activity_id;
  549. }
  550. public Long getStore_id() {
  551. return store_id;
  552. }
  553. public void setStore_id(Long store_id) {
  554. this.store_id = store_id;
  555. }
  556. public Date getDelivery_date() {
  557. return delivery_date;
  558. }
  559. public void setDelivery_date(Date delivery_date) {
  560. this.delivery_date = delivery_date;
  561. }
  562. public String getDelivery_remark() {
  563. return delivery_remark;
  564. }
  565. public void setDelivery_remark(String delivery_remark) {
  566. this.delivery_remark = delivery_remark;
  567. }
  568. public String getShipping_mobile() {
  569. return shipping_mobile;
  570. }
  571. public void setShipping_mobile(String shipping_mobile) {
  572. this.shipping_mobile = shipping_mobile;
  573. }
  574. public String getShipping_code() {
  575. return shipping_code;
  576. }
  577. public void setShipping_code(String shipping_code) {
  578. this.shipping_code = shipping_code;
  579. }
  580. public Date getPredict_time() {
  581. return predict_time;
  582. }
  583. public void setPredict_time(Date predict_time) {
  584. this.predict_time = predict_time;
  585. }
  586. public Long getAddress_id() {
  587. return address_id;
  588. }
  589. public void setAddress_id(Long address_id) {
  590. this.address_id = address_id;
  591. }
  592. public BigDecimal getLatitude() {
  593. return latitude;
  594. }
  595. public void setLatitude(BigDecimal latitude) {
  596. this.latitude = latitude;
  597. }
  598. public BigDecimal getLongitude() {
  599. return longitude;
  600. }
  601. public void setLongitude(BigDecimal longitude) {
  602. this.longitude = longitude;
  603. }
  604. public List<OrderGoodsVo> getGoodsList() {
  605. return goodsList;
  606. }
  607. public void setGoodsList(List<OrderGoodsVo> goodsList) {
  608. this.goodsList = goodsList;
  609. }
  610. public String getCoupon_name() {
  611. return coupon_name;
  612. }
  613. public void setCoupon_name(String coupon_name) {
  614. this.coupon_name = coupon_name;
  615. }
  616. public Long getEnd_time() {
  617. if (getOrder_status() == 0) {
  618. end_time = getAdd_time().getTime() + 60 * 10 * 1000;
  619. }
  620. return end_time;
  621. }
  622. public void setEnd_time(Long end_time) {
  623. this.end_time = end_time;
  624. }
  625. public List<GeometryMarker> getMarkers() {
  626. return markers;
  627. }
  628. public void pushMarkers(GeometryMarker marker) {
  629. if (null == this.markers) {
  630. this.markers = new ArrayList();
  631. }
  632. this.markers.add(marker);
  633. }
  634. public Integer getComment_count() {
  635. return comment_count;
  636. }
  637. public void setComment_count(Integer comment_count) {
  638. this.comment_count = comment_count;
  639. }
  640. }