jianghaiqing 2 years ago
commit b09e3f4f8e

@ -6082,7 +6082,7 @@
</member>
<member name="M:Myshipping.Application.BookingOrderService.LetterYardPdf(System.Int64,System.Int32)">
<summary>
获取放舱pdf
获取放舱pdf(准备作废,后期使用打印相关接口)
</summary>
<param name="bookingId"></param>
<param name="type">类型1pdf、2xlsx、3docx</param>
@ -6090,7 +6090,7 @@
</member>
<member name="M:Myshipping.Application.BookingOrderService.LetterYardXlsx(System.Int64)">
<summary>
获取放舱excel
获取放舱excel(准备作废,后期使用打印相关接口)
</summary>
<param name="bookingId"></param>
<returns></returns>
@ -6109,7 +6109,7 @@
生成打印报表文件
</summary>
<param name="bookingId">订舱ID</param>
<param name="template">打印模板</param>
<param name="printTemplate">打印模板</param>
<param name="type">类型1pdf、2xlsx、3docx</param>
<returns></returns>
</member>
@ -6140,15 +6140,22 @@
</member>
<member name="M:Myshipping.Application.BookingOrderService.ViewPrintPdf(System.String)">
<summary>
下载打印文件(PDF直接预览)
预览模板生成的pdf文件
</summary>
<param name="vid">查看ID</param>
<param name="fn">文件名称</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.PrintTemplateList">
<summary>
获取订舱打印模板列表带有当前用户打印历史排序准备作废使用PrintTemplateWithHistoryList代替
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.PrintTemplateWithHistoryList(System.String)">
<summary>
获取订舱打印模板列表(带有当前用户打印历史排序)
</summary>
<param name="cateCode">分类代码使用字典【booking_template_category】中的代码</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.SendXHZ(System.Int64)">

@ -368,7 +368,7 @@ namespace Myshipping.Application
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
input.CNTRTOTAL = string.Join(" / ", groupList);
}
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.HBLNO == input.HBLNO&&x.ParentId==input.ParentId).FirstAsync();
if (et != null)
{
@ -483,7 +483,7 @@ namespace Myshipping.Application
}
var main = await _rep.AsQueryable().Where(x => x.Id == input.Id).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.Id != input.Id && x.ParentId == 0).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.HBLNO == input.HBLNO && x.ParentId == input.ParentId&&x.Id!=input.Id).FirstAsync();
if (et != null)
{
@ -1644,7 +1644,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="fileName">文件名</param>
/// <returns></returns>
[HttpGet("/BookingOrder/DownloadPrint")]
[HttpGet("/BookingOrder/DownloadPrint"), AllowAnonymous]
public IActionResult DownloadPrint(string fileName)
{
var opt = App.GetOptions<TempFileOptions>().Path;
@ -3462,6 +3462,67 @@ namespace Myshipping.Application
}
}
#endregion
[HttpGet("/BookingOrder/test")]
public void test() {
var opt = App.GetOptions<TempFileOptions>();
var dirAbs = opt.Path;
var RemainHours = Convert.ToDouble(opt.RemainHours);
var fileFullPath = Path.Combine(App.WebHostEnvironment.WebRootPath, dirAbs);
string[] Files = Directory.GetFiles(fileFullPath); //当前目录下的文件:
foreach (string it in Files)
{
FileInfo fi = new FileInfo(it);
var date = fi.CreationTime.AddHours(RemainHours);
if (date < DateTime.Now)
{
File.Delete(it);
}
}
string[] _Files = Directory.GetDirectories(fileFullPath); //当前目录下的文件夹:
if (_Files.Length>0) {
foreach (string it in _Files)
{
//FileInfo fi = new FileInfo(it);
//var date = fi.CreationTime.AddHours(RemainHours);
//if (date < DateTime.Now)
//{
// File.Delete(it);
//}
test1( it);
}
}
}
public void test1(string path) {
var opt = App.GetOptions<TempFileOptions>();
var RemainHours = Convert.ToDouble(opt.RemainHours);
string[] Files = Directory.GetFiles(path); //当前目录下的文件:
foreach (string it in Files)
{
FileInfo fi = new FileInfo(it);
var date = fi.CreationTime.AddHours(RemainHours);
if (date < DateTime.Now)
{
File.Delete(it);
}
}
string[] _Files = Directory.GetDirectories(path); //当前目录下的文件夹:
if (_Files.Length>0) {
foreach (string it in _Files)
{
test1(it);
}
}
}
}
}

@ -277,5 +277,44 @@ public class LogJobWorker : ISpareTimeWorker, IDynamicApiController, ITransient
File.Delete(it);
}
}
string[] _Files = Directory.GetDirectories(fileFullPath); //当前目录下的文件夹:
if (_Files.Length > 0)
{
foreach (string it in _Files)
{
TemporaryDirectories(it);
}
}
}
public void TemporaryDirectories(string path)
{
var opt = App.GetOptions<TempFileOptions>();
var RemainHours = Convert.ToDouble(opt.RemainHours);
string[] Files = Directory.GetFiles(path); //当前目录下的文件:
foreach (string it in Files)
{
FileInfo fi = new FileInfo(it);
var date = fi.CreationTime.AddHours(RemainHours);
if (date < DateTime.Now)
{
File.Delete(it);
}
}
string[] _Files = Directory.GetDirectories(path); //当前目录下的文件夹:
if (_Files.Length > 0)
{
foreach (string it in _Files)
{
TemporaryDirectories(it);
}
}
}
}

Loading…
Cancel
Save