public static RespFunStruct ExtBaseFuncCall(ReqeFunStruct reqeObj) { RespFunStruct resp = new RespFunStruct(); bool result = false; UserIDOP userID = reqeObj.userIDOP; switch (reqeObj.FunName) { case ComFunCallEnum.LogFunctionCall: UserFunctionOPLog add = JsonConvert.DeserializeObject <UserFunctionOPLog>(reqeObj.FunObject.ToString()); try { result = BLL.OPLog.Add(add, GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode); resp.IsSuccess = "1"; resp.ReturnObject = result.ToString(); } catch (Exception ex) { resp.IsSuccess = "0"; resp.Msg = "ComFunCallEnum.LogFunctionCall error"; ex.Data.Add("UserCustomDefinitionMsg", "准确点错误描述:ComFunCallEnum.LogFunctionCall;Add对象JSON字串描述:" + reqeObj.FunObject.ToString()); throw ex; } break; } return(resp); }
/// <summary> 添加日志 /// </summary> /// <param name="item"></param> /// <param name="currAccDbName"></param> /// <returns></returns> public static bool Add(UserFunctionOPLog item, string currAccDbName) { Dictionary <string, string> DicParam = new Dictionary <string, string>(); DicParam.Add("user_id", item.userOP.UserID); DicParam.Add("u_f_log_id", System.Guid.NewGuid().ToString()); DicParam.Add("com_id", item.com_id); DicParam.Add("access_time", item.access_time.ToString()); DicParam.Add("fun_id", item.fun_id.ToString()); return(DBHelper.Submit_AddLog("添加用户菜单日志", currAccDbName, "tl_user_function_log", "", "", DicParam)); }
public static void LogFunctionCall(string fun_id, string setId = null) { UserFunctionOPLog FunctionOP_Add = new UserFunctionOPLog(); FunctionOP_Add.com_id = HXC_FuncUtility.GlobalStaticObj_Server.Instance.ComID; FunctionOP_Add.fun_id = fun_id; FunctionOP_Add.userOP = new SYSModel.UserIDOP() { UserID = HXC_FuncUtility.GlobalStaticObj_Server.Instance.UserID, OPName = "菜单功能操作日志" }; BLL.OPLog.Add(FunctionOP_Add, GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode); }
public void Add(UserFunctionOPLog item) { UserFunctionOPLogQueue.Enqueue(item); Interlocked.Increment(ref queueLength); lock (SynObject) { if (queueLength > 10 && !runFlag) { ThreadPool.QueueUserWorkItem(new WaitCallback(NewThreadFunc)); } } }
/// <summary> 添加日志 /// </summary> /// <param name="item"></param> /// <param name="currAccDbName"></param> /// <returns></returns> public static bool Add(UserFunctionOPLog item, string currAccDbName) { Dictionary <string, string> DicParam = new Dictionary <string, string>(); DicParam.Add("user_id", item.userOP.UserID); DicParam.Add("u_f_log_id", System.Guid.NewGuid().ToString()); DicParam.Add("com_id", item.com_id); DicParam.Add("access_time", item.access_time.ToString()); DicParam.Add("create_time", Common.LocalDateTimeToUtcLong(GlobalStaticObj_Server.Instance.CurrentDateTime).ToString()); DicParam.Add("fun_id", item.fun_id.ToString()); return(DBHelper.Submit_AddLog("添加用户菜单日志", currAccDbName, "tl_user_function_log", "", "", DicParam)); }
/// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="isDisposing">如果应释放托管资源,为 true;否则为 false</param> protected static void Dispose(bool isDisposing) { if (_alreadyDisposed) { return; } if (isDisposing) { _userFunctionOPLogQueue = null; _instance = null; //GC.SuppressFinalize(this); } _alreadyDisposed = true; }
private void NewThreadFunc(object state) { runFlag = true; UserFunctionOPLog item = null; while (UserFunctionOPLogQueue.TryDequeue(out item)) { //将item送往用户操作日志表 //访问数据库的操作写在这里 BLL.OPLog.Add(item, GlobalStaticObj_Server.DbPrefix + GlobalStaticObj_Server.CommAccCode); Interlocked.Decrement(ref queueLength); } runFlag = false; }