CustomAttachmentConfirmOrder.java 1.98 KB
Newer Older
1 2 3 4
package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

5 6 7 8 9 10
public class CustomAttachmentConfirmOrder extends CustomAttachment {
    private static final String TITLE = "title";//标题
    private static final String STATUS = "status";//状态,1代表已确认,0代表待确认
    private static final String BOOKINGTIME = "bookingTime";///咨询时间
    private static final String SERVICETYPE = "serviceType";//服务方式
    private static final String ORDERID = "orderId";//订单号
11
    private static final String SERVICEID = "serviceId";//订单号
12 13
    private static final String NEWSORDERID = "newsOrderId";//用于跳转新版订单详情
    private static final String URL = "url";//跳转链接
14

刘鹏 committed
15

16
    public String servicetype;
17 18 19 20 21 22 23 24 25
    public String consultDuration;
    public String bookingTime;
    public String title;
    public String productName;
    public String url;
    public String orderId;
    public String newsOrderId;
    public String serviceId;
    public int status;
26

27
    CustomAttachmentConfirmOrder() {
28 29 30 31 32 33
        super(CustomAttachmentType.TYPE_CONFIRM_ORDER);
    }


    @Override
    protected void parseData(JSONObject data) {
34 35 36 37 38
        this.title = data.getString(TITLE);
        this.status = data.getInteger(STATUS);
        this.bookingTime = data.getString(BOOKINGTIME);
        this.servicetype = data.getString(SERVICETYPE);
        this.orderId = data.getString(ORDERID);
39
        this.serviceId = data.getString(SERVICEID);
40 41
        this.newsOrderId = data.getString(NEWSORDERID);
        this.url = data.getString(URL);
刘鹏 committed
42

43 44 45 46 47
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
48
        data.put(TITLE, title);
49
        data.put(STATUS, status);
50
        data.put(BOOKINGTIME, bookingTime);
51
        data.put(SERVICETYPE, servicetype);
52
        data.put(ORDERID, orderId);
53
        data.put(SERVICEID, serviceId);
54 55
        data.put(NEWSORDERID, newsOrderId);
        data.put(URL, url);
56 57 58
        return data;
    }
}