package ink.wgink.module.wechat.pay.pojo.v3.order;


import ink.wgink.module.wechat.pay.pojo.v3.PayNoticeCiphertext;

/**
 * @ClassName: OrderBusiness
 * @Description: 订单查询
 * @Author: wanggeng
 * @Date: 2021/8/27 10:27 上午
 * @Version: 1.0
 */
public class OrderSearch {

    /**
     * 应用ID
     */
    private String appid;
    /**
     * 直连商户号
     */
    private String mchid;
    /**
     * 商户订单号
     */
    private String out_trade_no;
    /**
     * 微信支付订单号
     */
    private String transaction_id;
    /**
     * 交易类型
     */
    private String trade_type;
    /**
     * 交易状态
     */
    private String trade_state;
    /**
     * 交易状态描述
     */
    private String trade_state_desc;
    /**
     * 付款银行
     */
    private String bank_type;
    /**
     * 附加数据
     */
    private String attach;
    /**
     * 支付完成时间
     */
    private String success_time;
    /**
     * 支付者
     */
    private Payer payer;
    /**
     * 订单金额
     */
    private Amount amount;
    /**
     * 场景信息
     */
    private SceneInfo scene_info;
    /**
     * 优惠功能
     */
    private PromotionDetail promotion_detail;

    public String getAppid() {
        return appid == null ? "" : appid.trim();
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMchid() {
        return mchid == null ? "" : mchid.trim();
    }

    public void setMchid(String mchid) {
        this.mchid = mchid;
    }

    public String getOut_trade_no() {
        return out_trade_no == null ? "" : out_trade_no.trim();
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getTransaction_id() {
        return transaction_id == null ? "" : transaction_id.trim();
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getTrade_type() {
        return trade_type == null ? "" : trade_type.trim();
    }

    public void setTrade_type(String trade_type) {
        this.trade_type = trade_type;
    }

    public String getTrade_state() {
        return trade_state == null ? "" : trade_state.trim();
    }

    public void setTrade_state(String trade_state) {
        this.trade_state = trade_state;
    }

    public String getTrade_state_desc() {
        return trade_state_desc == null ? "" : trade_state_desc.trim();
    }

    public void setTrade_state_desc(String trade_state_desc) {
        this.trade_state_desc = trade_state_desc;
    }

    public String getBank_type() {
        return bank_type == null ? "" : bank_type.trim();
    }

    public void setBank_type(String bank_type) {
        this.bank_type = bank_type;
    }

    public String getAttach() {
        return attach == null ? "" : attach.trim();
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    public String getSuccess_time() {
        return success_time == null ? "" : success_time.trim();
    }

    public void setSuccess_time(String success_time) {
        this.success_time = success_time;
    }

    public Payer getPayer() {
        return payer;
    }

    public void setPayer(Payer payer) {
        this.payer = payer;
    }

    public Amount getAmount() {
        return amount;
    }

    public void setAmount(Amount amount) {
        this.amount = amount;
    }

    public SceneInfo getScene_info() {
        return scene_info;
    }

    public void setScene_info(SceneInfo scene_info) {
        this.scene_info = scene_info;
    }

    public PromotionDetail getPromotion_detail() {
        return promotion_detail;
    }

    public void setPromotion_detail(PromotionDetail promotion_detail) {
        this.promotion_detail = promotion_detail;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"appid\":\"")
                .append(appid).append('\"');
        sb.append(",\"mchid\":\"")
                .append(mchid).append('\"');
        sb.append(",\"out_trade_no\":\"")
                .append(out_trade_no).append('\"');
        sb.append(",\"transaction_id\":\"")
                .append(transaction_id).append('\"');
        sb.append(",\"trade_type\":\"")
                .append(trade_type).append('\"');
        sb.append(",\"trade_state\":\"")
                .append(trade_state).append('\"');
        sb.append(",\"trade_state_desc\":\"")
                .append(trade_state_desc).append('\"');
        sb.append(",\"bank_type\":\"")
                .append(bank_type).append('\"');
        sb.append(",\"attach\":\"")
                .append(attach).append('\"');
        sb.append(",\"success_time\":\"")
                .append(success_time).append('\"');
        sb.append(",\"payer\":")
                .append(payer);
        sb.append(",\"amount\":")
                .append(amount);
        sb.append(",\"scene_info\":")
                .append(scene_info);
        sb.append(",\"promotion_detail\":")
                .append(promotion_detail);
        sb.append('}');
        return sb.toString();
    }

    /**
     * 支付者
     */
    public static class Payer {
        /**
         * 用户标识
         */
        private String openid;

        public String getOpenid() {
            return openid == null ? "" : openid.trim();
        }

        public void setOpenid(String openid) {
            this.openid = openid;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"openid\":\"")
                    .append(openid).append('\"');
            sb.append('}');
            return sb.toString();
        }
    }

    /**
     * 订单金额
     */
    public static class Amount {
        /**
         * 总金额
         */
        private int total;
        /**
         * 用户支付金额
         */
        private int payer_total;
        /**
         * 货币类型
         */
        private String currency;
        /**
         * 用户支付币种
         */
        private String payer_currency;

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public int getPayer_total() {
            return payer_total;
        }

        public void setPayer_total(int payer_total) {
            this.payer_total = payer_total;
        }

        public String getCurrency() {
            return currency == null ? "" : currency.trim();
        }

        public void setCurrency(String currency) {
            this.currency = currency;
        }

        public String getPayer_currency() {
            return payer_currency == null ? "" : payer_currency.trim();
        }

        public void setPayer_currency(String payer_currency) {
            this.payer_currency = payer_currency;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"total\":")
                    .append(total);
            sb.append(",\"payer_total\":")
                    .append(payer_total);
            sb.append(",\"currency\":\"")
                    .append(currency).append('\"');
            sb.append(",\"payer_currency\":\"")
                    .append(payer_currency).append('\"');
            sb.append('}');
            return sb.toString();
        }
    }

    /**
     * 场景信息
     */
    public static class SceneInfo {
        /**
         * 商户端设备号
         */
        private String device_id;

        public String getDevice_id() {
            return device_id == null ? "" : device_id.trim();
        }

        public void setDevice_id(String device_id) {
            this.device_id = device_id;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"device_id\":\"")
                    .append(device_id).append('\"');
            sb.append('}');
            return sb.toString();
        }
    }

