public HttpResponseMessage GetAccountflowlist(parm reparm) { string result = string.Empty; try { int count = 0; string where = parwhere(reparm); DataTable dt = rule.getpaging("vwAccountflow", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count); getdata getdata = new getdata(); getdata.Table = dt; getdata.total = count; result = rule.JsonStr("ok", "成功", getdata); } catch (Exception e) { //错误保存日志 throw new InsertException(e.Message, " Accountflow", "GetAccountflowlist", reparm.ToString()); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage GetChannelinformation(parm reparm) { string result = string.Empty; try { int count = 0; string where = ""; //查询分页的数据 DataTable dt = rule.getpaging("tblChannelinformation", "*", "1=1" + where, reparm.page, reparm.limit, "fldUpstreamMerchantID desc", out count); getdata getdata = new getdata(); getdata.Table = dt; getdata.total = count; if (dt.Rows.Count > 0) { result = rule.JsonStr("ok", "成功", getdata); } else { result = rule.JsonStr("error", "失败", getdata); } } catch (Exception e) { //错误保存日志 throw new InsertException(e.Message, "tblChannelinformation", "GetChannelinformation", ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage Gethalfhour(parm reparm) { string result = string.Empty; try { int count = 0; string where = parwhere(reparm); //查询分页的数据 DataTable dt = rule.getpaging("vwtblAgentPay", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count); getdata getdata = new getdata(); getdata.Table = dt; getdata.total = count; result = rule.JsonStr("ok", "成功", getdata); } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage UpdateChannelinformation(parm reparm) { string result = string.Empty; try { int count = 0; RuletblChannelinformation ruletbl = new RuletblChannelinformation(); ruletbl.UpdateChannelinformation(reparm.fldbuckle, reparm.fldAutoID, out count); if (count > 0) { result = rule.JsonStr("ok", "成功", ""); } else { result = rule.JsonStr("error", "失败", ""); } } catch (Exception e) { //错误保存日志 throw new InsertException(e.Message, "tblChannelinformation", "GetChannelinformation", ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage GetOrdertableSystem(parm reparm) { string result = string.Empty; try { int count = 0; string where = parwhere(reparm); //查询分页的数据 DataSet dt = rule.getpaging("vwOrdertableSystem", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count, "SUM(fldOrderAmount) as fldOrderAmount,SUM(fldSettlement) as fldSettlement,SUM(fldServiceCharge) as fldServiceCharge"); getdata getdata = new getdata(); getdata.Table = dt.Tables[0]; getdata.SUMTable = dt.Tables[1]; getdata.total = count; result = rule.JsonStr("ok", "成功", getdata); } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage GetDataList(parm reparm) { string result = string.Empty; try { int count = 0; string where = ""; if (!string.IsNullOrEmpty(reparm.Accountingnum)) { where += " and fldAccountingnum='" + reparm.Accountingnum + "'"; } if (!string.IsNullOrEmpty(reparm.MerchID)) { where += " and fldMerchID='" + reparm.MerchID + "'"; } //查询分页的数据 DataTable dt = rule.getpaging("vwtblAccounting", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count); getdata getdata = new getdata(); getdata.Table = dt; getdata.total = count; result = rule.JsonStr("ok", "成功", getdata); } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage GetOrdertableSystemExcel(parm reparm) { string result = string.Empty; try { RuleExcel ruleExcel = new RuleExcel(); string path = @"~\Excel\MerchantSysem\"; string excname = DateTime.Now.ToString("yyyyMMddHHmmss") + "订单列表.xlsx"; string filename = path + excname; var sPath = @filename; path = HostingEnvironment.MapPath(path); sPath = HostingEnvironment.MapPath(sPath); //转为绝对路径 string where = parwhere(reparm); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string file = "fldCreatetime,fldtransactionnum,fldOrdernum,fldOrderAmount,fldMerchID,fldMerchName,fldStaute,fldChannelType,fldRateName,fldchangstautetime,fldSettlement,fldServiceCharge"; DataTable dt = rule.GetQueryDate("0", "vwOrdertableSystem", "1=1" + where, file); List <string> colname = new List <string>(); colname.Add("订单创建时间"); colname.Add("交易流水"); colname.Add("订单号"); colname.Add("订单金额"); colname.Add("商户ID"); colname.Add("商户名称"); colname.Add("代付状态"); colname.Add("支付类型"); colname.Add("支付方式"); colname.Add("状态变化时间"); colname.Add("结算金额"); colname.Add("手续费"); ruleExcel.TableToExcel(dt, sPath, colname); //取得当前网站的绝对路径 var sRootePath = HostingEnvironment.MapPath(HostingEnvironment.ApplicationVirtualPath); //取得文件相对于网站的路径(如:TempData/abc.mdb) var sRelativeUri = new Uri(sRootePath, UriKind.Absolute).MakeRelativeUri(new Uri(sPath, UriKind.Absolute)).ToString(); // 先判断是否与原路径相同,如相同则表示二者可能不在同一个磁盘上 var sResult = (0 == string.Compare(Path.GetFullPath(sRelativeUri), Path.GetFullPath(sPath), StringComparison.OrdinalIgnoreCase)) ? null : $"http://{HttpContext.Current.Request.Url.Authority}/{sRelativeUri}"; //构造返回路径 result = rule.JsonStr("ok", excname, sResult); } catch (Exception e) { throw new InsertException(e.Message, "Transaction", "GetOrdertableExcelDate" + "", ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
/// <summary> /// 功能描述:拼接where条件 /// 创建时间:2018-12-26 /// 创建 人:周文卿 /// </summary> /// <param name="reparm"></param> /// <returns></returns> public string parwhere(parm reparm) { string where = ""; if (!string.IsNullOrEmpty(reparm.Accountingnum)) { where += " and fldAccountingnum='" + reparm.Accountingnum + "'"; } if (!string.IsNullOrEmpty(reparm.MerchID)) { where += " and fldMerchID='" + reparm.MerchID + "'"; } if (!string.IsNullOrEmpty(reparm.transactionType)) { where += " and fldTransactionType='" + reparm.transactionType + "'"; } return(where); }
/// <summary> /// 功能描述:拼接where条件 /// 创建时间:2018-12-07 /// 创建 人:周文卿 /// </summary> /// <param name="reparm"></param> /// <returns></returns> public string parwhere(parm reparm) { string where = " and GETDATE()>=dateadd(MINUTE,+30, fldCreatetime)"; if (!string.IsNullOrEmpty(reparm.channelnum)) { where += " and fldChannelnum='" + reparm.channelnum + "'"; } if (!string.IsNullOrEmpty(reparm.flag)) { if (reparm.flag == "0") { where += " and fldPayState ='处理中'"; } } if (!string.IsNullOrEmpty(reparm.merchanid)) { where += " and fldMerchID='" + reparm.merchanid + "'"; } if (!string.IsNullOrEmpty(reparm.Ordernum)) { where += " and fldOrdernum='" + reparm.Ordernum + "'"; } if (!string.IsNullOrEmpty(reparm.minOrderAmount) && !string.IsNullOrEmpty(reparm.maxOrderAmount)) { where += " and fldActualAmount>=" + reparm.minOrderAmount + " and fldActualAmount<=" + reparm.maxOrderAmount; } if (!string.IsNullOrEmpty(reparm.PayState)) { where += " and fldPayState='" + reparm.PayState + "'"; } if (!string.IsNullOrEmpty(reparm.minOrdertime) && !string.IsNullOrEmpty(reparm.maxOrdertime)) { where += " and fldCreateTime>='" + reparm.minOrdertime + "'" + " and fldCreateTime<='" + reparm.maxOrdertime + "'"; } if (!string.IsNullOrEmpty(reparm.channelid)) { where += " and fldChannelID='" + reparm.channelid + "'"; } if (!string.IsNullOrEmpty(reparm.banknum)) { where += " and fldBankCardId='" + reparm.banknum + "'"; } return(where); }
/// <summary> /// 功能描述:拼接where条件 /// 创建时间:2018-12-07 /// 创建 人:周文卿 /// </summary> /// <param name="reparm"></param> /// <returns></returns> public string parwhere(parm reparm) { string where = ""; if (!string.IsNullOrEmpty(reparm.merchanid)) { where += " and fldMerchID='" + reparm.merchanid + "'"; } if (!string.IsNullOrEmpty(reparm.Ordernum)) { where += " and fldOrdernum='" + reparm.Ordernum + "'"; } if (!string.IsNullOrEmpty(reparm.minOrderAmount) && !string.IsNullOrEmpty(reparm.maxOrderAmount)) { where += " and fldOrderAmount>=" + reparm.minOrderAmount + " and fldOrderAmount<=" + reparm.maxOrderAmount; } if (!string.IsNullOrEmpty(reparm.Orderstaute)) { where += " and fldStaute='" + reparm.Orderstaute + "'"; } if (!string.IsNullOrEmpty(reparm.minOrdertime) && !string.IsNullOrEmpty(reparm.maxOrdertime)) { where += " and fldCreateTime>='" + reparm.minOrdertime + "'" + " and fldCreateTime<='" + reparm.maxOrdertime + "'"; } if (!string.IsNullOrEmpty(reparm.channelnum)) { where += " and fldChannelnum='" + reparm.channelnum + "'"; } if (!string.IsNullOrEmpty(reparm.channelid)) { where += " and fldChannelID='" + reparm.channelid + "'"; } if (!string.IsNullOrEmpty(reparm.paymethod)) { where += " and fldRateName='" + reparm.paymethod + "'"; } return(where); }
/// <summary> /// 功能描述:拼接where条件 /// 创建时间:2018-12-07 /// 创建 人:周文卿 /// </summary> /// <param name="reparm"></param> /// <returns></returns> public string parwhere(parm reparm) { string where = ""; if (!string.IsNullOrEmpty(reparm.merchanid)) { where += " and fldMerchID='" + reparm.merchanid + "'"; } if (!string.IsNullOrEmpty(reparm.Ordernum)) { where += " and fldOrdernum='" + reparm.Ordernum + "'"; } if (!string.IsNullOrEmpty(reparm.minOrderAmount) && !string.IsNullOrEmpty(reparm.maxOrderAmount)) { where += " and fldOrderAmount>=" + reparm.minOrderAmount + " and fldOrderAmount<=" + reparm.maxOrderAmount; } if (!string.IsNullOrEmpty(reparm.State)) { where += " and fldStaute='" + reparm.State + "'"; } if (!string.IsNullOrEmpty(reparm.minOrdertime) && !string.IsNullOrEmpty(reparm.maxOrdertime)) { where += " and fldCreateTime>='" + reparm.minOrdertime + "'" + " and fldCreateTime<='" + reparm.maxOrdertime + "'"; } else { where += " and fldCreatetime>='" + DateTime.Now.ToShortDateString() + "'"; } if (!string.IsNullOrEmpty(reparm.transactionnum)) { where += " and fldtransactionnum='" + reparm.transactionnum + "'"; } if (!string.IsNullOrEmpty(reparm.RateName)) { where += " and fldRateName='" + reparm.RateName + "'"; } return(where); }
public HttpResponseMessage GetOrdertable(parm reparm) { string result = string.Empty; try { int count = 0; string where = parwhere(reparm); if (where == "") { where = " and fldCreatetime>='" + DateTime.Now.ToShortDateString() + "'"; } //查询分页的数据 DataTable dt = rule.getpaging("vwOrdertable", "*", "1=1" + where, reparm.page, reparm.limit, "fldCreatetime desc", out count); getdata getdata = new getdata(); getdata.Table = dt; getdata.total = count; if (dt.Rows.Count > 0) { result = rule.JsonStr("ok", "成功", getdata); } else { result = rule.JsonStr("error", "失败", getdata); } } catch (Exception e) { //错误保存日志 throw new InsertException(e.Message, "Transaction", "GetOrdertable", ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public HttpResponseMessage GetSubroute(parm reparm) { string result = string.Empty; try { int count = 0; string where = ""; if (reparm.Gatewaynumber != "") { where += " and fldGatewaynumber='" + reparm.Gatewaynumber + "'"; } //查询分页的数据 DataTable dt = rule.getpaging("vwSubroute", "*", "1=1" + where, reparm.page, reparm.limit, "fldGatewaynumber,fldPayType desc", out count); getdata getdata = new getdata(); getdata.Table = dt; getdata.total = count; if (dt.Rows.Count > 0) { result = rule.JsonStr("ok", "成功", getdata); } else { result = rule.JsonStr("error", "失败", getdata); } } catch (Exception e) { //错误保存日志 throw new InsertException(e.Message, "Subroute", "GetSubroute", ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
public static dynamic ConvertInParm(Type ParameterType, parm jParm) { dynamic val = jParm.value; int T = jParm.type; dynamic retval = null; int csid = 0; if (ParameterType.IsEnum) { retval = Enum.ToObject(ParameterType, val); // Console.WriteLine(" enum in " + val + " " + retval.ToString()); return(retval); } if (T < 0) { csid = Convert.ToInt32(val); retval = Cache[csid].o; if (retval.GetType() != ParameterType) { retval = null; } } else { switch (T) { case 0: break; case 1: retval = Convert.ToString(val); break; case 2: retval = Convert.ToBoolean(val); break; case 3: retval = Convert.ToDateTime(val); break; case 4: retval = Convert.ToInt32(val); break; case 5: retval = Convert.ToDouble(val); break; case 6: retval = Convert.ToUInt32(val); break; case 7: retval = Convert.ToInt64(val); break; case 8: retval = Convert.ToUInt64(val); break; case 9: retval = Convert.ToSingle(val); break; case 10: retval = Convert.ToInt16(val); break; case 11: retval = Convert.ToUInt16(val); break; case 12: retval = Convert.ToDecimal(val); break; case 13: retval = Convert.ToByte(val); break; case 14: retval = Convert.ToSByte(val); break; case 15: retval = Convert.ToChar(val); break; case 16: retval = val; break; } } return(retval); }
public HttpResponseMessage GetExcelDate(parm reparm) { string result = string.Empty; try { RuleExcel ruleExcel = new RuleExcel(); string path = @"~\Excel\"; string excname = DateTime.Now.ToString("yyyyMMddHHmmss") + "代付列表.xlsx"; string filename = path + excname; var sPath = @filename; path = HostingEnvironment.MapPath(path); sPath = HostingEnvironment.MapPath(sPath); //转为绝对路径 string where = parwhere(reparm); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string file = "fldCreateTime,fldChannelnum,fldOrdernum,fldMerchID,fldMerchName,fldPayState,fldServiceCharge,fldBankName,fldBankbranch,fldAccountname,fldBankCardId,fldBankprovince,fldBankcity,fldPayAmount,fldRtefundAmount,fldChannelID," + "fldLaunchIP,fldNotice,fldchangstautetime,fldtransactiontime,fldBankType,fldBankTelephoneNo,fldIdCard,fldCardType"; DataTable dt = rule.GetQueryDate("0", "vwtblAgentPay", "1=1" + where, file); List <string> colname = new List <string>(); colname.Add("创建时间"); colname.Add("渠道流水号"); colname.Add("订单号"); colname.Add("商户号"); colname.Add("商户名"); colname.Add("订单状态"); colname.Add("手续费"); colname.Add("银行名称"); colname.Add("银行支行"); colname.Add("账户名"); colname.Add("银行卡号"); colname.Add("银行省份"); colname.Add("开户行所在市"); colname.Add("代付金额"); colname.Add("上送金额"); colname.Add("渠道号"); colname.Add("发起方IP"); colname.Add("异步通知地址"); colname.Add("状态变化时间"); colname.Add("交易时间"); colname.Add("银行类型"); colname.Add("电话号码"); colname.Add("身份证号"); colname.Add("银行卡类型"); ruleExcel.TableToExcel(dt, sPath, colname); //取得当前网站的绝对路径 var sRootePath = HostingEnvironment.MapPath(HostingEnvironment.ApplicationVirtualPath); //取得文件相对于网站的路径(如:TempData/abc.mdb) var sRelativeUri = new Uri(sRootePath, UriKind.Absolute).MakeRelativeUri(new Uri(sPath, UriKind.Absolute)).ToString(); // 先判断是否与原路径相同,如相同则表示二者可能不在同一个磁盘上 var sResult = (0 == string.Compare(Path.GetFullPath(sRelativeUri), Path.GetFullPath(sPath), StringComparison.OrdinalIgnoreCase)) ? null : $"http://{HttpContext.Current.Request.Url.Authority}/{sRelativeUri}"; //构造返回路径 result = rule.JsonStr("ok", excname, sResult); } catch (Exception e) { throw new InsertException(e.Message, "Transaction", "AgentPay", ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
/// <summary> /// 功能描述:拼接where条件 /// 创建时间:2018-12-07 /// 创建 人:周文卿 /// </summary> /// <param name="reparm"></param> /// <returns></returns> public string parwhere(parm reparm) { string where = ""; if (!string.IsNullOrEmpty(reparm.channelnum)) { where += " and fldChannelnum='" + reparm.channelnum + "'"; } if (!string.IsNullOrEmpty(reparm.flag)) { if (reparm.flag == "0") { where += " and fldPayState !='待提交' and fldPayState !='异常' and fldPayState !='待审核'"; } if (reparm.flag == "1") { where += " and fldPayState ='待提交' "; } if (reparm.flag == "2") { where += " and fldPayState ='待审核' "; } if (reparm.flag == "3") { where += " and fldPayState ='异常' "; } } if (!string.IsNullOrEmpty(reparm.merchanid)) { where += " and fldMerchID='" + reparm.merchanid + "'"; } if (!string.IsNullOrEmpty(reparm.Ordernum)) { where += " and fldOrdernum='" + reparm.Ordernum + "'"; } if (!string.IsNullOrEmpty(reparm.minOrderAmount) && !string.IsNullOrEmpty(reparm.maxOrderAmount)) { where += " and fldActualAmount>=" + reparm.minOrderAmount + " and fldActualAmount<=" + reparm.maxOrderAmount; } if (!string.IsNullOrEmpty(reparm.PayState)) { where += " and fldPayState='" + reparm.PayState + "'"; } if (!string.IsNullOrEmpty(reparm.minOrdertime) && !string.IsNullOrEmpty(reparm.maxOrdertime)) { where += " and fldCreateTime>='" + reparm.minOrdertime + "'" + " and fldCreateTime<='" + reparm.maxOrdertime + "'"; } else { where += " and fldCreatetime>='" + DateTime.Now.ToShortDateString() + "'"; } if (!string.IsNullOrEmpty(reparm.channelid)) { where += " and fldChannelID='" + reparm.channelid + "'"; } if (!string.IsNullOrEmpty(reparm.banknum)) { where += " and fldBankCardId='" + reparm.banknum + "'"; } return(where); }