package core.stlmes.server.sale.service.baseservice;

import java.sql.ResultSet;

import CoreFS.SA01.CoreIComponent;
import CoreFS.SA06.CoreReturnObject;
import core.stlmes.server.sale.dao.SlmBusinessOpeInfoDao;
import core.stlmes.server.sale.po.SlmBusinessOpeInfoBean;

public class BaseBll extends CoreIComponent
{
	public String Validflag = "1";
	public String Sale_Org = "10001";
	public String Car_Type = "汽运";
	public String Port_Type = "船运";
	public String Regionno = "1111";
	public String OrderSts_Init = "0";
	private SlmBusinessOpeInfoDao slmBusinessOpeInfoDao = new SlmBusinessOpeInfoDao();
	public String daoName = core.stlmes.server.sale.constdefine.ConstDef.daoName;

	public void setCroErrMsg(CoreReturnObject cro, String errMsg)
	{
		cro.setV_errCode(-1);
		cro.setV_errMsg(errMsg);

	}

	public CoreReturnObject ExcuteNonQueryIgnoreTrans(String sqlStr)
			throws java.sql.SQLException,java.lang.Exception
	{
		CoreReturnObject cro = new CoreReturnObject();
		cro = this.getDao(daoName).ExcuteNonQuery(sqlStr);
		return cro;
	}

	public CoreReturnObject ExcuteNonQueryIgnoreTrans(
			java.util.ArrayList listSql)
	{
		CoreReturnObject cro = new CoreReturnObject();
		cro = this.getDao(daoName).ExcuteTransction(listSql);
		return cro;

	}

	public String getRadomChar()
	{
		String Str = "QWERTYUIOPASDFGHJKLZXCVBNM";
		int rad = new java.util.Random().nextInt(Str.length() - 2);
		try
		{
			return Str.charAt(rad) + "";

		}
		catch (java.lang.Exception ex)
		{
			return Str.substring(0, 1);
		}
	}

	public String getRadomChar(int chaNum)
	{
		String Str = "QWERTYUIOPASDFGHJKLZXCVBNM";
		if (chaNum == 0) return getRadomChar();

		try
		{
			String strs = "";
			for (int i = 0; i < chaNum; i++)
			{
				int rad = new java.util.Random().nextInt(Str.length() - 2);
				strs += Str.charAt(rad) + "";

			}
			return strs;

		}
		catch (java.lang.Exception ex)
		{
			return Str.substring(0, 1);
		}
	}

	public void logBusinessInfo(SlmBusinessOpeInfoBean bean)
	{
		int saveDays = 90;
		try
		{
			slmBusinessOpeInfoDao.insert(bean);

		}
		catch (java.sql.SQLException ex)
		{

		}
		catch (java.lang.Exception ex)
		{

		}

		try
		{
			slmBusinessOpeInfoDao.delete(saveDays);

		}
		catch (java.sql.SQLException ex)
		{

		}
		catch (java.lang.Exception ex)
		{

		}

	}

	public final String orderLnStatus_Init = "0";
	public final String orderLnStatus_InsertAffrim = "1";
	public final String orderLnStatus_Declare = "1";
	public final String orderLnStatus_UnDeclare = "2";
	public final String orderLnStatus_DeclareSuccess = "3";
	public final String orderLnStatus_DeclareUnSuccess = "-3";
	public final String orderLnStatus_ReviewSuccess = "5";
	public final String orderLnStatus_ReviewUnSuccess = "-5";
	public final String orderLnStatus_RealAffrim = "6";
	public final String orderLnStatus_ResourceSend = "7";
	public final String orderLnStatus_SendClose = "8";
	public final String orderLnStatus_InvoiceClose = "9";
	public final String orderLnStatus_SceAccept = "10";
	public final String orderLnStatus_SceClose = "11";
}
