D60.java 5.52 KB
//package com.bsth.entity.directive;
//
//import javax.persistence.Embeddable;
//import javax.persistence.Entity;
//import javax.persistence.FetchType;
//import javax.persistence.GeneratedValue;
//import javax.persistence.Id;
//import javax.persistence.ManyToOne;
//import javax.persistence.NamedAttributeNode;
//import javax.persistence.NamedEntityGraph;
//import javax.persistence.NamedEntityGraphs;
//import javax.persistence.Table;
//import javax.persistence.Transient;
//
//import com.bsth.entity.realcontrol.ScheduleRealInfo;
//import com.fasterxml.jackson.annotation.JsonIgnore;
//
//
///**
// * 
// * @ClassName: D60 
// * @Description: TODO(调度指令) 
// * @author PanZhao
// * @date 2016年6月7日 上午10:21:59 
// *
// */
//@Entity
//@Table(name = "bsth_v_directive_60")
//@NamedEntityGraphs({
//	@NamedEntityGraph(name = "directive60_sch", attributeNodes = {
//			@NamedAttributeNode("sch")
//	})
//})
//public class D60 extends Directive{
//
//	@Id
//    @GeneratedValue
//	private Integer id;
//	
//	/**
//	 * 数据
//	 */
//	private DirectiveData data;
//	
//	/**
//	 * 唯一标识
//	 */
//	@Transient
//	private Integer msgId;
//	
//	/**
//	 * 46上行
//	 */
//	private Short reply46 = -1;
//	
//	/**
//	 * 47上行
//	 */
//	private Short reply47 = -1;
//	
//	/**
//	 * 是否是调度指令
//	 * 目前调度指令和消息短语都是短语下发,所以从协议上无法区分
//	 */
//	private boolean isDispatch;
//	
//	/**
//	 * 相关联的班次
//	 */
//	@JsonIgnore
//	@ManyToOne(fetch = FetchType.LAZY)
//	private ScheduleRealInfo sch;
//	
//	@Embeddable
//	public static class DirectiveData {
//		// 公司代码
//		private short companyCode;
//
//		// 设备号
//		@Transient
//		private String deviceId;
//
//		// 时间戳
//		@Transient
//		private Long timestamp;
//
//		// 保留 默认0
//		private short instructType = 0;
//
//		/*
//		 * 调度指令 调度指令。
//		 *  0X00表示信息短语 
//		 *  0X01表示取消上次指令+调度指令(闹钟有效) 
//		 *  0x02表示为调度指令(闹钟有效)
//		 *  0x03表示运营状态指令(闹钟无效) 
//		 *  0x04表示其他指令
//		 */
//		private Short dispatchInstruct;
//
//		// 唯一标识
//		private int msgId;
//
//		// 闹钟
//		private Long alarmTime;
//
//		// 多个运营状态字节
//		private Long serviceState;
//
//		// 消息文本
//		private String txtContent;
//
//		public short getCompanyCode() {
//			return companyCode;
//		}
//
//		public void setCompanyCode(short companyCode) {
//			this.companyCode = companyCode;
//		}
//
//		public String getDeviceId() {
//			return deviceId;
//		}
//
//		public void setDeviceId(String deviceId) {
//			this.deviceId = deviceId;
//		}
//
//		public Long getTimestamp() {
//			return timestamp;
//		}
//
//		public void setTimestamp(Long timestamp) {
//			this.timestamp = timestamp;
//		}
//
//		public short getInstructType() {
//			return instructType;
//		}
//
//		public void setInstructType(short instructType) {
//			this.instructType = instructType;
//		}
//
//		public Short getDispatchInstruct() {
//			return dispatchInstruct;
//		}
//
//		public void setDispatchInstruct(Short dispatchInstruct) {
//			this.dispatchInstruct = dispatchInstruct;
//		}
//
//		public int getMsgId() {
//			return msgId;
//		}
//
//		public void setMsgId(int msgId) {
//			this.msgId = msgId;
//		}
//
//		public Long getAlarmTime() {
//			return alarmTime;
//		}
//
//		public void setAlarmTime(Long alarmTime) {
//			this.alarmTime = alarmTime;
//		}
//
//		public Long getServiceState() {
//			return serviceState;
//		}
//
//		public void setServiceState(Long serviceState) {
//			this.serviceState = serviceState;
//		}
//
//		public String getTxtContent() {
//			return txtContent;
//		}
//
//		public void setTxtContent(String txtContent) {
//			this.txtContent = txtContent;
//		}
//	}
//
//	public Integer getId() {
//		return id;
//	}
//
//	public void setId(Integer id) {
//		this.id = id;
//	}
//
//	public short getOperCode() {
//		return operCode;
//	}
//
//	public void setOperCode(short operCode) {
//		this.operCode = operCode;
//	}
//
//	public DirectiveData getData() {
//		return data;
//	}
//
//	public void setData(DirectiveData data) {
//		this.data = data;
//	}
//
//	public Integer getMsgId() {
//		if(this.msgId != null)
//			return this.msgId;
//		else
//			return this.getData().getMsgId();
//	}
//
//	public void setMsgId(Integer msgId) {
//		this.msgId = msgId;
//	}
//	
//	@Override
//	public void setTimestamp(Long timestamp) {
//		if(this.data != null)
//			this.data.setTimestamp(timestamp);
//		
//		this.timestamp = timestamp;
//	}
//	
//	@Override
//	public void setDeviceId(String deviceId) {
//		if(this.data != null)
//			this.data.setDeviceId(deviceId);
//		
//		this.deviceId = deviceId;
//	}
//
//	public Short getReply46() {
//		return reply46;
//	}
//
//	public void setReply46(Short reply46) {
//		this.reply46 = reply46;
//	}
//
//	public Short getReply47() {
//		return reply47;
//	}
//
//	public void setReply47(Short reply47) {
//		this.reply47 = reply47;
//	}
//
//	public boolean isDispatch() {
//		return isDispatch;
//	}
//
//	public void setDispatch(boolean isDispatch) {
//		this.isDispatch = isDispatch;
//	}
//
//	public ScheduleRealInfo getSch() {
//		return sch;
//	}
//
//	public void setSch(ScheduleRealInfo sch) {
//		this.sch = sch;
//	}
//}