修改任务台账

optimize
jianghaiqing 2 years ago
parent 0e67062d16
commit 513751f81b

@ -98,6 +98,17 @@ namespace Myshipping.Application
result.succ = true; result.succ = true;
result.msg = "批量下载BC成功"; result.msg = "批量下载BC成功";
var downResultList = taskList.Select(x => x.Result);
if (downResultList.Any(x => !x.succ))
{
result.succ = false;
result.msg = "BC下载失败";
//result.ext =
}
//result.ext = id; //result.ext = id;
} }
catch (Exception ex) catch (Exception ex)
@ -187,10 +198,14 @@ namespace Myshipping.Application
string relativePath = $"{fileCfg.relativePath}\\bcfiles\\{bookingOrder.Id}"; string relativePath = $"{fileCfg.relativePath}\\bcfiles\\{bookingOrder.Id}";
string filePath = $"{(!string.IsNullOrWhiteSpace(fileCfg.basePath) ? fileCfg.basePath : App.WebHostEnvironment.WebRootPath)}\\{relativePath}"; string filePath = $"{(!string.IsNullOrWhiteSpace(fileCfg.basePath) ? fileCfg.basePath : App.WebHostEnvironment.WebRootPath)}\\{relativePath}";
string fileFullName = $"{filePath}\\{new System.IO.FileInfo(currFilePath).Name}";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{ {
relativePath = relativePath.Replace("\\", "/"); relativePath = relativePath.Replace("\\", "/");
filePath = filePath.Replace("\\", "/"); filePath = filePath.Replace("\\", "/");
fileFullName = fileFullName.Replace("\\", "/");
} }
_logger.LogInformation("批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, filePath, RuntimeInformation.OSDescription); _logger.LogInformation("批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, filePath, RuntimeInformation.OSDescription);
@ -202,8 +217,24 @@ namespace Myshipping.Application
var bcStream = await currFilePath.GetAsStreamAsync(); var bcStream = await currFilePath.GetAsStreamAsync();
using (var fileStream = File.Create(fileFullName))
{
await bcStream.CopyToAsync(fileStream);
}
string bookFilePath = string.Empty;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("/", "\\/") + ".*").Value;
}
else
{
bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("\\", "\\\\") + ".*").Value;
}
//这里先写入附件表 //这里先写入附件表
await SaveEDIFile(bookingOrder.Id, currFilePath, new System.IO.FileInfo(currFilePath).Name, await SaveEDIFile(bookingOrder.Id, bookFilePath, new System.IO.FileInfo(currFilePath).Name,
fileTypeCode, fileTypeName); fileTypeCode, fileTypeName);
} }

@ -180,5 +180,30 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string IssueTypeName { get; set; } public string IssueTypeName { get; set; }
/// <summary>
/// 操作ID
/// </summary>
public long TaskReqUserId { get; set; }
/// <summary>
/// 操作名称
/// </summary>
public string TaskReqUserName { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string ContaInfo { get; set; }
/// <summary>
/// 船名航次
/// </summary>
public string VesselVoyno { get; set; }
/// <summary>
/// 场站
/// </summary>
public string YardName { get; set; }
} }
} }

@ -97,7 +97,7 @@ namespace Myshipping.Application
.Map(dest => dest.CompleteDate, src => src.COMPLETE_DATE) .Map(dest => dest.CompleteDate, src => src.COMPLETE_DATE)
.Map(dest => dest.BookOrderNo, src => src.BOOK_ORDER_NO) .Map(dest => dest.BookOrderNo, src => src.BOOK_ORDER_NO)
.Map(dest => dest.ResultNote, src => src.RESULT_NOTE) .Map(dest => dest.ResultNote, src => src.RESULT_NOTE)
.Map(dest => dest.ETD, src => src.ETD.HasValue? src.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss"):"") .Map(dest => dest.ETD, src => src.ETD.HasValue ? src.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.CreatedTime, src => src.CreatedTime) .Map(dest => dest.CreatedTime, src => src.CreatedTime)
.Map(dest => dest.UpdatedTime, src => src.UpdatedTime.HasValue ? src.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "") .Map(dest => dest.UpdatedTime, src => src.UpdatedTime.HasValue ? src.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.CreatedUserId, src => src.CreatedUserId) .Map(dest => dest.CreatedUserId, src => src.CreatedUserId)
@ -107,7 +107,11 @@ namespace Myshipping.Application
.Map(dest => dest.ComplateDeal, src => src.COMPLETE_DEAL) .Map(dest => dest.ComplateDeal, src => src.COMPLETE_DEAL)
.Map(dest => dest.ComplateDealName, src => src.COMPLETE_DEAL_NAME) .Map(dest => dest.ComplateDealName, src => src.COMPLETE_DEAL_NAME)
.Map(dest => dest.IssueType, src => src.ISSUE_TYPE) .Map(dest => dest.IssueType, src => src.ISSUE_TYPE)
.Map(dest => dest.IssueTypeName, src => src.ISSUE_TYPE_NAME); .Map(dest => dest.IssueTypeName, src => src.ISSUE_TYPE_NAME)
.Map(dest => dest.TaskReqUserId, src => src.TASK_REQ_USERID)
.Map(dest => dest.TaskReqUserName, src => src.TASK_REQ_USERNAME)
.Map(dest => dest.YardName, src => src.YARD_NAME)
.Map(dest => dest.VesselVoyno, src => src.VESSEL_VOYNO);
config.ForType<TaskBaseInfoDto, TaskBaseInfo>() config.ForType<TaskBaseInfoDto, TaskBaseInfo>()
.Map(dest => dest.PK_ID, src => src.PKId) .Map(dest => dest.PK_ID, src => src.PKId)

Loading…
Cancel
Save