booking_auth_dev
wet 2 years ago
commit 827bba193e

@ -6,6 +6,7 @@ using Myshipping.Application.ConfigOption;
using Myshipping.Application.Entity; using Myshipping.Application.Entity;
using Myshipping.Core; using Myshipping.Core;
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using Myshipping.Core.Helper;
using Myshipping.Core.Service; using Myshipping.Core.Service;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SqlSugar; using SqlSugar;
@ -28,9 +29,11 @@ namespace Myshipping.Application.EDI
public static bool Send( public static bool Send(
long bookingId, string filerole, out string msg) long bookingId, string filerole, out string msg)
{ {
var repUser = App.GetService<SqlSugarRepository<SysUser>>();
var repOrder = App.GetService<SqlSugarRepository<BookingOrder>>(); var repOrder = App.GetService<SqlSugarRepository<BookingOrder>>();
var repCtn = App.GetService<SqlSugarRepository<BookingCtn>>(); var repCtn = App.GetService<SqlSugarRepository<BookingCtn>>();
var repBookingFile = App.GetService<SqlSugarRepository<BookingFile>>(); var repBookingFile = App.GetService<SqlSugarRepository<BookingFile>>();
var repUserMail = App.GetService<SqlSugarRepository<DjyUserMailAccount>>();
var cacheService = App.GetService<ISysCacheService>(); var cacheService = App.GetService<ISysCacheService>();
@ -106,7 +109,7 @@ namespace Myshipping.Application.EDI
{ {
Directory.CreateDirectory(ediPathAbs); Directory.CreateDirectory(ediPathAbs);
} }
var ediSettints = cacheService.GetAllEdiSetting().Result;
//港联捷所有用户使用一个ftp用户名和密码发送报文使用文件名中的下货纸代号进行区分 //港联捷所有用户使用一个ftp用户名和密码发送报文使用文件名中的下货纸代号进行区分
var paraServer = cacheService.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "booking_ftp_setting_glj" && x.Code == "ftp_server"); 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"); 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 = "场站联系人邮箱不能为空"; msg = "场站联系人邮箱不能为空";
return false; return false;
} }
// MailDataContext mailData = new MailDataContext();
// var userMail = mailData.UserAccounts.AsNoTracking().FirstOrDefault(ua => ua.UserId == order.USERID); var userMail = repUserMail.FirstOrDefault(x=>x.CreatedUserId == order.CreatedUserId);
// if (userMail == null if (userMail == null
// || string.IsNullOrEmpty(userMail.SmtpServer) || string.IsNullOrEmpty(userMail.SmtpServer)
// || userMail.SmtpPort == 0) || userMail.SmtpPort == 0)
// { {
// msg = "发件邮箱未配置"; msg = "发件邮箱未配置";
// return false; return false;
// } }
// var userbase = sugerClient.Queryable<SysUser>().First(u => u.Id == order.CreatedUserId); var userbase = repUser.FirstOrDefault(u => u.Id == order.CreatedUserId);
// var title = $"下货纸:{order.MBLNO}/{order.CARRIER}/{order.VESSEL}/{order.VOYNO}/{order.TenantName}"; var title = $"下货纸:{order.MBLNO}/{order.CARRIER}/{order.VESSEL}/{order.VOYNO}/{order.TenantName}";
// var bodyExt = string.Empty; var bodyExt = string.Empty;
// if (order.CARGOID == "R") if (order.CARGOID == "R")
// { {
// bodyExt = $@"温度:{order.TEMPSET}{order.TEMPID}<br/> bodyExt = $@"温度:{order.TEMPSET}{order.TEMPID}<br/>
//通风:{order.REEFERF}<br/> {order.REEFERF}<br/>
//湿度:{order.HUMIDITY}<br/>"; 湿{order.HUMIDITY}<br/>";
// } }
// else if (order.CARGOID == "D") else if (order.CARGOID == "D")
// { {
// bodyExt = $@"危险品等级:{order.DCLASS}<br/> bodyExt = $@"危险品等级:{order.DCLASS}<br/>
//危险品编号:{order.DUNNO}<br/> {order.DUNNO}<br/>
//危险品联系方式:{order.LINKMAN}<br/>"; {order.LINKMAN}<br/>";
// } }
// var body = $@"提单号:{order.MBLNO}<br/> var body = $@"提单号:{order.MBLNO}<br/>
//船名航次:{order.VESSEL}/{order.VOYNO}<br/> {order.VESSEL}/{order.VOYNO}<br/>
//起运港:{order.PORTLOAD},{order.PORTLOADID}<br/> {order.PORTLOAD},{order.PORTLOADID}<br/>
//目的港:{order.PORTDISCHARGE},{order.PORTDISCHARGEID}<br/> {order.PORTDISCHARGE},{order.PORTDISCHARGEID}<br/>
//目的地:{order.DESTINATION},{order.DESTINATIONID}<br/> {order.DESTINATION},{order.DESTINATIONID}<br/>
//预计船期:{(order.ETD.HasValue ? order.ETD.Value.ToString("yyyy-MM-dd") : "")}<br/> {(order.ETD.HasValue ? order.ETD.Value.ToString("yyyy-MM-dd") : "")}<br/>
//箱型箱量:{order.CNTRTOTAL}<br/> {order.CNTRTOTAL}<br/>
//件重尺:{order.PKGS} {order.KINDPKGS}/{order.KGS}KGS/{order.CBM}CBM<br/> {order.PKGS} {order.KINDPKGS}/{order.KGS}KGS/{order.CBM}CBM<br/>
//货物描述:{order.DESCRIPTION}<br/> {order.DESCRIPTION}<br/>
//{bodyExt} {bodyExt}
//备注:{order.YARDREMARK}<br/> {order.YARDREMARK}<br/>
//<br/> <br/>
//订舱代理:{order.TenantName}<br/> {order.TenantName}<br/>
//联系人:{order.CreatedUserName}<br/> {order.CreatedUserName}<br/>
//电话:{userbase.Tel} 手机:{userbase.Phone}<br/> {userbase.Tel} {userbase.Phone}<br/>
//邮箱:{userbase.Email}<br/> {userbase.Email}<br/>
//"; ";
// MailHelper.SendMail(userMail.GID, title, body, order.YardContractEmail, customerSend: true); MailSendHelper.SendMail(userMail, title, body, order.YARDCONTRACTEMAIL);
} }
msg = "已发送"; msg = "已发送";
return true; return true;

