package com.yonge.cooleshow.biz.dal.wrapper;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import com.yonge.cooleshow.biz.dal.entity.UserOrder;
import com.yonge.cooleshow.biz.dal.entity.UserOrderDetail;
import com.yonge.cooleshow.biz.dal.entity.UserOrderPayment;
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
import com.yonge.cooleshow.biz.dal.enums.GoodTypeEnum;
import com.yonge.cooleshow.biz.dal.enums.OrderStatusEnum;
import com.yonge.cooleshow.biz.dal.enums.OrderTypeEnum;
import com.yonge.cooleshow.common.enums.EPayerType;
import com.yonge.cooleshow.common.enums.EPaymentVersion;
import com.yonge.cooleshow.common.enums.payment.EGoodsType;
import com.yonge.cooleshow.common.enums.payment.EPaymentStatus;
import com.yonge.cooleshow.common.enums.payment.EPaymentType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

/**
 * 平台订单表
 * 2022-12-20 19:09:34
 */
@ApiModel(value = "UserPaymentOrderWrapper对象", description = "平台订单表查询对象")
public class UserPaymentOrderWrapper {

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" UserPaymentOrderQuery-平台订单表")
    public static class UserPaymentOrderQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;


        @ApiModelProperty("订单支付状态")
        private List<OrderStatusEnum> paymentStatus;

        @ApiModelProperty("订单结束时间")
        private Date endTime;


        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static UserPaymentOrderQuery from(String json) {
            return JSON.parseObject(json, UserPaymentOrderQuery.class);
        }

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" UserPaymentOrderQuery-平台订单表")
    public static class UserPaymentOrderExportQuery {

        @ApiModelProperty("城市编码")
        private Integer cityCode;

        @ApiModelProperty("学校名称")
        private String schoolName;

        @ApiModelProperty("学员编号、姓名、手机号")
        private String userKeyword;

        @ApiModelProperty("审核人")
        private Long auditUserId;

        @ApiModelProperty("申请开始时间")
        private Date refundStartTime;

        @ApiModelProperty("申请结束时间")
        private Date refundEndTime;

        @ApiModelProperty("订单编号")
        private String orderNo;

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public String getUserKeyword() {
            return Optional.ofNullable(userKeyword).filter(StringUtils::isNotBlank).orElse(null);
        }

        public static UserPaymentOrderQuery from(String json) {
            return JSON.parseObject(json, UserPaymentOrderQuery.class);
        }
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" UserPaymentOrderQuery-平台订单表")
    public static class StudentOrderQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        @ApiModelProperty("订单状态")
        private String orderStatus;

        @ApiModelProperty("用户Id")
        private Long userId;

        @ApiModelProperty("订单支付时间（yyyy-mm）")
        private String payMonth;
    }

    @Data
    @ApiModel(" UserPaymentApplyOrder-平台订单表")
    public static class UserPaymentApplyOrder {

        @ApiModelProperty("业务编号")
        private String bizId;

        @ApiModelProperty("用户Id")
        private Long userId;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" UserPaymentOrder-平台订单表")
    public static class UserPaymentOrder {

        @ApiModelProperty("主键")
        private Long id;

        @ApiModelProperty("支付类型: adapay, wxpay")
        private String paymentType;

        @ApiModelProperty("支付厂商")
        private String paymentVendor;

        @ApiModelProperty("支付厂商名")
        private String paymentVenderName;

        @ApiModelProperty("优惠券Id；多个使用，隔开")
        private String couponIds;

        @ApiModelProperty(value = "推荐用户id(有推荐人的情况)")
        private Long recomUserId;

        @ApiModelProperty(value = "活动id(有活动的情况)")
        private Long activityId;

        @ApiModelProperty(value = "活动奖品id(有活动的情况)")
        private Long rewardId;

        @ApiModelProperty("支付商户号")
        private String paymentMerchantNo;

        @ApiModelProperty("支付商户号appid")
        private String paymentAppId;

        @ApiModelProperty("支付渠道")
        private String paymentChannel;

        @ApiModelProperty("用户身份")
        private ClientEnum paymentClient;

        @ApiModelProperty("用户编号")
        private Long userId;


        @ApiModelProperty("机构ID ")
        private Long tenantId;

        @ApiModelProperty("商户订单号")
        private String orderNo;

        @ApiModelProperty("交易流水号")
        private String transNo;

        @ApiModelProperty("业务类型Id，学校编号")
        private String bizId;

        @ApiModelProperty("订单类型")
        private EPaymentType orderType;

        @ApiModelProperty("订单状态")
        private EPaymentStatus status;

        @ApiModelProperty("原价")
        private BigDecimal originalPrice;

        @ApiModelProperty("现价")
        private BigDecimal currentPrice;

        @ApiModelProperty("支付现金金额")
        private BigDecimal paymentCashAmount;

        @ApiModelProperty("支付优惠金额")
        private BigDecimal paymentCouponAmount;

        @ApiModelProperty("支付通道费用")
        private BigDecimal paymentChannelFee;

        @ApiModelProperty("订单名称")
        private String orderName;

        @ApiModelProperty("订单描述信息")
        private String orderDesc;

        @ApiModelProperty("用户备注")
        private String userNote;

        @ApiModelProperty("支付拉起时间")
        private Date transPayTime;

        @ApiModelProperty("支付时间")
        private Date payTime;

        @ApiModelProperty("原因")
        private String errorMsg;


        @ApiModelProperty("更新时间")
        private Date updateTime;

        @ApiModelProperty("下单时间")
        private Date createTime;


        @ApiModelProperty("实际价格 ")
        private BigDecimal actualPrice;


        @ApiModelProperty("商品信息")
        private List<OrderGoodsInfo> goodsInfos;


        @ApiModelProperty("支付配置参数")
        private PaymentConfig paymentConfig;


        @ApiModelProperty("支付消息通知")
        private Boolean paymentMessage;

        @ApiModelProperty("取消支付标记")
        private Boolean cancelPayment;

        @ApiModelProperty("取消支付限制剩余时长")
        private Long cancelTimes;


        public static UserPaymentOrder from(UserOrder userOrder, UserOrderPayment userOrderPayment) {
            if (userOrder == null) {
                return null;
            }
            if (userOrderPayment == null) {
                userOrderPayment = new UserOrderPayment();
            }
            return UserPaymentOrder.builder()
                    .id(userOrder.getId())
                    .paymentType(userOrder.getPaymentVendor())
                    .paymentVendor(userOrder.getPaymentVendor())
                    .paymentChannel(userOrder.getPaymentChannel())
                    .paymentClient(userOrder.getOrderClient())
                    .userId(userOrder.getUserId())
                    .orderNo(userOrder.getOrderNo())
                    .transNo(userOrderPayment.getTransNo())
                    .tenantId(userOrder.getTenantId())
                    .orderType(EPaymentType.valueOf(userOrder.getOrderType().name()))
                    .status(OrderStatusEnum.parse(userOrder.getStatus()))
                    .originalPrice(userOrder.getOriginalPrice())
                    .currentPrice(userOrder.getExpectPrice())
                    .paymentCashAmount(userOrder.getActualPrice())
                    .paymentCouponAmount(userOrder.getCouponAmount())
                    .paymentChannelFee(userOrderPayment.getFeeAmt())
                    .orderName(userOrder.getOrderName())
                    .orderDesc(userOrder.getOrderDesc())
                    .userNote(userOrder.getUserNote())
                    .transPayTime(userOrderPayment.getCreateTime())
                    .payTime(userOrder.getPayTime())
                    .errorMsg(userOrderPayment.getPayFailMsg())
                    .updateTime(userOrder.getUpdateTime())
                    .createTime(userOrder.getCreateTime())
                    .actualPrice(userOrder.getActualPrice())
                    .paymentMessage(null)
                    .cancelPayment(null)
                    .cancelTimes(null)
                    .recomUserId(userOrder.getRecomUserId())
                    .activityId(userOrder.getActivityId())
                    .rewardId(userOrder.getRewardId())
                    .build();
        }

        // 转 UserOrder
        public UserOrder toUserOrder() {
            return UserOrder.builder()
                    .id(getId())
                    .paymentVendor(getPaymentVendor())
                    .paymentChannel(getPaymentChannel())
                    .paymentAppId(getPaymentAppId())
                    .orderClient(getPaymentClient())
                    .userId(getUserId())
                    .orderNo(getOrderNo())
                    .orderType(getOrderType() != null ? OrderTypeEnum.valueOf(getOrderType().name()) : null)
                    .status(getStatus() != null ? OrderStatusEnum.parse(getStatus()) : null)
                    .originalPrice(getOriginalPrice())
                    .expectPrice(getCurrentPrice())
                    .actualPrice(getPaymentCashAmount())
                    .couponAmount(getPaymentCouponAmount())
                    .orderName(getOrderName())
                    .orderDesc(getOrderDesc())
                    .userNote(getUserNote())
                    .payTime(getPayTime())
                    .updateTime(getUpdateTime())
                    .createTime(getCreateTime())
                    .recomUserId(getRecomUserId())
                    .activityId(getActivityId())
                    .rewardId(getRewardId())
                    .tenantId(getTenantId())
                    .build();
        }

        public Boolean getCancelPayment() {
            if (EPaymentStatus.PAYING == getStatus() && Objects.nonNull(getTransPayTime())) {
                // 超过1分钟，才可以取消订单
                return getTransPayTime().getTime() + 65 * 1000 < System.currentTimeMillis();
            }
            return Optional.ofNullable(cancelPayment).orElse(true);
        }

        public Long getCancelTimes() {
            if (!getCancelPayment() && Objects.nonNull(getTransPayTime())) {
                // 超过1分钟，才可以取消订单
                return getTransPayTime().getTime() + 65 * 1000 - System.currentTimeMillis();
            }
            return Optional.ofNullable(cancelTimes).orElse(0L);
        }

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static UserPaymentOrder from(String json) {
            return JSON.parseObject(json, UserPaymentOrder.class);
        }


        public void setPayTime(Long payTime) {

            if (Objects.nonNull(payTime)) {
                // 时间戳精度为毫秒，自动*1000
                if (payTime.toString().length() <= 10) {
                    payTime *= 1000;
                }
                this.payTime = new Date(payTime);
            }
        }

        public UserPaymentOrder paymentChannelFee(BigDecimal paymentChannelFee) {
            this.paymentChannelFee = paymentChannelFee;
            return this;
        }

        public UserPaymentOrder payTime(Date payTime) {
            this.payTime = payTime;
            return this;
        }

        public UserPaymentOrder paymentVender(String paymentVender) {
            if (StringUtils.isBlank(this.paymentVendor)) {
                this.paymentVendor = paymentVender;
            }
            return this;
        }

        public UserPaymentOrder paymentChannel(String paymentChannel) {
            this.paymentChannel = paymentChannel;
            return this;
        }

        public UserPaymentOrder paymentClient(ClientEnum paymentClient) {
            this.paymentClient = paymentClient;
            return this;
        }

        public UserPaymentOrder userId(Long userId) {
            this.userId = userId;
            return this;
        }

        public UserPaymentOrder orderNo(String orderNo) {
            this.orderNo = orderNo;
            return this;
        }

        public UserPaymentOrder status(EPaymentStatus status) {
            this.status = status;
            return this;
        }

        public UserPaymentOrder originalPrice(BigDecimal originalPrice) {
            this.originalPrice = originalPrice;
            return this;
        }

        public UserPaymentOrder currentPrice(BigDecimal currentPrice) {
            this.currentPrice = currentPrice;
            return this;
        }

        public UserPaymentOrder id(Long id) {
            this.id = id;
            return this;
        }

        public UserPaymentOrder paymentCashAmount(BigDecimal paymentCashAmount) {
            this.paymentCashAmount = paymentCashAmount;
            return this;
        }

        public UserPaymentOrder paymentCouponAmount(BigDecimal paymentCouponAmount) {
            this.paymentCouponAmount = paymentCouponAmount;
            return this;
        }

        public UserPaymentOrder actualPrice(BigDecimal actualPrice) {
            this.actualPrice = actualPrice;
            return this;
        }


        public UserPaymentOrder updateTime(Date updateTime) {
            this.updateTime = updateTime;
            return this;
        }
    }

    @Data
    @ApiModel(" StudentPaymentOrder-学员订单表")
    public static class StudentPaymentOrder {
        @ApiModelProperty("订单id")
        private Long id;

        @ApiModelProperty("订单编号")
        private String orderNo;

        @ApiModelProperty("订单类型")
        private EPaymentType orderType;

        @ApiModelProperty("订单状态")
        private EPaymentStatus status;

        @ApiModelProperty("支付现金金额")
        private BigDecimal paymentCashAmount;

        @ApiModelProperty("支付时间")
        private Date payTime;

        @ApiModelProperty("订单详情")
        private List<StudentPaymentOrderDetail> studentPaymentOrderDetails;
    }

    @Data
    @ApiModel(" StudentPaymentOrder-学员订单表")
    public static class StudentPaymentOrderDetail {

        @ApiModelProperty("订单详情编号")
        private Long userPaymentOrderDetailId;

        @ApiModelProperty("商品类型")
        private EGoodsType goodsType;

        @ApiModelProperty("商品名称")
        private String goodsName;

        @ApiModelProperty("商品图片")
        private String goodsUrl;

        @ApiModelProperty("商品数量")
        private Integer goodsNum;

        @ApiModelProperty("支付现金金额")
        private BigDecimal paymentCashAmount;
    }

    @Data
    public static class RefundOperatorDto {
        @ApiModelProperty("操作人编号")
        private Long id;

        @ApiModelProperty("操作人姓名")
        private String name;
    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("支付配置信息")
    public static class PaymentConfig implements Serializable {

        @ApiModelProperty("商户订单编号")
        private String orderNo;

        @ApiModelProperty("支付类型: adapay, wxpay")
        private String paymentType;

        @ApiModelProperty("支付状态")
        private String status;

        @ApiModelProperty("支付配置参数: 透传")
        private PaymentOrderReqConfig paymentConfig;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("订单支付参数配置")
    public static class PaymentOrderReqConfig implements Serializable {

        @ApiModelProperty("支付三方")
        private String paymentVendor;

        @ApiModelProperty("支付渠道")
        private String paymentChannel;

        @ApiModelProperty("商户订单号")
        private String merOrderNo;

        @ApiModelProperty("商品名称")
        private String subject;

        @ApiModelProperty("商品描述")
        private String body;

        @ApiModelProperty("附加信息")
        private String addition;

        @ApiModelProperty("价格")
        private BigDecimal price;

        @ApiModelProperty("银行卡类型")
        private String bankType;

        @ApiModelProperty("微信授权code")
        private String code;

        @ApiModelProperty("订单过期时间")
        private Date expirationTime;

        @ApiModelProperty("微信支付公众号")
        private String wxAppId;

        @ApiModelProperty("支付宝应用ID")
        private String alipayAppId;

        @ApiModelProperty("支付用户Id")
        private String userId;

        @ApiModelProperty("支付用户类型")
        private ClientEnum userType;

        @ApiModelProperty(value = "请求ip", hidden = true)
        private String ip;

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static PaymentOrderReqConfig from(String json) {
            return JSON.parseObject(json, PaymentOrderReqConfig.class);
        }


        public PaymentOrderReqConfig paymentChannel(String paymentChannel) {
            this.paymentChannel = paymentChannel;
            return this;
        }

        public PaymentOrderReqConfig merOrderNo(String merOrderNo) {
            this.merOrderNo = merOrderNo;
            return this;
        }

        public PaymentOrderReqConfig subject(String subject) {
            this.subject = subject;
            return this;
        }

        public PaymentOrderReqConfig price(BigDecimal price) {
            this.price = price;
            return this;
        }

        public PaymentOrderReqConfig code(String code) {
            this.code = code;
            return this;
        }

        public PaymentOrderReqConfig userId(String userId) {
            this.userId = userId;
            return this;
        }
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("用户支付参数")
    public static class PaymentReq implements Serializable {

        @ApiModelProperty("交易流水号")
        private String transNo;

        @ApiModelProperty("请求支付的参数")
        private Map<String, Object> reqParams;

        public static PaymentReq from(String json) {
            return JSON.parseObject(json, PaymentReq.class);
        }
    }

    @ApiModel(" UserPaymentOrder-平台订单表")
    @Data
    public static class UserPaymentOrderDetailVo {

        @ApiModelProperty("订单编号")
        private Long userPaymentOrderId;

        @ApiModelProperty("商品名称")
        private String goodsName;

        @ApiModelProperty("商品图片")
        private String goodsUrl;

        @ApiModelProperty("商品数量")
        private Integer goodsNum = 1;

        @ApiModelProperty("原价")
        private BigDecimal originalPrice = BigDecimal.ZERO;

        @ApiModelProperty("现价")
        private BigDecimal currentPrice = BigDecimal.ZERO;

        @ApiModelProperty("实付金额")
        private BigDecimal paymentCashAmount = BigDecimal.ZERO;

        @ApiModelProperty("优惠金额")
        private BigDecimal paymentCouponAmount = BigDecimal.ZERO;
    }

    @ApiModel(" UserPaymentOrder-平台订单表")
    @Data
    public static class UserPaymentOrderDetailVo1 {

        @ApiModelProperty("商品名称")
        private String goodsName;

        @ApiModelProperty("商品数量")
        private Integer goodsNum = 1;

        @ApiModelProperty("支付时间")
        private Date payTime;

        @ApiModelProperty("支付时间")
        private String orderNo;

        @ApiModelProperty("订单状态")
        private EPaymentStatus orderStatus;

        @ApiModelProperty("原价")
        private BigDecimal originalPrice = BigDecimal.ZERO;

        @ApiModelProperty("现价")
        private BigDecimal currentPrice = BigDecimal.ZERO;

        @ApiModelProperty("实付金额")
        private BigDecimal paymentCashAmount = BigDecimal.ZERO;

        @ApiModelProperty("优惠金额")
        private BigDecimal paymentCouponAmount = BigDecimal.ZERO;

        public void setPayTime(Long payTime) {
            if (Objects.nonNull(payTime)) {

                if (payTime.toString().length() <= 10) {
                    payTime *= 1000;
                }

                this.payTime = new Date(payTime);
            }
        }
    }

    @ApiModel(" UserPaymentOrder-平台订单表")
    @Data
    public static class UserPaymentOrderDetailActivateVip {

        private String userNote;

        private Long userId;

        private ClientEnum paymentClient;

        private String orderNo;

        private Long userPaymentOrderDetailId;

        private BigDecimal paymentCashAmount;

        @ApiModelProperty("支付时间")
        private Date payTime;

        public void setPayTime(Long payTime) {
            if (Objects.nonNull(payTime)) {

                if (payTime.toString().length() <= 10) {
                    payTime *= 1000;
                }

                this.payTime = new Date(payTime);
            }
        }
    }

    @ApiModel(" UserPaymentOrder-平台订单表")
    @Data
    public static class UserPaymentOrderVo {

        @ApiModelProperty("主键")
        private Long id;

        @ApiModelProperty("商户订单号")
        private String orderNo;

        @ApiModelProperty("交易流水号")
        private String transNo;

        @ApiModelProperty("手机号")
        private String phone;

        @ApiModelProperty("用户编号")
        private Long userId;

        @ApiModelProperty("用户姓名")
        private String nickname;

        @ApiModelProperty("订单类型:  VIP（开通会员）， ORCHESTRA（乐团报名）")
        private EPaymentType orderType;

        @ApiModelProperty("订单状态")
        private EPaymentStatus orderStatus;

        @ApiModelProperty("原价")
        private BigDecimal originalPrice;

        @ApiModelProperty("现价")
        private BigDecimal currentPrice;

        @ApiModelProperty("支付现金金额")
        private BigDecimal paymentCashAmount;

        @ApiModelProperty("支付优惠金额")
        private BigDecimal paymentCouponAmount;

        @ApiModelProperty("支付通道费用")
        private BigDecimal paymentChannelFee;

        @ApiModelProperty("订单描述信息")
        private String orderDesc;

        @ApiModelProperty("支付时间")
        private Date payTime;

        @ApiModelProperty("订单详情")
        private List<UserPaymentOrderDetailVo> orderDetailList;

        public void setPayTime(Long payTime) {
            if (Objects.nonNull(payTime)) {

                if (payTime.toString().length() <= 10) {
                    payTime *= 1000;
                }

                this.payTime = new Date(payTime);
            }
        }
    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel("订单商品信息")
    public static class OrderGoodsInfo implements Serializable {


        @ApiModelProperty("优惠券Id")
        private Long couponId;


        @ApiModelProperty("学生购买机构专辑时的小组ID")
        private Long tenantGroupAlbumId;

        @ApiModelProperty(value = "活动id", hidden = true)
        private Long activityId;

        @ApiModelProperty(value = "订单号 ", hidden = true)
        private String orderNo;

        @ApiModelProperty(value = "订单详情号 ", hidden = true)
        private String subOrderNo;

        @ApiModelProperty("订单类型: 学生端（ VIP、开通会员  PRACTICE、陪练课购买  LIVE、直播课购买 VIDEO、视频课购买 MUSIC、单曲点播 ACTI_REGIST、活动报名） 老师端（VIP、开通会员 PIANO_ROOM、琴房时长）")
        private GoodTypeEnum goodType;

        @ApiModelProperty("业务id ")
        private Long bizId;
        @ApiModelProperty("业务内容 ")
        private Object bizContent;


        @ApiModelProperty("商品数量 ")
        private Integer goodNum;

        @ApiModelProperty("商品名称 ")
        private String goodName;

        @ApiModelProperty(value = "购买人ID ", hidden = true)
        private Long userId;


        @ApiModelProperty(value = "用户身份", hidden = true)
        private ClientEnum paymentClient;

        @ApiModelProperty(value = "生成的订单详情信息", hidden = true)
        private UserOrderDetail userOrderDetail;


        @ApiModelProperty(value = "推荐用户id(有推荐人的情况)", hidden = true)
        private Long recomUserId;
        public Integer getGoodNum() {
            return Optional.ofNullable(goodNum).orElse(1);
        }
    }


    @Data
    @ApiModel("OrderPayTypeReq-订单支付方式")
    public static class OrderPayTypeReq implements Serializable {

        @ApiModelProperty("订单类型: 学生端（ VIP、开通会员  PRACTICE、陪练课购买  LIVE、直播课购买 VIDEO、视频课购买 MUSIC、单曲点播 ACTI_REGIST、活动报名） 老师端（VIP、开通会员 PIANO_ROOM、琴房时长）")
        private GoodTypeEnum goodType;

        @ApiModelProperty("业务id ")
        private Long bizId;

        @ApiModelProperty(value = "购买人ID",hidden = true)
        private Long buyId;

        @ApiModelProperty(value = "购买人身份",hidden = true)
        private ClientEnum clientType;


        @ApiModelProperty(value = "推荐用户id(有推荐人的情况)")
        private Long recomUserId;
    }


    @Data
    @ApiModel("OrderPayTypeReq-订单支付方式")
    public static class OrderPayTypeResp implements Serializable {

        @ApiModelProperty("支付版本")
        private EPaymentVersion paymentVersion;


        @ApiModelProperty("支付厂商")
        private String paymentVendor;

        @ApiModelProperty("支付渠道")
        private List<String> paymentChannels;
    }



    @Data
    @ApiModel("AccountTo-订单金额接收方")
    public static class AccountTenantTo implements Serializable {

        @ApiModelProperty("收入机构  -1 默认平台 0不分润")
        private Long incomeTenant = -1L;

        @ApiModelProperty("是否到老师")
        private boolean incomeTeacher = false;


        @ApiModelProperty("分享机构  -1 默认平台 0不分润")
        private Long shareTenant = -1L;

        @ApiModelProperty("是否到老师")
        private boolean shareTeacher = false;

        public String jsonString() {
            return JSON.toJSONString(this);
        }
    }
}
