Commit 58fa7bb2 authored by 吴春's avatar 吴春
parents 14a15218 eeffd79c
...@@ -161,18 +161,28 @@ namespace Mall.Common ...@@ -161,18 +161,28 @@ namespace Mall.Common
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
private static string ReadConfigKey(string key) public static string ReadConfigKey(string key,string subKey="")
{ {
string valueStr = "";
try try
{ {
return Configuration.GetSection(key).Value; if (!string.IsNullOrWhiteSpace(subKey))
{
valueStr = Configuration.GetSection(key)[subKey].ToString();
}
else
{
valueStr = Configuration.GetSection(key).Value;
}
} }
catch catch
{ {
return "";
} }
return valueStr;
} }
/// <summary> /// <summary>
/// 阿里云oss域名 /// 阿里云oss域名
/// </summary> /// </summary>
......
...@@ -33,4 +33,14 @@ namespace Mall.Model.Extend.BaseSetUp ...@@ -33,4 +33,14 @@ namespace Mall.Model.Extend.BaseSetUp
/// </summary> /// </summary>
public int CategoryId { get; set; } public int CategoryId { get; set; }
} }
/// <summary>
/// 包邮满足的订单商品
/// </summary>
public class FreeShippingGoodsDetail {
public int FreeShipping { get; set; }
public string Name { get; set; }
public int GoodsId { get; set; }
public string SpecificationKey { get; set; }
}
} }
...@@ -1638,8 +1638,10 @@ namespace Mall.Module.Product ...@@ -1638,8 +1638,10 @@ namespace Mall.Module.Product
} }
#region 处理全局包邮 #region 处理全局包邮
List<RB_FreeShipping_Extend> freeShippingList = new List<RB_FreeShipping_Extend>(); List<RB_FreeShipping_Extend> freeShippingList = new List<RB_FreeShipping_Extend>();
List<FreeShippingGoodsDetail> SatisfiedGoodsList = new List<FreeShippingGoodsDetail>();//可包邮的商品
if (YFCategoryList.Any()) { if (YFCategoryList.Any()) {
string categoryIds = string.Join(",", YFCategoryList.Distinct()); YFCategoryList = YFCategoryList.Distinct().ToList();
string categoryIds = string.Join(",", YFCategoryList);
freeShippingList = freeShippingRepository.GetFreeShippingListByCategoryIds(new RB_FreeShipping_Extend { MallBaseId = demodel.MallBaseId, TenantId = demodel.TenantId, CategoryIds = categoryIds }); freeShippingList = freeShippingRepository.GetFreeShippingListByCategoryIds(new RB_FreeShipping_Extend { MallBaseId = demodel.MallBaseId, TenantId = demodel.TenantId, CategoryIds = categoryIds });
} }
#endregion #endregion
...@@ -1682,6 +1684,7 @@ namespace Mall.Module.Product ...@@ -1682,6 +1684,7 @@ namespace Mall.Module.Product
#region 运费 #region 运费
decimal Express = 0; decimal Express = 0;
string FreeShippingDescription = "";
if (defModel.Id > 0 && demodel.DeliveryMethod == OrderDeliveryMethodEnum.ExpressDistribution) if (defModel.Id > 0 && demodel.DeliveryMethod == OrderDeliveryMethodEnum.ExpressDistribution)
{ {
//计算总和 //计算总和
...@@ -1689,77 +1692,168 @@ namespace Mall.Module.Product ...@@ -1689,77 +1692,168 @@ namespace Mall.Module.Product
decimal exMoney = demodel.DetailList.Where(x => x.GoodsId == item.GoodsId).Sum(x => x.NorGoodsMoney); decimal exMoney = demodel.DetailList.Where(x => x.GoodsId == item.GoodsId).Sum(x => x.NorGoodsMoney);
if (!((gmodel.FullNumPinkage > 0 && exNum >= gmodel.FullNumPinkage) || (gmodel.FullMoneyPinkage > 0 && exMoney >= gmodel.FullMoneyPinkage))) if (!((gmodel.FullNumPinkage > 0 && exNum >= gmodel.FullNumPinkage) || (gmodel.FullMoneyPinkage > 0 && exMoney >= gmodel.FullMoneyPinkage)))
{ {
int FreightId2 = gmodel.FreightId ?? 0; bool IsFreeShipping = false;
if (gmodel.FreightId == 0) if ((gmodel.FullMoneyPinkage ?? 0) == 0 && (gmodel.FullNumPinkage ?? 0) == 0 && YFCategoryList.Any())
{ {
FreightId2 = DefFreightId; //查找全局包邮规则
} if (freeShippingList != null && freeShippingList.Any())
if (FreightId2 > 0)
{
var rulesModel = rulesList.Where(x => x.ID == FreightId2).FirstOrDefault();
List<Model.Extend.BaseSetUp.RB_Logistics_RulesPrice_Extend> priceList2 = priceList.Where(x => x.RulesId == FreightId2).ToList();
if (priceList2.Any())
{ {
var priceIds = priceList2.Select(x => x.ID).ToList(); var fullNumPinkageModel = freeShippingList.Where(x => item.CategoryIdList.Contains(x.CategoryId) && x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullNumPinkage > 0 && x.CategoryId > 0).OrderBy(x => x.FullNumPinkage).ThenByDescending(x => x.ID).FirstOrDefault();
var regionList2 = regionList.Where(x => priceIds.Contains(x.RulesPriceId)).ToList(); if (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0)
var regionModel = regionList2.Where(x => disList.Contains(x.RegionId)).FirstOrDefault();
if (regionModel != null)
{ {
var pmodel = priceList2.Where(x => x.ID == regionModel.RulesPriceId).FirstOrDefault(); fullNumPinkageModel = freeShippingList.Where(x => item.CategoryIdList.Contains(x.CategoryId) && x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullMoneyPinkage > 0 && x.CategoryId > 0).OrderBy(x => x.FullMoneyPinkage).ThenByDescending(x => x.ID).FirstOrDefault();
if (pmodel != null && rulesModel != null) }
if (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0)
{
fullNumPinkageModel = freeShippingList.Where(x => item.CategoryIdList.Contains(x.CategoryId) && x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullNumPinkage > 0 && x.CategoryId == 0).OrderBy(x => x.FullNumPinkage).ThenByDescending(x => x.ID).FirstOrDefault();
}
if (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0)
{
fullNumPinkageModel = freeShippingList.Where(x => item.CategoryIdList.Contains(x.CategoryId) && x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullMoneyPinkage > 0 && x.CategoryId == 0).OrderBy(x => x.FullMoneyPinkage).ThenByDescending(x => x.ID).FirstOrDefault();
}
if (fullNumPinkageModel != null)
{
//看所有商品是否满足该规则
var sglist = SatisfiedGoodsList.Where(x => x.FreeShipping != fullNumPinkageModel.ID).ToList();
var nosglist = SatisfiedGoodsList.Where(x => x.FreeShipping == fullNumPinkageModel.ID).ToList();
if (sglist.Any())
{ {
if (rulesModel.ChargeMode == Common.Enum.MallBase.ChargeModeEnum.Num) //看着商品是否包含在这里面
if (sglist.Where(x => x.GoodsId == item.GoodsId && x.SpecificationKey == item.SpecificationSort).Any())
{ {
//按件计费 IsFreeShipping = true;
if (item.Number <= pmodel.First) FreeShippingDescription = sglist.Where(x => x.GoodsId == item.GoodsId && x.SpecificationKey == item.SpecificationSort).FirstOrDefault().Name;
{ }
Express = pmodel.FirstPrice; }
} else
else {
//查询出规格下所有的分类
List<int> GZCList = new List<int>();
if (fullNumPinkageModel.CategoryId >= 0)
{
GZCList = freeShippingList.Where(x => x.ID == fullNumPinkageModel.ID).Select(x => x.CategoryId).ToList();
}
//根据分类 查询出所有的订单商品
foreach (var qitem in demodel.DetailList)
{
if (!nosglist.Where(x => x.GoodsId == qitem.GoodsId && x.SpecificationKey == qitem.SpecificationSort).Any())
{ {
if (pmodel.Second > 0) string Name = fullNumPinkageModel.Name;
if (fullNumPinkageModel.FullNumPinkage > 0) {
Name += ":满" + fullNumPinkageModel.FullNumPinkage + "件包邮";
}
else if(fullNumPinkageModel.FullMoneyPinkage > 0) {
Name += ":满" + fullNumPinkageModel.FullMoneyPinkage + "元包邮";
}
if (GZCList.Any())
{ {
if (((item.Number ?? 0) - pmodel.First) % pmodel.Second == 0) if (qitem.CategoryIdList.Where(x => GZCList.Contains(x)).Any())
{
Express = pmodel.FirstPrice + (((item.Number ?? 0) - pmodel.First) / pmodel.Second) * pmodel.SecondPrice;
}
else
{ {
Express = pmodel.FirstPrice + (((item.Number ?? 0) - pmodel.First) / pmodel.Second + 1) * pmodel.SecondPrice; SatisfiedGoodsList.Add(new FreeShippingGoodsDetail()
{
FreeShipping = fullNumPinkageModel.ID,
Name = Name,
GoodsId = qitem.GoodsId ?? 0,
SpecificationKey = qitem.NewSpecificationSort
});
} }
} }
else else
{ {
Express = pmodel.FirstPrice; SatisfiedGoodsList.Add(new FreeShippingGoodsDetail()
{
FreeShipping = fullNumPinkageModel.ID,
Name = Name,
GoodsId = qitem.GoodsId ?? 0,
SpecificationKey = qitem.NewSpecificationSort
});
} }
} }
} }
else //看着商品是否包含在这里面
if (SatisfiedGoodsList.Where(x => x.GoodsId == item.GoodsId && x.SpecificationKey == item.SpecificationSort).Any())
{ {
//重量计费 IsFreeShipping = true;
int TotalW = (item.Number ?? 0) * (item.GoodsWeight ?? 0); FreeShippingDescription = SatisfiedGoodsList.Where(x => x.GoodsId == item.GoodsId && x.SpecificationKey == item.SpecificationSort).FirstOrDefault().Name;
if (TotalW <= pmodel.First) }
{ }
Express = pmodel.FirstPrice; }
} }
else }
if (IsFreeShipping == false)
{
int FreightId2 = gmodel.FreightId ?? 0;
if (gmodel.FreightId == 0)
{
FreightId2 = DefFreightId;
}
if (FreightId2 > 0)
{
var rulesModel = rulesList.Where(x => x.ID == FreightId2).FirstOrDefault();
List<Model.Extend.BaseSetUp.RB_Logistics_RulesPrice_Extend> priceList2 = priceList.Where(x => x.RulesId == FreightId2).ToList();
if (priceList2.Any())
{
var priceIds = priceList2.Select(x => x.ID).ToList();
var regionList2 = regionList.Where(x => priceIds.Contains(x.RulesPriceId)).ToList();
var regionModel = regionList2.Where(x => disList.Contains(x.RegionId)).FirstOrDefault();
if (regionModel != null)
{
var pmodel = priceList2.Where(x => x.ID == regionModel.RulesPriceId).FirstOrDefault();
if (pmodel != null && rulesModel != null)
{
if (rulesModel.ChargeMode == Common.Enum.MallBase.ChargeModeEnum.Num)
{ {
if (pmodel.Second > 0) //按件计费
if (item.Number <= pmodel.First)
{ {
if ((TotalW - pmodel.First) % pmodel.Second == 0) Express = pmodel.FirstPrice;
}
else
{
if (pmodel.Second > 0)
{ {
Express = pmodel.FirstPrice + ((TotalW - pmodel.First) / pmodel.Second) * pmodel.SecondPrice; if (((item.Number ?? 0) - pmodel.First) % pmodel.Second == 0)
{
Express = pmodel.FirstPrice + (((item.Number ?? 0) - pmodel.First) / pmodel.Second) * pmodel.SecondPrice;
}
else
{
Express = pmodel.FirstPrice + (((item.Number ?? 0) - pmodel.First) / pmodel.Second + 1) * pmodel.SecondPrice;
}
} }
else else
{ {
Express = pmodel.FirstPrice + ((TotalW - pmodel.First) / pmodel.Second + 1) * pmodel.SecondPrice; Express = pmodel.FirstPrice;
} }
} }
else }
else
{
//重量计费
int TotalW = (item.Number ?? 0) * (item.GoodsWeight ?? 0);
if (TotalW <= pmodel.First)
{ {
Express = pmodel.FirstPrice; Express = pmodel.FirstPrice;
} }
else
{
if (pmodel.Second > 0)
{
if ((TotalW - pmodel.First) % pmodel.Second == 0)
{
Express = pmodel.FirstPrice + ((TotalW - pmodel.First) / pmodel.Second) * pmodel.SecondPrice;
}
else
{
Express = pmodel.FirstPrice + ((TotalW - pmodel.First) / pmodel.Second + 1) * pmodel.SecondPrice;
}
}
else
{
Express = pmodel.FirstPrice;
}
}
} }
} }
} }
...@@ -1767,26 +1861,6 @@ namespace Mall.Module.Product ...@@ -1767,26 +1861,6 @@ namespace Mall.Module.Product
} }
} }
} }
else {
if ((gmodel.FullMoneyPinkage ?? 0) == 0 && (gmodel.FullNumPinkage ?? 0) == 0 && YFCategoryList.Any()) {
//查找全局包邮规则
//if (freeShippingList != null && freeShippingList.Any())
//{
// var nowcategory = categoryList.Where(x => x.GoodsId == item.GoodsId).Select(x => x.CategoryId);
// var fullNumPinkageModel = freeShippingList.Where(x => nowcategory.Contains(x.CategoryId) && x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullNumPinkage > 0).OrderBy(x => x.FullNumPinkage).FirstOrDefault();
// if (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0)
// {
// fullNumPinkageModel = freeShippingList.Where(x => x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullMoneyPinkage > 0).OrderBy(x => x.FullMoneyPinkage).FirstOrDefault();
// }
// item.FreeShippingModel = (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0) ? new RB_FreeShipping_Extend() : fullNumPinkageModel;
//}
//else
//{
// item.FreeShippingModel = new RB_FreeShipping_Extend();
//}
}
}
} }
TotalExpress += Express; TotalExpress += Express;
item.Final_Price += Express; item.Final_Price += Express;
...@@ -1833,6 +1907,7 @@ namespace Mall.Module.Product ...@@ -1833,6 +1907,7 @@ namespace Mall.Module.Product
address_disabled, address_disabled,
pieces = gmodel.FullNumPinkage,//满件包邮 pieces = gmodel.FullNumPinkage,//满件包邮
forehead = gmodel.FullMoneyPinkage,//满额包邮 forehead = gmodel.FullMoneyPinkage,//满额包邮
freeShippingDescription = FreeShippingDescription,
freight_id = gmodel.FreightId, freight_id = gmodel.FreightId,
express_price = item.Express, express_price = item.Express,
unit_price = item.Unit_Price, unit_price = item.Unit_Price,
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<PackageReference Include="Aliyun.Net.SDK.Core" Version="1.0.3" /> <PackageReference Include="Aliyun.Net.SDK.Core" Version="1.0.3" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.10.0" /> <PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="RabbitMQ.Client" Version="6.0.0" />
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.10" /> <PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.10" />
</ItemGroup> </ItemGroup>
......
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Exceptions;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Dysmsapi.Model.V20170525;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Mall.ThirdCore.Commom;
using System;
using System.Threading;
using Mall.ThirdCore.Message;
namespace Mall.ThirdCore.Mq
{
/// <summary>
/// 消息队列配置文件
/// </summary>
public class RabbitConfig
{
/// <summary>
/// 主机名:ip地址
/// </summary>
public string HostName { get; set; }
/// <summary>
/// 端口
/// </summary>
public int Port { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 队列名称
/// </summary>
public string QueenName { get; set; }
}
}
using RabbitMQ.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.ThirdCore.Mq
{
/// <summary>
/// 消息队列帮助类
/// </summary>
public class RabbitMQService
{
/// <summary>
/// 获取连接
/// </summary>
/// <param name="rabbitConfig">连接配置实体</param>
/// <returns></returns>
public static ConnectionFactory GetConnectionFactory(RabbitConfig rabbitConfig)
{
ConnectionFactory factory = new ConnectionFactory
{
HostName = rabbitConfig.HostName,
//默认端口
Port = rabbitConfig.Port,
UserName = rabbitConfig.UserName,
Password = rabbitConfig.Password
};
return factory;
}
/// <summary>
/// 发送信息
/// </summary>
/// <param name="rabbitConfig"></param>
/// <param name="message"></param>
public static void SendMessage(RabbitConfig rabbitConfig, string message)
{
using (IConnection conn = GetConnectionFactory(rabbitConfig).CreateConnection())
{
using (IModel channel = conn.CreateModel())
{
//在MQ上定义一个持久化队列,如果名称相同不会重复创建
channel.QueueDeclare(rabbitConfig.QueenName, true, false, false, null);
byte[] buffer = Encoding.UTF8.GetBytes(message);
IBasicProperties properties = channel.CreateBasicProperties();
properties.DeliveryMode = 2;
channel.BasicPublish("", rabbitConfig.QueenName, properties, buffer);
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Mall.Common.API;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Mall.WebApi.Controllers.CAP
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class TestController : BaseController
{
private readonly DotNetCore.CAP.ICapPublisher _capBus;
public TestController(DotNetCore.CAP.ICapPublisher capPublisher)
{
this._capBus = capPublisher;
}
[HttpPost]
[AllowAnonymous]
public ApiResult Get()
{
ApiResult apiResult = new ApiResult()
{
message = "操作成功",
resultCode = 1,
data = DateTime.Now
};
_capBus.Publish("show.time", Common.Plugin.JsonHelper.Serialize(apiResult));
return apiResult;
}
[NonAction]
[AllowAnonymous]
[DotNetCore.CAP.CapSubscribe("show.time")]
public void CheckReceiveMessage(string result)
{
string str = "";
Console.WriteLine(result);
}
}
}
\ No newline at end of file
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="2.6.0" />
<PackageReference Include="DotNetCore.CAP.MongoDB" Version="2.6.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="2.6.0" />
<PackageReference Include="JWT" Version="5.3.1" /> <PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" /> <PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup> </ItemGroup>
...@@ -28,7 +30,7 @@ ...@@ -28,7 +30,7 @@
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" /> <ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="https://json-schema.org/draft/2019-09/schema" /></VisualStudio></ProjectExtensions>
</Project> </Project>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth> <WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected> <WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
......
...@@ -56,11 +56,30 @@ namespace Mall.WebApi ...@@ -56,11 +56,30 @@ namespace Mall.WebApi
"http://yx.oytour.com", "http://yx.oytour.com",
"http://mall.oytour.com", "http://mall.oytour.com",
"http://testmall.oytour.com", "http://testmall.oytour.com",
"http://yx.oytour.com", "http://yx.oytour.com",
}; };
services.AddCors(options => options.AddPolicy("AllowCors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().WithOrigins(corsArray.ToArray()))); services.AddCors(options => options.AddPolicy("AllowCors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().WithOrigins(corsArray.ToArray())));
services.AddCap(x =>
{
x.UseMongoDB(Common.Config.ReadConfigKey("Mongo"));
x.UseRabbitMQ(cfg =>
{
cfg.HostName = Common.Config.ReadConfigKey("RabbitMqConfig", "HostName");
cfg.VirtualHost = Common.Config.ReadConfigKey("RabbitMqConfig", "VirtualHost");
cfg.Port = Convert.ToInt32(Common.Config.ReadConfigKey("RabbitMqConfig", "Port"));
cfg.UserName = Common.Config.ReadConfigKey("RabbitMqConfig", "UserName");
cfg.Password = Common.Config.ReadConfigKey("RabbitMqConfig", "Password");
});
//失败后的重试次数,默认50次;在FailedRetryInterval默认60秒的情况下,即默认重试50*60秒(50分钟)之后放弃失败重试
x.FailedRetryCount = 10;
//失败后的重拾间隔,默认60秒
x.FailedRetryInterval = 10;
//设置成功信息的删除时间默认24*3600秒
x.SucceedMessageExpiredAfter = 3600;
});
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime appLifetime) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime appLifetime)
...@@ -78,12 +97,12 @@ namespace Mall.WebApi ...@@ -78,12 +97,12 @@ namespace Mall.WebApi
app.UseAuthorization(); app.UseAuthorization();
app.UseEndpoints(endpoints => app.UseEndpoints(endpoints =>
{ {
endpoints.MapControllers(); endpoints.MapControllers();
}); });
System.WebHttpContext.HttpContext.Configure(app.ApplicationServices.GetRequiredService<Microsoft.AspNetCore.Http.IHttpContextAccessor>()); System.WebHttpContext.HttpContext.Configure(app.ApplicationServices.GetRequiredService<Microsoft.AspNetCore.Http.IHttpContextAccessor>());
//启动信息发送 //启动信息发送
Task.Run(() => MessageCore.Init()); Task.Run(() => MessageCore.Init());
......
{ {
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_4;CharSet=utf8; Convert Zero Datetime=true; ", "DefaultConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_3;CharSet=utf8; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient", "DefaultConnectionPName": "MySql.Data.MySqlClient",
"FinanceConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; ", "FinanceConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; ",
"FinanceConnectionPName": "MySql.Data.MySqlClient", "FinanceConnectionPName": "MySql.Data.MySqlClient",
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
"ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com", "ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com",
"ImKey": "b612b31e837c79c68f141aeb719d2b20", "ImKey": "b612b31e837c79c68f141aeb719d2b20",
"ImSecret": "66000451fb72", "ImSecret": "66000451fb72",
//"Mongo": "mongodb://192.168.2.214:27017",
"Mongo": "mongodb://47.96.25.130:27017", "Mongo": "mongodb://47.96.25.130:27017",
"MongoDBName": "Mall", "MongoDBName": "Mall",
"ProjectUrl": "D:/project/GitProject/mallapp", "ProjectUrl": "D:/project/GitProject/mallapp",
...@@ -50,11 +49,13 @@ ...@@ -50,11 +49,13 @@
"PaymentFinanceApi": "http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut", "PaymentFinanceApi": "http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut",
"FinanceKey": "FinanceMallInsertToERPViitto2020", "FinanceKey": "FinanceMallInsertToERPViitto2020",
"SettlementRate": "0.60", "SettlementRate": "0.60",
//"RedisSetting": { "RabbitMqConfig": {
// "RedisServer": "192.168.2.214", "HostName": "47.96.25.130",
// "RedisPort": "6379", "VirtualHost": "/",
// "RedisPwd": "123456" "Port": 5672,
//}, "UserName": "guest",
"Password": "viitto2019"
},
"RedisSetting": { "RedisSetting": {
"RedisServer": "47.96.23.199", "RedisServer": "47.96.23.199",
"RedisPort": "6379", "RedisPort": "6379",
......
...@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall ...@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.AOP", "Mall.AOP\Mall.AOP.csproj", "{231B6093-D5A7-4FEB-A624-7FACE432EA86}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -107,6 +109,10 @@ Global ...@@ -107,6 +109,10 @@ Global
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.Build.0 = Release|Any CPU {C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.Build.0 = Release|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
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