diff --git a/ds-wms-service/DS.Module.Core/Data/TaskFlowDataContext.cs b/ds-wms-service/DS.Module.Core/Data/TaskFlowDataContext.cs index 29004542..02fb3b2c 100644 --- a/ds-wms-service/DS.Module.Core/Data/TaskFlowDataContext.cs +++ b/ds-wms-service/DS.Module.Core/Data/TaskFlowDataContext.cs @@ -73,6 +73,26 @@ namespace DS.Module.Core.Data return default; } + /// + /// + /// + public T? GetOrDefault(string key) + { + if (dataContext.TryGetValue(key, out var value)) + { + if (value is T t) + { + return t; + } + else if (value != null) + { + return (T)Convert.ChangeType(value, typeof(T)); + } + } + + return default; + } + /// /// /// diff --git a/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs b/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs index c5f4811f..a2c996b8 100644 --- a/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs +++ b/ds-wms-service/DS.Module.Core/Utils/ApiFox.cs @@ -168,12 +168,14 @@ namespace DS.Module.Core } else if (method == HttpMethod.Post) { - var jsonRequest = new StringContent(JsonConvert.SerializeObject(requestParams), Encoding.UTF8, "application/json"); + string json = JsonConvert.SerializeObject(requestParams); + var jsonRequest = new StringContent(json, Encoding.UTF8, "application/json"); response = await http.PostAsync(reqUri, jsonRequest); } else if (method == HttpMethod.Put) { - var jsonRequest = new StringContent(JsonConvert.SerializeObject(requestParams), Encoding.UTF8, "application/json"); + string json = JsonConvert.SerializeObject(requestParams); + var jsonRequest = new StringContent(json, Encoding.UTF8, "application/json"); response = await http.PutAsync(reqUri, jsonRequest); } else if (method == HttpMethod.Delete) diff --git a/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj b/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj index 1b5a659e..5b526759 100644 --- a/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj +++ b/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj @@ -18,11 +18,11 @@ - + - + @@ -31,7 +31,7 @@ - + diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskAttachment.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskAttachment.cs index e43fd789..04eafadc 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskAttachment.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskAttachment.cs @@ -21,9 +21,9 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction public long TemplateId { get; set; } /// - /// 附件获取接口的URL + /// 附件文件名 /// - [SugarColumn(ColumnDescription = "附件获取接口的URL", Length = 255, IsNullable = false)] - public string RequestURL { get; set; } = string.Empty; + [SugarColumn(ColumnDescription = "附件文件名", Length = 50, IsNullable = true)] + public string? FileName { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMail.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMail.cs index f43f9316..ac2c0604 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMail.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMail.cs @@ -48,15 +48,9 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction /// /// 服务器设置ID /// - [SugarColumn(ColumnDescription = "任务类型", IsNullable = false)] + [SugarColumn(ColumnDescription = "服务器设置ID", IsNullable = false)] public long ServerId { get; set; } - /// - /// 服务器设置 - /// - [Navigate(NavigateType.OneToOne, nameof(ServerId))] - public BusinessTaskMailServer? Server { get; set; } - /// /// 接收人设置 /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMailServer.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMailServer.cs deleted file mode 100644 index 288b0809..00000000 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/TaskInteraction/BusinessTaskMailServer.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DS.Module.Core.Data; -using SqlSugar; - -namespace DS.WMS.Core.Op.Entity.TaskInteraction -{ - /// - /// 任务邮件服务器配置 - /// - [SugarTable("business_task_mail_server", "任务邮件服务器配置")] - public class BusinessTaskMailServer : BaseOrgModelV2 - { - /// - /// 服务器地址 - /// - [SugarColumn(ColumnDescription = "服务器地址", Length = 200, IsNullable = false)] - public string Host { get; set; } = string.Empty; - - /// - /// 端口号 - /// - [SugarColumn(ColumnDescription = "端口号")] - public int Port { get; set; } - - /// - /// 使用SSL连接 - /// - [SugarColumn(ColumnDescription = "使用SSL连接", DefaultValue = "1")] - public bool UseSSL { get; set; } = true; - - /// - /// 登录账号 - /// - [SugarColumn(ColumnDescription = "登录账号", Length = 200, IsNullable = true)] - public string? LoginName { get; set; } - - /// - /// 登录密码 - /// - [SugarColumn(ColumnDescription = "登录密码", Length = 200, IsNullable = true)] - public string? Password { get; set; } - } -} diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/IActionManagerService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/IActionManagerService.cs index 7d427c53..e22ce8bb 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/IActionManagerService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/IActionManagerService.cs @@ -1,4 +1,5 @@ -using DS.Module.Core.Data; +using DS.Module.Core; +using DS.Module.Core.Data; using DS.WMS.Core.Op.Entity.TaskInteraction; namespace DS.WMS.Core.Op.Interface.TaskInteraction @@ -21,5 +22,7 @@ namespace DS.WMS.Core.Op.Interface.TaskInteraction /// 任务信息 /// Task TriggerAction(BusinessTask businessTask); + + Task TriggerTest(TaskBaseTypeEnum taskType, long? id); } } diff --git a/ds-wms-service/DS.WMS.Core/Op/MailTemplate.cshtml b/ds-wms-service/DS.WMS.Core/Op/MailTemplate.cshtml index bb6c5272..044eeb10 100644 --- a/ds-wms-service/DS.WMS.Core/Op/MailTemplate.cshtml +++ b/ds-wms-service/DS.WMS.Core/Op/MailTemplate.cshtml @@ -1,9 +1,23 @@ -@model DS.WMS.Core.Op.Dtos.TaskInteraction.MailTemplateModel - -@{ +@{ var item = Model.Primary; } + +