@ -3936,7 +3936,7 @@
收货人代码 收货人代码
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.NotifyPrtId"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.NotifyPartyId">
<summary> <summary>
通知人代码 通知人代码
</summary> </summary>
@ -3951,7 +3951,7 @@
收货人 收货人
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.NotifyPrt"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.NotifyParty">
<summary> <summary>
通知人 通知人
</summary> </summary>
@ -4318,52 +4318,52 @@
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeName"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeName">
<summary> <summary>
货人名称 货人名称
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAddr1"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAddr1">
<summary> <summary>
货人地址1 货人地址1
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAddr2"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAddr2">
<summary> <summary>
货人地址2 货人地址2
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAddr3"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAddr3">
<summary> <summary>
货人地址3 货人地址3
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeCity"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeCity">
<summary> <summary>
货人城市 货人城市
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeProvince"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeProvince">
<summary> <summary>
货人省份代码 货人省份代码
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneePostCode"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneePostCode">
<summary> <summary>
货人邮编 货人邮编
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeCountry"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeCountry">
<summary> <summary>
货人国家代码 货人国家代码
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAttn"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeAttn">
<summary> <summary>
货人联系人 货人联系人
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeTel"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.ConsigneeTel">
<summary> <summary>
货人电话 货人电话
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.NotifyPartyName"> <member name="P:Myshipping.Application.RulesEngineOrderBookingMainBusinessInfo.NotifyPartyName">

@ -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<RespCommon>(); 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<RespCommon>();
_logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString()); _logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString());
} }
[HttpGet("/BookingPrintTemplate/test")]
public async Task<string> Test(long id)
{
var rtn = XiahuozhiHelpler.Send(id, "9", out string msg);
return $"{rtn} {msg}";
}
} }
} }