    /**
     * 优惠功能
     */
    public static class PromotionDetail {
        /**
         * 券ID
         */
        private String coupon_id;
        /**
         * 优惠名称
         */
        private String name;
        /**
         * 优惠范围
         */
        private String scope;
        /**
         * 优惠类型
         */
        private String type;
        /**
         * 优惠券面额
         */
        private Integer amount;
        /**
         * 活动ID
         */
        private String stock_id;
        /**
         * 微信出资
         */
        private Integer wechatpay_contribute;
        /**
         * 商户出资
         */
        private Integer merchant_contribute;
        /**
         * 其他出资
         */
        private Integer other_contribute;
        /**
         * 优惠币种
         */
        private String currency;
        /**
         * 单品列表
         */
        private PayNoticeCiphertext.PromotionDetail.GoodsDetail goods_detail;

        public String getCoupon_id() {
            return coupon_id == null ? "" : coupon_id.trim();
        }

        public void setCoupon_id(String coupon_id) {
            this.coupon_id = coupon_id;
        }

        public String getName() {
            return name == null ? "" : name.trim();
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getScope() {
            return scope == null ? "" : scope.trim();
        }

        public void setScope(String scope) {
            this.scope = scope;
        }

        public String getType() {
            return type == null ? "" : type.trim();
        }

        public void setType(String type) {
            this.type = type;
        }

        public Integer getAmount() {
            return amount == null ? 0 : amount;
        }

        public void setAmount(Integer amount) {
            this.amount = amount;
        }

        public String getStock_id() {
            return stock_id == null ? "" : stock_id.trim();
        }

        public void setStock_id(String stock_id) {
            this.stock_id = stock_id;
        }

        public Integer getWechatpay_contribute() {
            return wechatpay_contribute == null ? 0 : wechatpay_contribute;
        }

        public void setWechatpay_contribute(Integer wechatpay_contribute) {
            this.wechatpay_contribute = wechatpay_contribute;
        }

        public Integer getMerchant_contribute() {
            return merchant_contribute == null ? 0 : merchant_contribute;
        }

        public void setMerchant_contribute(Integer merchant_contribute) {
            this.merchant_contribute = merchant_contribute;
        }

        public Integer getOther_contribute() {
            return other_contribute == null ? 0 : other_contribute;
        }

        public void setOther_contribute(Integer other_contribute) {
            this.other_contribute = other_contribute;
        }

        public String getCurrency() {
            return currency == null ? "" : currency.trim();
        }

        public void setCurrency(String currency) {
            this.currency = currency;
        }

        public PayNoticeCiphertext.PromotionDetail.GoodsDetail getGoods_detail() {
            return goods_detail;
        }

        public void setGoods_detail(PayNoticeCiphertext.PromotionDetail.GoodsDetail goods_detail) {
            this.goods_detail = goods_detail;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"coupon_id\":\"")
                    .append(coupon_id).append('\"');
            sb.append(",\"name\":\"")
                    .append(name).append('\"');
            sb.append(",\"scope\":\"")
                    .append(scope).append('\"');
            sb.append(",\"type\":\"")
                    .append(type).append('\"');
            sb.append(",\"amount\":")
                    .append(amount);
            sb.append(",\"stock_id\":\"")
                    .append(stock_id).append('\"');
            sb.append(",\"wechatpay_contribute\":")
                    .append(wechatpay_contribute);
            sb.append(",\"merchant_contribute\":")
                    .append(merchant_contribute);
            sb.append(",\"other_contribute\":")
                    .append(other_contribute);
            sb.append(",\"currency\":\"")
                    .append(currency).append('\"');
            sb.append(",\"goods_detail\":")
                    .append(goods_detail);
            sb.append('}');
            return sb.toString();
        }

