package com.uas.platform.b2b.erp.model;

import java.util.Date;

import com.uas.platform.b2b.model.PrintLog;

/**
 * Created by dongbw on 17/03/11 15:06.
 */
public class MessageLog {

    private int ml_id; // id
    private Date ml_date;  // 日期
    private String ml_man; // 操作人
    private String ml_content; // 内容
    private String ml_result;  // 结果
    private String ml_search;  // 查找条件
    private String code;  // 对应单据编号

    public int getMl_id() {
        return ml_id;
    }

    public void setMl_id(int ml_id) {
        this.ml_id = ml_id;
    }

    public Date getMl_date() {
        return ml_date;
    }

    public void setMl_date(Date ml_date) {
        this.ml_date = ml_date;
    }

    public String getMl_man() {
        return ml_man;
    }

    public void setMl_man(String ml_man) {
        this.ml_man = ml_man;
    }

    public String getMl_result() {
        return ml_result;
    }

    public void setMl_result(String ml_result) {
        this.ml_result = ml_result;
    }

    public String getMl_search() {
        return ml_search;
    }

    public void setMl_search(String ml_search) {
        this.ml_search = ml_search;
    }

    public String getMl_content() {
        return ml_content;
    }

    public void setMl_content(String ml_content) {
        this.ml_content = ml_content;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public MessageLog(PrintLog printLog) {
        this.ml_date = printLog.getDate();
        this.ml_man = printLog.getUser();
        this.ml_content = printLog.getType();
        this.ml_result = printLog.getType() + "成功";
        if (printLog.getTable().equals("purc$orders")) {
            this.ml_search ="Purchase|pu_id=" + printLog.getErpId();
        }
        this.code = printLog.getCode();
    }
}