@ -62,7 +62,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 通知人代码 /// 通知人代码
/// </summary> /// </summary>
public string NotifyPrtId { get; set; } public string NotifyPartyId { get; set; }
/// <summary> /// <summary>
/// 发货人 /// 发货人
/// </summary> /// </summary>
@ -74,7 +74,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 通知人 /// 通知人
/// </summary> /// </summary>
public string NotifyPrt { get; set; } public string NotifyParty { get; set; }
/// <summary> /// <summary>
/// 第二通知人 /// 第二通知人
/// </summary> /// </summary>
@ -365,43 +365,43 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string ShipperTel { get; set; } public string ShipperTel { get; set; }
/// <summary> /// <summary>
/// 货人名称 /// 货人名称
/// </summary> /// </summary>
public string ConsigneeName { get; set; } public string ConsigneeName { get; set; }
/// <summary> /// <summary>
/// 货人地址1 /// 货人地址1
/// </summary> /// </summary>
public string ConsigneeAddr1 { get; set; } public string ConsigneeAddr1 { get; set; }
/// <summary> /// <summary>
/// 货人地址2 /// 货人地址2
/// </summary> /// </summary>
public string ConsigneeAddr2 { get; set; } public string ConsigneeAddr2 { get; set; }
/// <summary> /// <summary>
/// 货人地址3 /// 货人地址3
/// </summary> /// </summary>
public string ConsigneeAddr3 { get; set; } public string ConsigneeAddr3 { get; set; }
/// <summary> /// <summary>
/// 货人城市 /// 货人城市
/// </summary> /// </summary>
public string ConsigneeCity { get; set; } public string ConsigneeCity { get; set; }
/// <summary> /// <summary>
/// 货人省份代码 /// 货人省份代码
/// </summary> /// </summary>
public string ConsigneeProvince { get; set; } public string ConsigneeProvince { get; set; }
/// <summary> /// <summary>
/// 货人邮编 /// 货人邮编
/// </summary> /// </summary>
public string ConsigneePostCode { get; set; } public string ConsigneePostCode { get; set; }
/// <summary> /// <summary>
/// 货人国家代码 /// 货人国家代码
/// </summary> /// </summary>
public string ConsigneeCountry { get; set; } public string ConsigneeCountry { get; set; }
/// <summary> /// <summary>
/// 货人联系人 /// 货人联系人
/// </summary> /// </summary>
public string ConsigneeAttn { get; set; } public string ConsigneeAttn { get; set; }
/// <summary> /// <summary>
/// 货人电话 /// 货人电话
/// </summary> /// </summary>
public string ConsigneeTel { get; set; } public string ConsigneeTel { get; set; }
/// <summary> /// <summary>

@ -18,7 +18,7 @@ namespace Myshipping.Core.Entity
/// <summary> /// <summary>
/// 角色ID /// 角色ID
/// </summary> /// </summary>
public long? RoleId { get; set; } public string RoleCode { get; set; }
/// <summary> /// <summary>
/// 角色名称 /// 角色名称
/// </summary> /// </summary>

@ -0,0 +1,60 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 用户邮箱账号
/// </summary>
[SugarTable("djy_user_mail_account")]
[Description("用户邮箱账号")]
public class DjyUserMailAccount : DBEntityTenant
{
/// <summary>
/// 邮箱账号
/// </summary>
public string MailAccount { get; set; }
/// <summary>
/// 发件显示名
/// </summary>
public string ShowName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 收件服务器
/// </summary>
public string ReceiveServer { get; set; }
/// <summary>
/// 使用IMAP4
/// </summary>
public bool? UseImap { get; set; }
/// <summary>
/// 收件端口
/// </summary>
public int? ReceivePort { get; set; }
/// <summary>
/// 收件SSL
/// </summary>
public bool? ReceiveSSL { get; set; }
/// <summary>
/// 发件服务器
/// </summary>
public string SmtpServer { get; set; }
/// <summary>
/// 发件端口
/// </summary>
public int? SmtpPort { get; set; }
/// <summary>
/// 发件SSL
/// </summary>
public bool? SmtpSSL { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantName { get; set; }
}
}

