public static void AddPayOrder(OrderMqMessage item) { var orderModel = new TAutoTransfer { FAmount = item.FAmount, FBankName = item.FBankName, FCardNo = item.FCardNo, FHolders = item.FHolders, FMerchantAddTime = Convert.ToDateTime(item.FMerchantAddTime), FMerchantCode = item.FMerchantCode, FMerchantOrderNumber = item.FMerchantOrderNumber, FOrderNumber = CreateNoHelper.CreatPayOrderNo(), FAddTime = DateTime.Now, FStatus = 0 }; try { DBDataSourceHelper.AddOrmData(orderModel); } catch (Exception ex) { throw new Exception("PayOrderService.AddPayOrder--消息队列执行出错" + ex.Message); } }
/// <summary> /// 功能描述:获取代付订单列表 /// </summary> /// <param name="merchantCode">商户号</param> /// <param name="pageInfo">分页信息</param> /// <param name="status">订单状态</param> /// <returns></returns> public static FeedBackResponse <IList <TAutoTransfer> > GetTautoTransferInfoByMerchantCode(string merchantCode, PageInfoParam pageInfo, int?status = null) { var fbrReturn = new FeedBackResponse <IList <TAutoTransfer> >(); var strSqlBase = new StringBuilder(200); var strSqlCout = new StringBuilder(200); //参数字典 var parames = new Dictionary <string, object>(); strSqlBase.Append("SELECT FId,FMerchantCode,FMerchantOrderNumber,FMerchantAddTime,FAmount,FStatus,FHolders,FBankName,FCardNo,FOrderNumber,FAddTime from tautotransfer where FMerchantCode=@FMerchantCode"); strSqlCout.Append("select count(1) from tautotransfer where FMerchantCode=@FMerchantCode"); parames.Add("FMerchantCode", merchantCode); if (null != status) { strSqlBase.Append(" and FStatus=@FStatus"); strSqlCout.Append(" and FStatus=@FStatus"); parames.Add("FStatus", status.Value); } var sql = new StringBuilder(DBDataSourceHelper.GetPageSql(strSqlBase.ToString(), pageInfo)); sql.Append(";"); sql.Append(strSqlCout); var data = DBDataSourceHelper.GetOrmPageData <TAutoTransfer>(sql.ToString(), parames: parames); fbrReturn.ResultData = data.Item1; fbrReturn.TotalCount = data.Item2; return(fbrReturn); }
/// <summary> /// 功能:搜索日志数据列表 /// </summary> /// <param name="strLevel">日志级别</param> /// <param name="strSource">日志来源</param> /// <param name="dtmStartTime">日志起始时间</param> /// <param name="dtmEndTime">日志结束时间</param> /// <param name="strMessage">日志信息</param> /// <param name="strAddition">附加信息</param> /// <returns>日志数据列表 </returns> public static FeedBackResponse <List <TCommonlog> > SearchLogData(string strLevel, string strSource, DateTime dtmStartTime, DateTime?dtmEndTime, string strMessage, string strAddition) { var fbrReturn = new FeedBackResponse <List <TCommonlog> >(); StringBuilder strSql = new StringBuilder(); strSql.Append("select * from tcommonlog "); strSql.Append("where 1=1 "); Dictionary <string, object> dictParameter = new Dictionary <string, object>(); if (!string.IsNullOrEmpty(strLevel)) { strSql.Append(" and lower(LogLevel) like ?LogLevel"); dictParameter["LogLevel"] = "%" + strLevel.ToLower() + "%"; } if (!string.IsNullOrEmpty(strSource)) { strSql.Append(" and lower(LogSource) like ?LogSource"); dictParameter["LogSource"] = "%" + strSource.ToLower() + "%"; } if (!string.IsNullOrEmpty(strMessage)) { strSql.Append(" and lower(LogMessage) like ?LogMessage"); dictParameter["LogMessage"] = "%" + strMessage.ToLower() + "%"; } if (!string.IsNullOrEmpty(strAddition)) { strSql.Append(" and lower(LogAddition) like ?LogAddition"); dictParameter["LogAddition"] = "%" + strAddition.ToLower() + "%"; } strSql.Append(" and LogDateTime >= ?SLogDateTime"); dictParameter["SLogDateTime"] = dtmStartTime; if (dtmEndTime.HasValue) { strSql.Append(" and LogDateTime <= ?ELogDateTime"); dictParameter["ELogDateTime"] = dtmEndTime; } strSql.Append(" order by LogDateTime desc"); fbrReturn.ResultData = DBDataSourceHelper.GetOrmCommonData <TCommonlog>(strSql.ToString(), parames: dictParameter); return(fbrReturn); }
/// <summary> /// 功能描述:根据用户Id获取用户信息 /// </summary> /// <param name="userId"></param> /// <returns></returns> public static FeedBackResponse <TAccounts> GetUserData(long userId) { var model = new TAccounts(); var fbrReturn = new FeedBackResponse <TAccounts>(); var cacheKey = CacheKeys.MakeUserLoginKey(userId); model = CacheHelper.Get <TAccounts>(cacheKey); if (null == model) { var predicate = Predicates.Field <TAccounts>(et => et.FID, Operator.Eq, userId); model = DBDataSourceHelper.GetSingleOrmData <TAccounts>(predicate); if (null != model) { CacheHelper.Set(CacheKeys.MakeUserLoginKey(userId), model); } } fbrReturn.ResultData = model; return(fbrReturn); }