package cn.ibizlab.core.extensions.domain;

import cn.ibizlab.core.lite.extensions.domain.ModelObj;
import lombok.Data;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

@Data
public class BaseRequest
{
	private String id;
	private String msg;
	private String systemid;

	@Override
	public String toString() {
		return "BaseRequest{" +
				"id='" + id + '\'' +
				", msg='" + msg + '\'' +
				", datas=" + datas.size() +
				", model='" + model + '\'' +
				", batch='" + batch + '\'' +
				", rules=" + rules.size() +
				'}';
	}

	public String toString2() {
		return "BaseRequest{" +
				"id='" + id + '\'' +
				", msg='" + msg + '\'' +
				", datas=" + datas +
				", model='" + model + '\'' +
				", batch='" + batch + '\'' +
				", rules=" + rules.size() +
				'}';
	}

	private List<ModelObj> datas;
	private String model;
	private String engineId;
	private String resultDataSource;
	private String resultTableName;
	private String batch;
	private List<String> rules;
	private List<String> ruleIds;

	private SimpleDateFormat format =new SimpleDateFormat("yyyyMMddHHmmss");
	public String getBatch()
	{
		if(batch==null || batch.equals(""))
		{

			batch= format.format(new java.util.Date())+"["+model+"]";
		}

		return this.batch;
	}


}