@ -436,4 +436,14 @@ public enum ErrorCode
[ErrorCodeItemMetadata("不允许的文件类型")] [ErrorCodeItemMetadata("不允许的文件类型")]
BOOK114, BOOK114,
#endregion #endregion
#region 邮箱账号
/// <summary>
/// 邮箱账号已存在
/// </summary>
[ErrorCodeItemMetadata("邮箱账号已存在")]
EMAIL001,
#endregion
} }

@ -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
{
/// <summary>
/// 使用用户邮箱配置发送邮件
/// </summary>
/// <param name="acc"></param>
/// <param name="subject"></param>
/// <param name="body"></param>
/// <param name="sendTo"></param>
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);
}
}
}
}

@ -49,6 +49,7 @@
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.3.9" /> <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.3.9" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.3.9" /> <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.3.9" />
<PackageReference Include="Furion.Pure" Version="4.3.9" /> <PackageReference Include="Furion.Pure" Version="4.3.9" />
<PackageReference Include="MailKit" Version="3.4.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.8" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.8" />
<PackageReference Include="MiniExcel" Version="1.26.5" /> <PackageReference Include="MiniExcel" Version="1.26.5" />
<PackageReference Include="SqlSugarCore" Version="5.1.2.6" /> <PackageReference Include="SqlSugarCore" Version="5.1.2.6" />

