hao 10 months ago
commit db292b757b

@ -306,5 +306,83 @@ namespace Myshipping.Application
return bookFilePath;
}
#endregion
#region 保存文件并返回文件完整路径
/// <summary>
/// 保存文件并返回文件完整路径
/// </summary>
/// <param name="fileDictKey">文件目录KEY</param>
/// <param name="fileBytes">文件二进制流</param>
/// <param name="batchNo">批次号</param>
/// <param name="fileName">文件名称</param>
/// <param name="attachFileType">附件类型 bcfiles-BC文件 sofile-订舱附件</param>
/// <returns>返回文件完整路径</returns>
public static async Task<string> SaveFileDirect(string fileDictKey, byte[] fileBytes, string batchNo,
string fileName,string attachFileType = "sofiles")
{
var logger = Log.CreateLogger(nameof(FileAttachHelper));
var fileCfg = App.GetOptions<BookingAttachOptions>();
string fileRoot = string.Empty;
if (fileCfg != null)
{
if (!string.IsNullOrWhiteSpace(fileCfg.basePath))
{
fileRoot = fileCfg.basePath;
}
}
if (string.IsNullOrWhiteSpace(fileRoot))
fileRoot = App.WebHostEnvironment.WebRootPath;
string relativePath = fileCfg.relativePath;
if (!string.IsNullOrWhiteSpace(attachFileType))
relativePath += $"\\{attachFileType}";
if (!string.IsNullOrWhiteSpace(fileDictKey))
relativePath += $"\\{fileDictKey}";
relativePath += $"\\{DateTime.Now.ToString("yyyyMMddHHmmssfff")}";
string filePath = $"{fileRoot}\\{relativePath}";
string fileFullName = $"{filePath}\\{fileName}";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
relativePath = relativePath.Replace("\\", "/");
filePath = filePath.Replace("\\", "/");
fileFullName = fileFullName.Replace("\\", "/");
}
logger.LogInformation("批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, filePath,
RuntimeInformation.OSDescription);
//预先创建目录
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
await File.WriteAllBytesAsync(fileFullName, fileBytes);
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;
}
return bookFilePath;
}
#endregion
}
}

