修改舱位生成

增加台账查询用时
usertest
jianghaiqing 4 months ago
parent bc594c6a78
commit 4766d50717

@ -916,7 +916,7 @@ namespace DS.WMS.Core.Op.Method
{
var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.CtnName) && a.CtnName.Equals(t.CtnALL, StringComparison.OrdinalIgnoreCase));
t.CtnCode = ctnCode != null ? $"{ctnCode.CtnSize}{ctnCode.CtnType}" : "(箱型未收录)";
t.CtnCode = ctnCode != null ? ctnCode.EdiCode : "(箱型未收录)";
}
BookingSlotCtnSaveInput ctn = new BookingSlotCtnSaveInput
@ -1147,6 +1147,7 @@ namespace DS.WMS.Core.Op.Method
foreach (var ctn in dto.DataObj.CtnList)
{
var newCtn = ctn.Adapt<BookingSlotCtn>();
newCtn.SlotId = model.Id;
await tenantDb.Insertable<BookingSlotCtn>(newCtn).ExecuteCommandAsync();
}
@ -3564,6 +3565,15 @@ namespace DS.WMS.Core.Op.Method
public async Task<DataResult<List<BookingSlotBaseDto>>> GetPageAsync(PageRequest querySearch)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
long batchNo = SnowFlakeSingle.Instance.NextId();
DateTime bDate = DateTime.Now;
Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} 开始查询台账");
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
@ -3736,6 +3746,12 @@ namespace DS.WMS.Core.Op.Method
}
}
DateTime eDate = DateTime.Now;
TimeSpan ts = eDate.Subtract(bDate);
var timeDiff = ts.TotalMilliseconds;
Logger.Log(NLog.LogLevel.Info, "批次={no} 请求完成,耗时:{timeDiff}ms.");
return data;
}

@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NLog;
using NPOI.HPSF;
using NPOI.SS.Formula.Functions;
@ -134,32 +135,13 @@ namespace DS.WMS.Core.Sys.Method
string fileRoot = AppSetting.app(new string[] { "FileSettings", "BasePath" });
string relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
/*
if (string.IsNullOrWhiteSpace(fileRoot))
fileRoot = _environment.WebRootPath;
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("\\", "/");
}*/
var dirAbs = string.Empty;
var fileRelaPath = string.Empty;
var fileAbsPath = string.Empty;
string? dirAbs;
if (string.IsNullOrEmpty(fileRoot))
{
dirAbs = Path.Combine(_environment.WebRootPath ?? "", relativePath);
@ -171,14 +153,15 @@ namespace DS.WMS.Core.Sys.Method
if (!Directory.Exists(dirAbs))
Directory.CreateDirectory(dirAbs);
// 先存库获取Id
var id = SnowFlakeSingle.Instance.NextId();
var fileSuffix = Path.GetExtension(fileName).ToLower(); // 文件后缀
var fileSaveName = $"{id}{fileSuffix}".ToLower();
fileRelaPath = Path.Combine(relativePath, fileSaveName).ToLower();
fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
string fileRelaPath = Path.Combine(relativePath, fileSaveName).ToLower();
string fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
Logger.Log(NLog.LogLevel.Info, "批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, fileAbsPath,
RuntimeInformation.OSDescription);
@ -202,7 +185,7 @@ namespace DS.WMS.Core.Sys.Method
// bookFilePath = System.Text.RegularExpressions.Regex.Match(dirAbs, relativePath.Replace("\\", "\\\\") + ".*").Value;
//}
return DataResult<string>.Success(fileSaveName);
return DataResult<string>.Success(fileAbsPath);
}
#region 转移文件
@ -223,32 +206,13 @@ namespace DS.WMS.Core.Sys.Method
string relativePath = AppSetting.app(new string[] { "FileSettings", "RelativePath" });
/*
if (string.IsNullOrWhiteSpace(fileRoot))
fileRoot = _environment.WebRootPath;
if (!string.IsNullOrWhiteSpace(attachFileType))
relativePath += $"\\{attachFileType}";
if (!string.IsNullOrWhiteSpace(fileDictKey))
relativePath += $"\\{fileDictKey}";
relativePath += $"\\{DateTime.Now.ToString("yyyyMMddHHmmss")}";
string filePath = $"{fileRoot}\\{relativePath}";
string fileFullName = $"{filePath}\\{new System.IO.FileInfo(sourceFilePath).Name}";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
relativePath = relativePath.Replace("\\", "/");
filePath = filePath.Replace("\\", "/");
fileFullName = fileFullName.Replace("\\", "/");
}
*/
var dirAbs = string.Empty;
var fileRelaPath = string.Empty;
var fileAbsPath = string.Empty;
string? dirAbs;
if (string.IsNullOrEmpty(fileRoot))
{
dirAbs = Path.Combine(_environment.WebRootPath ?? "", relativePath);
@ -260,14 +224,15 @@ namespace DS.WMS.Core.Sys.Method
if (!Directory.Exists(dirAbs))
Directory.CreateDirectory(dirAbs);
// 先存库获取Id
var id = SnowFlakeSingle.Instance.NextId();
var fileSuffix = Path.GetExtension(sourceFilePath).ToLower(); // 文件后缀
var fileSaveName = $"{id}{fileSuffix}".ToLower();
fileRelaPath = Path.Combine(relativePath, fileSaveName).ToLower();
fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
string fileRelaPath = Path.Combine(relativePath, fileSaveName).ToLower();
string fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower();
Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} 生成文件保存路径完成 路由={fileAbsPath} 服务器系统={RuntimeInformation.OSDescription}");
@ -326,7 +291,7 @@ namespace DS.WMS.Core.Sys.Method
// bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("\\", "\\\\") + ".*").Value;
//}
return DataResult<string>.Success(fileSaveName);
return DataResult<string>.Success(fileAbsPath);
}
#endregion
}

@ -49,5 +49,8 @@
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".txt", ".pms" ]
},
"BCCompare": {
"Url": "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentCompare"
}
}

Loading…
Cancel
Save