diff --git a/Myshipping.Application/EDI/Yard/XiahuozhiHelpler.cs b/Myshipping.Application/EDI/Yard/XiahuozhiHelpler.cs index c54ecc7e..4515bddd 100644 --- a/Myshipping.Application/EDI/Yard/XiahuozhiHelpler.cs +++ b/Myshipping.Application/EDI/Yard/XiahuozhiHelpler.cs @@ -6,6 +6,7 @@ using Myshipping.Application.ConfigOption; using Myshipping.Application.Entity; using Myshipping.Core; using Myshipping.Core.Entity; +using Myshipping.Core.Helper; using Myshipping.Core.Service; using Newtonsoft.Json.Linq; using SqlSugar; @@ -28,9 +29,11 @@ namespace Myshipping.Application.EDI public static bool Send( long bookingId, string filerole, out string msg) { + var repUser = App.GetService>(); var repOrder = App.GetService>(); var repCtn = App.GetService>(); var repBookingFile = App.GetService>(); + var repUserMail = App.GetService>(); var cacheService = App.GetService(); @@ -106,7 +109,7 @@ namespace Myshipping.Application.EDI { Directory.CreateDirectory(ediPathAbs); } - + var ediSettints = cacheService.GetAllEdiSetting().Result; //港联捷所有用户使用一个ftp用户名和密码发送报文,使用文件名中的下货纸代号进行区分 var paraServer = cacheService.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "booking_ftp_setting_glj" && x.Code == "ftp_server"); var paraUser = cacheService.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "booking_ftp_setting_glj" && x.Code == "username"); @@ -574,53 +577,53 @@ namespace Myshipping.Application.EDI msg = "场站联系人邮箱不能为空"; return false; } - // MailDataContext mailData = new MailDataContext(); - // var userMail = mailData.UserAccounts.AsNoTracking().FirstOrDefault(ua => ua.UserId == order.USERID); - // if (userMail == null - // || string.IsNullOrEmpty(userMail.SmtpServer) - // || userMail.SmtpPort == 0) - // { - // msg = "发件邮箱未配置"; - // return false; - // } - - - // var userbase = sugerClient.Queryable().First(u => u.Id == order.CreatedUserId); - // var title = $"下货纸:{order.MBLNO}/{order.CARRIER}/{order.VESSEL}/{order.VOYNO}/{order.TenantName}"; - - // var bodyExt = string.Empty; - // if (order.CARGOID == "R") - // { - // bodyExt = $@"温度:{order.TEMPSET}{order.TEMPID}
- //通风:{order.REEFERF}
- //湿度:{order.HUMIDITY}
"; - // } - // else if (order.CARGOID == "D") - // { - // bodyExt = $@"危险品等级:{order.DCLASS}
- //危险品编号:{order.DUNNO}
- //危险品联系方式:{order.LINKMAN}
"; - // } - - // var body = $@"提单号:{order.MBLNO}
- //船名航次:{order.VESSEL}/{order.VOYNO}
- //起运港:{order.PORTLOAD},{order.PORTLOADID}
- //目的港:{order.PORTDISCHARGE},{order.PORTDISCHARGEID}
- //目的地:{order.DESTINATION},{order.DESTINATIONID}
- //预计船期:{(order.ETD.HasValue ? order.ETD.Value.ToString("yyyy-MM-dd") : "")}
- //箱型箱量:{order.CNTRTOTAL}
- //件重尺:{order.PKGS} {order.KINDPKGS}/{order.KGS}KGS/{order.CBM}CBM
- //货物描述:{order.DESCRIPTION}
- //{bodyExt} - //备注:{order.YARDREMARK}
- //
- //订舱代理:{order.TenantName}
- //联系人:{order.CreatedUserName}
- //电话:{userbase.Tel} 手机:{userbase.Phone}
- //邮箱:{userbase.Email}
- //"; - - // MailHelper.SendMail(userMail.GID, title, body, order.YardContractEmail, customerSend: true); + + var userMail = repUserMail.FirstOrDefault(x=>x.CreatedUserId == order.CreatedUserId); + if (userMail == null + || string.IsNullOrEmpty(userMail.SmtpServer) + || userMail.SmtpPort == 0) + { + msg = "发件邮箱未配置"; + return false; + } + + + var userbase = repUser.FirstOrDefault(u => u.Id == order.CreatedUserId); + var title = $"下货纸:{order.MBLNO}/{order.CARRIER}/{order.VESSEL}/{order.VOYNO}/{order.TenantName}"; + + var bodyExt = string.Empty; + if (order.CARGOID == "R") + { + bodyExt = $@"温度:{order.TEMPSET}{order.TEMPID}
+ 通风:{order.REEFERF}
+ 湿度:{order.HUMIDITY}
"; + } + else if (order.CARGOID == "D") + { + bodyExt = $@"危险品等级:{order.DCLASS}
+ 危险品编号:{order.DUNNO}
+ 危险品联系方式:{order.LINKMAN}
"; + } + + var body = $@"提单号:{order.MBLNO}
+ 船名航次:{order.VESSEL}/{order.VOYNO}
+ 起运港:{order.PORTLOAD},{order.PORTLOADID}
+ 目的港:{order.PORTDISCHARGE},{order.PORTDISCHARGEID}
+ 目的地:{order.DESTINATION},{order.DESTINATIONID}
+ 预计船期:{(order.ETD.HasValue ? order.ETD.Value.ToString("yyyy-MM-dd") : "")}
+ 箱型箱量:{order.CNTRTOTAL}
+ 件重尺:{order.PKGS} {order.KINDPKGS}/{order.KGS}KGS/{order.CBM}CBM
+ 货物描述:{order.DESCRIPTION}
+ {bodyExt} + 备注:{order.YARDREMARK}
+
+ 订舱代理:{order.TenantName}
+ 联系人:{order.CreatedUserName}
+ 电话:{userbase.Tel} 手机:{userbase.Phone}
+ 邮箱:{userbase.Email}
+ "; + + MailSendHelper.SendMail(userMail, title, body, order.YARDCONTRACTEMAIL); } msg = "已发送"; return true; diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index c5e129fb..8f2dfc3d 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3936,7 +3936,7 @@ 收货人代码 - + 通知人代码 @@ -3951,7 +3951,7 @@ 收货人 - + 通知人 @@ -4318,52 +4318,52 @@ - 发货人名称 + 收货人名称 - 发货人地址1 + 收货人地址1 - 发货人地址2 + 收货人地址2 - 发货人地址3 + 收货人地址3 - 发货人城市 + 收货人城市 - 发货人省份代码 + 收货人省份代码 - 发货人邮编 + 收货人邮编 - 发货人国家代码 + 收货人国家代码 - 发货人联系人 + 收货人联系人 - 发货人电话 + 收货人电话 diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index f596698f..28a83efa 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -542,5 +542,14 @@ namespace Myshipping.Application var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync(); _logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString()); } + + + + [HttpGet("/BookingPrintTemplate/test")] + public async Task Test(long id) + { + var rtn = XiahuozhiHelpler.Send(id, "9", out string msg); + return $"{rtn} {msg}"; + } } } diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs index 06fc57d6..6e93425d 100644 --- a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs @@ -62,7 +62,7 @@ namespace Myshipping.Application /// /// 通知人代码 /// - public string NotifyPrtId { get; set; } + public string NotifyPartyId { get; set; } /// /// 发货人 /// @@ -74,7 +74,7 @@ namespace Myshipping.Application /// /// 通知人 /// - public string NotifyPrt { get; set; } + public string NotifyParty { get; set; } /// /// 第二通知人 /// @@ -365,43 +365,43 @@ namespace Myshipping.Application /// public string ShipperTel { get; set; } /// - /// 发货人名称 + /// 收货人名称 /// public string ConsigneeName { get; set; } /// - /// 发货人地址1 + /// 收货人地址1 /// public string ConsigneeAddr1 { get; set; } /// - /// 发货人地址2 + /// 收货人地址2 /// public string ConsigneeAddr2 { get; set; } /// - /// 发货人地址3 + /// 收货人地址3 /// public string ConsigneeAddr3 { get; set; } /// - /// 发货人城市 + /// 收货人城市 /// public string ConsigneeCity { get; set; } /// - /// 发货人省份代码 + /// 收货人省份代码 /// public string ConsigneeProvince { get; set; } /// - /// 发货人邮编 + /// 收货人邮编 /// public string ConsigneePostCode { get; set; } /// - /// 发货人国家代码 + /// 收货人国家代码 /// public string ConsigneeCountry { get; set; } /// - /// 发货人联系人 + /// 收货人联系人 /// public string ConsigneeAttn { get; set; } /// - /// 发货人电话 + /// 收货人电话 /// public string ConsigneeTel { get; set; } /// diff --git a/Myshipping.Core/Entity/DJY/DjyCustomerContact.cs b/Myshipping.Core/Entity/DJY/DjyCustomerContact.cs index f6054d3b..06d73bad 100644 --- a/Myshipping.Core/Entity/DJY/DjyCustomerContact.cs +++ b/Myshipping.Core/Entity/DJY/DjyCustomerContact.cs @@ -18,7 +18,7 @@ namespace Myshipping.Core.Entity /// /// 角色ID /// - public long? RoleId { get; set; } + public string RoleCode { get; set; } /// /// 角色名称 /// diff --git a/Myshipping.Core/Entity/DJY/DjyUserMailAccount.cs b/Myshipping.Core/Entity/DJY/DjyUserMailAccount.cs new file mode 100644 index 00000000..de28b304 --- /dev/null +++ b/Myshipping.Core/Entity/DJY/DjyUserMailAccount.cs @@ -0,0 +1,60 @@ +using System; +using SqlSugar; +using System.ComponentModel; +using Myshipping.Core.Entity; +namespace Myshipping.Application.Entity +{ + /// + /// 用户邮箱账号 + /// + [SugarTable("djy_user_mail_account")] + [Description("用户邮箱账号")] + public class DjyUserMailAccount : DBEntityTenant + { + + /// + /// 邮箱账号 + /// + public string MailAccount { get; set; } + /// + /// 发件显示名 + /// + public string ShowName { get; set; } + /// + /// 密码 + /// + public string Password { get; set; } + /// + /// 收件服务器 + /// + public string ReceiveServer { get; set; } + /// + /// 使用IMAP4 + /// + public bool? UseImap { get; set; } + /// + /// 收件端口 + /// + public int? ReceivePort { get; set; } + /// + /// 收件SSL + /// + public bool? ReceiveSSL { get; set; } + /// + /// 发件服务器 + /// + public string SmtpServer { get; set; } + /// + /// 发件端口 + /// + public int? SmtpPort { get; set; } + /// + /// 发件SSL + /// + public bool? SmtpSSL { get; set; } + /// + /// 租户名称 + /// + public string TenantName { get; set; } + } +} \ No newline at end of file diff --git a/Myshipping.Core/Enum/ErrorCode.cs b/Myshipping.Core/Enum/ErrorCode.cs index bed41739..a67e4990 100644 --- a/Myshipping.Core/Enum/ErrorCode.cs +++ b/Myshipping.Core/Enum/ErrorCode.cs @@ -436,4 +436,14 @@ public enum ErrorCode [ErrorCodeItemMetadata("不允许的文件类型")] BOOK114, #endregion + + #region 邮箱账号 + + /// + /// 邮箱账号已存在 + /// + [ErrorCodeItemMetadata("邮箱账号已存在")] + EMAIL001, + + #endregion } diff --git a/Myshipping.Core/Helper/MailSendHelper.cs b/Myshipping.Core/Helper/MailSendHelper.cs new file mode 100644 index 00000000..8b76f119 --- /dev/null +++ b/Myshipping.Core/Helper/MailSendHelper.cs @@ -0,0 +1,92 @@ +using Furion.Logging; +using MailKit.Net.Smtp; +using MailKit.Security; +using MimeKit; +using Myshipping.Application.Entity; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Core.Helper +{ + public static class MailSendHelper + { + /// + /// 使用用户邮箱配置发送邮件 + /// + /// + /// + /// + /// + public static void SendMail(DjyUserMailAccount acc, string subject, string body, string sendTo) + { + SmtpClient client = null; + try + { + var message = new MimeMessage(); + + if (!string.IsNullOrEmpty(acc.ShowName)) + { + message.From.Add(new MailboxAddress(acc.ShowName, acc.MailAccount)); + } + else + { + message.From.Add(MailboxAddress.Parse(acc.MailAccount)); + } + + //分隔符不统一,统一替换成分号 + sendTo = sendTo.Replace(",", ";"); + + if (sendTo.IndexOf(";") > -1) + { + var arrSendTo = sendTo.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + foreach (var s in arrSendTo) + { + var trimStr = s.Trim(); + if (!string.IsNullOrEmpty(trimStr)) + { + message.To.Add(MailboxAddress.Parse(trimStr)); + } + } + } + else + { + message.To.Add(MailboxAddress.Parse(sendTo)); + } + + message.Subject = subject; + var html = new TextPart("html") + { + Text = body + }; + + MimeEntity entity = html; + + message.Sender = MailboxAddress.Parse(acc.MailAccount); + message.Body = entity; + + + using (client = new SmtpClient()) + { + Log.Information($"准备发送邮件{subject} 从【{acc.MailAccount}】到【{sendTo}】,{acc.SmtpServer} {acc.SmtpPort} {acc.SmtpSSL}"); + client.Connect(acc.SmtpServer, acc.SmtpPort.Value, acc.SmtpSSL.HasValue && acc.SmtpSSL.Value ? SecureSocketOptions.SslOnConnect : SecureSocketOptions.None); + client.Authenticate(acc.MailAccount, acc.Password); + client.Send(message); + + client.Disconnect(true); + } + + Log.Information($"mail send success:{subject}"); + } + catch (Exception ex) + { + Log.Error($"mail send fail:{subject} 从【{acc.MailAccount}】到【{sendTo}】,{acc.SmtpServer} {acc.SmtpPort} {acc.SmtpSSL}"); + Log.Error(ex.Message); + Log.Error(ex.StackTrace); + } + } + } +} diff --git a/Myshipping.Core/Myshipping.Core.csproj b/Myshipping.Core/Myshipping.Core.csproj index 489779c5..6832ded9 100644 --- a/Myshipping.Core/Myshipping.Core.csproj +++ b/Myshipping.Core/Myshipping.Core.csproj @@ -49,6 +49,7 @@ + diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index c3185754..69e38642 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1484,7 +1484,7 @@ 客户Id - + 角色ID @@ -3810,6 +3810,11 @@ 不允许的文件类型 + + + 邮箱账号已存在 + + 文件扩展枚举 @@ -4664,6 +4669,15 @@ + + + 使用用户邮箱配置发送邮件 + + + + + + 聊天集线器 @@ -7085,7 +7099,7 @@ 客户Id - + 角色ID @@ -7140,7 +7154,7 @@ 客户Id - + 角色ID @@ -7275,7 +7289,7 @@ 主键 - + 客户Id @@ -8224,6 +8238,241 @@ 配置数据json + + + 用户邮箱账号服务 + + + + + 分页查询用户邮箱账号 + + + + + + + 增加用户邮箱账号 + + + + + + + 更新用户邮箱账号 + + + + + + + 删除用户邮箱账号 + + + + + + + 获取用户邮箱账号 + + + + + + + 用户邮箱账号输入参数 + + + + + 邮箱账号 + + + + + 发件显示名 + + + + + 密码 + + + + + 收件服务器 + + + + + 使用IMAP4 + + + + + 收件端口 + + + + + 收件SSL + + + + + 发件服务器 + + + + + 发件端口 + + + + + 发件SSL + + + + + 用户邮箱账号新增输入参数 + + + + + 用户邮箱账号修改输入参数 + + + + + 主键Id + + + + + 用户邮箱账号获取(删除)输入参数 + + + + + 主键Id + + + + + 用户邮箱账号查询输入参数 + + + + + 主键Id + + + + + 邮箱账号 + + + + + 密码 + + + + + 收件服务器 + + + + + 使用IMAP4 + + + + + 收件端口 + + + + + 收件SSL + + + + + 发件服务器 + + + + + 发件端口 + + + + + 发件SSL + + + + + 用户邮箱账号输出参数 + + + + + 主键Id + + + + + 邮箱账号 + + + + + 发件显示名 + + + + + 密码 + + + + + 收件服务器 + + + + + 使用IMAP4 + + + + + 收件端口 + + + + + 收件SSL + + + + + 发件服务器 + + + + + 发件端口 + + + + + 发件SSL + + 网站账号维护服务 @@ -14180,5 +14429,65 @@ + + + 用户邮箱账号 + + + + + 邮箱账号 + + + + + 发件显示名 + + + + + 密码 + + + + + 收件服务器 + + + + + 使用IMAP4 + + + + + 收件端口 + + + + + 收件SSL + + + + + 发件服务器 + + + + + 发件端口 + + + + + 发件SSL + + + + + 租户名称 + + diff --git a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactDto.cs b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactDto.cs index 42d466d5..05785814 100644 --- a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactDto.cs +++ b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactDto.cs @@ -17,12 +17,12 @@ namespace Myshipping.Core.Service /// 客户Id /// public long? CustomerId { get; set; } - + /// /// 角色ID /// - public long? RoleId { get; set; } - + public string RoleCode { get; set; } + /// /// 角色名称 /// diff --git a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactInput.cs b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactInput.cs index 7cbfaeb6..20900089 100644 --- a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactInput.cs +++ b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactInput.cs @@ -13,12 +13,12 @@ namespace Myshipping.Core.Service /// 客户Id /// public virtual long CustomerId { get; set; } - + /// /// 角色ID /// - public virtual long RoleId { get; set; } - + public string RoleCode { get; set; } + /// /// 角色名称 /// diff --git a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactOutput.cs b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactOutput.cs index 11401e8f..fcf641c3 100644 --- a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactOutput.cs +++ b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerContactOutput.cs @@ -11,12 +11,12 @@ namespace Myshipping.Core.Service /// 主键 /// public long Id { get; set; } - + /// /// 客户Id /// - public long CustomerId { get; set; } - + public string RoleCode { get; set; } + /// /// 角色ID /// diff --git a/Myshipping.Core/Service/DjyUserMailAccount/DjyUserMailAccountService.cs b/Myshipping.Core/Service/DjyUserMailAccount/DjyUserMailAccountService.cs new file mode 100644 index 00000000..0125b59f --- /dev/null +++ b/Myshipping.Core/Service/DjyUserMailAccount/DjyUserMailAccountService.cs @@ -0,0 +1,108 @@ +using Myshipping.Core; +using Furion.DependencyInjection; +using Furion.DynamicApiController; +using Mapster; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using System.Linq; +using System.Threading.Tasks; +using Myshipping.Application.Entity; +using Microsoft.Extensions.Logging; +using Furion.FriendlyException; + +namespace Myshipping.Core.Service +{ + /// + /// 用户邮箱账号服务 + /// + [ApiDescriptionSettings(Name = "DjyUserMailAccount", Order = 1)] + public class DjyUserMailAccountService : IDjyUserMailAccountService, IDynamicApiController, ITransient + { + private readonly SqlSugarRepository _rep; + private readonly ILogger _logger; + + public DjyUserMailAccountService(SqlSugarRepository rep, ILogger logger) + { + _rep = rep; + _logger = logger; + } + + /// + /// 分页查询用户邮箱账号 + /// + /// + /// + [HttpGet("/DjyUserMailAccount/page")] + public async Task Page([FromQuery] QueryDjyUserMailAccountInput input) + { + var entities = await _rep.AsQueryable() + .WhereIF(!string.IsNullOrWhiteSpace(input.MailAccount), u => u.MailAccount.Contains(input.MailAccount.Trim())) + .ToPagedListAsync(input.PageNo, input.PageSize); + return entities.XnPagedResult(); + } + + /// + /// 增加用户邮箱账号 + /// + /// + /// + [HttpPost("/DjyUserMailAccount/add")] + public async Task Add(AddDjyUserMailAccountInput input) + { + var cc = _rep.AsQueryable().Filter(null, true).Count(x => x.MailAccount == input.MailAccount); + if (cc > 0) + { + throw Oops.Oh(ErrorCode.EMAIL001); + } + + var entity = input.Adapt(); + await _rep.InsertAsync(entity); + } + + /// + /// 更新用户邮箱账号 + /// + /// + /// + [HttpPost("/DjyUserMailAccount/edit")] + public async Task Update(UpdateDjyUserMailAccountInput input) + { + var entity = input.Adapt(); + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + + /// + /// 删除用户邮箱账号 + /// + /// + /// + [HttpPost("/DjyUserMailAccount/delete")] + public async Task Delete(GetDjyUserMailAccountInput input) + { + var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id); + await _rep.DeleteAsync(entity); + } + + /// + /// 获取用户邮箱账号 + /// + /// + /// + [HttpGet("/DjyUserMailAccount/detail")] + public async Task Get([FromQuery] GetDjyUserMailAccountInput input) + { + return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id); + } + + ///// + ///// 获取用户邮箱账号列表 + ///// + ///// + ///// + //[HttpGet("/DjyUserMailAccount/list")] + //public async Task List([FromQuery] QueryDjyUserMailAccountInput input) + //{ + // return await _rep.ToListAsync(); + //} + } +} diff --git a/Myshipping.Core/Service/DjyUserMailAccount/Dto/DjyUserMailAccountInput.cs b/Myshipping.Core/Service/DjyUserMailAccount/Dto/DjyUserMailAccountInput.cs new file mode 100644 index 00000000..59930dcc --- /dev/null +++ b/Myshipping.Core/Service/DjyUserMailAccount/Dto/DjyUserMailAccountInput.cs @@ -0,0 +1,153 @@ +using Myshipping.Core; +using System; +using System.ComponentModel.DataAnnotations; + +namespace Myshipping.Core.Service +{ + /// + /// 用户邮箱账号输入参数 + /// + public class DjyUserMailAccountInput + { + /// + /// 邮箱账号 + /// + public virtual string MailAccount { get; set; } + + /// + /// 发件显示名 + /// + public string ShowName { get; set; } + + /// + /// 密码 + /// + public virtual string Password { get; set; } + + /// + /// 收件服务器 + /// + public virtual string ReceiveServer { get; set; } + + /// + /// 使用IMAP4 + /// + public virtual bool UseImap { get; set; } + + /// + /// 收件端口 + /// + public virtual int ReceivePort { get; set; } + + /// + /// 收件SSL + /// + public virtual bool ReceiveSSL { get; set; } + + /// + /// 发件服务器 + /// + public virtual string SmtpServer { get; set; } + + /// + /// 发件端口 + /// + public virtual int SmtpPort { get; set; } + + /// + /// 发件SSL + /// + public virtual bool SmtpSSL { get; set; } + + } + + /// + /// 用户邮箱账号新增输入参数 + /// + public class AddDjyUserMailAccountInput : DjyUserMailAccountInput + { + } + + /// + /// 用户邮箱账号修改输入参数 + /// + public class UpdateDjyUserMailAccountInput : DjyUserMailAccountInput + { + /// + /// 主键Id + /// + [Required(ErrorMessage = "主键Id不能为空")] + public long Id { get; set; } + + } + + /// + /// 用户邮箱账号获取(删除)输入参数 + /// + public class GetDjyUserMailAccountInput + { + /// + /// 主键Id + /// + [Required(ErrorMessage = "主键Id不能为空")] + public long Id { get; set; } + + } + + /// + /// 用户邮箱账号查询输入参数 + /// + public class QueryDjyUserMailAccountInput : PageInputBase + { + /// + /// 主键Id + /// + public virtual long Id { get; set; } + + /// + /// 邮箱账号 + /// + public virtual string MailAccount { get; set; } + + /// + /// 密码 + /// + public virtual string Password { get; set; } + + /// + /// 收件服务器 + /// + public virtual string ReceiveServer { get; set; } + + /// + /// 使用IMAP4 + /// + public virtual bool UseImap { get; set; } + + /// + /// 收件端口 + /// + public virtual int ReceivePort { get; set; } + + /// + /// 收件SSL + /// + public virtual bool ReceiveSSL { get; set; } + + /// + /// 发件服务器 + /// + public virtual string SmtpServer { get; set; } + + /// + /// 发件端口 + /// + public virtual int SmtpPort { get; set; } + + /// + /// 发件SSL + /// + public virtual bool SmtpSSL { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyUserMailAccount/Dto/DjyUserMailAccountOutput.cs b/Myshipping.Core/Service/DjyUserMailAccount/Dto/DjyUserMailAccountOutput.cs new file mode 100644 index 00000000..f24c0b71 --- /dev/null +++ b/Myshipping.Core/Service/DjyUserMailAccount/Dto/DjyUserMailAccountOutput.cs @@ -0,0 +1,66 @@ +using System; + +namespace Myshipping.Core.Service +{ + /// + /// 用户邮箱账号输出参数 + /// + public class DjyUserMailAccountOutput + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 邮箱账号 + /// + public string MailAccount { get; set; } + + /// + /// 发件显示名 + /// + public string ShowName { get; set; } + + /// + /// 密码 + /// + public string Password { get; set; } + + /// + /// 收件服务器 + /// + public string ReceiveServer { get; set; } + + /// + /// 使用IMAP4 + /// + public bool UseImap { get; set; } + + /// + /// 收件端口 + /// + public int ReceivePort { get; set; } + + /// + /// 收件SSL + /// + public bool ReceiveSSL { get; set; } + + /// + /// 发件服务器 + /// + public string SmtpServer { get; set; } + + /// + /// 发件端口 + /// + public int SmtpPort { get; set; } + + /// + /// 发件SSL + /// + public bool SmtpSSL { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyUserMailAccount/IDjyUserMailAccountService.cs b/Myshipping.Core/Service/DjyUserMailAccount/IDjyUserMailAccountService.cs new file mode 100644 index 00000000..5afb278c --- /dev/null +++ b/Myshipping.Core/Service/DjyUserMailAccount/IDjyUserMailAccountService.cs @@ -0,0 +1,16 @@ +using Myshipping.Core; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Myshipping.Application.Entity; +namespace Myshipping.Core.Service +{ + public interface IDjyUserMailAccountService + { + Task Page([FromQuery] QueryDjyUserMailAccountInput input); + Task Add(AddDjyUserMailAccountInput input); + Task Update(UpdateDjyUserMailAccountInput input); + Task Delete(GetDjyUserMailAccountInput input); + Task Get([FromQuery] GetDjyUserMailAccountInput input); + //Task List([FromQuery] QueryDjyUserMailAccountInput input); + } +} \ No newline at end of file diff --git a/Myshipping.Web.Core/applicationconfig.json b/Myshipping.Web.Core/applicationconfig.json index bfff3fca..b7d6946a 100644 --- a/Myshipping.Web.Core/applicationconfig.json +++ b/Myshipping.Web.Core/applicationconfig.json @@ -54,8 +54,8 @@ "DES": "072B13C9" }, "Cache": { - "CacheType": "MemoryCache", // RedisCache - "RedisConnectionString": "127.0.0.1:6379,password=,defaultDatabase=2" + "CacheType": "RedisCache", // RedisCache + "RedisConnectionString": "192.168.0.80:6379,password=,defaultDatabase=11" }, "SnowId": { "WorkerId": "1" // 取值范围0~63,默认1 @@ -104,10 +104,10 @@ "path": "Upload/Default", "maxSize": 41943040, "contentType": [ "image/jpg", "image/png", "image/jpeg", "image/gif", "image/bmp", "text/plain", "application/pdf", "application/msword", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.presentationml.presentation" ] - }, - "RulesEngineUrl": "http://192.168.0.181:8088/api/RulesEngineManage/ExcuteWorkFlow", - "RulesEngineAuthKey": "clova3dXNnBldkM4bzVyUkxNcjVIS0lhUTNja2xmRVI4SDZDMkIzRURBMitKamJPb0tIRkMxemF5VlZOQ0wxUDdNeGNuTzF1NnEyOS9FS1VpeDBDZWFya0VucFR4ZE1Ca1JaUXZVb3lhdGs9", - "RulesEngineSender": "NewOceanBooking", - "RulesEngineProjects": "OCEAN_BOOKING" - } + } + }, + "RulesEngineUrl": "http://192.168.0.181:8088/api/RulesEngineManage/ExcuteWorkFlow", + "RulesEngineAuthKey": "clova3dXNnBldkM4bzVyUkxNcjVIS0lhUTNja2xmRVI4SDZDMkIzRURBMitKamJPb0tIRkMxemF5VlZOQ0wxUDdNeGNuTzF1NnEyOS9FS1VpeDBDZWFya0VucFR4ZE1Ca1JaUXZVb3lhdGs9", + "RulesEngineSender": "NewOceanBooking", + "RulesEngineProjects": "OCEAN_BOOKING" } \ No newline at end of file