OrderVo.java 20 KB

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