|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
using Furion.EventBus;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
@ -16,6 +17,8 @@ using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading.Channels;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Application
|
|
|
|
@ -29,10 +32,10 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<EmaiReceiveRecordInfo> _emaiReceiveRecordeInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<EmaiReceiveRecordDetailInfo> _emaiReceiveRecordDetailInfoRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly ILogger<EmaiReceiveRecordService> _logger;
|
|
|
|
|
|
|
|
|
|
public EmaiReceiveRecordService(ILogger<EmaiReceiveRecordService> logger,
|
|
|
|
|
public EmaiReceiveRecordService(ILogger<EmaiReceiveRecordService> logger,
|
|
|
|
|
SqlSugarRepository<EmaiReceiveRecordInfo> emaiReceiveRecordeInfoRepository,
|
|
|
|
|
SqlSugarRepository<EmaiReceiveRecordDetailInfo> emaiReceiveRecordDetailInfoRepository)
|
|
|
|
|
{
|
|
|
|
@ -66,9 +69,9 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
var showModel = model.Adapt<EmaiReceiveRecordDto>();
|
|
|
|
|
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(model.MAIL_ATTACHMENTS))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(model.MAIL_ATTACHMENTS))
|
|
|
|
|
{
|
|
|
|
|
showModel.AttachmentList = model.MAIL_ATTACHMENTS.Split(new char[] { ';'}).Where(t=>!string.IsNullOrWhiteSpace(t)).Select(t=>t.Trim()).ToList();
|
|
|
|
|
showModel.AttachmentList = model.MAIL_ATTACHMENTS.Split(new char[] { ';' }).Where(t => !string.IsNullOrWhiteSpace(t)).Select(t => t.Trim()).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
@ -196,7 +199,7 @@ namespace Myshipping.Application
|
|
|
|
|
query = query.Where(t => t.UpdatedTime < currDate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(QuerySearch.MailSubject))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(QuerySearch.MailSubject))
|
|
|
|
|
{
|
|
|
|
|
query = query.Where(t => t.MAIL_SUBJECT.Contains(QuerySearch.MailSubject));
|
|
|
|
|
}
|
|
|
|
@ -280,7 +283,7 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
showModel.detailList = detailList.OrderByDescending(a => a.CreatedTime)
|
|
|
|
|
.Select(a => new EmaiReceiveRecordDetailDto
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
GID = a.GID,
|
|
|
|
|
FileName = a.FILE_NAME,
|
|
|
|
|
Status = a.STATUS,
|
|
|
|
@ -329,7 +332,7 @@ namespace Myshipping.Application
|
|
|
|
|
if (model == null)
|
|
|
|
|
throw Oops.Oh($"邮件接收记录获取失败,邮件接收记录不存在或已作废", typeof(InvalidOperationException));
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrWhiteSpace(model.MAIL_FILEPATH))
|
|
|
|
|
if (string.IsNullOrWhiteSpace(model.MAIL_FILEPATH))
|
|
|
|
|
throw Oops.Oh($"邮件文件提取失败,请联系管理员", typeof(InvalidOperationException));
|
|
|
|
|
|
|
|
|
|
//读取邮件,解析邮件正文
|
|
|
|
@ -388,6 +391,8 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.msg = "成功";
|
|
|
|
|
}
|
|
|
|
|