@ -1,9 +1,13 @@
using Furion.DependencyInjection;
using Furion.DistributedIDGenerator;
using Furion.DynamicApiController;
using Furion.EventBus;
using Furion.Extensions;
using Furion.FriendlyException;
using Furion.JsonSerialization;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
@ -12,14 +16,17 @@ using Myshipping.Application.Service.BookingOrder.Dto;
using Myshipping.Application.Service.BookingSlot.Dto;
using Myshipping.Core;
using Myshipping.Core.Service;
using Org.BouncyCastle.Asn1.Tsp;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Yitter.IdGenerator;
namespace Myshipping.Application
{
@ -34,6 +41,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingSlotStock> _repStock;
private readonly SqlSugarRepository<BookingSlotAllocation> _repAllocation;
private readonly SqlSugarRepository<BookingSlotAllocationCtn> _repAllocationCtn;
private readonly SqlSugarRepository<BookingFile> _bookingFileRepository;
private readonly SqlSugarRepository<BookingLog> _repBookingLog;
private readonly SqlSugarRepository<BookingLogDetail> _repBookingLogDetail;
@ -44,6 +52,12 @@ namespace Myshipping.Application
private readonly IEventPublisher _publisher;
const string CONST_BC_FILE_CODE = "bc";
const string CONST_BC_FILE_NAME = "Booking Confirmation";
const string CONST_BC_NOTICE_FILE_CODE = "bc_notice";
const string CONST_BC_NOTICE_FILE_NAME = "Booking Confirmation Notice";
public BookingSlotService(SqlSugarRepository<BookingSlotBase> repBase,
SqlSugarRepository<BookingSlotCtn> repCtn,
SqlSugarRepository<BookingSlotStock> repStock,
@ -54,7 +68,8 @@ namespace Myshipping.Application
ISysCacheService cache,
IEventPublisher publisher,
SqlSugarRepository<BookingSlotAllocation> repAllocation,
SqlSugarRepository<BookingSlotAllocationCtn> repAllocationCtn)
SqlSugarRepository<BookingSlotAllocationCtn> repAllocationCtn,
SqlSugarRepository<BookingFile> bookingFileRepository)
{
_repBase = repBase;
_repCtn = repCtn;
@ -70,6 +85,7 @@ namespace Myshipping.Application
_publisher = publisher;
_bookingfile = bookingfile;
_bookingFileRepository = bookingFileRepository;
}
#region 舱位
@ -180,12 +196,99 @@ namespace Myshipping.Application
/// </summary>
/// <returns></returns>
[HttpPost("/BookingSlot/ApiReceive"), AllowAnonymous, ApiUser]
public async Task<long> ApiReceive(BookingSlotBaseApiDto dto)
public async Task<TaskManageOrderResultDto> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
BookingSlotBaseApiDto dto = JSON.Deserialize<BookingSlotBaseApiDto>(jsonData);
DynameFileInfo bcFile = null;
DynameFileInfo bcNoticeFile = null;
if (file != null)
{
bcFile = new DynameFileInfo
{
FileBytes = file.ToByteArray(),
FileName = file.FileName
};
}
if (modifyFile != null)
{
bcNoticeFile = new DynameFileInfo
{
FileBytes = modifyFile.ToByteArray(),
FileName = modifyFile.FileName
};
}
var id = InnerApiReceive(dto, bcFile, bcNoticeFile).GetAwaiter().GetResult();
result.succ = true;
result.msg = "成功";
result.ext = id;
}
catch(Exception ex)
{
result.succ = false;
result.msg = $"失败,原因:{ex.Message}";
}
return result;
}
#endregion
/// <summary>
/// 舱位接收保存、取消接口
/// </summary>
/// <param name="dto"></param>
/// <param name="file"></param>
/// <param name="modifyFile"></param>
/// <returns></returns>
[HttpPost("/BookingSlot/InnerApiReceive")]
public async Task<long> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null)
{
long id = 0;
//接口方法直接调用save、delete等方法会报错可能因为非token授权登录导致故重写一遍保存、删除代码
if (dto.OpType == "add" || dto.OpType == "update" || dto.OpType == "del")
{
//翻译船公司
if (!string.IsNullOrWhiteSpace(dto.DataObj.CARRIERID) && string.IsNullOrWhiteSpace(dto.DataObj.CARRIER))
{
var carrierInfo = _cache.GetAllCodeCarrier().GetAwaiter().GetResult()
.Where(t => t.Code.Equals(dto.DataObj.CARRIERID, StringComparison.OrdinalIgnoreCase)
|| t.EnName.Equals(dto.DataObj.CARRIERID, StringComparison.OrdinalIgnoreCase)
|| t.CnName.Equals(dto.DataObj.CARRIERID, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
if(carrierInfo != null)
{
dto.DataObj.CARRIER = carrierInfo.CnName?.Trim();
}
}
//翻译箱型代码
if (dto.DataObj.CtnList != null && dto.DataObj.CtnList.Count > 0 &&
dto.DataObj.CtnList.Any(t => string.IsNullOrWhiteSpace(t.CTNCODE)))
{
var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList();
dto.DataObj.CtnList.ForEach(t =>
{
if(!string.IsNullOrWhiteSpace(t.CTNALL) && string.IsNullOrWhiteSpace(t.CTNCODE))
{
var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.Name) &&
a.Name.Equals(t.CTNALL, StringComparison.OrdinalIgnoreCase));
if (ctnCode != null)
t.CTNCODE = ctnCode?.Code;
}
});
}
BookingSlotBase model = null;
if (dto.OpType == "add")
{
@ -208,6 +311,41 @@ namespace Myshipping.Application
}
await InsLog("Add", model.Id, "新增舱位");
string batchNo = IDGen.NextID().ToString();
//处理附件
if (file != null)
{
_logger.LogInformation($"请求文件名:{file.FileName}");
var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), file.FileBytes, batchNo, file.FileName, "bcfiles");
_logger.LogInformation($"保存文件路径:{fileFullPath}");
if (!string.IsNullOrWhiteSpace(fileFullPath))
{
//将格式单附件写入订舱的附件
SaveEDIFile(id, fileFullPath, file.FileName, UserManager.TENANT_ID,
CONST_BC_FILE_CODE, CONST_BC_FILE_NAME).GetAwaiter();
}
}
if (modifyFile != null)
{
_logger.LogInformation($"请求文件名(变更文件):{modifyFile.FileName}");
var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), modifyFile.FileBytes, batchNo, modifyFile.FileName, "bcnoticefiles");
_logger.LogInformation($"保存文件路径(变更文件):{fileFullPath}");
if (!string.IsNullOrWhiteSpace(fileFullPath))
{
//将格式单附件写入订舱的附件
SaveEDIFile(id, fileFullPath, modifyFile.FileName, UserManager.TENANT_ID,
CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter();
}
}
}
else if (dto.OpType == "update")
{
@ -269,7 +407,6 @@ namespace Myshipping.Application
return id;
}
#endregion
/// <summary>
/// 插入日志(仅显示一条文本信息)
@ -704,5 +841,54 @@ namespace Myshipping.Application
return result.XnPagedResult();
}
#endregion
#region 异步写入附件表
/// <summary>
/// 异步写入附件表
/// </summary>
/// <param name="boookId">订舱ID</param>
/// <param name="FilePath">文件路径</param>
/// <param name="fileName">文件名</param>
/// <param name="tenantId">租户ID</param>
/// <param name="fileTypeCode">附件类型代码</param>
/// <param name="fileTypeName">附件类型名称</param>
/// <param name="moudle">附件模块代码</param>
/// <returns></returns>
[NonAction]
private async Task SaveEDIFile(long boookId, string FilePath, string fileName, long tenantId,
string fileTypeCode = "bc", string fileTypeName = "Booking Confirmation", string moudle = "BookingSlot")
{
/*
*/
//EDI文件
var bookFile = new BookingFile
{
Id = YitIdHelper.NextId(),
FileName = fileName,
FilePath = FilePath,
TypeCode = fileTypeCode,
TypeName = fileTypeName,
BookingId = boookId,
TenantId = tenantId,
Moudle = moudle
};
await _bookingFileRepository.InsertAsync(bookFile);
}
#endregion
}
public class DynameFileInfo
{
/// <summary>
/// 文件名称
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 文件二进制流
/// </summary>
public byte[] FileBytes { get; set; }
}
}

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Myshipping.Application.Entity;
using Myshipping.Application.Event;
using Myshipping.Application.Service.BookingSlot.Dto;
@ -9,7 +10,15 @@ namespace Myshipping.Application
{
public interface IBookingSlotService
{
Task<long> ApiReceive(BookingSlotBaseApiDto dto);
/// <summary>
/// 舱位接收保存、取消接口
/// </summary>
/// <param name="jsonData">请求详情</param>
/// <param name="file">BC附件</param>
/// <param name="modifyFile">BC变更附件</param>
/// <returns></returns>
Task<TaskManageOrderResultDto> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null);
Task<BookingSlotBaseSaveOutput> Detail(long id);
Task<List<BookingSlotBaseWithCtnDto>> GetAvailableSlots(BookingSlotBaseDto input);
@ -55,5 +64,15 @@ namespace Myshipping.Application
/// <param name="input"></param>
/// <returns></returns>
Task<dynamic> Page(BookingSlotBasePageInput input);
/// <summary>
/// 舱位接收保存、取消接口
/// </summary>
/// <param name="dto"></param>
/// <param name="file"></param>
/// <param name="modifyFile"></param>
/// <returns></returns>
Task<long> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null);
}
}