@ -1484,7 +1484,7 @@
客户Id 客户Id
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Entity.DjyCustomerContact.RoleId"> <member name="P:Myshipping.Core.Entity.DjyCustomerContact.RoleCode">
<summary> <summary>
角色ID 角色ID
</summary> </summary>
@ -3810,6 +3810,11 @@
不允许的文件类型 不允许的文件类型
</summary> </summary>
</member> </member>
<member name="F:Myshipping.Core.ErrorCode.EMAIL001">
<summary>
邮箱账号已存在
</summary>
</member>
<member name="T:Myshipping.Core.FileExtensionEnum"> <member name="T:Myshipping.Core.FileExtensionEnum">
<summary> <summary>
文件扩展枚举 文件扩展枚举
@ -4664,6 +4669,15 @@
<param name="next"></param> <param name="next"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Core.Helper.MailSendHelper.SendMail(Myshipping.Application.Entity.DjyUserMailAccount,System.String,System.String,System.String)">
<summary>
使用用户邮箱配置发送邮件
</summary>
<param name="acc"></param>
<param name="subject"></param>
<param name="body"></param>
<param name="sendTo"></param>
</member>
<member name="T:Myshipping.Core.ChatHub"> <member name="T:Myshipping.Core.ChatHub">
<summary> <summary>
聊天集线器 聊天集线器
@ -7085,7 +7099,7 @@
客户Id 客户Id
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.DjyCustomerContactDto.RoleId"> <member name="P:Myshipping.Core.Service.DjyCustomerContactDto.RoleCode">
<summary> <summary>
角色ID 角色ID
</summary> </summary>
@ -7140,7 +7154,7 @@
客户Id 客户Id
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.DjyCustomerContactInput.RoleId"> <member name="P:Myshipping.Core.Service.DjyCustomerContactInput.RoleCode">
<summary> <summary>
角色ID 角色ID
</summary> </summary>
@ -7275,7 +7289,7 @@
主键 主键
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Core.Service.DjyCustomerContactOutput.CustomerId"> <member name="P:Myshipping.Core.Service.DjyCustomerContactOutput.RoleCode">
<summary> <summary>
客户Id 客户Id
</summary> </summary>
@ -8224,6 +8238,241 @@
配置数据json 配置数据json
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Core.Service.DjyUserMailAccountService">
<summary>
用户邮箱账号服务
</summary>
</member>
<member name="M:Myshipping.Core.Service.DjyUserMailAccountService.Page(Myshipping.Core.Service.QueryDjyUserMailAccountInput)">
<summary>
分页查询用户邮箱账号
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyUserMailAccountService.Add(Myshipping.Core.Service.AddDjyUserMailAccountInput)">
<summary>
增加用户邮箱账号
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyUserMailAccountService.Update(Myshipping.Core.Service.UpdateDjyUserMailAccountInput)">
<summary>
更新用户邮箱账号
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyUserMailAccountService.Delete(Myshipping.Core.Service.GetDjyUserMailAccountInput)">
<summary>
删除用户邮箱账号
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyUserMailAccountService.Get(Myshipping.Core.Service.GetDjyUserMailAccountInput)">
<summary>
获取用户邮箱账号
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.DjyUserMailAccountInput">
<summary>
用户邮箱账号输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.MailAccount">
<summary>
邮箱账号
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.ShowName">
<summary>
发件显示名
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.Password">
<summary>
密码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.ReceiveServer">
<summary>
收件服务器
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.UseImap">
<summary>
使用IMAP4
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.ReceivePort">
<summary>
收件端口
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.ReceiveSSL">
<summary>
收件SSL
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.SmtpServer">
<summary>
发件服务器
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.SmtpPort">
<summary>
发件端口
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountInput.SmtpSSL">
<summary>
发件SSL
</summary>
</member>
<member name="T:Myshipping.Core.Service.AddDjyUserMailAccountInput">
<summary>
用户邮箱账号新增输入参数
</summary>
</member>
<member name="T:Myshipping.Core.Service.UpdateDjyUserMailAccountInput">
<summary>
用户邮箱账号修改输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.UpdateDjyUserMailAccountInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Service.GetDjyUserMailAccountInput">
<summary>
用户邮箱账号获取(删除)输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.GetDjyUserMailAccountInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Service.QueryDjyUserMailAccountInput">
<summary>
用户邮箱账号查询输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.MailAccount">
<summary>
邮箱账号
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.Password">
<summary>
密码
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.ReceiveServer">
<summary>
收件服务器
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.UseImap">
<summary>
使用IMAP4
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.ReceivePort">
<summary>
收件端口
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.ReceiveSSL">
<summary>
收件SSL
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.SmtpServer">
<summary>
发件服务器
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.SmtpPort">
<summary>
发件端口
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyUserMailAccountInput.SmtpSSL">
<summary>
发件SSL
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyUserMailAccountOutput">
<summary>
用户邮箱账号输出参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.MailAccount">
<summary>
邮箱账号
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.ShowName">
<summary>
发件显示名
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.Password">
<summary>
密码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.ReceiveServer">
<summary>
收件服务器
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.UseImap">
<summary>
使用IMAP4
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.ReceivePort">
<summary>
收件端口
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.ReceiveSSL">
<summary>
收件SSL
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.SmtpServer">
<summary>
发件服务器
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.SmtpPort">
<summary>
发件端口
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyUserMailAccountOutput.SmtpSSL">
<summary>
发件SSL
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyWebsiteAccountConfigService"> <member name="T:Myshipping.Core.Service.DjyWebsiteAccountConfigService">
<summary> <summary>
网站账号维护服务 网站账号维护服务
@ -14180,5 +14429,65 @@
<param name="node"></param> <param name="node"></param>
<param name="childNodeLists"></param> <param name="childNodeLists"></param>
</member> </member>
<member name="T:Myshipping.Application.Entity.DjyUserMailAccount">
<summary>
用户邮箱账号
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.MailAccount">
<summary>
邮箱账号
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.ShowName">
<summary>
发件显示名
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.Password">
<summary>
密码
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.ReceiveServer">
<summary>
收件服务器
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.UseImap">
<summary>
使用IMAP4
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.ReceivePort">
<summary>
收件端口
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.ReceiveSSL">
<summary>
收件SSL
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.SmtpServer">
<summary>
发件服务器
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.SmtpPort">
<summary>
发件端口
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.SmtpSSL">
<summary>
发件SSL
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyUserMailAccount.TenantName">
<summary>
租户名称
</summary>
</member>
</members> </members>
</doc> </doc>

