123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- /*
- *
- *
- *
- */
- package com.hboxs.entity;
- import com.fasterxml.jackson.annotation.JsonValue;
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.SequenceGenerator;
- import javax.persistence.Table;
- import java.math.BigDecimal;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.Map;
- /**
- * Entity - 订单流水
- */
- @Entity
- @Table(name = "t_order")
- @SequenceGenerator(name = "sequenceGenerator", sequenceName = "t_order_sequence")
- public class Order extends BaseEntity {
- private static final long serialVersionUID = -6614222055528827322L;
- public Order(){
- super();
- }
- public Order(String sn , Long productId, String productName, BigDecimal price, String clientId, Long equipmentId, Type type , Long adminId,
- Long agencyId , Long merchantId , Long personageId ,
- String frp_code, String altInfo, BigDecimal adminProportion, BigDecimal agencyProportion,
- BigDecimal merchantProportion, BigDecimal personageProportion, Status status) {
- this.sn = sn;
- this.productId = productId;
- this.productName = productName;
- this.price = price;
- this.clientId = clientId;
- this.equipmentId = equipmentId;
- this.adminId = adminId;
- this.type = type;
- this.agencyId = agencyId;
- this.merchantId = merchantId;
- this.personageId = personageId;
- this.frp_code = frp_code;
- this.altInfo = altInfo;
- this.adminProportion = adminProportion;
- this.agencyProportion = agencyProportion;
- this.merchantProportion = merchantProportion;
- this.personageProportion = personageProportion;
- this.status = status;
- }
- /**
- * 订单编号
- */
- private String sn;
- /**
- * 商品id
- */
- private Long productId;
- /**
- * 花型名称
- */
- private String productName;
- /**
- * 价格
- */
- private BigDecimal price;
- /**
- * 设备推送码
- */
- private String clientId;
- /**
- * 备注
- */
- private String note;
- /**
- * 设备id
- */
- private Long equipmentId;
- /**
- * 所属商家id
- */
- private Long adminId;
- /**
- * 类型
- */
- public enum Type {
- /**
- * 管理员
- */
- admin,
- /**
- * 代理商
- */
- agency,
- /**
- * 经销商
- */
- merchant,
- /**
- * 个人商家
- */
- personage;
- private static Map<String, Type> map = new HashMap<>();
- static {
- map.put("管理员", admin);
- map.put("省级", agency);
- map.put("市级", merchant);
- map.put("终端", personage);
- }
- public static Type forValue(String value) {
- return map.get(value);
- }
- @JsonValue
- public String toValue() {
- for (Map.Entry<String, Type> entry : map.entrySet()) {
- if (entry.getValue() == this) {
- return entry.getKey();
- }
- }
- return "";
- }
- }
- /**
- * 商家类型
- */
- private Type type;
- /**
- * 代理商id
- */
- private Long agencyId;
- /**
- * 经销商id
- */
- private Long merchantId;
- /**
- * 个人商家id
- */
- private Long personageId;
- /**
- * 支付方式
- */
- private String frp_code;
- /**
- * 分销逻辑
- */
- private String altInfo;
- /**
- * 支付时间
- */
- private Date payDate;
- /**
- * 退款时间
- */
- private Date refundDate;
- /**
- * 支付流水号
- */
- private String trxNo;
- /**
- * 退款流水号
- */
- private String refundTrxNo;
- /**
- * 退款金额
- */
- private BigDecimal refundAmount;
- /**
- * 申请支付时分销的逻辑:admin比例
- */
- private BigDecimal adminProportion;
- /**
- * 申请支付时分销的逻辑:代理比例
- */
- private BigDecimal agencyProportion;
- /**
- * 申请支付时分销的逻辑:商家比例
- */
- private BigDecimal merchantProportion;
- /**
- * 申请支付时分销的逻辑:个人商家比例
- */
- private BigDecimal personageProportion;
- /**
- * 状态
- */
- public enum Status {
- /**
- * 未支付
- */
- unpay,
- /**
- * 已支付
- */
- pay,
- /**
- * 退款中:短暂状态
- */
- applyRefund,
- /**
- * 已退款
- */
- refund;
- private static Map<String, Status> map = new HashMap<>();
- static {
- map.put("未支付", unpay);
- map.put("已支付", pay);
- map.put("退款中", applyRefund);
- map.put("已退款", refund);
- }
- public static Status forValue(String value) {
- return map.get(value);
- }
- @JsonValue
- public String toValue() {
- for (Map.Entry<String, Status> entry : map.entrySet()) {
- if (entry.getValue() == this) {
- return entry.getKey();
- }
- }
- return "";
- }
- }
- /**
- * 状态
- */
- private Status status;
- @Column(nullable = false, updatable = false, unique = true, length = 100)
- public String getSn() {
- return sn;
- }
- public void setSn(String sn) {
- this.sn = sn;
- }
- public String getNote() {
- return note;
- }
- public void setNote(String note) {
- this.note = note;
- }
- public String getProductName() {
- return productName;
- }
- public void setProductName(String productName) {
- this.productName = productName;
- }
- public BigDecimal getPrice() {
- return price;
- }
- public void setPrice(BigDecimal price) {
- this.price = price;
- }
- public String getClientId() {
- return clientId;
- }
- public void setClientId(String clientId) {
- this.clientId = clientId;
- }
- public Long getEquipmentId() {
- return equipmentId;
- }
- public void setEquipmentId(Long equipmentId) {
- this.equipmentId = equipmentId;
- }
- public Long getAdminId() {
- return adminId;
- }
- public void setAdminId(Long adminId) {
- this.adminId = adminId;
- }
- public String getFrp_code() {
- return frp_code;
- }
- public void setFrp_code(String frp_code) {
- this.frp_code = frp_code;
- }
- public String getAltInfo() {
- return altInfo;
- }
- public void setAltInfo(String altInfo) {
- this.altInfo = altInfo;
- }
- public Status getStatus() {
- return status;
- }
- public void setStatus(Status status) {
- this.status = status;
- }
- public Long getProductId() {
- return productId;
- }
- public void setProductId(Long productId) {
- this.productId = productId;
- }
- public BigDecimal getAdminProportion() {
- return adminProportion;
- }
- public void setAdminProportion(BigDecimal adminProportion) {
- this.adminProportion = adminProportion;
- }
- public BigDecimal getAgencyProportion() {
- return agencyProportion;
- }
- public void setAgencyProportion(BigDecimal agencyProportion) {
- this.agencyProportion = agencyProportion;
- }
- public BigDecimal getMerchantProportion() {
- return merchantProportion;
- }
- public void setMerchantProportion(BigDecimal merchantProportion) {
- this.merchantProportion = merchantProportion;
- }
- public BigDecimal getPersonageProportion() {
- return personageProportion;
- }
- public void setPersonageProportion(BigDecimal personageProportion) {
- this.personageProportion = personageProportion;
- }
- public Type getType() {
- return type;
- }
- public void setType(Type type) {
- this.type = type;
- }
- public Long getAgencyId() {
- return agencyId;
- }
- public void setAgencyId(Long agencyId) {
- this.agencyId = agencyId;
- }
- public Long getMerchantId() {
- return merchantId;
- }
- public void setMerchantId(Long merchantId) {
- this.merchantId = merchantId;
- }
- public Long getPersonageId() {
- return personageId;
- }
- public void setPersonageId(Long personageId) {
- this.personageId = personageId;
- }
- public Date getPayDate() {
- return payDate;
- }
- public void setPayDate(Date payDate) {
- this.payDate = payDate;
- }
- public Date getRefundDate() {
- return refundDate;
- }
- public void setRefundDate(Date refundDate) {
- this.refundDate = refundDate;
- }
- public String getTrxNo() {
- return trxNo;
- }
- public void setTrxNo(String trxNo) {
- this.trxNo = trxNo;
- }
- public String getRefundTrxNo() {
- return refundTrxNo;
- }
- public void setRefundTrxNo(String refundTrxNo) {
- this.refundTrxNo = refundTrxNo;
- }
- public BigDecimal getRefundAmount() {
- return refundAmount;
- }
- public void setRefundAmount(BigDecimal refundAmount) {
- this.refundAmount = refundAmount;
- }
- }
|