!14 升级支付组件。修复调用自定义首页数据排序导致sql报错问题。

* 1、更换支付组件从Payment 到Paylink。2、修复page页面取数据排序问题。
* 调整支付组件
* 代码格式细节微调
* 修改细节
* 修复通过core first生成mysql数据库的两个问题。
* 经过测试,mysql版本需要5.7或以上
* 增加HangFire到单独配置
pull/14/MERGE
大灰灰 4 years ago
parent 3b1d26d253
commit 3f784c4374

@ -24,7 +24,6 @@ namespace CoreCms.Net.Configuration
public static readonly string AppConfigAppInterFaceUrl = AppSettingsHelper.GetContent("AppConfig", "AppInterFaceUrl");
#endregion
#region 数据库================================================================================
/// <summary>
/// 获取数据库连接字符串
@ -55,7 +54,6 @@ namespace CoreCms.Net.Configuration
#endregion
#region AOP================================================================================
/// <summary>
/// 事务切面开关
@ -71,14 +69,12 @@ namespace CoreCms.Net.Configuration
public static readonly string JwtConfigAudience = AppSettingsHelper.GetContent("JwtConfig", "Audience");
#endregion
#region Cors跨域设置================================================================================
public static readonly string CorsPolicyName = AppSettingsHelper.GetContent("Cors", "PolicyName");
public static readonly bool CorsEnableAllIPs = AppSettingsHelper.GetContent("Cors", "EnableAllIPs").ObjToBool();
public static readonly string CorsIPs = AppSettingsHelper.GetContent("Cors", "IPs");
#endregion
#region Middleware中间件================================================================================
/// <summary>
/// Ip限流
@ -119,7 +115,6 @@ namespace CoreCms.Net.Configuration
public static readonly string PayCallBackAlipayRefundUrl = AppSettingsHelper.GetContent("PayCallBack", "AlipayRefundUrl");
#endregion
#region 易联云打印机================================================================================
/// <summary>

@ -26,7 +26,7 @@ namespace CoreCms.Net.Core.Config
/// </summary>
public static class HangFireSetup
{
public static void AddHangFireSetupSetup(this IServiceCollection services)
public static void AddHangFireSetup(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Essensoft.AspNetCore.Payment.WeChatPay" Version="3.3.2" />
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.4" />
<PackageReference Include="InitQ" Version="1.0.0.6" />
<PackageReference Include="Qc.YilianyunSdk" Version="1.0.7" />
</ItemGroup>

@ -7,8 +7,6 @@ using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Utility.Helper;
using Essensoft.AspNetCore.Payment.WeChatPay.V2;
using Essensoft.AspNetCore.Payment.WeChatPay.V2.Notify;
using InitQ.Abstractions;
using InitQ.Attributes;
using Microsoft.Extensions.Logging;

@ -7,8 +7,8 @@ using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Essensoft.AspNetCore.Payment.WeChatPay.V2;
using Essensoft.AspNetCore.Payment.WeChatPay.V2.Notify;
using Essensoft.Paylink.WeChatPay.V2;
using Essensoft.Paylink.WeChatPay.V2.Notify;
using InitQ.Abstractions;
using InitQ.Attributes;
using Microsoft.Extensions.Logging;

@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="DotLiquid" Version="2.1.457" />
<PackageReference Include="Essensoft.AspNetCore.Payment.WeChatPay" Version="3.3.2" />
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.4" />
<PackageReference Include="Senparc.CO2NET" Version="1.4.400" />
<PackageReference Include="Senparc.Weixin.MP" Version="16.12.400" />
</ItemGroup>

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Essensoft.AspNetCore.Payment.WeChatPay" Version="3.3.2" />
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.4" />
<PackageReference Include="Flurl.Http" Version="3.2.0" />
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />

@ -18,10 +18,9 @@ using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using Essensoft.AspNetCore.Payment.WeChatPay;
//using Essensoft.AspNetCore.Payment.WeChatPay.Request;
using Essensoft.AspNetCore.Payment.WeChatPay.V2;
using Essensoft.AspNetCore.Payment.WeChatPay.V2.Request;
using Essensoft.Paylink.WeChatPay;
using Essensoft.Paylink.WeChatPay.V2;
using Essensoft.Paylink.WeChatPay.V2.Request;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

@ -158,7 +158,14 @@ namespace CoreCms.Net.Services
{
noticeIdsStr = string.Join(",", noticeIdsStr);
//按照固定的序列id进行排序
orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + noticeIdsStr + "') ";
if (AppSettingsConstVars.DbDbType == DbType.SqlServer.ToString())
{
orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + noticeIdsStr + "') ";
}
else if (AppSettingsConstVars.DbDbType == DbType.MySql.ToString())
{
orderBy = " find_in_set(id,'" + noticeIdsStr + "') ";
}
}
}
var notices = await _noticeServices.QueryListByClauseAsync(where, orderBy);
@ -289,7 +296,15 @@ namespace CoreCms.Net.Services
if (goodids.Any())
{
goodidsStr = string.Join(",", goodids);
orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + goodidsStr + "') ";
//按照id序列打乱后的顺序排序
if (AppSettingsConstVars.DbDbType == DbType.SqlServer.ToString())
{
orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + goodidsStr + "') ";
}
else if (AppSettingsConstVars.DbDbType == DbType.MySql.ToString())
{
orderBy = " find_in_set(id,'" + goodidsStr + "') ";
}
}
}
var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy);