@ -21,7 +21,7 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 角色ID /// 角色ID
/// </summary> /// </summary>
public long? RoleId { get; set; } public string RoleCode { get; set; }
/// <summary> /// <summary>
/// 角色名称 /// 角色名称

@ -17,7 +17,7 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 角色ID /// 角色ID
/// </summary> /// </summary>
public virtual long RoleId { get; set; } public string RoleCode { get; set; }
/// <summary> /// <summary>
/// 角色名称 /// 角色名称

@ -15,7 +15,7 @@ namespace Myshipping.Core.Service
/// <summary> /// <summary>
/// 客户Id /// 客户Id
/// </summary> /// </summary>
public long CustomerId { get; set; } public string RoleCode { get; set; }
/// <summary> /// <summary>
/// 角色ID /// 角色ID

@ -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
{
/// <summary>
/// 用户邮箱账号服务
/// </summary>
[ApiDescriptionSettings(Name = "DjyUserMailAccount", Order = 1)]
public class DjyUserMailAccountService : IDjyUserMailAccountService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<DjyUserMailAccount> _rep;
private readonly ILogger<DjyUserMailAccount> _logger;
public DjyUserMailAccountService(SqlSugarRepository<DjyUserMailAccount> rep, ILogger<DjyUserMailAccount> logger)
{
_rep = rep;
_logger = logger;
}
/// <summary>
/// 分页查询用户邮箱账号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/DjyUserMailAccount/page")]
public async Task<dynamic> 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();
}
/// <summary>
/// 增加用户邮箱账号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[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<DjyUserMailAccount>();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 更新用户邮箱账号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyUserMailAccount/edit")]
public async Task Update(UpdateDjyUserMailAccountInput input)
{
var entity = input.Adapt<DjyUserMailAccount>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 删除用户邮箱账号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyUserMailAccount/delete")]
public async Task Delete(GetDjyUserMailAccountInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
await _rep.DeleteAsync(entity);
}
/// <summary>
/// 获取用户邮箱账号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/DjyUserMailAccount/detail")]
public async Task<DjyUserMailAccount> Get([FromQuery] GetDjyUserMailAccountInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
///// <summary>
///// 获取用户邮箱账号列表
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpGet("/DjyUserMailAccount/list")]
//public async Task<dynamic> List([FromQuery] QueryDjyUserMailAccountInput input)
//{
// return await _rep.ToListAsync();
//}
}
}

@ -0,0 +1,153 @@
using Myshipping.Core;
using System;
using System.ComponentModel.DataAnnotations;
namespace Myshipping.Core.Service
{
/// <summary>
/// 用户邮箱账号输入参数
/// </summary>
public class DjyUserMailAccountInput
{
/// <summary>
/// 邮箱账号
/// </summary>
public virtual string MailAccount { get; set; }
/// <summary>
/// 发件显示名
/// </summary>
public string ShowName { get; set; }
/// <summary>
/// 密码
/// </summary>
public virtual string Password { get; set; }
/// <summary>
/// 收件服务器
/// </summary>
public virtual string ReceiveServer { get; set; }
/// <summary>
/// 使用IMAP4
/// </summary>
public virtual bool UseImap { get; set; }
/// <summary>
/// 收件端口
/// </summary>
public virtual int ReceivePort { get; set; }
/// <summary>
/// 收件SSL
/// </summary>
public virtual bool ReceiveSSL { get; set; }
/// <summary>
/// 发件服务器
/// </summary>
public virtual string SmtpServer { get; set; }
/// <summary>
/// 发件端口
/// </summary>
public virtual int SmtpPort { get; set; }
/// <summary>
/// 发件SSL
/// </summary>
public virtual bool SmtpSSL { get; set; }
}
/// <summary>
/// 用户邮箱账号新增输入参数
/// </summary>
public class AddDjyUserMailAccountInput : DjyUserMailAccountInput
{
}
/// <summary>
/// 用户邮箱账号修改输入参数
/// </summary>
public class UpdateDjyUserMailAccountInput : DjyUserMailAccountInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 用户邮箱账号获取(删除)输入参数
/// </summary>
public class GetDjyUserMailAccountInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 用户邮箱账号查询输入参数
/// </summary>
public class QueryDjyUserMailAccountInput : PageInputBase
{
/// <summary>
/// 主键Id
/// </summary>
public virtual long Id { get; set; }
/// <summary>
/// 邮箱账号
/// </summary>
public virtual string MailAccount { get; set; }
/// <summary>
/// 密码
/// </summary>
public virtual string Password { get; set; }
/// <summary>
/// 收件服务器
/// </summary>
public virtual string ReceiveServer { get; set; }
/// <summary>
/// 使用IMAP4
/// </summary>
public virtual bool UseImap { get; set; }
/// <summary>
/// 收件端口
/// </summary>
public virtual int ReceivePort { get; set; }
/// <summary>
/// 收件SSL
/// </summary>
public virtual bool ReceiveSSL { get; set; }
/// <summary>
/// 发件服务器
/// </summary>
public virtual string SmtpServer { get; set; }
/// <summary>
/// 发件端口
/// </summary>
public virtual int SmtpPort { get; set; }
/// <summary>
/// 发件SSL
/// </summary>
public virtual bool SmtpSSL { get; set; }
}
}

