wet 2 years ago
commit 20ad6f02e2

@ -34,6 +34,10 @@ namespace Myshipping.Application
/// <summary>
/// 未指定
/// </summary>
NULL
NULL,
/// <summary>
/// 阿联酋航运
/// </summary>
ESL,
}
}

@ -3019,7 +3019,7 @@ namespace Myshipping.Application
{
strCheck = Regex.Replace(strCheck, "\\<br\\s{1,}/\\>", "\n");
}
throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}");
throw Oops.Bah($"发送{EDIRouteEnum.WY.ToString()}校验失败,{strCheck}");
}
var currRlt = WYEdiHelper.CreateEdiWY(ediModel);
@ -3042,7 +3042,7 @@ namespace Myshipping.Application
strCheck = Regex.Replace(strCheck, "\\<br\\s{1,}/\\>", "\n");
}
throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}");
throw Oops.Bah($"发送{EDIRouteEnum.YML.ToString()}校验失败,{strCheck}");
}
CommonWebApiResult currRlt = new CommonWebApiResult();
@ -3074,13 +3074,46 @@ namespace Myshipping.Application
strCheck = Regex.Replace(strCheck, "\\<br\\s{1,}/\\>", "\n");
}
throw Oops.Bah($"发送{EDIRouteEnum.PIL.ToString()}校验失败,{strCheck}");
throw Oops.Bah($"发送{EDIRouteEnum.YT.ToString()}校验失败,{strCheck}");
}
CommonWebApiResult currRlt = YTEdiHelper.CreateEdiYT(ediModel);
#endregion
result.succ = currRlt.succ;
result.extra = currRlt.succ ? currRlt.extra.ToString() : "";
}
else if (ediRouteEnum == EDIRouteEnum.ESL)
{
#region YT
string strCheck = TSLEdiHelper.IsCreateTSL(ediModel);
_logger.LogInformation($"调用SO(SI),校验:{strCheck},数据对象:{JsonConvert.SerializeObject(ediModel)}");
if (!string.IsNullOrWhiteSpace(strCheck))
{
if (Regex.IsMatch(strCheck, "\\<br\\s{1,}/\\>"))
{
strCheck = Regex.Replace(strCheck, "\\<br\\s{1,}/\\>", "\n");
}
throw Oops.Bah($"发送{EDIRouteEnum.ESL.ToString()}校验失败,{strCheck}");
}
CommonWebApiResult currRlt = new CommonWebApiResult();
if (model.sendType == "B")
{
currRlt = TSLEdiHelper.CreateEdiTSL(ediModel);
}
else if (model.sendType == "E")
{
currRlt = TSLEdiHelper.CreateEdiTSLSI(ediModel);
}
#endregion
result.succ = currRlt.succ;
result.extra = currRlt.succ ? currRlt.extra.ToString() : "";
}

@ -47,10 +47,11 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskStatManageInfo> _taskStatManageInfoRepository;
private readonly SqlSugarRepository<TaskOriginalDownloadHisInfo> _taskOriginalDownloadHisInfoRepository;
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ISysCacheService _cache;
private readonly ILogger<BookingOrderService> _logger;
const string CONST_WEB_ACCOUNT_TYPE = "CmaWeb";
const string CONST_BOOK_ORIGINAL_DOWN_URL_CODE = "bookOriginalDownUrl";
public TaskManageService(SqlSugarRepository<TaskBaseInfo> taskBaseInfoRepository,
SqlSugarRepository<TaskSIFeedBackInfo> taskSIFeedBackInfoRepository,
@ -63,6 +64,7 @@ namespace Myshipping.Application
SqlSugarRepository<TaskStatManageInfo> taskStatManageInfoRepository,
SqlSugarRepository<TaskOriginalDownloadHisInfo> taskOriginalDownloadHisInfoRepository,
IDjyWebsiteAccountConfigService webAccountConfig,
ISysCacheService cache,
ILogger<BookingOrderService> logger)
{
_taskBaseInfoRepository = taskBaseInfoRepository;
@ -76,6 +78,7 @@ namespace Myshipping.Application
_taskStatManageInfoRepository = taskStatManageInfoRepository;
_taskOriginalDownloadHisInfoRepository = taskOriginalDownloadHisInfoRepository;
_webAccountConfig = webAccountConfig;
_cache = cache;
_logger = logger;
}
@ -694,6 +697,12 @@ namespace Myshipping.Application
DateTime startDate = DateTime.Now;
var downloadUrl = _cache.GetAllDictData().GetAwaiter().GetResult()
.First(t => t.Code.Equals(CONST_BOOK_ORIGINAL_DOWN_URL_CODE, StringComparison.OrdinalIgnoreCase))?.Value;
if(string.IsNullOrWhiteSpace(downloadUrl))
throw Oops.Bah($"正本下载URL不存在请确认字典是否配置 code={CONST_BOOK_ORIGINAL_DOWN_URL_CODE}");
TaskOriginalDownloadHisInfo taskOriginalDownloadHisInfo = new TaskOriginalDownloadHisInfo
{
PK_ID = IDGen.NextID().ToString(),
@ -710,6 +719,8 @@ namespace Myshipping.Application
//写入记录
_taskOriginalDownloadHisInfoRepository.Insert(taskOriginalDownloadHisInfo);
//请求远程链接
}
catch (Exception ex)
{

Loading…
Cancel
Save