package com.swfarm.biz.chain.bo;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Random;

import com.swfarm.pub.framework.FormNumberCache;

public class JobExecutionState implements Serializable {

	private Long id;

	private String jobName;

	private String jobInstanceName;

	private String saleChannel;

	private String accountNumber;

	private Timestamp executionTime = new Timestamp(System.currentTimeMillis());

	public Long getId() {
		return id;
	}

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

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getJobInstanceName() {
		return jobInstanceName;
	}

	public void setJobInstanceName(String jobInstanceName) {
		this.jobInstanceName = jobInstanceName;
	}

	public String getSaleChannel() {
		return saleChannel;
	}

	public void setSaleChannel(String saleChannel) {
		this.saleChannel = saleChannel;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public Timestamp getExecutionTime() {
		return executionTime;
	}

	public void setExecutionTime(Timestamp executionTime) {
		this.executionTime = executionTime;
	}

	public String generateJobInstanceName() {
		StringBuffer jobInstanceNameBuffer = new StringBuffer();
		jobInstanceNameBuffer.append(this.jobName);
		jobInstanceNameBuffer.append(System.currentTimeMillis());
		Random random = new Random();
		int i1 = FormNumberCache.getRandomInteger(1, 9, random);
		int i2 = FormNumberCache.getRandomInteger(1, 9, random);
		int i3 = FormNumberCache.getRandomInteger(1, 9, random);
		int i4 = FormNumberCache.getRandomInteger(1, 9, random);
		jobInstanceNameBuffer.append(i1);
		jobInstanceNameBuffer.append(i2);
		jobInstanceNameBuffer.append(i3);
		jobInstanceNameBuffer.append(i4);
		return jobInstanceNameBuffer.toString();
	}

	public static void main(String[] args) {
	}
}