You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
498 lines
17 KiB
498 lines
17 KiB
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using SiaSun.LMS.Interface;
|
|
using System.Data;
|
|
using SiaSun.LMS.Persistence;
|
|
using System.ServiceModel;
|
|
using System.Reflection;
|
|
using System.IO;
|
|
using System.Xml;
|
|
using System.Linq;
|
|
using IBatisNet.Common;
|
|
using log4net;
|
|
using SiaSun.LMS.Model;
|
|
|
|
|
|
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]
|
|
namespace SiaSun.LMS.Implement
|
|
{
|
|
[ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple, MaxItemsInObjectGraph = int.MaxValue)]
|
|
public partial class S_BaseService : SiaSun.LMS.Interface.I_BaseService
|
|
{
|
|
public S_BaseService()
|
|
{
|
|
dicDataAccess.Add("HouseMap", _P_Base_House);
|
|
|
|
dicDataAccess.Add("ERPMap", _P_Base_ERP);
|
|
}
|
|
|
|
/// <summary>
|
|
/// ÏûϢת»»Îĵµ
|
|
/// </summary>
|
|
public static XmlDocument xmlDocMessage = null;
|
|
|
|
/// <summary>
|
|
/// ÈÕÖ¾²Ù×÷
|
|
/// </summary>
|
|
public ILog _log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
IDictionary<string, P_Base> dicDataAccess = new Dictionary<string, P_Base>();
|
|
|
|
public SiaSun.LMS.Persistence.P_Base_House _P_Base_House = new SiaSun.LMS.Persistence.P_Base_House();
|
|
|
|
public SiaSun.LMS.Persistence.P_Base_ERP _P_Base_ERP = new P_Base_ERP();
|
|
|
|
|
|
#region ------Êý¾Ý³Ö¾Ã²ãʵÀý
|
|
|
|
public SiaSun.LMS.Persistence.P_FIELD_DESCRIPTION _P_FIELD_DESCRIPTION = new P_FIELD_DESCRIPTION();
|
|
|
|
public SiaSun.LMS.Persistence.P_FLOW_ACTION _P_FLOW_ACTION = new SiaSun.LMS.Persistence.P_FLOW_ACTION();
|
|
public SiaSun.LMS.Persistence.P_FLOW_NODE _P_FLOW_NODE = new SiaSun.LMS.Persistence.P_FLOW_NODE();
|
|
public SiaSun.LMS.Persistence.P_FLOW_PARA _P_FLOW_PARA = new SiaSun.LMS.Persistence.P_FLOW_PARA();
|
|
public SiaSun.LMS.Persistence.P_FLOW_TYPE _P_FLOW_TYPE = new SiaSun.LMS.Persistence.P_FLOW_TYPE();
|
|
|
|
public SiaSun.LMS.Persistence.P_GOODS_CLASS _P_GOODS_CLASS = new SiaSun.LMS.Persistence.P_GOODS_CLASS();
|
|
public SiaSun.LMS.Persistence.P_GOODS_MAIN _P_GOODS_MAIN = new SiaSun.LMS.Persistence.P_GOODS_MAIN();
|
|
public SiaSun.LMS.Persistence.P_GOODS_TEMPLATE _P_GOODS_TEMPLETE = new SiaSun.LMS.Persistence.P_GOODS_TEMPLATE();
|
|
public SiaSun.LMS.Persistence.P_GOODS_TEMPLATE_LIST _P_GOODS_TEMPLETE_LIST = new SiaSun.LMS.Persistence.P_GOODS_TEMPLATE_LIST();
|
|
public SiaSun.LMS.Persistence.P_GOODS_TYPE _P_GOODS_TYPE = new SiaSun.LMS.Persistence.P_GOODS_TYPE();
|
|
public SiaSun.LMS.Persistence.P_GOODS_PROPERTY _P_GOODS_PROPERTY = new SiaSun.LMS.Persistence.P_GOODS_PROPERTY();
|
|
|
|
public SiaSun.LMS.Persistence.P_IO_CONTROL _P_IO_CONTROL = new SiaSun.LMS.Persistence.P_IO_CONTROL();
|
|
public SiaSun.LMS.Persistence.P_IO_CONTROL_APPLY _P_IO_CONTROL_APPLY = new SiaSun.LMS.Persistence.P_IO_CONTROL_APPLY();
|
|
public SiaSun.LMS.Persistence.P_IO_CONTROL_APPLY_HIS _P_IO_CONTROL_APPLY_HIS = new SiaSun.LMS.Persistence.P_IO_CONTROL_APPLY_HIS();
|
|
public SiaSun.LMS.Persistence.P_IO_CONTROL_ROUTE _P_IO_CONTROL_ROUTE = new SiaSun.LMS.Persistence.P_IO_CONTROL_ROUTE();
|
|
|
|
public SiaSun.LMS.Persistence.P_RECORD_DETAIL _P_RECORD_DETAIL = new SiaSun.LMS.Persistence.P_RECORD_DETAIL();
|
|
public SiaSun.LMS.Persistence.P_RECORD_LIST _P_RECORD_LIST = new SiaSun.LMS.Persistence.P_RECORD_LIST();
|
|
public SiaSun.LMS.Persistence.P_RECORD_MAIN _P_RECORD_MAIN = new SiaSun.LMS.Persistence.P_RECORD_MAIN();
|
|
|
|
public SiaSun.LMS.Persistence.P_MANAGE_DETAIL _P_MANAGE_DETAIL = new SiaSun.LMS.Persistence.P_MANAGE_DETAIL();
|
|
public SiaSun.LMS.Persistence.P_MANAGE_LIST _P_MANAGE_LIST = new SiaSun.LMS.Persistence.P_MANAGE_LIST();
|
|
public SiaSun.LMS.Persistence.P_MANAGE_MAIN _P_MANAGE_MAIN = new SiaSun.LMS.Persistence.P_MANAGE_MAIN();
|
|
public SiaSun.LMS.Persistence.P_MANAGE_TYPE _P_MANAGE_TYPE = new SiaSun.LMS.Persistence.P_MANAGE_TYPE();
|
|
public SiaSun.LMS.Persistence.P_MANAGE_TYPE_PARAM _P_MANAGE_TYPE_PARAM = new SiaSun.LMS.Persistence.P_MANAGE_TYPE_PARAM();
|
|
|
|
public SiaSun.LMS.Persistence.P_PLAN_DETAIL _P_PLAN_DETAIL = new SiaSun.LMS.Persistence.P_PLAN_DETAIL();
|
|
public SiaSun.LMS.Persistence.P_PLAN_LIST _P_PLAN_LIST = new SiaSun.LMS.Persistence.P_PLAN_LIST();
|
|
public SiaSun.LMS.Persistence.P_PLAN_MAIN _P_PLAN_MAIN = new SiaSun.LMS.Persistence.P_PLAN_MAIN();
|
|
public SiaSun.LMS.Persistence.P_PLAN_TYPE _P_PLAN_TYPE = new SiaSun.LMS.Persistence.P_PLAN_TYPE();
|
|
|
|
|
|
public SiaSun.LMS.Persistence.P_STORAGE_DETAIL _P_STORAGE_DETAIL = new SiaSun.LMS.Persistence.P_STORAGE_DETAIL();
|
|
public SiaSun.LMS.Persistence.P_STORAGE_LIST _P_STORAGE_LIST = new SiaSun.LMS.Persistence.P_STORAGE_LIST();
|
|
public SiaSun.LMS.Persistence.P_STORAGE_MAIN _P_STORAGE_MAIN = new SiaSun.LMS.Persistence.P_STORAGE_MAIN();
|
|
|
|
public SiaSun.LMS.Persistence.P_SYS_ITEM _P_SYS_ITEM = new SiaSun.LMS.Persistence.P_SYS_ITEM();
|
|
public SiaSun.LMS.Persistence.P_SYS_ITEM_LIST _P_SYS_ITEM_LIST = new SiaSun.LMS.Persistence.P_SYS_ITEM_LIST();
|
|
public SiaSun.LMS.Persistence.P_SYS_MENU _P_SYS_MENU = new SiaSun.LMS.Persistence.P_SYS_MENU();
|
|
|
|
public SiaSun.LMS.Persistence.P_SYS_ROLE _P_SYS_ROLE = new SiaSun.LMS.Persistence.P_SYS_ROLE();
|
|
public SiaSun.LMS.Persistence.P_SYS_ROLE_WINDOW _P_SYS_ROLE_WINDOW = new SiaSun.LMS.Persistence.P_SYS_ROLE_WINDOW();
|
|
public SiaSun.LMS.Persistence.P_SYS_USER _P_SYS_USER = new SiaSun.LMS.Persistence.P_SYS_USER();
|
|
public SiaSun.LMS.Persistence.P_SYS_TABLE _P_SYS_TABLE = new SiaSun.LMS.Persistence.P_SYS_TABLE();
|
|
public SiaSun.LMS.Persistence.P_SYS_TABLE_CONVERTER _P_SYS_TABLE_CONVERTER = new SiaSun.LMS.Persistence.P_SYS_TABLE_CONVERTER();
|
|
public SiaSun.LMS.Persistence.P_SYS_TABLE_CONVERTER_LIST _P_SYS_TABLE_CONVERTER_LIST = new SiaSun.LMS.Persistence.P_SYS_TABLE_CONVERTER_LIST();
|
|
|
|
public SiaSun.LMS.Persistence.P_SYS_RELATION _P_SYS_RELATION = new SiaSun.LMS.Persistence.P_SYS_RELATION();
|
|
public SiaSun.LMS.Persistence.P_SYS_RELATION_LIST _P_SYS_RELATION_LIST = new SiaSun.LMS.Persistence.P_SYS_RELATION_LIST();
|
|
|
|
|
|
public SiaSun.LMS.Persistence.P_TECHNICS_MAIN _P_TECHNICS_MAIN = new P_TECHNICS_MAIN();
|
|
public SiaSun.LMS.Persistence.P_TECHNICS_ROUTE _P_TECHNICS_ROUTE = new P_TECHNICS_ROUTE();
|
|
|
|
public SiaSun.LMS.Persistence.P_WH_AREA _P_WH_AREA = new SiaSun.LMS.Persistence.P_WH_AREA();
|
|
public SiaSun.LMS.Persistence.P_WH_CELL _P_WH_CELL = new SiaSun.LMS.Persistence.P_WH_CELL();
|
|
public SiaSun.LMS.Persistence.P_WH_DESCRIPTION _P_WH_DESCRIPTION = new SiaSun.LMS.Persistence.P_WH_DESCRIPTION();
|
|
public SiaSun.LMS.Persistence.P_WH_LOGIC _P_WH_LOGIC = new SiaSun.LMS.Persistence.P_WH_LOGIC();
|
|
public SiaSun.LMS.Persistence.P_WH_WAREHOUSE _P_WH_WAREHOUSE = new SiaSun.LMS.Persistence.P_WH_WAREHOUSE();
|
|
|
|
public SiaSun.LMS.Persistence.P_LED_MAIN _P_LED_MAIN = new SiaSun.LMS.Persistence.P_LED_MAIN();
|
|
public SiaSun.LMS.Persistence.P_LED_LIST _P_LED_LIST = new SiaSun.LMS.Persistence.P_LED_LIST();
|
|
|
|
#endregion
|
|
|
|
#region ------ÒµÎñ²ãʵÀý
|
|
|
|
/// <summary>
|
|
/// ϵͳ´¦ÀíÀà
|
|
/// </summary>
|
|
///
|
|
private SiaSun.LMS.Implement.S_SystemService _s_systemservice = null;
|
|
public SiaSun.LMS.Implement.S_SystemService _S_SystemService
|
|
{
|
|
get
|
|
{
|
|
if (_s_systemservice == null)
|
|
_s_systemservice = new SiaSun.LMS.Implement.S_SystemService();
|
|
|
|
return _s_systemservice;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ¹¤×÷Á÷´¦ÀíÀà
|
|
/// </summary>
|
|
private SiaSun.LMS.Implement.S_FlowService _s_flowservice = null;
|
|
|
|
public SiaSun.LMS.Implement.S_FlowService _S_FlowService
|
|
{
|
|
get
|
|
{
|
|
if (_s_flowservice == null)
|
|
_s_flowservice = new S_FlowService();
|
|
|
|
return _s_flowservice;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ²Ö¿â´¦ÀíÀà
|
|
/// </summary>
|
|
private SiaSun.LMS.Implement.S_CellService _s_cellservice = null;
|
|
public SiaSun.LMS.Implement.S_CellService _S_CellService
|
|
{
|
|
get
|
|
{
|
|
if (_s_cellservice == null)
|
|
_s_cellservice = new S_CellService();
|
|
|
|
return _s_cellservice;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ¼Æ»®µ¥¾ÝÀà
|
|
/// </summary>
|
|
private SiaSun.LMS.Implement.S_PlanService _s_planservice = null;
|
|
|
|
public SiaSun.LMS.Implement.S_PlanService _S_PlanService
|
|
{
|
|
get
|
|
{
|
|
if (_s_planservice == null)
|
|
_s_planservice = new S_PlanService();
|
|
|
|
return _s_planservice;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ÈÎÎñ´¦ÀíÀà
|
|
/// </summary>
|
|
|
|
private SiaSun.LMS.Implement.S_ManageService _s_manageservice = null;
|
|
public SiaSun.LMS.Implement.S_ManageService _S_ManageService
|
|
{
|
|
get
|
|
{
|
|
if (_s_manageservice == null)
|
|
_s_manageservice = new S_ManageService();
|
|
|
|
return _s_manageservice;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ÎïÁÏ¡¢¿â´æ´¦ÀíÀà
|
|
/// </summary>
|
|
|
|
|
|
private SiaSun.LMS.Implement.S_StorageService _s_storageservice = null;
|
|
public SiaSun.LMS.Implement.S_StorageService _S_StorageService
|
|
{
|
|
get
|
|
{
|
|
if (_s_storageservice == null)
|
|
_s_storageservice = new S_StorageService();
|
|
|
|
return _s_storageservice;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ÎïÁÏÀà
|
|
/// </summary>
|
|
private SiaSun.LMS.Implement.S_GoodsService _s_goodsservice = null;
|
|
public SiaSun.LMS.Implement.S_GoodsService _S_GoodsService
|
|
{
|
|
get
|
|
{
|
|
if (_s_goodsservice == null)
|
|
_s_goodsservice = new S_GoodsService();
|
|
|
|
return _s_goodsservice;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// ·¢ËÍÆÁÄ»
|
|
/// </summary>
|
|
private SiaSun.LMS.Implement.S_LEDService _s_ledsservice = null;
|
|
public SiaSun.LMS.Implement.S_LEDService _S_LEDService
|
|
{
|
|
get
|
|
{
|
|
if (_s_ledsservice == null)
|
|
_s_ledsservice = new S_LEDService();
|
|
|
|
return _s_ledsservice;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ²Ù×÷·½·¨
|
|
|
|
public bool Invoke(string sPlanType, string sMethod, object[] inParams, out string sResult)
|
|
{
|
|
bool bResult = true;
|
|
|
|
sResult = string.Empty;
|
|
|
|
string sClassFullName = string.Format("SiaSun.LMS.Implement.{0}", sPlanType);
|
|
|
|
List<object> oPara = inParams.ToList<object>();
|
|
|
|
oPara.Add(sResult);
|
|
|
|
Type t = this.GetType();
|
|
|
|
Assembly complierAssembly = t.Assembly;
|
|
|
|
object complierInstance = complierAssembly.CreateInstance(sClassFullName);
|
|
|
|
Type type = complierInstance.GetType();
|
|
|
|
object[] obj = oPara.ToArray();
|
|
|
|
object oResult = null;
|
|
|
|
//´´½¨·´ÉäµÄËùÓй«Ó÷½·¨
|
|
MethodInfo[] lsMethodInfo = type.GetMethods();
|
|
|
|
foreach (MethodInfo methodInfo in lsMethodInfo)
|
|
{
|
|
if (methodInfo.Name.Equals(sMethod) && oPara.Count.Equals(methodInfo.GetParameters().Length))
|
|
{
|
|
oResult = methodInfo.Invoke(complierInstance, obj);
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
bResult = Convert.ToBoolean(oResult);
|
|
|
|
sResult = obj[oPara.Count - 1].ToString();
|
|
|
|
return bResult;
|
|
}
|
|
|
|
|
|
public bool Invoke(string sPlanType, string sMethod, object[] inParams, out object[] outParams)
|
|
{
|
|
bool bResult = true;
|
|
|
|
string sClassFullName = string.Format("SiaSun.LMS.Implement.{0}", sPlanType);
|
|
|
|
List<object> oPara = inParams.ToList<object>();
|
|
|
|
Type t = this.GetType();
|
|
|
|
Assembly complierAssembly = t.Assembly;
|
|
|
|
object complierInstance = complierAssembly.CreateInstance(sClassFullName);
|
|
|
|
Type type = complierInstance.GetType();
|
|
|
|
outParams = oPara.ToArray();
|
|
|
|
object oResult = null;
|
|
|
|
//´´½¨·´ÉäµÄËùÓй«Ó÷½·¨
|
|
MethodInfo[] lsMethodInfo = type.GetMethods();
|
|
|
|
foreach (MethodInfo methodInfo in lsMethodInfo)
|
|
{
|
|
if (methodInfo.Name.Equals(sMethod) && oPara.Count.Equals(methodInfo.GetParameters().Length))
|
|
{
|
|
oResult = methodInfo.Invoke(complierInstance, outParams);
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
bResult = Convert.ToBoolean(oResult);
|
|
|
|
return bResult;
|
|
}
|
|
|
|
public void ExecuteNonQuery_ReturnVoid(string strSQL, string DataAccess = "HouseMap")
|
|
{
|
|
try
|
|
{
|
|
this.dicDataAccess[DataAccess].ExecuteNonQuery(strSQL, "dynamicSQL");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(string.Format("ExecuteNonQuery({0}):", strSQL) + ex.Message, ex);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
public int ExecuteNonQuery_ReturnInt(string strSQL,string DataAccess="HouseMap")
|
|
{
|
|
try
|
|
{
|
|
int intResult = this.dicDataAccess[DataAccess].ExecuteNonQuery(strSQL, "dynamicSQL");
|
|
return intResult;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(string.Format("ExecuteNonQuery({0}):", strSQL) + ex.Message, ex);
|
|
}
|
|
}
|
|
|
|
public DataTable GetList(string strSQL,string DataAccess="HouseMap")
|
|
{
|
|
DataTable dtResult = new DataTable();
|
|
|
|
try
|
|
{
|
|
dtResult = this.dicDataAccess[DataAccess].ExecuteQueryForDataTable("dynamicSQL", strSQL);
|
|
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
return dtResult;
|
|
}
|
|
|
|
public DataTable GetTableXmlSql(string statementsql, object paramObject,string DataAccess="HouseMap")
|
|
{
|
|
DataTable dtResult = new DataTable();
|
|
try
|
|
{
|
|
dtResult = this.dicDataAccess[DataAccess].ExecuteQueryForDataTable(statementsql, paramObject);
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
return dtResult;
|
|
}
|
|
|
|
public ObjectT GetModel(string statementName, object parameterObject, string DataAccess = "HouseMap")
|
|
{
|
|
try
|
|
{
|
|
return this.dicDataAccess[DataAccess].ExecuteQueryForObject(statementName, parameterObject);
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public ObjectList GetListObject(string statementName, object parameterObject, string DataAccess = "HouseMap")
|
|
{
|
|
try
|
|
{
|
|
return this.dicDataAccess[DataAccess].ExecuteQueryForList(statementName, parameterObject);
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public int Save(DataTable dt, string tablename,string DataAccess="HouseMap")
|
|
{
|
|
int iResult = 0;
|
|
|
|
try
|
|
{
|
|
iResult = this.dicDataAccess[DataAccess].SaveDataTable(dt, tablename);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
}
|
|
|
|
return iResult;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
/// ¸ù¾Ý¹Ø¼ü×Ö»ñµÃÐÅÏ¢ÃèÊö
|
|
/// </summary>
|
|
public string MessageConverter_GetKeyValue(string Key, params object[] Param)
|
|
{
|
|
string strMessage = null;
|
|
try
|
|
{
|
|
string strLanguge = SiaSun.LMS.Common.AppSettings.GetValue("Language");
|
|
if (xmlDocMessage == null)
|
|
{
|
|
xmlDocMessage = MessageConverter_GetXmlDoc();
|
|
}
|
|
|
|
System.Xml.XmlNode xmlNode = xmlDocMessage.SelectSingleNode(string.Format("MessageDictionary/Message[@Key='{0}']", Key));
|
|
if (xmlNode != null)
|
|
{
|
|
//»ñµÃÏûÏ¢Öµ
|
|
strMessage = string.Format(xmlNode.Attributes[strLanguge].Value.ToString(), (Param == null || Param.Length == 0 ? new object[] { string.Empty } : Param));
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
strMessage = Key;
|
|
}
|
|
return string.IsNullOrEmpty(strMessage) ? Key : strMessage;
|
|
}
|
|
|
|
/// <summary>
|
|
/// ¸ù¾Ý¹Ø¼ü×Ö»ñµÃÐÅÏ¢ÃèÊö
|
|
/// </summary>
|
|
private System.Xml.XmlDocument MessageConverter_GetXmlDoc()
|
|
{
|
|
try
|
|
{
|
|
string strMessageXmlFile = AppDomain.CurrentDomain.BaseDirectory + string.Format(@"Files\MessageDictionary.xml");
|
|
return new Common.XmlFiles(strMessageXmlFile);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
/// <summary>ϵͳ³õʼ»¯
|
|
/// ϵͳ³õʼ»¯
|
|
/// </summary>
|
|
public void InitSystem()
|
|
{
|
|
this._P_Base_House.InitSystem();
|
|
}
|
|
}
|
|
|
|
}
|