package com.szpg.db.data;

import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

import com.szpg.util.TimeFormat;

/**
 * 读取内存命令对应数据表
 * 
 * @author admin
 *
 */
public class PgAcuRdcmd implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4164184831926735991L;
	
	private String id; // ID
	private Date tm; // 命令发送时间
	private String cmd_type; // 命令类型
	private String dest_acu_code; // 目标ACU代码
	private boolean timeout; // 是否超时
	
	public PgAcuRdcmd() {
		this.setId(UUID.randomUUID().toString().replace("-", ""));
		this.setTm(Calendar.getInstance().getTime());
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getTm() {
		return tm;
	}

	public void setTm(Date tm) {
		this.tm = tm;
	}

	public String getCmd_type() {
		return cmd_type;
	}

	public void setCmd_type(String cmd_type) {
		this.cmd_type = cmd_type;
	}

	public String getDest_acu_code() {
		return dest_acu_code;
	}

	public void setDest_acu_code(String dest_acu_code) {
		this.dest_acu_code = dest_acu_code;
	}

	public boolean isTimeout() {
		return timeout;
	}

	public void setTimeout(boolean timeout) {
		this.timeout = timeout;
	}

	@Override
	public String toString() {
		return "PgAcuRdcmd [tm=" + getTmStr() + ", cmd_type=" + cmd_type + ", acu=" + dest_acu_code + "]";
	}
	
	public String getTmStr() {
		if (null != this.getTm()) 
			return TimeFormat.formatTimestamp(getTm());
		else 
			return "";
	}

}
