Commit 1fdc3aa7 authored by liudong1993's avatar liudong1993
parents ce1add48 333a57de
...@@ -353,5 +353,16 @@ namespace Mall.Common ...@@ -353,5 +353,16 @@ namespace Mall.Common
} }
} }
/// <summary>
/// 数据库地址
/// </summary>
public static string RebornDMC
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("RebornDMC").Value;
}
}
} }
} }
\ No newline at end of file
...@@ -49,7 +49,6 @@ namespace Mall.Common.Pay.WeChatPat ...@@ -49,7 +49,6 @@ namespace Mall.Common.Pay.WeChatPat
{ {
openid = openid.Replace("/t", ""); openid = openid.Replace("/t", "");
string url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + access_token + "&openid=" + openid + "&lang=zh_CN"; string url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + access_token + "&openid=" + openid + "&lang=zh_CN";
//string url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid + "&lang=zh_CN";
string type = "utf-8"; string type = "utf-8";
Mall.Common.Plugin.GetUsersHelper GetUsersHelper = new Mall.Common.Plugin.GetUsersHelper(); Mall.Common.Plugin.GetUsersHelper GetUsersHelper = new Mall.Common.Plugin.GetUsersHelper();
string wenXinResult = string.Empty; string wenXinResult = string.Empty;
......
using System; using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
namespace Mall.Common.Plugin namespace Mall.Common.Plugin
{ {
public class WeiXinHelper public class WeiXinHelper
{ {
/// <summary>
/// 获取微信用户OpenId
/// </summary>
/// <param name="AppId"></param>
/// <param name="AppSecret"></param>
/// <param name="Code"></param>
/// <returns></returns>
public static string GetWeChatOpenId(string AppId, string AppSecret, string Code)
{
string result = "";
string openid = "";
try
{
//请求路径
string url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + AppId + "&secret=" + AppSecret + "&js_code=" + Code + "&grant_type=authorization_code";
result= Common.Plugin.HttpHelper.HttpGet(url);
if (result != null && !string.IsNullOrEmpty(result))
{
JObject jObj = JObject.Parse(result);
openid = jObj["openid"].ToString();
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetWeChatOpenId:result="+ result);
}
return openid;
}
} }
/// <summary> /// <summary>
...@@ -170,7 +199,7 @@ namespace Mall.Common.Plugin ...@@ -170,7 +199,7 @@ namespace Mall.Common.Plugin
return xml; return xml;
} }
public SortedDictionary<string, object> NoSignFromXml(string xml) public SortedDictionary<string, object> NoSignFromXml(string xml)
{ {
...@@ -248,7 +277,5 @@ namespace Mall.Common.Plugin ...@@ -248,7 +277,5 @@ namespace Mall.Common.Plugin
//_logger.LogError(this.GetType().ToString(), "WxPayData签名验证错误!"); //_logger.LogError(this.GetType().ToString(), "WxPayData签名验证错误!");
throw new Exception("WxPayData签名验证错误!"); throw new Exception("WxPayData签名验证错误!");
} }
}
} }
}
using Mall.Common.Enum; using Mall.Common;
using Mall.Common.Enum;
using Mall.Model.Entity.Finance; using Mall.Model.Entity.Finance;
using Mall.Model.Extend.Finance; using Mall.Model.Extend.Finance;
using System; using System;
...@@ -28,36 +29,37 @@ namespace Mall.Repository.Finance ...@@ -28,36 +29,37 @@ namespace Mall.Repository.Finance
public List<RB_ClientBankAccount_Extend> GetPageList(int pageIndex, int pageSize, RB_ClientBankAccount_Extend model, out long count) public List<RB_ClientBankAccount_Extend> GetPageList(int pageIndex, int pageSize, RB_ClientBankAccount_Extend model, out long count)
{ {
string where = " WHERE 1=1 "; string where = " WHERE 1=1 ";
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.Status) + "={0}", (int)DateStateEnum.Normal); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.Status) + "={0}", (int)DateStateEnum.Normal);
if (model.RB_Group_Id > 0) if (model.RB_Group_Id > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.RB_Group_Id) + "={0}", model.RB_Group_Id); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.RB_Group_Id) + "={0}", model.RB_Group_Id);
} }
if (model.RB_Branch_Id >= 0) if (model.RB_Branch_Id >= 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.RB_Branch_Id) + "={0}", model.RB_Branch_Id); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.RB_Branch_Id) + "={0}", model.RB_Branch_Id);
} }
if (model.Type > 0) if (model.Type > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.Type) + "={0}", (int)model.Type); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.Type) + "={0}", (int)model.Type);
} }
if (!string.IsNullOrEmpty(model.AccountAlias)) if (!string.IsNullOrEmpty(model.AccountAlias))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.AccountAlias) + " like '%{0}%' ", model.AccountAlias); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.AccountAlias) + " like '%{0}%' ", model.AccountAlias);
} }
if (!string.IsNullOrEmpty(model.OpenBankName)) if (!string.IsNullOrEmpty(model.OpenBankName))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.OpenBankName) + " like '%{0}%' ", model.OpenBankName); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.OpenBankName) + " like '%{0}%' ", model.OpenBankName);
} }
if (!string.IsNullOrEmpty(model.CardNum)) if (!string.IsNullOrEmpty(model.CardNum))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.CardNum) + " like '%{0}%' ", model.CardNum); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.CardNum) + " like '%{0}%' ", model.CardNum);
} }
if (!string.IsNullOrEmpty(model.AccountHolder)) if (!string.IsNullOrEmpty(model.AccountHolder))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount_Extend.AccountHolder) + " like '%{0}%' ", model.AccountHolder); where += string.Format(" AND a." + nameof(RB_ClientBankAccount_Extend.AccountHolder) + " like '%{0}%' ", model.AccountHolder);
} }
return GetPage<RB_ClientBankAccount_Extend>(pageIndex, pageSize, out count, " select * from " + TableName + "" + where).ToList(); string sql = $@"select a.*,b.name as BankName from {TableName} as a {TableName}";
return GetPage<RB_ClientBankAccount_Extend>(pageIndex, pageSize, out count, sql).ToList();
} }
/// <summary> /// <summary>
/// 获取客户账户列表 /// 获取客户账户列表
...@@ -69,44 +71,45 @@ namespace Mall.Repository.Finance ...@@ -69,44 +71,45 @@ namespace Mall.Repository.Finance
public List<RB_ClientBankAccount> GetList(RB_ClientBankAccount model, string AccountAlias = "", string ClientIdStr = "") public List<RB_ClientBankAccount> GetList(RB_ClientBankAccount model, string AccountAlias = "", string ClientIdStr = "")
{ {
string where = " WHERE 1=1 "; string where = " WHERE 1=1 ";
where += string.Format(" AND " + nameof(RB_ClientBankAccount.Status) + "={0} ", (int)DateStateEnum.Normal); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.Status) + "={0} ", (int)DateStateEnum.Normal);
if (model.RB_Group_Id > 0) if (model.RB_Group_Id > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.RB_Group_Id) + "={0} ", model.RB_Group_Id); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.RB_Group_Id) + "={0} ", model.RB_Group_Id);
} }
if (model.RB_Branch_Id >= 0) if (model.RB_Branch_Id >= 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.RB_Branch_Id) + "={0} ", model.RB_Branch_Id); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.RB_Branch_Id) + "={0} ", model.RB_Branch_Id);
} }
if (model.ID > 0) if (model.ID > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ID) + "={0} ", model.ID); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ID) + "={0} ", model.ID);
} }
if (ClientIdStr != "") if (ClientIdStr != "")
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ID) + " in({0}) ", ClientIdStr); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ID) + " in({0}) ", ClientIdStr);
} }
if (model.Type > 0) if (model.Type > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.Type) + "={0}", (int)model.Type); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.Type) + "={0}", (int)model.Type);
} }
if (model.ObjID > 0) if (model.ObjID > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ObjID) + "={0}", model.ObjID); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ObjID) + "={0}", model.ObjID);
} }
if (!string.IsNullOrEmpty(model.AccountAlias)) if (!string.IsNullOrEmpty(model.AccountAlias))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.AccountAlias) + "='{0}'", model.AccountAlias); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.AccountAlias) + "='{0}'", model.AccountAlias);
} }
if (AccountAlias != "") if (AccountAlias != "")
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.AccountAlias) + " like'%{0}%'", AccountAlias); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.AccountAlias) + " like'%{0}%'", AccountAlias);
} }
if (!string.IsNullOrEmpty(model.CardNum)) if (!string.IsNullOrEmpty(model.CardNum))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.CardNum) + " like '%{0}%' ", model.CardNum); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.CardNum) + " like '%{0}%' ", model.CardNum);
} }
return Get<RB_ClientBankAccount>("select * from " + TableName + " " + where).ToList(); string sql = $@"select a.*,b.name as BankName from {TableName} as a {TableName}";
return Get<RB_ClientBankAccount>(sql).ToList();
} }
/// <summary> /// <summary>
...@@ -117,45 +120,46 @@ namespace Mall.Repository.Finance ...@@ -117,45 +120,46 @@ namespace Mall.Repository.Finance
public List<RB_ClientBankAccount> GetList(RB_ClientBankAccount_Extend model) public List<RB_ClientBankAccount> GetList(RB_ClientBankAccount_Extend model)
{ {
string where = " WHERE 1=1 "; string where = " WHERE 1=1 ";
where += string.Format(" AND " + nameof(RB_ClientBankAccount.Status) + "={0} ", (int)DateStateEnum.Normal); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.Status) + "={0} ", (int)DateStateEnum.Normal);
if (model.RB_Group_Id > 0) if (model.RB_Group_Id > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.RB_Group_Id) + "={0} ", model.RB_Group_Id); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.RB_Group_Id) + "={0} ", model.RB_Group_Id);
} }
if (model.RB_Branch_Id >= 0) if (model.RB_Branch_Id >= 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.RB_Branch_Id) + "={0} ", model.RB_Branch_Id); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.RB_Branch_Id) + "={0} ", model.RB_Branch_Id);
} }
if (model.ID > 0) if (model.ID > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ID) + "={0} ", model.ID); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ID) + "={0} ", model.ID);
} }
if (!string.IsNullOrWhiteSpace(model.ClientIdStr)) if (!string.IsNullOrWhiteSpace(model.ClientIdStr))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ID) + " in({0}) ", model.ClientIdStr); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ID) + " in({0}) ", model.ClientIdStr);
} }
if (model.Type > 0) if (model.Type > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.Type) + "={0}", (int)model.Type); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.Type) + "={0}", (int)model.Type);
} }
if (model.ObjID > 0) if (model.ObjID > 0)
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ObjID) + "={0}", model.ObjID); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ObjID) + "={0}", model.ObjID);
} }
if (!string.IsNullOrWhiteSpace(model.ObjIdStr)) if (!string.IsNullOrWhiteSpace(model.ObjIdStr))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.ObjID) + " in({0})", model.ObjIdStr); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.ObjID) + " in({0})", model.ObjIdStr);
} }
if (!string.IsNullOrEmpty(model.AccountAlias)) if (!string.IsNullOrEmpty(model.AccountAlias))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.AccountAlias) + "='{0}'", model.AccountAlias); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.AccountAlias) + "='{0}'", model.AccountAlias);
} }
if (!string.IsNullOrEmpty(model.CardNum)) if (!string.IsNullOrEmpty(model.CardNum))
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.CardNum) + " like '%{0}%' ", model.CardNum); where += string.Format(" AND a." + nameof(RB_ClientBankAccount.CardNum) + " like '%{0}%' ", model.CardNum);
} }
return Get<RB_ClientBankAccount>("select * from " + TableName + " " + where).ToList(); string sql = $@"select a.*,b.name as BankName from {TableName} as a {TableName}";
return Get<RB_ClientBankAccount>(sql).ToList();
} }
} }
} }
...@@ -43,7 +43,7 @@ namespace Mall.Repository.User ...@@ -43,7 +43,7 @@ namespace Mall.Repository.User
} }
if (dmodel.Type > 0) if (dmodel.Type > 0)
{ {
where += $@" and {nameof(RB_Member_Integral.Type)}={dmodel.Type}"; where += $@" and {nameof(RB_Member_Integral.Type)}={(int)dmodel.Type}";
} }
if (dmodel.UserId > 0) if (dmodel.UserId > 0)
{ {
......
...@@ -2162,5 +2162,28 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -2162,5 +2162,28 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Failed(message: "请获取用户OpenId"); return ApiResult.Failed(message: "请获取用户OpenId");
} }
} }
/// <summary>
/// 获取用户信息
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
[AllowAnonymous]
public ApiResult GetWeChatOpenId()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
string code = parms.GetStringValue("Code");
string openId = "";
if (RequestParm.MiniAppId != null && !string.IsNullOrWhiteSpace(RequestParm.MiniAppId))
{
var miniProgram = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend() { MiniAppId = RequestParm.MiniAppId });
if (miniProgram != null && miniProgram.MallBaseId > 0)
{
openId = Common.Plugin.WeiXinHelper.GetWeChatOpenId(miniProgram.MiniAppId, miniProgram.MiniAppSecret, code);
}
}
return ApiResult.Success(data: openId);
}
} }
} }
\ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
"ByteDanceSendTemplate": "https://developer.toutiao.com/api/apps/game/template/send", "ByteDanceSendTemplate": "https://developer.toutiao.com/api/apps/game/template/send",
"sTenpayNotify": "http://mallapi.oytour.com/api/WeChatNotify/Notify", //微信回调地址 "sTenpayNotify": "http://mallapi.oytour.com/api/WeChatNotify/Notify", //微信回调地址
"NetworkDirector": 1756, //网络主管的id,用于新建供应商账户的时候的创建人 "NetworkDirector": 1756, //网络主管的id,用于新建供应商账户的时候的创建人
"RebornDMC": "reborn_dmc",
"RedisSetting": { "RedisSetting": {
"RedisServer": "192.168.2.214", "RedisServer": "192.168.2.214",
"RedisPort": "6379", "RedisPort": "6379",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment