master
wet 3 years ago
parent d889044ac8
commit a9efa64582

@ -16,7 +16,7 @@ namespace Common.Authentication
public class TokenProvider
{
private JwtTokenProviderOptions _jwtoptions;
private WebConfig _webconfig = sysOptionConfig.YsWebconfig;
private WebConfig _webconfig = sysOptionConfig.Webconfig;
public TokenProvider()
{

@ -3145,7 +3145,7 @@
</member>
<member name="M:Common.Extensions.ListExtension.StrFilter``1(``0,System.String[])">
<summary>
脏字过滤拓展 ys自定义 脏字字典默认读取配置 sysoptionconfig.yswebconfig.filtearray
脏字过滤拓展 ys自定义 脏字字典默认读取配置 sysoptionconfig.Webconfig.filtearray
</summary>
<typeparam name="T"></typeparam>
<param name="Value"></param>
@ -5164,7 +5164,7 @@
系统静态配置
</summary>
</member>
<member name="P:Common.sysOptionConfig.YsWebconfig">
<member name="P:Common.sysOptionConfig.Webconfig">
<summary>
系统基础配置来于系统json配置文件
</summary>
@ -5832,7 +5832,7 @@
</member>
<member name="P:Common.Tools.YsRedisHelp.RedisContext">
<summary>
Redis 地址 默认使用 sysOptionConfig.YsWebconfig.Redis 配置信息的
Redis 地址 默认使用 sysOptionConfig.Webconfig.Redis 配置信息的
</summary>
</member>
<member name="F:Common.Tools.YsRedisHelp.DbRedis">

@ -24,7 +24,7 @@ namespace Common
public DapperDBBase()
{
sqlConnection = sysOptionConfig.YsWebconfig.DapperDbString;
sqlConnection = sysOptionConfig.Webconfig.DapperDbString;
}
/// <summary>
///
@ -34,7 +34,7 @@ namespace Common
{
if (string.IsNullOrEmpty(sqlConnection))
sqlConnection = sysOptionConfig.YsWebconfig.DapperDbString;
sqlConnection = sysOptionConfig.Webconfig.DapperDbString;
IDbConnection conn = new SqlConnection(sqlConnection);
conn.Open();
return conn;

@ -155,7 +155,7 @@ namespace Common.DjyService
RetrunData.IsPower = false;
}
//if (sysOptionConfig.YsWebconfig.IsDev)
//if (sysOptionConfig.Webconfig.IsDev)
//{
// RetrunData.UserId = null;
// RetrunData.CompayId =null;
@ -237,7 +237,7 @@ namespace Common.DjyService
/// <returns></returns>
protected static string _DecryptDES(string value)
{
return SafeTools.DecryptDES(value, sysOptionConfig.YsWebconfig.DesKey);
return SafeTools.DecryptDES(value, sysOptionConfig.Webconfig.DesKey);
}
#endregion
}

@ -49,7 +49,7 @@ namespace Common.DjyService
/// <summary>
/// RedisDB
/// </summary>
public static RedisClient DbRedis = new RedisClient(string.Format("{0}", sysOptionConfig.YsWebconfig.Redis));
public static RedisClient DbRedis = new RedisClient(string.Format("{0}", sysOptionConfig.Webconfig.Redis));
/// <summary>
/// 数据库连接池初始化
@ -57,7 +57,7 @@ namespace Common.DjyService
/// <returns></returns>
public static bool DbBusInit() {
foreach (var item in sysOptionConfig.YsWebconfig.DataConnList)
foreach (var item in sysOptionConfig.Webconfig.DataConnList)
{
if (item.SysKey == DbList.Logsdb)//日志库允许自动更新表结构

@ -114,7 +114,7 @@ namespace Common.DjyService
}
else
{
mailBodyEntity.SenderAddress = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SendAccess"];
mailBodyEntity.SenderAddress = sysOptionConfig.Webconfig.ConfigList["sys.Email_SendAccess"];
}
}
@ -125,10 +125,10 @@ namespace Common.DjyService
MailConfig = new SendServerConfigurationEntity
{
SmtpHost = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SmtpHost"],
SmtpPort = int.Parse(sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SmtpPort"]),
SenderAccount = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_LoginName"],
SenderPassword = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_Password"],
SmtpHost = sysOptionConfig.Webconfig.ConfigList["sys.Email_SmtpHost"],
SmtpPort = int.Parse(sysOptionConfig.Webconfig.ConfigList["sys.Email_SmtpPort"]),
SenderAccount = sysOptionConfig.Webconfig.ConfigList["sys.Email_LoginName"],
SenderPassword = sysOptionConfig.Webconfig.ConfigList["sys.Email_Password"],
IsSsl = false
};
}
@ -186,16 +186,16 @@ namespace Common.DjyService
//}
//else
{
mailBodyEntity.SenderAddress = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SendAccess"];
mailBodyEntity.SenderAddress = sysOptionConfig.Webconfig.ConfigList["sys.Email_SendAccess"];
}
}
var sendServerConfiguration = new SendServerConfigurationEntity
{
SmtpHost = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SmtpHost"],
SmtpPort = int.Parse(sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SmtpPort"]),
SenderAccount = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_LoginName"],
SenderPassword = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_Password"],
SmtpHost = sysOptionConfig.Webconfig.ConfigList["sys.Email_SmtpHost"],
SmtpPort = int.Parse(sysOptionConfig.Webconfig.ConfigList["sys.Email_SmtpPort"]),
SenderAccount = sysOptionConfig.Webconfig.ConfigList["sys.Email_LoginName"],
SenderPassword = sysOptionConfig.Webconfig.ConfigList["sys.Email_Password"],
IsSsl = false
};

@ -33,7 +33,7 @@ namespace Common.DjyService
user = DbBus.Get(DbList.djyolddb).Select<User>().Where(w => w.GID == usergid).ToOne();
if (user != null)
{
DjyTools.RedisSet("UserInfo_" + usergid, user, sysOptionConfig.YsWebconfig.cache_time);
DjyTools.RedisSet("UserInfo_" + usergid, user, sysOptionConfig.Webconfig.cache_time);
}
}
rs.Data = user;
@ -97,7 +97,7 @@ namespace Common.DjyService
list = DbBus.Get(DbList.djyolddb).Ado.Query<DJyUserAuthorityDto>(strSql.ToString());
DjyTools.RedisSet(rkey,list, sysOptionConfig.YsWebconfig.cache_time);
DjyTools.RedisSet(rkey,list, sysOptionConfig.Webconfig.cache_time);
}
if (Dto.KeyName.IsNotNull()) {

@ -40,7 +40,7 @@ namespace Common
private string[] _strFilterArray = sysOptionConfig.YsWebconfig.FilteArray;
private string[] _strFilterArray = sysOptionConfig.Webconfig.FilteArray;
/// <summary>
/// 脏字过滤

@ -116,6 +116,10 @@ namespace Common.Entity
public string DapperDbString { get; set; }
public string requesterDea { get; set; }
#region jwt认证配置
/// <summary>
/// jwt发行者

@ -24,11 +24,11 @@ namespace Common.Extensions
/// <returns></returns>
public static T StrFilter<T>(this IFilterData<T> Value, string[] strFilterArray = null)
{
return StrFilteFun<T>.FilterCode(Value.Data, strFilterArray == null ? sysOptionConfig.YsWebconfig.FilteArray : strFilterArray);
return StrFilteFun<T>.FilterCode(Value.Data, strFilterArray == null ? sysOptionConfig.Webconfig.FilteArray : strFilterArray);
}
/// <summary>
/// 脏字过滤拓展 ys自定义 脏字字典默认读取配置 sysoptionconfig.yswebconfig.filtearray
/// 脏字过滤拓展 ys自定义 脏字字典默认读取配置 sysoptionconfig.Webconfig.filtearray
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="Value"></param>
@ -36,7 +36,7 @@ namespace Common.Extensions
/// <returns></returns>
public static T StrFilter<T>(this T Value, string[] strFilterArray = null)
{
var rt = strFilterArray == null ? sysOptionConfig.YsWebconfig.FilteArray : strFilterArray;
var rt = strFilterArray == null ? sysOptionConfig.Webconfig.FilteArray : strFilterArray;
return StrFilteFun<T>.FilterCode(Value,rt);
}

@ -26,16 +26,16 @@ namespace Common.Tools.Email
}
if (mailBodyEntity.SenderAddress.IsNull())
mailBodyEntity.SenderAddress = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SendAccess"];
mailBodyEntity.SenderAddress = sysOptionConfig.Webconfig.ConfigList["sys.Email_SendAccess"];
if (sendServerConfiguration == null)
{//读取默认配置
sendServerConfiguration = new SendServerConfigurationEntity {
SmtpHost = sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SmtpHost"],
SmtpPort =int.Parse( sysOptionConfig.YsWebconfig.ConfigList["sys.Email_SmtpPort"]),
SenderAccount=sysOptionConfig.YsWebconfig.ConfigList["sys,Email_LoginName"],
SenderPassword=sysOptionConfig.YsWebconfig.ConfigList["sys.Email_Password"],
SmtpHost = sysOptionConfig.Webconfig.ConfigList["sys.Email_SmtpHost"],
SmtpPort =int.Parse( sysOptionConfig.Webconfig.ConfigList["sys.Email_SmtpPort"]),
SenderAccount=sysOptionConfig.Webconfig.ConfigList["sys,Email_LoginName"],
SenderPassword=sysOptionConfig.Webconfig.ConfigList["sys.Email_Password"],
IsSsl=false
};

@ -13,9 +13,9 @@ namespace Common.Tools
/// </summary>
public class YsRedisHelp
{
private static string _RedisContext = sysOptionConfig.YsWebconfig.Redis;
private static string _RedisContext = sysOptionConfig.Webconfig.Redis;
/// <summary>
/// Redis 地址 默认使用 sysOptionConfig.YsWebconfig.Redis 配置信息的
/// Redis 地址 默认使用 sysOptionConfig.Webconfig.Redis 配置信息的
/// </summary>
public static string RedisContext { set {
_RedisContext = value;

@ -39,7 +39,7 @@ namespace Common.Tools
/// </summary>
public static async Task<ReturnResult<string>> ServerWarnMessageErr(string Message)
{
return await ServerWarnMessage(new WarnMessageDto { Message = Message,DingUrl=sysOptionConfig.YsWebconfig.ServerWarnApiUrlErr });
return await ServerWarnMessage(new WarnMessageDto { Message = Message,DingUrl=sysOptionConfig.Webconfig.ServerWarnApiUrlErr });
}
/// <summary>
@ -59,15 +59,15 @@ namespace Common.Tools
}
if (Dto.DingUrl.IsNull())
{
Dto.DingUrl = sysOptionConfig.YsWebconfig.ServerWarnApiUrl;
Dto.DingUrl = sysOptionConfig.Webconfig.ServerWarnApiUrl;
}
if (Dto.KeyTag.IsNull())
{
Dto.KeyTag= "[" + sysOptionConfig.YsWebconfig.ServerWarnKey + "]";
Dto.KeyTag= "[" + sysOptionConfig.Webconfig.ServerWarnKey + "]";
}
if (Dto.Title.IsNull())
{
Dto.Title = sysOptionConfig.YsWebconfig.WebName;
Dto.Title = sysOptionConfig.Webconfig.WebName;
}
if (Dto.DingUrl.IsNotNull())
{

@ -19,7 +19,7 @@ namespace Common.Tools.UpLoad
private Config qiniuconfig = new Config { Zone = Zone.ZONE_CN_East };//上传的部分配置
public UploadQiniu()
{
_QnConfig =sysOptionConfig.YsQiniuconfig;
_QnConfig =sysOptionConfig.Qiniuconfig;
}
/// <summary>

@ -19,18 +19,18 @@ namespace Common
/// <summary>
/// 系统基础配置来于系统json配置文件
/// </summary>
public static WebConfig YsWebconfig { get; set; } = new WebConfig();
public static WebConfig Webconfig { get; set; } = new WebConfig();
/// <summary>
/// 微信配置
/// </summary>
public static WeixinConfig YsWeixinConfig { get; set; } = new WeixinConfig();
public static WeixinConfig WeixinConfig { get; set; } = new WeixinConfig();
/// <summary>
/// 七牛云存储配置
/// </summary>
public static QiniuConfig YsQiniuconfig { get; set; } = new QiniuConfig();
public static QiniuConfig Qiniuconfig { get; set; } = new QiniuConfig();
/// <summary>
/// jwt身份认证发行者实体属性
/// </summary>

@ -45,5 +45,10 @@ namespace djy.Paas.IService
List<CommonCodeValue> GetKINDPKGS();
List<AMS_SysDangerousGoods> GetDangerousGoods();
Response SendDE(string Gid, string userid);
}
}

@ -8,9 +8,6 @@ namespace djy.Model.Ams
[JsonObject(MemberSerialization.OptIn), Table(Name = "AMS_Cntrno", DisableSyncStructure = true)]
public class AMS_Cntrno
{
public AMS_Cntrno()
{
this.IsDel = false;

@ -0,0 +1,184 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace djy.Model.AmsDto
{
public class masterBillInfo
{
public string masterBillNo { get; set; }
public string shipCompany { get; set; }
public string vessel { get; set; }
public string voyage { get; set; }
public string requesterDea { get; set; }
public string consignmentType { get; set; }
public string loadHarbour { get; set; }
public string loadHarbourCode { get; set; }
public string dischargeHarbour { get; set; }
public string dischargeHarbourCode { get; set; }
public string lastForeignHarbour { get; set; }
public string lastForeignHarbourCode { get; set; }
public string loadDate { get; set; }
public string estimatedArrivalTime { get; set; }
public string filingType { get; set; }
}
public class InsertListItem
{
/// <summary>
///
/// </summary>
public string enProductName { get; set; }
/// <summary>
///
/// </summary>
public string containerNo { get; set; }
/// <summary>
///
/// </summary>
public string containerType { get; set; }
/// <summary>
///
/// </summary>
public string sealNo { get; set; }
/// <summary>
///
/// </summary>
public string digit { get; set; }
/// <summary>
///
/// </summary>
public string grossWeight { get; set; }
/// <summary>
///
/// </summary>
public string volume { get; set; }
/// <summary>
///
/// </summary>
public string packing { get; set; }
/// <summary>
///
/// </summary>
public string packingCode { get; set; }
/// <summary>
///
/// </summary>
public string shippingMark { get; set; }
/// <summary>
///
/// </summary>
public string unCode { get; set; }
/// <summary>
///
/// </summary>
public string dangerGrade { get; set; }
}
public class CtnInfo
{
/// <summary>
///
/// </summary>
public List<InsertListItem> insertList { get; set; }
}
public class HouseBillInfoListItem
{
/// <summary>
///
/// </summary>
public string businessId { get; set; }
/// <summary>
///
/// </summary>
public string houseBillNo { get; set; }
/// <summary>
///
/// </summary>
public string sendAddress { get; set; }
/// <summary>
///
/// </summary>
public string sendName { get; set; }
/// <summary>
///
/// </summary>
public string sendCity { get; set; }
/// <summary>
///
/// </summary>
public string sendCountry { get; set; }
/// <summary>
///
/// </summary>
public string sendCountryCode { get; set; }
/// <summary>
///
/// </summary>
public string receiveAddress { get; set; }
/// <summary>
///
/// </summary>
public string receiveName { get; set; }
/// <summary>
///
/// </summary>
public string receiveCity { get; set; }
/// <summary>
///
/// </summary>
public string receiveCountry { get; set; }
/// <summary>
///
/// </summary>
public string receiveCountryCode { get; set; }
/// <summary>
///
/// </summary>
public string notifyAddress { get; set; }
/// <summary>
///
/// </summary>
public string notifyName { get; set; }
/// <summary>
///
/// </summary>
public string notifyCity { get; set; }
/// <summary>
///
/// </summary>
public string notifyCountry { get; set; }
/// <summary>
///
/// </summary>
public string notifyCountryCode { get; set; }
/// <summary>
///
/// </summary>
public CtnInfo ctnInfo { get; set; }
}
public class MasterBillInfoDto
{
public masterBillInfo masterBillInfo { get; set; }
public List<HouseBillInfoListItem> houseBillInfoList { get; set; }
}
}

@ -16,6 +16,8 @@ using Common.DJYModel;
using System.Transactions;
using Dapper.Contrib.Extensions;
using Common.Utilities;
using Newtonsoft.Json;
namespace djy.Service.Ams
{
/// <summary>
@ -27,18 +29,19 @@ namespace djy.Service.Ams
{
var result = new TableData();
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
var dto = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => x.IsDel == false || x.IsDel == null&&x.CompID==user.CompId).WhereIf(req.MBLNO != null, x => x.MBLNO == req.MBLNO);
var dto = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => (x.IsDel == false || x.IsDel == null)&&x.CompID==user.CompId).WhereIf(req.MBLNO != null, x => x.MBLNO == req.MBLNO);
result.count = dto.ToList().Count();
var list= dto.Page(req.Page,req.Limit).ToList<AMSDto>();
if (list != null) {
if (list != null)
{
foreach (var item in list)
{
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel == false || x.IsDel == null && x.PID == item.GID).ToList<AMS_HouseDto>();
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x =>( x.IsDel == false || x.IsDel == null) && x.PID == item.GID).ToList<AMS_HouseDto>();
item.HouseDto = hodto;
if (hodto!=null) {
foreach (var it in hodto)
{
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => x.IsDel == false || x.IsDel == null && x.HID == it.GID).ToList();
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => (x.IsDel == false || x.IsDel == null )&& x.HID == it.GID).ToList();
it.CntrnoDto = cnt;
}
}
@ -141,7 +144,6 @@ namespace djy.Service.Ams
}
});
}
}
public List<CommonCodeValue> GetCountry()
@ -209,5 +211,98 @@ namespace djy.Service.Ams
throw;
}
}
public Response SendDE(string Gid,string userid)
{
var result = new Response();
try {
if (Gid.IsNull()) {
result.Code = 500;
result.Message = "请传入相关业务id!";
return result;
}
string[] id = Gid.Split(',');
foreach (string oid in id)
{
if (oid != "")
{
MasterBillInfoDto dto = new MasterBillInfoDto();
masterBillInfo masterBillInfo = new masterBillInfo();
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => (x.IsDel == false || x.IsDel == null) && x.CompID == user.CompId&&x.GID==oid).ToOne();
masterBillInfo.masterBillNo = master.MBLNO;
masterBillInfo.shipCompany = master.CARRIERID;
masterBillInfo.vessel = master.VESSEL;
masterBillInfo.voyage = master.VOYNO;
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
masterBillInfo.consignmentType = master.ConsignmentType;
masterBillInfo.loadHarbour = master.LoadingPort;
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
masterBillInfo.dischargeHarbour = master.PORTDISCHARGE;
masterBillInfo.dischargeHarbourCode = master.PORTDISCHARGECode;
masterBillInfo.lastForeignHarbour = master.LastNoUsPort;
masterBillInfo.lastForeignHarbourCode = master.LastNoUsPortCode;
masterBillInfo.loadDate = master.ETA.ToString("yyyy-MM-dd hh:mm:ss");
masterBillInfo.estimatedArrivalTime = master.ETD.ToString("yyyy-MM-dd hh:mm:ss");
masterBillInfo.filingType = master.ShippingType;
dto.masterBillInfo = masterBillInfo;
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID).ToList<AMS_HouseDto>();
List<HouseBillInfoListItem> houseBillInfoListItems = new List<HouseBillInfoListItem>();
foreach (var item in hodto)
{
HouseBillInfoListItem houseinfo = new HouseBillInfoListItem();
houseinfo.businessId = item.GID;
houseinfo.houseBillNo = item.HBLNo;
houseinfo.sendAddress = item.SHIPPERADDR;
houseinfo.sendName = item.SHIPPERNAME;
houseinfo.sendCity = item.SHIPPERCity;
houseinfo.sendCountry = item.SHIPPERCountry;
houseinfo.sendCountryCode = item.SHIPPERCountryCode;
houseinfo.receiveAddress = item.CONSIGNEEDADDR;
houseinfo.receiveName = item.CONSIGNEEName;
houseinfo.receiveCity = item.CONSIGNEECity;
houseinfo.receiveCountry = item.CONSIGNEECountry;
houseinfo.receiveCountryCode = item.CONSIGNEECountryCode;
houseinfo.notifyAddress = item.NOTIFYPARTYADDR;
houseinfo.notifyName = item.NOTIFYPARTYNAME;
houseinfo.notifyCity = item.NOTIFYPARTYCity;
houseinfo.notifyCountry = item.NOTIFYPARTYCountry;
houseinfo.notifyCountryCode = item.NOTIFYPARTYCountryCode;
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => (x.IsDel == false || x.IsDel == null) && x.HID == item.GID).ToList();
CtnInfo CtnInfo = new CtnInfo();
List<InsertListItem> list = new List<InsertListItem>();
foreach (var it in cnt)
{
InsertListItem insertList = new InsertListItem();
insertList.enProductName = it.ProductName;
insertList.containerNo = it.CNTRNO;
insertList.sealNo = it.SEALNO;
insertList.digit = it.PKGS.ToString();
insertList.grossWeight = it.KGS.ToString();
insertList.volume = it.CBM.ToString();
insertList.packing = it.KINDPKGS;
insertList.packingCode = it.KINDPKGSCode;
insertList.shippingMark = it.MARKS;
insertList.unCode = it.DUNNO;
insertList.dangerGrade = it.DangerGrade;
list.Add(insertList);
}
CtnInfo.insertList = list;
houseinfo.ctnInfo = CtnInfo;
houseBillInfoListItems.Add(houseinfo);
}
dto.houseBillInfoList = houseBillInfoListItems;
var data = JsonConvert.SerializeObject(dto).ToBase64();
}
}
}
catch (Exception e) {
result.Code = 500;
result.Message = e.InnerException?.Message ?? e.Message;
}
return result;
}
}
}

@ -89,8 +89,6 @@ namespace djy_AmsApi.Controllers
return result;
}
/// <summary>
/// 下拉获取船公司
/// </summary>
@ -154,8 +152,6 @@ namespace djy_AmsApi.Controllers
return result;
}
/// <summary>
/// 下拉获取危品等级及 CODE
/// </summary>
@ -175,6 +171,37 @@ namespace djy_AmsApi.Controllers
}
return result;
}
[HttpGet("Send")]
public Response Send(string ids)
{
var result = new Response();
//if (GetLoginId == null)
//{
// var result = new Response();
// result.Code = 401;
// result.Message = "登录过期,请重新登录!";
// return result;
//}
try
{
ser.SendDE(ids, "d85fd590-d9f6-4410-93a1-f6fac77b606e");
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
}
}

File diff suppressed because one or more lines are too long

@ -46,11 +46,11 @@ namespace djy_AmsApi
//读取配置信息
Configuration.Bind("WebConfig", sysOptionConfig.YsWebconfig);
Configuration.Bind("WebConfig", sysOptionConfig.Webconfig);
sysOptionConfig._Configuration = Configuration;
services.AddAuthentication("Bearer").AddJwtBearer("Bearer",option=> {
option.Authority = sysOptionConfig.YsWebconfig.IdentServerUrl;//ÊÚȨ·þÎñµÄURlµØÖ·
option.Authority = sysOptionConfig.Webconfig.IdentServerUrl;//ÊÚȨ·þÎñµÄURlµØÖ·
option.RequireHttpsMetadata = false;//是否使用了https
option.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
{ ValidateAudience = false };
@ -76,26 +76,26 @@ namespace djy_AmsApi
//任务配置
services.AddHangfire(config => {
config.UseRedisStorage(sysOptionConfig.YsWebconfig.Redis, new Hangfire.Redis.RedisStorageOptions { Prefix = "hf_"+sysOptionConfig.YsWebconfig.WebName,InvisibilityTimeout=TimeSpan.FromHours(1) });
config.UseRedisStorage(sysOptionConfig.Webconfig.Redis, new Hangfire.Redis.RedisStorageOptions { Prefix = "hf_"+sysOptionConfig.Webconfig.WebName,InvisibilityTimeout=TimeSpan.FromHours(1) });
});
services.AddHangfireServer();
//CAP 消息队列总线
if (sysOptionConfig.YsWebconfig.Rbmq_Host.IsNotNull())
if (sysOptionConfig.Webconfig.Rbmq_Host.IsNotNull())
{
services.AddCap(x =>
{
x.UseSqlServer(sysOptionConfig.YsWebconfig.Rbmq_Sqlhost);
x.UseSqlServer(sysOptionConfig.Webconfig.Rbmq_Sqlhost);
x.UseRabbitMQ(options =>
{
var _host = sysOptionConfig.YsWebconfig.Rbmq_Host.Split(':');
var _host = sysOptionConfig.Webconfig.Rbmq_Host.Split(':');
options.HostName = _host[0];
if (_host.Length == 2)
{
options.Port = int.Parse(_host[1]);
}
options.UserName = sysOptionConfig.YsWebconfig.Rbmq_UserName;
options.Password = sysOptionConfig.YsWebconfig.Rbmq_Password;
options.UserName = sysOptionConfig.Webconfig.Rbmq_UserName;
options.Password = sysOptionConfig.Webconfig.Rbmq_Password;
});
x.UseDashboard();
});

Loading…
Cancel
Save