CustomAttachReceivedMoney.java 1.99 KB
Newer Older
konghaorui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

/**
 * 收款消息拓展
 * Created by harvie on 2017/1/10.
 */

public class CustomAttachReceivedMoney extends CustomAttachment {
    private static final String KEY_TITLE="title";
    private static final String KEY_NUM = "num";
    private static final String KEY_ORPAY = "orPay";
    private static final String KEY_ORDERID="orderid";
    private String num = "";//订单金额
    private String title = "";//订单标题题
    private int orPay;//支付状态 0未支付1已支付
    private String orderid = "";//订单id
    public CustomAttachReceivedMoney() {
        super(CustomAttachmentType.RECEIVEDMONEY);
    }

    public CustomAttachReceivedMoney(String num, String title, int orPay, String orderId) {
        super(CustomAttachmentType.RECEIVEDMONEY);
        this.num = num;
        this.title = title;
        this.orPay = orPay;
        this.orderid = orderId;
    }

    @Override
    protected void parseData(JSONObject data) {
        this.orderid=data.getString(KEY_ORDERID);
        this.title=data.getString(KEY_TITLE);
        this.num=data.getString(KEY_NUM);
        this.orPay=data.getInteger(KEY_ORPAY);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data=new JSONObject();
        data.put(KEY_ORDERID,orderid);
        data.put(KEY_TITLE,title);
        data.put(KEY_NUM,num);
        data.put(KEY_ORPAY,orPay);
        return data;
    }

    public String getOrderId() {
        return orderid;
    }

    public int getOrPay() {
        return orPay;
    }
    public String getTitle() {
        return title;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setOrPay(int orPay) {
        this.orPay = orPay;
    }

    public void setOrderId(String orderId) {
        this.orderid = orderId;
    }
}