CustomAttachReceivedMoney.java 2.09 KB
Newer Older
konghaorui committed
1 2 3 4 5 6 7 8 9 10 11 12 13
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";
14
    private static final String ISNEWORDER = "isNewOrder";
konghaorui committed
15 16 17 18 19
    private static final String KEY_ORDERID="orderid";
    private String num = "";//订单金额
    private String title = "";//订单标题题
    private int orPay;//支付状态 0未支付1已支付
    private String orderid = "";//订单id
20 21
    private Boolean isNewOrder = false;//是否是新订单

konghaorui committed
22 23 24 25 26 27 28 29 30 31 32
    public CustomAttachReceivedMoney() {
        super(CustomAttachmentType.RECEIVEDMONEY);
    }


    @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);
33
        this.isNewOrder=data.getBoolean(ISNEWORDER);
konghaorui committed
34 35 36 37 38 39 40 41 42
    }

    @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);
43
        data.put(ISNEWORDER,isNewOrder);
konghaorui committed
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
        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;
    }
77 78 79 80 81 82 83 84 85


    public Boolean getNewOrder() {
        return isNewOrder;
    }

    public void setNewOrder(Boolean newOrder) {
        isNewOrder = newOrder;
    }
konghaorui committed
86
}