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

import java.sql.SQLException;
import core.stlmes.server.sale.po.fund.*;
import core.stlmes.server.sale.service.baseservice.BaseBll;
import java.util.*;
import CoreFS.SA06.CoreReturnObject;
import core.stlmes.server.sale.dao.fund.FundCustAccountDao;
import core.stlmes.server.sale.dao.fund.FundInOutDao;
import core.stlmes.server.sale.dbhelp.DbTrans;
import core.stlmes.server.sale.dao.*;

public class FundCustAccountMgt extends BaseBll
{
	public CoreReturnObject createCustAccount(java.util.HashMap map)
	{
		CoreReturnObject cro = new CoreReturnObject();
		if (map == null || map.size() == 0) return cro;
		core.stlmes.server.sale.po.fund.SelFundCustAccountBean bean = SelFundCustAccountBean
				.convertHashMapToBean(map);
		FundCustAccountDao dao = new FundCustAccountDao();
		bean.setTotalmoney(0.0);
		bean.setLeavemoney(0.0);
		try
		{
			List<SelFundCustAccountBean> list = dao.getSelFundCustAccountInfo(
					bean.getBalancesubject(), bean.getBuyercode());
			if (list == null || list.size() == 0)
			{
				cro = dao.insert(bean);
			}

		}
		catch (java.sql.SQLException ex)
		{
			super.setCroErrMsg(cro, ex.getMessage());
			return cro;
		}
		catch (java.lang.Exception ex)
		{
			super.setCroErrMsg(cro, ex.getMessage());
			return cro;
		}
		return cro;
	}

}