测试邮件-@item.MBLNO@item.CustomerNo

@@ -14,3 +28,7 @@
订单创建时间:@item.CreateTime.ToString("yyyy年MM月dd日 HH:mm:ss")
+ +
+
+
\ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor.cs deleted file mode 100644 index 81a503ef..00000000 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor.cs +++ /dev/null @@ -1,45 +0,0 @@ -using DS.Module.Core; -using DS.WMS.Core.Op.Entity.TaskInteraction; -using DS.WMS.Core.Op.Interface.TaskInteraction; -using Microsoft.Extensions.DependencyInjection; - -namespace DS.WMS.Core.Op.Method.TaskInteraction -{ - public class ActionExecutor : ServiceBase - { - //任务日志服务 - //readonly ITaskLogService LogService; - - /// - /// 初始化 - /// - /// - public ActionExecutor(IServiceProvider provider) : base(provider) - { - //LogService = provider.GetRequiredService(); - } - - ///// - ///// 执行特定任务类型的邮件服务 - ///// - ///// 任务 - ///// - ///// 为null - //public async Task ExecuteAsync(BusinessTask task) - //{ - // ArgumentNullException.ThrowIfNull(task, nameof(task)); - - // var list = await TenantDb.Queryable().Where(x => x.TaskType == task.TaskType && x.TaskStatus == task.TaskStatus) - // .Select(x => new - // { - // TemplateIds = x.Attachments.Select(x => x.TemplateId), - // x.Receiver, - // x.Sender, - // x.Title, - // x.Content - // }).ToListAsync(); - - - //} - } -} diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs index b323c407..d8851223 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionManagerService.cs @@ -1,9 +1,11 @@ using DS.Module.Core; using DS.Module.Core.Data; using DS.WMS.Core.Op.Dtos.TaskInteraction; +using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity.TaskInteraction; using DS.WMS.Core.Op.Interface.TaskInteraction; using DS.WMS.Core.TaskPlat; +using SqlSugar; namespace DS.WMS.Core.Op.Method.TaskInteraction { @@ -65,6 +67,28 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction await executor.ExecuteAsync(context); } } + + public async Task TriggerTest(TaskBaseTypeEnum taskType, long? id) + { + var task = await TenantDb.Queryable() + .Where(t => t.TaskType == taskType + //&& SqlFunc.Subqueryable().Where(s => t.BusinessId == s.Id && s.BillSubmitStatus == AuditStatusEnum.Approve).Any() + ) + //.Where(x => x.TaskStatus == TaskStatusEnum.Complete) + .WhereIF(id.HasValue, x => x.BusinessId == id) + .OrderByDescending(t => SqlFunc.GetRandom()).Take(1).FirstAsync(); + if (task != null) + { + TaskFlowDataContext dataContext = new( + (TaskFlowDataNameConst.BusinessTask, task), + ("ActionType", 1), + ("Name", "订舱代理通知") + ); + + TaskFlowRuner taskFlow = new(TenantDb, ServiceProvider); + await taskFlow.RunWithBsno(task.TaskType, task.BusinessId, dataContext); + } + } } /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs index f1f6f919..b479f451 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/MailActionExecutor.cs @@ -2,17 +2,19 @@ using DS.Module.PrintModule; using DS.Module.SqlSugar; using DS.Module.UserModule; +using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Info.Entity; using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Dtos.TaskInteraction; +using DS.WMS.Core.Op.Entity.TaskInteraction; using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Op.Interface.TaskInteraction; using DS.WMS.Core.Sys.Entity; -using MailKit.Net.Smtp; +using HtmlAgilityPack; using Masuit.Tools; using Masuit.Tools.Systems; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using MimeKit; using Newtonsoft.Json; using RazorEngineCore; using SqlSugar; @@ -47,159 +49,222 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction var logService = context.ServiceProvider.GetRequiredService(); var seService = context.ServiceProvider.GetRequiredService(); - var mailName = context.AdditionalData["MailName"] as string; - if (mailName.IsNullOrEmpty()) + var config = context.ServiceProvider.GetRequiredService(); + + BusinessTaskMail? mailConfig = null; + if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail.Id), out var id)) { - await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置"); - return; + if (id == null) + { + await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置"); + return; + } + var idVal = (long)Convert.ChangeType(id, typeof(long)); + mailConfig = (await service.GetAsync(idVal)).Data; + } + else if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail.Name), out var name)) + { + var mailName = name as string; + if (mailName.IsNullOrEmpty()) + { + await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置"); + return; + } + mailConfig = await service.GetAsync(mailName); } - var mailConfig = await service.GetAsync(mailName); + if (mailConfig == null) { - await logService.WriteLogAsync(context.TaskInfo, $"未能获取名为【{mailName}】的邮件配置"); + await logService.WriteLogAsync(context.TaskInfo, $"未能根据任务配置值获取邮件模板设置"); return; } var result = seService.GetSeaExportInfo(context.TaskInfo.BusinessId.ToString()); - if (!result.Succeeded) + if (!result.Succeeded || result.Data == null) { await logService.WriteLogAsync(context.TaskInfo, $"未能获取Id={context.TaskInfo.BusinessId}的{context.TaskInfo.BusinessType.GetDescription()}数据"); return; } + string title, content = string.Empty; var templateModel = new MailTemplateModel { Primary = result.Data }; IRazorEngine razorEngine = new RazorEngine(); - var titleTemplate = razorEngine.Compile>>(mailConfig.Title); - string title = titleTemplate.Run(x => - { - x.Model = templateModel; - }); - var contentTemplate = razorEngine.Compile>>(mailConfig.Content); - string content = contentTemplate.Run(x => - { - x.Model = templateModel; - }); - var textPart = new TextPart("plain") { Text = content }; - var message = new MimeMessage + try { - Subject = title, - }; + var titleTemplate = razorEngine.Compile>>(mailConfig.Title); + title = await titleTemplate.RunAsync(x => + { + x.Model = templateModel; + }); - //设置发件人 - List senderIds = new List(); - if (mailConfig.Sender.IsSale) - { - senderIds.Add(templateModel.Primary.SaleId); + var contentTemplate = razorEngine.Compile>>(mailConfig.Content); + content = await contentTemplate.RunAsync(x => + { + x.Model = templateModel; + }); } - if (mailConfig.Sender.IsOperator) + catch (Exception ex) { - senderIds.Add(templateModel.Primary.OperatorId); + await ex.LogAsync(db); + await logService.WriteLogAsync(context.TaskInfo, $"渲染邮件模板({mailConfig.Id})时出错,请检查模板是否有语法错误"); + return; } - if (mailConfig.Sender.IsCustomerService) + + //设置发件人 + long senderId = 0; + if (mailConfig.Sender.IsSale) + senderId = templateModel.Primary.SaleId; + else if (mailConfig.Sender.IsOperator) + senderId = templateModel.Primary.OperatorId; + else if (mailConfig.Sender.IsCustomerService) + senderId = templateModel.Primary.CustomerService; + else if (mailConfig.Sender.IsVouchingClerk) + senderId = templateModel.Primary.Doc; + + var sender = await db.Queryable().Where(x => x.Id == senderId).Select( + x => new { x.UserName, x.SignatureHtml }).FirstAsync(); + if (sender == null) { - senderIds.Add(templateModel.Primary.CustomerService); + await logService.WriteLogAsync(context.TaskInfo, "未设置发件人"); + return; } - if (mailConfig.Sender.IsVouchingClerk) + var senderConfig = await tenantDb.Queryable().FirstAsync(x => x.CreateBy == senderId); + if (senderConfig == null) { - senderIds.Add(templateModel.Primary.Doc); + await logService.WriteLogAsync(context.TaskInfo, $"发件人用户:{sender.UserName} 未设置SMTP发件信息"); + return; } - var senderList = await db.Queryable().Where(x => senderIds.Contains(x.Id) && x.Email != null && x.Email != string.Empty) - .Select(x => new { x.UserName, x.UserEnName, x.Email }).ToListAsync(); - foreach (var sender in senderList) - message.From.Add(new MailboxAddress(sender.UserName, sender.Email)); + + //插入发件人签名 + var htmlDoc = new HtmlDocument(); + htmlDoc.LoadHtml(content); + var node = htmlDoc.GetElementbyId("sign"); + if (node != null) + node.InnerHtml = sender.SignatureHtml; + + StringWriter writer = new(); + htmlDoc.Save(writer); + content = writer.ToString(); //设置收件人 - List receiverIds = new List(); + List receiverIds = []; if (mailConfig.Receiver.IsCarrier) - { receiverIds.Add(templateModel.Primary.CarrierId); - } + if (mailConfig.Receiver.IsBooking) - { - //receiverIds.Add(templateModel.Primary.CarrierId); - } + receiverIds.Add(templateModel.Primary.CarrierId); + if (mailConfig.Receiver.IsYard) - { receiverIds.Add(templateModel.Primary.YardId); - } + if (mailConfig.Receiver.IsTruck) - { receiverIds.Add(templateModel.Primary.TruckerId); - } + if (mailConfig.Receiver.IsController) - { receiverIds.Add(templateModel.Primary.CustomerId); - } + var receiverList = await tenantDb.Queryable().Where(x => receiverIds.Contains(x.Id) && x.Email != null && x.Email != string.Empty) .Select(x => new { x.ShortName, x.EnShortName, x.Email }).ToListAsync(); - foreach (var item in receiverList) - message.To.Add(new MailboxAddress(item.ShortName, item.Email)); - //需要上传附件 - if (mailConfig.Attachments?.Count > 0) + var attachmentList = mailConfig.Attachments == null ? [] : new List>(mailConfig.Attachments.Count); + try { - var multipart = new Multipart("mixed"); - multipart.Add(textPart); - - if (api.DefaultHeaders.Contains("Authorization")) - api.DefaultHeaders.Remove("Authorization"); + //需要上传附件 + if (mailConfig.Attachments?.Count > 0) + { + if (api.DefaultHeaders.Contains("Authorization")) + api.DefaultHeaders.Remove("Authorization"); - api.DefaultHeaders.Add("Authorization", "Bearer " + user.GetToken()); + api.DefaultHeaders.Add("Authorization", "Bearer " + user.GetToken()); - long tenantId = long.Parse(user.TenantId); - foreach (var item in mailConfig.Attachments) - { - var req = new OpenPrintReq - { - ParamJsonStr = JsonConvert.SerializeObject(new { Id = context.TaskInfo.BusinessId }), - PrintType = "1", - TemplateId = item.TemplateId, - TenantId = tenantId - }; - var reqResult = await api.PostAsync(item.RequestURL, req); - if (!reqResult.Succeeded) + long tenantId = long.Parse(user.TenantId); + string requestUrl = config["TaskMail:FileBaseUrl"] + config["TaskMail:SQLPrint"]; + foreach (var item in mailConfig.Attachments) { - await logService.WriteLogAsync(context.TaskInfo, $"未能获取打印API生成的文件,请求地址:{item.RequestURL}"); - return; + var req = new OpenPrintReq + { + ParamJsonStr = JsonConvert.SerializeObject(new { Id = context.TaskInfo.BusinessId }), + PrintType = ((int)FileFormat.PDF).ToString(), + TemplateId = item.TemplateId, + TenantId = tenantId + }; + var reqResult = await api.PostAsync(requestUrl, req); + if (!reqResult.Succeeded) + { + await logService.WriteLogAsync(context.TaskInfo, $"未能获取打印API生成的文件,请求地址:{requestUrl}"); + return; + } + + string url = config["TaskMail:FileBaseUrl"] + @"/PrintTempFile/" + reqResult.Data.Data; + var fileResult = await api.SendRequestAsync(HttpMethod.Get, url); + if (!fileResult.Succeeded) + { + await logService.WriteLogAsync(context.TaskInfo, $"未能获取打印API生成的文件,附件地址:{url}"); + return; + } + + string fileName = item.FileName.IsNullOrEmpty() ? Path.GetFileName(reqResult.Data.Data) : item.FileName; + var bytes = await fileResult.Data.Content.ReadAsByteArrayAsync(); + string base64Str = Convert.ToBase64String(bytes); + attachmentList.Add(new Tuple(fileName, base64Str)); } - Uri uri = new Uri(item.RequestURL); - string url = uri.Scheme + "://" + uri.Host - + ((uri.Port == 80 || uri.Port == 443) ? string.Empty : ":" + uri.Port) - + "//PrintTempFile//" + reqResult.Data; - //var attachment = new MimePart("image", "gif") - //{ - // Content = new MimeContent(File.OpenRead(path), ContentEncoding.Default), - // ContentDisposition = new ContentDisposition(ContentDisposition.Attachment), - // ContentTransferEncoding = ContentEncoding.Base64, - // FileName = Path.GetFileName(path) - //}; } - } - else - { - message.Body = textPart; - } - var client = new SmtpClient(); - try - { - client.Connect(mailConfig.Server.Host, mailConfig.Server.Port, mailConfig.Server.UseSSL); - if (!mailConfig.Server.LoginName.IsNullOrEmpty() && !mailConfig.Server.Password.IsNullOrEmpty()) + dynamic[] mailParams = [new + { + SendTo = string.Join(",", receiverList.Select(x => x.Email)), + Title = title, + Body = content, + ShowName = senderConfig.ShowName.IsNullOrEmpty() ? sender.UserName : senderConfig.ShowName, + Account = senderConfig.MailAccount, + senderConfig.Password, + Server = senderConfig.SmtpServer, + Port = senderConfig.SmtpPort.GetValueOrDefault(), + UseSSL = senderConfig.SmtpSSL.GetValueOrDefault(), + Attaches = attachmentList.Select(x => new + { + AttachName = x.Item1, + AttachContent = x.Item2 + }).ToList() + }]; + var mailResult = await api.SendRequestAsync(HttpMethod.Post, config["TaskMail:MailApiUrl"], mailParams); + if (mailResult.Data.IsSuccessStatusCode) { - client.Authenticate(mailConfig.Server.LoginName, mailConfig.Server.Password); + await logService.WriteLogAsync(context.TaskInfo, $"已发邮件(委托单:{templateModel.Primary.CustomerNo}),收件人:" + + string.Join(",", receiverList.Select(x => x.Email)) + "发件人:" + senderConfig.MailAccount); + } + else + { + await logService.WriteLogAsync(context.TaskInfo, $"邮件发送失败(委托单:{templateModel.Primary.CustomerNo}),收件人:" + + string.Join(",", receiverList.Select(x => x.Email)) + "发件人:" + senderConfig.MailAccount); } - - client.Send(message); - client.Disconnect(true); } catch (Exception ex) { await ex.LogAsync(db); } - finally - { - client?.Dispose(); - } } + + } + + /// + /// 文件格式 + /// + public enum FileFormat + { + /// + /// PDF + /// + PDF = 1, + + /// + /// Excel + /// + Xlsx = 2, + + /// + /// Word + /// + Docx = 3 } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs index 173340b4..04e431a1 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskMailService.cs @@ -39,7 +39,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction public async Task> GetAsync(long id) { var entity = await TenantDb.Queryable() - .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Server).Includes(x => x.Attachments) + .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments) .Where(x => x.Id == id).FirstAsync(); return DataResult.Success(entity); @@ -53,7 +53,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction public async Task GetAsync(string name) { return await TenantDb.Queryable() - .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Server).Includes(x => x.Attachments) + .Includes(x => x.Receiver).Includes(x => x.Sender).Includes(x => x.Attachments) .Where(x => x.Name == name).FirstAsync(); } @@ -71,13 +71,12 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction { taskMail.Receiver ??= new(); taskMail.Sender ??= new(); - taskMail.Server ??= new(); - taskMail = await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Server).ExecuteReturnEntityAsync(); + taskMail = await TenantDb.InsertNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteReturnEntityAsync(); } else { - await TenantDb.UpdateNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Server).ExecuteCommandAsync(); + await TenantDb.UpdateNav(taskMail).Include(x => x.Receiver).Include(x => x.Sender).ExecuteCommandAsync(); } if (taskMail.Attachments?.Count > 0) @@ -113,7 +112,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction try { await TenantDb.DeleteNav(x => model.Ids.Contains(x.Id)) - .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Server).Include(x => x.Attachments) + .Include(x => x.Receiver).Include(x => x.Sender).Include(x => x.Attachments) .ExecuteCommandAsync(); await TenantDb.Ado.CommitTranAsync(); diff --git a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs index b7fb0a4e..e9fd271f 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs @@ -1,4 +1,5 @@ using DS.Module.Core.Data; +using SqlSugar; using System.ComponentModel; namespace DS.WMS.Core.Sys.Entity; @@ -6,9 +7,9 @@ namespace DS.WMS.Core.Sys.Entity; /// /// 用户实体 /// -[SqlSugar.SugarTable("sys_user")] +[SugarTable("sys_user")] public class SysUser : UserTenantModel -{ +{ /// /// 登陆账号 /// @@ -118,7 +119,7 @@ public class SysUser : UserTenantModel [Description("大简云用户id")] public string DjyUserId { get; set; } - + /// /// 用户类型 0-超管 1-管理员 2-普通用户 3- 租户申请 /// @@ -142,8 +143,8 @@ public class SysUser : UserTenantModel /// [Description("公司Id")] public string CompanyId { get; set; } - - + + /// /// 默认机构Id /// @@ -166,25 +167,25 @@ public class SysUser : UserTenantModel /// [Description("是否操作")] public bool IsOperator { get; set; } = false; - + /// /// 是否单证 /// [Description("是否单证")] public bool IsVouchingClerk { get; set; } = false; - + /// /// 是否销售 /// [Description("是否销售")] public bool IsSale { get; set; } = false; - + /// /// 是否报关员 /// [Description("是否报关员")] public bool IsCustom { get; set; } = false; - + /// /// 是否财务 /// @@ -216,4 +217,11 @@ public class SysUser : UserTenantModel /// [Description("邮件签名")] public string SignatureHtml { get; set; } + + /// + /// 邮件签名Html代码 + /// + [SugarColumn(ColumnDescription = "SignatureHtml", Length = 255, IsNullable = true)] + public string? SignatureHtml { get; set; } + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt index bf95c4f7..a2d6236b 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.FeeApi/Logs/internal-nlog.txt @@ -110,3 +110,10 @@ 2024-08-08 19:59:15.1322 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config 2024-08-08 19:59:15.1322 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-08-08 19:59:15.1461 Info Configuration initialized. +2024-08-09 09:16:39.0114 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-08-09 09:16:39.0238 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-08-09 09:16:39.0238 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-08-09 09:16:39.0383 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-08-09 09:16:39.0383 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config +2024-08-09 09:16:39.0383 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-08-09 09:16:39.0514 Info Configuration initialized. diff --git a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user index 3437dc22..da1782b6 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. <_PublishTargetUrl>D:\Publish\DS8\FeeApi - True|2024-08-09T00:45:38.7858906Z||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||; + True|2024-08-09T01:18:05.8484398Z||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||; \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/TaskMailController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/TaskMailController.cs index a0a21775..a69e4130 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/TaskMailController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/TaskMailController.cs @@ -1,4 +1,5 @@ -using DS.Module.Core; +using System.Net; +using DS.Module.Core; using DS.WMS.Core.Op.Entity.TaskInteraction; using DS.WMS.Core.Op.Interface.TaskInteraction; using Microsoft.AspNetCore.Mvc; @@ -21,6 +22,31 @@ namespace DS.WMS.OpApi.Controllers this.service = service; } + /// + /// 运行测试 + /// + /// + /// 任务类型 + /// 业务ID + /// + [HttpGet, Route("RunTest")] + public async Task RunTestAsync([FromServices] IActionManagerService actionManager, + [FromQuery] TaskBaseTypeEnum taskype, [FromQuery] long? id) + { + HttpStatusCode statusCode; + try + { + await actionManager.TriggerTest(taskype, id); + statusCode = HttpStatusCode.NoContent; + } + catch + { + statusCode = HttpStatusCode.InternalServerError; + } + + return new StatusCodeResult((int)statusCode); + } + /// /// 获取分页列表 /// @@ -38,7 +64,7 @@ namespace DS.WMS.OpApi.Controllers /// ID /// [HttpGet, Route("Edit")] - public async Task>GetAsync(long id) + public async Task> GetAsync(long id) { return await service.GetAsync(id); } @@ -49,7 +75,7 @@ namespace DS.WMS.OpApi.Controllers /// 邮件配置 /// [HttpPost, Route("Edit")] - public async Task EditAsync(BusinessTaskMail taskMail) + public async Task EditAsync(BusinessTaskMail taskMail) { if (taskMail.Receiver == null) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskMailReceiverNotNull)); diff --git a/ds-wms-service/DS.WMS.OpApi/appsettings.json b/ds-wms-service/DS.WMS.OpApi/appsettings.json index 9982e71a..efa550f2 100644 --- a/ds-wms-service/DS.WMS.OpApi/appsettings.json +++ b/ds-wms-service/DS.WMS.OpApi/appsettings.json @@ -1,64 +1,64 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "JwtSettings": { - "Issuer": "vol.core.owner", - "Audience": "vol.core", - "User": "C5ABA9E202D94C43A3CA66002BF77FAF", - "SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs" - }, - "Cors": { - "PolicyName": "WMSCore.API", - "Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084" - }, - "DBInfo": { - "DefaultDbConnId": "1288018625843826688", - "DefaultDbType": 0, - "DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev", - "DBS": [ - { - "ConnId": "1288018625843826680", - "DBType": 0, - "Enabled": false, - "HitRate": 40, - "Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log" - } - ] - }, - "SwaggerDoc": { - "ContactName": "WmsOpAPI", - "ContactEmail": "Wms API.Core@xxx.com", - "ContactUrl": "https://www.xxx.com", - "Version": "1.0", - "Title": "Wms Op API", - "Description": "Wms Op API" - }, - "Middleware": { - "RecordAccessLogs": { - "Enabled": true, - "IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server," - } - }, - "FileSettings": { - "BasePath": "", //基础路径,不配置则使用当前系统目录 - "RelativePath": "LinkAttach", - "FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ] - }, - //打印模板 - "PrintTemplate": { - "BasePath": "", //基础路径,不配置则使用当前系统目录 - "RelativePath": "Upload/PrintTemplate", - "FileType": [ ".frx", ".xls" ] - }, - "TempFile": { - "Path": "TempFiles", - "RemainHours": 2 - }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "JwtSettings": { + "Issuer": "vol.core.owner", + "Audience": "vol.core", + "User": "C5ABA9E202D94C43A3CA66002BF77FAF", + "SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs" + }, + "Cors": { + "PolicyName": "WMSCore.API", + "Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084" + }, + "DBInfo": { + "DefaultDbConnId": "1288018625843826688", + "DefaultDbType": 0, + "DefaultDbString": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_dev", + "DBS": [ + { + "ConnId": "1288018625843826680", + "DBType": 0, + "Enabled": false, + "HitRate": 40, + "Connection": "server=rm-m5e06xxqpa68a68ry5o.mysql.rds.aliyuncs.com;port=3306;uid=rulesengine_admin;pwd=Rule1qaz2wsx!QAZ;database=shippingweb8_log" + } + ] + }, + "SwaggerDoc": { + "ContactName": "WmsOpAPI", + "ContactEmail": "Wms API.Core@xxx.com", + "ContactUrl": "https://www.xxx.com", + "Version": "1.0", + "Title": "Wms Op API", + "Description": "Wms Op API" + }, + "Middleware": { + "RecordAccessLogs": { + "Enabled": true, + "IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server," + } + }, + "FileSettings": { + "BasePath": "", //基础路径,不配置则使用当前系统目录 + "RelativePath": "LinkAttach", + "FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ] + }, + //打印模板 + "PrintTemplate": { + "BasePath": "", //基础路径,不配置则使用当前系统目录 + "RelativePath": "Upload/PrintTemplate", + "FileType": [ ".frx", ".xls" ] + }, + "TempFile": { + "Path": "TempFiles", + "RemainHours": 2 + }, "PrintService": { "IP": "60.209.125.238", "Port": "3009", @@ -82,27 +82,34 @@ "CancelServiceStatusUrl": "/EmbedProjectGoodsStatus/CancelServiceStatus", "GetEnableProjectDictTreeList": "/EmbedProjectGoodsStatus/GetEnableProjectDictTreeList" }, - "ExcuteRuleService": { - "IP": "47.104.73.97", - "Port": "7115", - "SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9", - "SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow", - "RulesEngineSender": "Dongsheng8", - "RulesEngineSenderName": "东胜8" - }, - "MSKAPIService": { - "UserKey": "wu", - "UserSecret": "123456", - "Environment": "TEST" - }, + "ExcuteRuleService": { + "IP": "47.104.73.97", + "Port": "7115", + "SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9", + "SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow", + "RulesEngineSender": "Dongsheng8", + "RulesEngineSenderName": "东胜8" + }, + "MSKAPIService": { + "UserKey": "wu", + "UserSecret": "123456", + "Environment": "TEST" + }, "RedisInfo": { "RedisConfig": "127.0.0.1:6379,password=,defaultDatabase=15" }, - "BCCompare": { - "Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare" - }, + "BCCompare": { + "Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare" + }, "ShippingOrderCompare": { "Url": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/ExcuteShippingOrderCompare", "ResultUrl": "http://47.104.73.97:7115/api/TaskShippingOrderCompare/CompareResult" + }, + "TaskMail": { + "FileBaseUrl": "http://118.190.144.189:3008", + "JsonPrint": "/printApi/OpenPrint/GetOpenJsonPrintInfoAsync", + "JsonPrintByCode": "/printApi/OpenPrint/GetOpenJsonPrintInfoByTemplateCode", + "SQLPrint": "/printApi/OpenPrint/GetOpenSqlPrintInfo", + "MailApiUrl": "http://47.104.73.97:8801/mail/send" } }