@ -361,5 +361,6 @@ namespace Myshipping.Application
/// 订舱确认时间
/// </summary>
public Nullable<DateTime> BookingConfirmDate { get; set; }
}
}

@ -331,5 +331,10 @@ namespace Myshipping.Application
/// 订舱确认时间
/// </summary>
public Nullable<DateTime> BookingConfirmDate { get; set; }
/// <summary>
/// 舱位主键
/// </summary>
public Nullable<long> BookingSlotId { get; set; }
}
}

@ -48,7 +48,7 @@
<td class="etd-val" width="160">2023-12-01</td>
</tr>
<tr>
<td class="eta-label" width="15%">ETD:</td>
<td class="eta-label" width="15%">ETA:</td>
<td class="eta-val" width="160">2023-12-01</td>
</tr>
</table>

@ -677,8 +677,7 @@ namespace Myshipping.Application
var fileList = _taskFileRepository.AsQueryable().Where(a => a.TASK_PKID == bcTaskInfo.PK_ID).ToList();
if ((bcOrder.BOOKING_ORDER_ID.HasValue && bcOrder.BOOKING_ORDER_ID.Value>0)
|| (bcOrder.BOOKING_SLOT_ID.HasValue && bcOrder.BOOKING_SLOT_ID.Value > 0))
if (bcOrder.BOOKING_ORDER_ID.HasValue && bcOrder.BOOKING_ORDER_ID.Value > 0)
{
throw Oops.Oh($"当前BC任务已生成订舱或舱位不能重复生成");
}
@ -687,7 +686,16 @@ namespace Myshipping.Application
{
#region 推送舱位、推送订舱
//推送舱位
var bookingSlotId = await GenerateBookingSlot(bcOrder, bcCtnList, fileList);
long bookingSlotId = 0;
if(bcOrder.BOOKING_SLOT_ID.HasValue && bcOrder.BOOKING_SLOT_ID.Value > 0)
{
bookingSlotId = bcOrder.BOOKING_SLOT_ID.Value;
}
else
{
bookingSlotId = await GenerateBookingSlot(bcOrder, bcCtnList, fileList);
}
if (bookingSlotId > 0)
{
@ -696,6 +704,7 @@ namespace Myshipping.Application
if (bookingOrderId > 0)
{
//更新库存
//_bookingSlotService.
var bcEntity = _taskBCInfoRepository.AsQueryable().First(a => a.PK_ID == bcOrder.PK_ID);
@ -722,6 +731,10 @@ namespace Myshipping.Application
}).ExecuteCommand();
var currBCOrder = _taskBCInfoRepository.AsQueryable().First(a => a.PK_ID == bcEntity.PK_ID);
if (currBCOrder != null)
await GenerateSendEmail(currBCOrder);
var taskEntity = _taskBaseRepository.AsQueryable().First(u => u.PK_ID == bcEntity.TASK_ID);
@ -748,6 +761,10 @@ namespace Myshipping.Application
}
}
}
else
{
throw Oops.Oh($"生成舱位失败,舱位已存在");
}
#endregion
}
else if (model.GenerateMethod == "GEN_BOOKING")
@ -957,52 +974,42 @@ namespace Myshipping.Application
});
}
id = await _bookingSlotService.ApiReceive(slotModel);
var opt = App.GetOptions<BookingAttachOptions>();
var dirAbs = opt.basePath;
if (string.IsNullOrEmpty(dirAbs))
{
dirAbs = App.WebHostEnvironment.WebRootPath;
}
string batchNo = IDGen.NextID().ToString();
DynameFileInfo dynameFile = null;
DynameFileInfo dynameNoticeFile = null;
//成功后写入附件
if (id > 0)
if (taskFileList.Any(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString()))
{
var opt = App.GetOptions<BookingAttachOptions>();
var dirAbs = opt.basePath;
if (string.IsNullOrEmpty(dirAbs))
{
dirAbs = App.WebHostEnvironment.WebRootPath;
}
var fileInfo = taskFileList.FirstOrDefault(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString());
var fileFullPath = Path.Combine(dirAbs, fileInfo.FILE_PATH);
taskFileList.ForEach(file =>
dynameFile = new DynameFileInfo
{
if (file.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString())
{
var fileFullPath = Path.Combine(dirAbs, file.FILE_PATH);
FileBytes = File.ReadAllBytes(fileFullPath),
FileName = Path.GetFileName(fileFullPath)
};
}
if (File.Exists(fileFullPath))
{
//如果确认文件读取成功
var bookFilePath = FileAttachHelper.MoveFile(id.ToString(), fileFullPath, batchNo, false, "bcfiles", true).GetAwaiter().GetResult();
if (taskFileList.Any(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC_NOTICE.ToString()))
{
var fileInfo = taskFileList.FirstOrDefault(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString());
var fileFullPath = Path.Combine(dirAbs, fileInfo.FILE_PATH);
//将格式单附件写入订舱的附件
SaveEDIFile(id, bookFilePath, new System.IO.FileInfo(bookFilePath).Name, taskBCInfo.TenantId.Value,
CONST_BC_FILE_CODE, CONST_BC_FILE_NAME).GetAwaiter();
}
}
else if (file.FILE_CATEGORY == TaskFileCategoryEnum.BC_NOTICE.ToString())
{
var fileFullPath = Path.Combine(dirAbs, file.FILE_PATH);
dynameNoticeFile = new DynameFileInfo
{
FileBytes = File.ReadAllBytes(fileFullPath),
FileName = Path.GetFileName(fileFullPath)
};
}
if (File.Exists(fileFullPath))
{
//如果确认文件读取成功
var bookFilePath = FileAttachHelper.MoveFile(id.ToString(), fileFullPath, batchNo,false,"bcnoticefile",true).GetAwaiter().GetResult();
id = await _bookingSlotService.InnerApiReceive(slotModel, dynameFile, dynameNoticeFile);
//将格式单附件写入订舱的附件
SaveEDIFile(id, bookFilePath, new System.IO.FileInfo(bookFilePath).Name, taskBCInfo.TenantId.Value,
CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter();
}
}
});
}
}
catch (Exception ex)
{
@ -1364,11 +1371,11 @@ namespace Myshipping.Application
_logger.LogInformation($"提取当前公共邮箱的配置完成id={publicMailAccount.Id}");
string emailTitle = string.Empty;
string emailTitle = $"Booking Confirmation : {taskBCInfo.MBL_NO}";
string filePath = string.Empty;
//读取邮件模板并填充数据
string emailHtml = GenerateSendEmailHtml(taskBCInfo).GetAwaiter().GetResult();
string emailHtml = GenerateSendEmailHtml(taskBCInfo, UserManager.TENANT_NAME).GetAwaiter().GetResult();
_logger.LogInformation($"生成邮件BODY结果{emailHtml}");
@ -1401,11 +1408,13 @@ namespace Myshipping.Application
Password = publicMailAccount.Password?.Trim(),
Server = publicMailAccount.SmtpServer?.Trim(),
Port = publicMailAccount.SmtpPort.HasValue ? publicMailAccount.SmtpPort.Value : 465,
UseSSL = publicMailAccount.SmtpSSL.HasValue ? publicMailAccount.SmtpSSL.Value : true
UseSSL = publicMailAccount.SmtpSSL.HasValue ? publicMailAccount.SmtpSSL.Value : true,
Attaches = new List<AttachesInfo>()
};
_logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}");
//推送邮件
var emailRlt = await PushEmail(emailApiUserDefinedDto, filePath);
@ -1431,8 +1440,9 @@ namespace Myshipping.Application
/// 通过邮件模板生成HTML
/// </summary>
/// <param name="taskBCInfo">BC任务详情</param>
/// <param name="tenantName">当前租户全称</param>
/// <returns>返回生成的HTML</returns>
public async Task<string> GenerateSendEmailHtml(TaskBCInfo taskBCInfo)
public async Task<string> GenerateSendEmailHtml(TaskBCInfo taskBCInfo,string tenantName)
{
string result = string.Empty;
@ -1445,6 +1455,14 @@ namespace Myshipping.Application
{
string templatePath = App.Configuration["EmailTemplateFilePath"];
var opt = App.GetOptions<BookingAttachOptions>();
var dirAbs = opt.basePath;
if (string.IsNullOrEmpty(dirAbs))
{
dirAbs = App.WebHostEnvironment.WebRootPath;
}
templatePath = $"{dirAbs}{templatePath}\\BCEmailTemplate.html";
string baseHtml = File.ReadAllText(templatePath);
if (string.IsNullOrWhiteSpace(baseHtml))
@ -1504,6 +1522,27 @@ namespace Myshipping.Application
}
}
var noreplyTr = html.DocumentNode.SelectNodes("//tr[@class='email-noreply']").FirstOrDefault();
if (noreplyTr != null)
{
var currTd = noreplyTr.SelectNodes(".//td").FirstOrDefault();
if(currTd != null)
{
var currPList = currTd.SelectNodes(".//p");
foreach (var baseP in currPList)
{
if (baseP.Attributes["class"].Value == "notice-comp-val")
{
baseP.InnerHtml = tenantName;
}
}
}
}
result = html.DocumentNode.OuterHtml;
}
catch (Exception ex)
@ -1610,6 +1649,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="taskPKId">BC任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageBC/SendEmail")]
public async Task<TaskManageOrderResultDto> SendEmail(string taskPKId)
{
if (string.IsNullOrWhiteSpace(taskPKId))

@ -302,7 +302,7 @@ namespace Myshipping.Application
if (userTendInfo != null)
{
taskInfo.IS_PUBLIC = 0;
taskInfo.IS_PUBLIC = 1;
}
}
else
@ -350,7 +350,8 @@ namespace Myshipping.Application
if (TaskBaseTypeEnum.BC.ToString() == taskInfo.TASK_BASE_TYPE)
attachFileType = "bcfiles";
var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, file.FileName,
var noExtensionFileName = Path.GetFileNameWithoutExtension(file.FileName);
var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, noExtensionFileName,
GetFileType(file.FileName), attachFileType);
if (!string.IsNullOrWhiteSpace(fileFullName))
@ -380,7 +381,8 @@ namespace Myshipping.Application
if (TaskBaseTypeEnum.BC.ToString() == taskInfo.TASK_BASE_TYPE)
attachFileType = "bcnoticefiles";
var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, modifyFile.FileName,
var noExtensionFileName = Path.GetFileNameWithoutExtension(modifyFile.FileName);
var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, noExtensionFileName,
GetFileType(modifyFile.FileName), attachFileType);
if (!string.IsNullOrWhiteSpace(fileFullName))
@ -674,6 +676,9 @@ namespace Myshipping.Application
bcInfo.TenantId = taskInfo.TenantId;
bcInfo.TenantName = taskInfo.TenantName;
if (info.Main.BCInfo.BookingSlotId.HasValue && info.Main.BCInfo.BookingSlotId.Value > 0)
bcInfo.BOOKING_SLOT_ID = info.Main.BCInfo.BookingSlotId.Value;
await _taskBCInfoRepository.InsertAsync(bcInfo);
//异步写入集装箱
@ -1184,7 +1189,7 @@ namespace Myshipping.Application
_logger.LogInformation("任务台账权限范围 {list}", userlist);
var entities = await _taskBaseInfoRepository.AsQueryable()
.Where(t=> userlist.Contains(t.CreatedUserId))
.Where(t=> userlist.Contains(t.CreatedUserId) || t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Contains(t.MBL_NO))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim()))
.WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin)

@ -56,7 +56,7 @@
},
"Cache": {
"CacheType": "RedisCache", // RedisCache
"RedisConnectionString": "192.168.0.80:6379,password=,defaultDatabase=11"
"RedisConnectionString": "192.168.0.180:6379,password=,defaultDatabase=11"
},
"SnowId": {
"WorkerId": "1" // 0~63,1
@ -130,5 +130,6 @@
"ServiceStatusOpenAuto": "0",
"DraftCompareUrl": "http://localhost:5110/api/TaskDraftCompare/ExcuteDraftCompare",
"GetDraftCompareUrl": "http://localhost:5110/api/TaskDraftCompare/DraftCompareResult",
"DraftReadUrl": "http://localhost:5110/api/TaskDraftCompare/ExcuteDraftFileRead"
"DraftReadUrl": "http://localhost:5110/api/TaskDraftCompare/ExcuteDraftFileRead",
"EmailTemplateFilePath": "\\EmailTemplate"
}

@ -37,5 +37,5 @@
}
},
"AllowedHosts": "*",
"Urls": "http://localhost:5000"
"Urls": "http://localhost:5120"
}
Loading…
Cancel
Save