package com.cloudcross.ssp.model;
import java.util.Date;
public class AdvBalance {
	private Long id;
	private Long accountId;
	private Long agentId;
	private Long advertiserId;
	private String advertiserName;
	private String agentName;
	private Date actTime;
	private String startDate;
	private String endDate;
	private String num;
	private String type;
	private Double balance;
	private Double cash;
	private Double charge;
	private Double allocate;
	private Double consume;
	private String memo;
	private Integer status;
	
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long accountId) {
		this.accountId = accountId;
	}
	public Long getAgentId() {
		return agentId;
	}
	public void setAgentId(Long agentId) {
		this.agentId = agentId;
	}
	public Long getAdvertiserId() {
		return advertiserId;
	}
	public void setAdvertiserId(Long advertiserId) {
		this.advertiserId = advertiserId;
	}
	public String getAdvertiserName() {
		return advertiserName;
	}
	public void setAdvertiserName(String advertiserName) {
		this.advertiserName = advertiserName;
	}
	public String getAgentName() {
		return agentName;
	}
	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}
	public Date getActTime() {
		return actTime;
	}
	public void setActTime(Date actTime) {
		this.actTime = actTime;
	}
	public String getStartDate() {
		return startDate;
	}
	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	public String getNum() {
		return num;
	}
	public void setNum(String num) {
		this.num = num;
	}
	
	public String getType() {
		if   ( charge > 0)  {
		return "充值";
		}
		else if ( allocate > 0) {
		return "分配";
		}
		else if( consume > 0)	{
		return "消费";
		}
		else 
		return "未知";	
	}
	
	public void setType(String type) {
		if  ( charge > 0)  { 
		    this.type = "充值";
		    }
		else if  ( allocate > 0)  { 
			this.type = "分配";
			}
		else if ( consume > 0)  { 
			this.type = "消费";
			}
		else  
			this.type = "未知";
			
	}
	public Double getCash() {
		if   ( charge > 0)  {
			return charge;
			}
			else if ( allocate > 0) {
			return allocate;
			}
			else if( consume > 0)	{
			return consume;
			}
			else 
			return null;	
	}
	public void setCash(Double cash) {
		if  ( charge > 0)  { 
		    this.cash = charge;
		    }
		else if  ( allocate > 0)  { 
			this.cash = allocate;
			}
		else if ( consume > 0)  { 
			this.cash = consume;
			}
		else  
			this.type = null;
	}
	public Double getBalance() {
		return balance;
	}
	public void setBalance(Double balance) {
		this.balance = balance;
	}
	public Double getCharge() {
		return charge;
	}
	public void setCharge(Double charge) {
		this.charge = charge;
	}
	public Double getAllocate() {
		return allocate;
	}
	public void setAllocate(Double allocate) {
		this.allocate = allocate;
	}
	public Double getConsume() {
		return consume;
	}
	public void setConsume(Double consume) {
		this.consume = consume;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	
	@Override
	public String toString() {
		return "AdvBalance [id=" + id + ", accountId=" + accountId
				+ ", agentId=" + agentId + ", advertiserId=" + advertiserId
				+ ", advertiserName=" + advertiserName + ", agentName="
				+ agentName + ", actTime=" + actTime + ", startDate="
				+ startDate + ", endDate=" + endDate + ", num=" + num
				+ ", type=" + type + ", balance=" + balance + ", cash=" + cash
				+ ", charge=" + charge + ", allocate=" + allocate
				+ ", consume=" + consume + ", memo=" + memo + ", status="
				+ status + "]";
	}
	
}