@ -7,26 +7,12 @@
* CreateTime: 2021/1/31 21:45:10
* Description:
***********************************************************************/
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using AutoMapper;
using CoreCms.Net.Caching.AutoMate.RedisCache;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.ViewModels.Api;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Essensoft.AspNetCore.Payment.Alipay.Domain;
using Flurl;
using Flurl.Http;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using NPOI.HSSF.UserModel;
using SqlSugar;
namespace CoreCms.Net.Web.Admin.Controllers
{

@ -25,7 +25,6 @@ using CoreCms.Net.Loging;
using CoreCms.Net.IServices;
using CoreCms.Net.Utility.Helper;
using CoreCms.Net.Utility.Extensions;
using Essensoft.AspNetCore.Payment.Alipay.Domain;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;

@ -51,8 +51,8 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="6.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="Essensoft.AspNetCore.Payment.Alipay" Version="3.3.2" />
<PackageReference Include="Essensoft.AspNetCore.Payment.WeChatPay" Version="3.3.2" />
<PackageReference Include="Essensoft.Paylink.Alipay" Version="4.0.4" />
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.4" />
<PackageReference Include="IdentityModel" Version="5.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.7" />

@ -1,33 +1,19 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Autofac;
using Autofac.Extras.DynamicProxy;
using AutoMapper;
using CoreCms.Net.Auth;
using CoreCms.Net.Configuration;
using CoreCms.Net.Core.AOP;
using CoreCms.Net.Core.AutoFac;
using CoreCms.Net.Core.Config;
using CoreCms.Net.Filter;
using CoreCms.Net.Loging;
using CoreCms.Net.Mapping;
using CoreCms.Net.Middlewares;
using CoreCms.Net.Model.ViewModels.Options;
using CoreCms.Net.Model.ViewModels.Sms;
using CoreCms.Net.Repository.CodeGenerator;
using CoreCms.Net.Services.CodeGenerator;
using CoreCms.Net.Services.Mediator;
using CoreCms.Net.Swagger;
using CoreCms.Net.Task;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.WeChatService.CustomMessageHandler;
using CoreCms.Net.WeChatService.MessageHandlers.WebSocket;
using CoreCms.Net.WeChatService.WxOpenMessageHandler;
using Essensoft.AspNetCore.Payment.Alipay;
using Essensoft.AspNetCore.Payment.WeChatPay;
using Essensoft.Paylink.Alipay;
using Essensoft.Paylink.WeChatPay;
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -42,13 +28,10 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Qc.YilianyunSdk;
using Senparc.CO2NET;
using Senparc.CO2NET.AspNet;
using Senparc.WebSocket;
using Senparc.Weixin;
using Senparc.Weixin.Entities;
using Senparc.Weixin.MP;
using Senparc.Weixin.RegisterServices;
using Senparc.Weixin.WxOpen;
using SqlSugar;

@ -77,25 +77,33 @@
//
"Phone": ""
},
//
// WeChatPayOptions
"WeChatPay": {
//(AppId/AppId/AppId/CorpId)
//
// AppIdAppIdAppIdCorpId
"AppId": "",
//
//
//
"MchId": "",
//APIAPIv3
"Key": "",
// API
// APIAPIv3
"APIKey": "",
// APIv3
// APIv3APIv3
"V3Key": "",
//API .p12
"APIv3Key": "",
// API(.p12)
// API(.p12)v3
// (.p12) / (.p12)base64
"Certificate": "WxPayCert\\apiclient_cert.p12",
//RSA ("企业付款到银行卡API"使"获取RSA加密公钥API")
// RSA
// "企业付款到银行卡API"使"获取RSA加密公钥API"
"RsaPublicKey": ""
},
//
// AlipayOptions
"Alipay": {
// :
// :
// ()使使
// CertificateExecuteAsync API
// 使 CertificateExecuteAsync ExecuteAsync
@ -104,7 +112,6 @@
// Id
// -APPID
"AppId": "",
// RSA
// -
//
@ -124,7 +131,7 @@
// / base64
//
//
"AppCert": "",
"AppPublicCert": "",
//
// / base64
//

@ -11,9 +11,9 @@
using System;
using System.Threading.Tasks;
using System.Xml;
using Essensoft.AspNetCore.Payment.Alipay;
using Essensoft.AspNetCore.Payment.Alipay.Notify;
using Essensoft.AspNetCore.Payment.Alipay.Utility;
using Essensoft.Paylink.Alipay;
using Essensoft.Paylink.Alipay.Notify;
using Essensoft.Paylink.Alipay.Utility;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

@ -12,7 +12,6 @@ using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using Essensoft.AspNetCore.Payment.WeChatPay;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
@ -20,8 +19,9 @@ using NLog;
using System;
using System.Threading.Tasks;
using CoreCms.Net.Caching.AutoMate.RedisCache;
using Essensoft.AspNetCore.Payment.WeChatPay.V2;
using Essensoft.AspNetCore.Payment.WeChatPay.V2.Notify;
using Essensoft.Paylink.WeChatPay;
using Essensoft.Paylink.WeChatPay.V2;
using Essensoft.Paylink.WeChatPay.V2.Notify;
namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
{

@ -42,8 +42,8 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Autofac.Extras.DynamicProxy" Version="6.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="Essensoft.AspNetCore.Payment.Alipay" Version="3.3.2" />
<PackageReference Include="Essensoft.AspNetCore.Payment.WeChatPay" Version="3.3.2" />
<PackageReference Include="Essensoft.Paylink.Alipay" Version="4.0.4" />
<PackageReference Include="Essensoft.Paylink.WeChatPay" Version="4.0.4" />
<PackageReference Include="Hangfire" Version="1.7.23" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.23" />
<PackageReference Include="Hangfire.Core" Version="1.7.23" />

@ -13,8 +13,6 @@ using CoreCms.Net.Model.ViewModels.Sms;
using CoreCms.Net.Services.Mediator;
using CoreCms.Net.Swagger;
using CoreCms.Net.Task;
using Essensoft.AspNetCore.Payment.Alipay;
using Essensoft.AspNetCore.Payment.WeChatPay;
using Hangfire;
using Hangfire.Dashboard.BasicAuthorization;
using InitQ;
@ -43,6 +41,8 @@ using System.Collections.Generic;
using System.Linq;
using CoreCms.Net.RedisMQ.Subscribe;
using CoreCms.Net.Utility.Extensions;
using Essensoft.Paylink.Alipay;
using Essensoft.Paylink.WeChatPay;
namespace CoreCms.Net.Web.WebApi
{
@ -117,7 +117,8 @@ namespace CoreCms.Net.Web.WebApi
services.AddYiLianYunSetup();
//注册Hangfire定时任务
services.AddHangFireSetupSetup();
services.AddHangFireSetup();
//授权支持注入
services.AddAuthorizationSetupForClient();

@ -77,25 +77,33 @@
//
"Phone": ""
},
//
// WeChatPayOptions
"WeChatPay": {
//(AppId/AppId/AppId/CorpId)
//
// AppIdAppIdAppIdCorpId
"AppId": "",
//
//
//
"MchId": "",
//APIAPIv3
"Key": "",
// API
// APIAPIv3
"APIKey": "",
// APIv3
// APIv3APIv3
"V3Key": "",
//API .p12
"APIv3Key": "",
// API(.p12)
// API(.p12)v3
// (.p12) / (.p12)base64
"Certificate": "WxPayCert\\apiclient_cert.p12",
//RSA ("企业付款到银行卡API"使"获取RSA加密公钥API")
// RSA
// "企业付款到银行卡API"使"获取RSA加密公钥API"
"RsaPublicKey": ""
},
//
// AlipayOptions
"Alipay": {
// :
// :
// ()使使
// CertificateExecuteAsync API
// 使 CertificateExecuteAsync ExecuteAsync
@ -104,7 +112,6 @@
// Id
// -APPID
"AppId": "",
// RSA
// -
//
@ -124,7 +131,7 @@
// / base64
//
//
"AppCert": "",
"AppPublicCert": "",
//
// / base64
//

Loading…
Cancel
Save