@ -0,0 +1,66 @@
using System;
namespace Myshipping.Core.Service
{
/// <summary>
/// 用户邮箱账号输出参数
/// </summary>
public class DjyUserMailAccountOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 邮箱账号
/// </summary>
public string MailAccount { get; set; }
/// <summary>
/// 发件显示名
/// </summary>
public string ShowName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 收件服务器
/// </summary>
public string ReceiveServer { get; set; }
/// <summary>
/// 使用IMAP4
/// </summary>
public bool UseImap { get; set; }
/// <summary>
/// 收件端口
/// </summary>
public int ReceivePort { get; set; }
/// <summary>
/// 收件SSL
/// </summary>
public bool ReceiveSSL { get; set; }
/// <summary>
/// 发件服务器
/// </summary>
public string SmtpServer { get; set; }
/// <summary>
/// 发件端口
/// </summary>
public int SmtpPort { get; set; }
/// <summary>
/// 发件SSL
/// </summary>
public bool SmtpSSL { get; set; }
}
}

@ -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<dynamic> Page([FromQuery] QueryDjyUserMailAccountInput input);
Task Add(AddDjyUserMailAccountInput input);
Task Update(UpdateDjyUserMailAccountInput input);
Task Delete(GetDjyUserMailAccountInput input);
Task<DjyUserMailAccount> Get([FromQuery] GetDjyUserMailAccountInput input);
//Task<dynamic> List([FromQuery] QueryDjyUserMailAccountInput input);
}
}

@ -54,8 +54,8 @@
"DES": "072B13C9" "DES": "072B13C9"
}, },
"Cache": { "Cache": {
"CacheType": "MemoryCache", // RedisCache "CacheType": "RedisCache", // RedisCache
"RedisConnectionString": "127.0.0.1:6379,password=,defaultDatabase=2" "RedisConnectionString": "192.168.0.80:6379,password=,defaultDatabase=11"
}, },
"SnowId": { "SnowId": {
"WorkerId": "1" // 0~63,1 "WorkerId": "1" // 0~63,1
@ -104,10 +104,10 @@
"path": "Upload/Default", "path": "Upload/Default",
"maxSize": 41943040, "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" ] "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", "RulesEngineUrl": "http://192.168.0.181:8088/api/RulesEngineManage/ExcuteWorkFlow",
"RulesEngineSender": "NewOceanBooking", "RulesEngineAuthKey": "clova3dXNnBldkM4bzVyUkxNcjVIS0lhUTNja2xmRVI4SDZDMkIzRURBMitKamJPb0tIRkMxemF5VlZOQ0wxUDdNeGNuTzF1NnEyOS9FS1VpeDBDZWFya0VucFR4ZE1Ca1JaUXZVb3lhdGs9",
"RulesEngineProjects": "OCEAN_BOOKING" "RulesEngineSender": "NewOceanBooking",
} "RulesEngineProjects": "OCEAN_BOOKING"
} }
Loading…
Cancel
Save