        /**
         * 单品列表
         */
        public static class GoodsDetail {
            /**
             * 商品编码
             */
            private String goods_id;
            /**
             * 商品数量
             */
            private Integer quantity;
            /**
             * 商品单价
             */
            private Integer unit_price;
            /**
             * 商品优惠金额
             */
            private Integer discount_amount;
            /**
             * 商品备注
             */
            private String goods_remark;

            public String getGoods_id() {
                return goods_id == null ? "" : goods_id.trim();
            }

            public void setGoods_id(String goods_id) {
                this.goods_id = goods_id;
            }

            public Integer getQuantity() {
                return quantity == null ? 0 : quantity;
            }

            public void setQuantity(Integer quantity) {
                this.quantity = quantity;
            }

            public Integer getUnit_price() {
                return unit_price == null ? 0 : unit_price;
            }

            public void setUnit_price(Integer unit_price) {
                this.unit_price = unit_price;
            }

            public Integer getDiscount_amount() {
                return discount_amount == null ? 0 : discount_amount;
            }

            public void setDiscount_amount(Integer discount_amount) {
                this.discount_amount = discount_amount;
            }

            public String getGoods_remark() {
                return goods_remark == null ? "" : goods_remark.trim();
            }

            public void setGoods_remark(String goods_remark) {
                this.goods_remark = goods_remark;
            }

            @Override
            public String toString() {
                final StringBuilder sb = new StringBuilder("{");
                sb.append("\"goods_id\":\"")
                        .append(goods_id).append('\"');
                sb.append(",\"quantity\":")
                        .append(quantity);
                sb.append(",\"unit_price\":")
                        .append(unit_price);
                sb.append(",\"discount_amount\":")
                        .append(discount_amount);
                sb.append(",\"goods_remark\":\"")
                        .append(goods_remark).append('\"');
                sb.append('}');
                return sb.toString();
            }
        }

    }

}
