package com.hmsoft.model.request;

import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.hmsoft.model.CoursePlan;

/**
 * 业务请求包装.
 * @author zq
 *
 */
public class BizRequest {
	private Integer reqType; //1-学校选择课程,2-命题办通知其他学校课程被选择了,3-命题办指定该课程征集学校,4-学校取消选择的课程,5-命题办刷新课程列表数据到各个学校客户端
	private String batchNo;//批次编号
	private Long schoolId;
	private String schoolName;
	private String selectIds;//选择的课程代码，可以选多个
	private List<CoursePlan> sourceList;//服务端发送过来的列表(开启命题征集的列表，或者是命题办指定的征集列表)
	protected byte zjStatus;//0-征集中，1-最终发布
	
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public List<CoursePlan> getSourceList() {
		return sourceList;
	}
	public void setSourceList(List<CoursePlan> sourceList) {
		this.sourceList = sourceList;
	}
	public Integer getReqType() {
		return reqType;
	}
	public void setReqType(Integer reqType) {
		this.reqType = reqType;
	}
	public Long getSchoolId() {
		return schoolId;
	}
	public void setSchoolId(Long schoolId) {
		this.schoolId = schoolId;
	}
	public String getSchoolName() {
		return schoolName;
	}
	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}
	public String getSelectIds() {
		return selectIds;
	}
	public void setSelectIds(String selectIds) {
		this.selectIds = selectIds;
	}
	public byte getZjStatus() {
		return zjStatus;
	}
	public void setZjStatus(byte zjStatus) {
		this.zjStatus = zjStatus;
	}
	public int hashCode() {
	     return new HashCodeBuilder(17, 37).
	       append(this.reqType).
	       append(this.schoolId).
	       append(this.schoolName).
	       append(this.selectIds).
	       toHashCode();
	}
	
	public boolean equals(Object obj) {
		   if (obj == null) { return false; }
		   if (obj == this) { return true; }
		   if (obj.getClass() != getClass()) {
		     return false;
		   }
		   BizRequest oth = (BizRequest) obj;
		   return new EqualsBuilder()
				   		 .append(this.reqType, oth.reqType)
		                 .append(this.schoolId, oth.schoolId)
		                 .append(this.schoolName, oth.schoolName)
		                 .append(this.selectIds, oth.selectIds)
		                 .isEquals();
	}
}
