From ab8a92db6e68d8329b0b31df98e542bbac0b8020 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 3 Jan 2023 15:06:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=85=B1=E5=BA=93sort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 6 +- .../BookingTemplate/BookingTemplateService.cs | 27 ++--- Myshipping.Core/Myshipping.Core.xml | 105 ++++++++++++++++++ .../Service/CommonDB/CommonDBService.cs | 4 +- .../Service/CommonDB/Dto/CodeCarrierDto.cs | 6 +- .../Service/CommonDB/Dto/CodeCountryDto.cs | 4 + .../Service/CommonDB/Dto/CodeCtnDto.cs | 5 +- .../Service/CommonDB/Dto/CodeForwarderDto.cs | 5 +- .../Service/CommonDB/Dto/CodeFrtDto.cs | 5 +- .../Service/CommonDB/Dto/CodeLaneDto.cs | 4 + .../Service/CommonDB/Dto/CodePackageDto.cs | 5 +- .../Service/CommonDB/Dto/CodePortDto.cs | 5 +- .../Service/CommonDB/Dto/CodePortLoadDto.cs | 4 + .../Service/CommonDB/Dto/CodeServiceDto.cs | 5 +- .../Service/CommonDB/Dto/CodeVesselDto.cs | 5 +- .../Service/CommonDB/Dto/CodeYardDto.cs | 5 +- .../Service/CommonDB/Dto/MappingCarrierDto.cs | 5 +- .../Service/CommonDB/Dto/MappingCtnDto.cs | 5 +- .../Service/CommonDB/Dto/MappingFrtDto.cs | 4 + .../Service/CommonDB/Dto/MappingPackageDto.cs | 4 + .../Service/CommonDB/Dto/MappingPortDto.cs | 4 + .../CommonDB/Dto/MappingPortLoadDto.cs | 4 + .../Service/CommonDB/Dto/MappingServiceDto.cs | 4 + .../Service/CommonDB/Dto/MappingVesselDto.cs | 4 + .../Service/CommonDB/Dto/MappingYardDto.cs | 4 + 25 files changed, 205 insertions(+), 33 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 766fb8b0..8720bd62 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -822,7 +822,7 @@ namespace Myshipping.Application [HttpGet("/BookingOrder/GetFile")] public async Task> GetFile(long Id) { - var list = await _bookingfile.AsQueryable().Where(u => u.BookingId == Id).ToListAsync(); + var list = await _bookingfile.AsQueryable().Filter(null, true).Where(u => u.BookingId == Id).ToListAsync(); return list; } @@ -834,7 +834,7 @@ namespace Myshipping.Application public async Task> GetBookingStatusLog(long Id) { - var statuslog = await _repStatuslog.AsQueryable().Where(x => x.BookingId == Id).ToListAsync(); + var statuslog = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == Id).ToListAsync(); var dto = statuslog.Adapt>(); foreach (var item in dto) { @@ -852,7 +852,7 @@ namespace Myshipping.Application public async Task> GetBookingStatus(long Id) { - var dto = await _repBookingStatus.AsQueryable().Where(x => x.BookingId == Id).ToListAsync(); + var dto = await _repBookingStatus.AsQueryable().Filter(null, true).Where(x => x.BookingId == Id).ToListAsync(); return dto; } diff --git a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs index c5e1525e..362b4f2c 100644 --- a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs +++ b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs @@ -219,7 +219,6 @@ namespace Myshipping.Application throw Oops.Bah("请传入正确参数"); } - var excelwork = new HSSFWorkbook(); var sheet = excelwork.CreateSheet("订舱台账"); sheet.ForceFormulaRecalculation = true; @@ -230,21 +229,23 @@ namespace Myshipping.Application for (int _row = 0; _row < entity.Max(x => x.Row); _row++) { - + if (entity.Where(x => x.Row == (_row + 1)).Count() > 0) { ///创建行 var row = NpoiExcelExportHelper._.CreateRow(sheet, _row, 25); for (int _cellNum = 0; _cellNum < entity.Max(x => x.Column); _cellNum++) { - if (entity.Where(x=>x.Row==_row+1&&x.Column==_cellNum+1).Count()>0) { + if (entity.Where(x => x.Row == _row + 1 && x.Column == _cellNum + 1).Count() > 0) + { foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order)) { var name = entity.Where(x => x.Row == _row + 1 && x.Column == _cellNum + 1).Select(x => x.Field).FirstOrDefault(); var _name = descriptor.Name.ToLower(); - if (name == _name) { - var value = descriptor.GetValue(order).ToString(); - var cell=NpoiExcelExportHelper._.CreateCells(row, cellStyle, _cellNum+1, value); + if (name == _name) + { + var value = descriptor.GetValue(order).ToString(); + var cell = NpoiExcelExportHelper._.CreateCells(row, cellStyle, _cellNum + 1, value); } } } @@ -259,16 +260,10 @@ namespace Myshipping.Application } var fileName = string.Format("订舱{0}.xls", DateTime.Now.Ticks); _logger.LogInformation("导出excel:" + Path.Combine(fileFullPath, fileName)); - var filestream = new FileStream(Path.Combine(fileFullPath ,fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite); - excelwork.Write(filestream); - var result = new FileStreamResult(new FileStream(Path.Combine(fileFullPath, fileName), FileMode.Open), "application/octet-stream") { FileDownloadName = fileName }; - return result; + var filestream = new FileStream(Path.Combine(fileFullPath, fileName), FileMode.OpenOrCreate, FileAccess.ReadWrite); + excelwork.Write(filestream); + //var result = new FileStreamResult(new FileStream(Path.Combine(fileFullPath, fileName), FileMode.Open), "application/octet-stream") { FileDownloadName = fileName }; + return fileName; } - - - - - - } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index d64475ea..1331cede 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -7674,6 +7674,11 @@ 备注 + + + 排序 + + 主键 @@ -7714,6 +7719,11 @@ 备注 + + + 排序 + + 主键 @@ -7754,6 +7764,11 @@ 大小箱分类(small-小箱 big-大箱) + + + 排序 + + 代码 @@ -7774,6 +7789,11 @@ 备注 + + + 排序 + + 代码 @@ -7799,6 +7819,11 @@ 备注 + + + 排序 + + 代码 @@ -7864,6 +7889,11 @@ 描述 + + + 排序 + + 代码 @@ -7889,6 +7919,11 @@ 备注 + + + 排序 + + 代码 @@ -7939,6 +7974,11 @@ 备注 + + + 排序 + + 代码 @@ -7969,6 +8009,11 @@ 备注 + + + 排序 + + 代码 @@ -7994,6 +8039,11 @@ 备注 + + + 排序 + + 名称 @@ -8014,6 +8064,11 @@ 备注 + + + 排序 + + 代码 @@ -8034,6 +8089,11 @@ 备注 + + + 排序 + + 业务id @@ -8064,6 +8124,11 @@ 备注 + + + 排序 + + 业务id @@ -8099,6 +8164,11 @@ 备注 + + + 排序 + + 业务id @@ -8134,6 +8204,11 @@ 备注 + + + 排序 + + 业务id @@ -8169,6 +8244,11 @@ 备注 + + + 排序 + + 业务id @@ -8204,6 +8284,11 @@ 备注 + + + 排序 + + 业务id @@ -8239,6 +8324,11 @@ 备注 + + + 排序 + + 业务id @@ -8274,6 +8364,11 @@ 备注 + + + 排序 + + 名称 @@ -8294,6 +8389,11 @@ 备注 + + + 排序 + + 业务id @@ -8324,6 +8424,11 @@ 备注 + + + 排序 + + 航线与港口的的关系表 diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index c3a6483f..edf4df8a 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -1607,13 +1607,13 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie { if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CTN)) { - var list = await _codeCtnRep.AsQueryable().OrderBy(x => x.Name).ToListAsync(); + var list = await _codeCtnRep.AsQueryable().OrderBy(x => x.Sort).ToListAsync(); await _sysCacheService.SetAllCodeCtn(list); } } else { - var list = await _codeCtnRep.AsQueryable().OrderBy(x => x.Name).ToListAsync(); + var list = await _codeCtnRep.AsQueryable().OrderBy(x => x.Sort).ToListAsync(); await _sysCacheService.SetAllCodeCtn(list); } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeCarrierDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeCarrierDto.cs index a113fd54..ee595ebd 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeCarrierDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeCarrierDto.cs @@ -39,8 +39,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } - - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeCountryDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeCountryDto.cs index 5c99d7d1..b98f4055 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeCountryDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeCountryDto.cs @@ -46,5 +46,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeCtnDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeCtnDto.cs index ebde76f9..689ea047 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeCtnDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeCtnDto.cs @@ -48,6 +48,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public string CtnCategory { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeForwarderDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeForwarderDto.cs index 90d8bfba..3caa843d 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeForwarderDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeForwarderDto.cs @@ -30,7 +30,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeFrtDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeFrtDto.cs index 09cdf580..919e6ff1 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeFrtDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeFrtDto.cs @@ -34,7 +34,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeLaneDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeLaneDto.cs index 7f7fd697..e5307c4b 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeLaneDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeLaneDto.cs @@ -39,5 +39,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 描述 /// public string Description { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodePackageDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodePackageDto.cs index 895fd973..8277f693 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodePackageDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodePackageDto.cs @@ -34,7 +34,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodePortDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodePortDto.cs index c847e1eb..1e17e801 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodePortDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodePortDto.cs @@ -59,7 +59,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodePortLoadDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodePortLoadDto.cs index 74fd8e3a..124dd816 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodePortLoadDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodePortLoadDto.cs @@ -39,5 +39,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeServiceDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeServiceDto.cs index 19ff7fee..0af634b6 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeServiceDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeServiceDto.cs @@ -34,6 +34,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeVesselDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeVesselDto.cs index fd54a07d..7c2a10f7 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeVesselDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeVesselDto.cs @@ -29,8 +29,11 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeYardDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeYardDto.cs index 9d59c081..cb072bf6 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/CodeYardDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeYardDto.cs @@ -28,6 +28,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingCarrierDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingCarrierDto.cs index 7f68eb63..87a8dc3c 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingCarrierDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingCarrierDto.cs @@ -37,6 +37,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingCtnDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingCtnDto.cs index 9ef8d084..1dcd70c9 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingCtnDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingCtnDto.cs @@ -41,6 +41,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } - + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingFrtDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingFrtDto.cs index 944ee31d..ede0a739 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingFrtDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingFrtDto.cs @@ -41,5 +41,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingPackageDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingPackageDto.cs index 6e73e3c1..38896f29 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingPackageDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingPackageDto.cs @@ -41,5 +41,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingPortDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingPortDto.cs index 098d2479..eccfdc84 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingPortDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingPortDto.cs @@ -41,5 +41,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingPortLoadDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingPortLoadDto.cs index 97e716ea..2a2ea56a 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingPortLoadDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingPortLoadDto.cs @@ -42,5 +42,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingServiceDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingServiceDto.cs index 0226f9ec..47456985 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingServiceDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingServiceDto.cs @@ -41,5 +41,9 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs index c7a6e40a..dd6e45cf 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs @@ -28,6 +28,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } } diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingYardDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingYardDto.cs index 01a694d6..e089cc98 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingYardDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingYardDto.cs @@ -36,6 +36,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// 备注 /// public string Remark { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } } }